commit af3ee52058bcf51718e1d27192b3cd6ab6466f78 Author: Adolfo Gómez Date: Thu Jul 19 23:47:54 2012 +0000 Initial release diff --git a/client/administration/UdsAdmin.sln b/client/administration/UdsAdmin.sln new file mode 100644 index 000000000..6cb017487 --- /dev/null +++ b/client/administration/UdsAdmin.sln @@ -0,0 +1,30 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual C# Express 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UdsAdmin", "UdsAdmin\UdsAdmin.csproj", "{F8DBFEC2-6B52-4A89-AD0B-1886B2ABC11D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F8DBFEC2-6B52-4A89-AD0B-1886B2ABC11D}.Debug|Any CPU.ActiveCfg = Debug|x86 + {F8DBFEC2-6B52-4A89-AD0B-1886B2ABC11D}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {F8DBFEC2-6B52-4A89-AD0B-1886B2ABC11D}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {F8DBFEC2-6B52-4A89-AD0B-1886B2ABC11D}.Debug|x86.ActiveCfg = Debug|x86 + {F8DBFEC2-6B52-4A89-AD0B-1886B2ABC11D}.Debug|x86.Build.0 = Debug|x86 + {F8DBFEC2-6B52-4A89-AD0B-1886B2ABC11D}.Release|Any CPU.ActiveCfg = Release|x86 + {F8DBFEC2-6B52-4A89-AD0B-1886B2ABC11D}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {F8DBFEC2-6B52-4A89-AD0B-1886B2ABC11D}.Release|Mixed Platforms.Build.0 = Release|x86 + {F8DBFEC2-6B52-4A89-AD0B-1886B2ABC11D}.Release|x86.ActiveCfg = Release|x86 + {F8DBFEC2-6B52-4A89-AD0B-1886B2ABC11D}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/client/administration/UdsAdmin/Images.Designer.cs b/client/administration/UdsAdmin/Images.Designer.cs new file mode 100644 index 000000000..2427d5da0 --- /dev/null +++ b/client/administration/UdsAdmin/Images.Designer.cs @@ -0,0 +1,224 @@ +//------------------------------------------------------------------------------ +// +// Este código fue generado por una herramienta. +// Versión de runtime:4.0.30319.239 +// +// Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si +// se vuelve a generar el código. +// +//------------------------------------------------------------------------------ + +namespace UdsAdmin { + using System; + + + /// + /// Clase de recurso con establecimiento inflexible de tipos, para buscar cadenas traducidas, etc. + /// + // StronglyTypedResourceBuilder generó automáticamente esta clase + // a través de una herramienta como ResGen o Visual Studio. + // Para agregar o quitar un miembro, edite el archivo .ResX y, a continuación, vuelva a ejecutar ResGen + // con la opción /str o vuelva a generar su proyecto de VS. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Images { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Images() { + } + + /// + /// Devuelve la instancia de ResourceManager almacenada en caché utilizada por esta clase. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("UdsAdmin.Images", typeof(Images).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Reemplaza la propiedad CurrentUICulture del subproceso actual para todas las + /// búsquedas de recursos mediante esta clase de recurso con establecimiento inflexible de tipos. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static System.Drawing.Bitmap apply16 { + get { + object obj = ResourceManager.GetObject("apply16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap assignedServices16 { + get { + object obj = ResourceManager.GetObject("assignedServices16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap authenticators16 { + get { + object obj = ResourceManager.GetObject("authenticators16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap cache16 { + get { + object obj = ResourceManager.GetObject("cache16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap cancel16 { + get { + object obj = ResourceManager.GetObject("cancel16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap connectivity16 { + get { + object obj = ResourceManager.GetObject("connectivity16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap delete16 { + get { + object obj = ResourceManager.GetObject("delete16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap deployedService16 { + get { + object obj = ResourceManager.GetObject("deployedService16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap deployedServices16 { + get { + object obj = ResourceManager.GetObject("deployedServices16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap downarrow16 { + get { + object obj = ResourceManager.GetObject("downarrow16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap empty16 { + get { + object obj = ResourceManager.GetObject("empty16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap find16 { + get { + object obj = ResourceManager.GetObject("find16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap groups16 { + get { + object obj = ResourceManager.GetObject("groups16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Icon iconDeployedServices16 { + get { + object obj = ResourceManager.GetObject("iconDeployedServices16", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + internal static System.Drawing.Bitmap networks16 { + get { + object obj = ResourceManager.GetObject("networks16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap new16 { + get { + object obj = ResourceManager.GetObject("new16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap osmanagers16 { + get { + object obj = ResourceManager.GetObject("osmanagers16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap publications16 { + get { + object obj = ResourceManager.GetObject("publications16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap serviceProviders16 { + get { + object obj = ResourceManager.GetObject("serviceProviders16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap services16 { + get { + object obj = ResourceManager.GetObject("services16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap transports16 { + get { + object obj = ResourceManager.GetObject("transports16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap uparrow16 { + get { + object obj = ResourceManager.GetObject("uparrow16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap users16 { + get { + object obj = ResourceManager.GetObject("users16", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/client/administration/UdsAdmin/Images.resx b/client/administration/UdsAdmin/Images.resx new file mode 100644 index 000000000..ce559c08e --- /dev/null +++ b/client/administration/UdsAdmin/Images.resx @@ -0,0 +1,191 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Resources\apply16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\assignedServices16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\authenticators16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\cache16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\cancel16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\connectivity16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\delete16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\deployedService16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\deployedServices16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\downarrow16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + + Resources\empty16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\find16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\groups16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\deployedServices16.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\networks16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\new16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\osmanagers16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\publications16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\serviceProviders16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\services16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\transports16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\uparrow16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Resources\users16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/Program.cs b/client/administration/UdsAdmin/Program.cs new file mode 100644 index 000000000..d320101e1 --- /dev/null +++ b/client/administration/UdsAdmin/Program.cs @@ -0,0 +1,62 @@ +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; +using System.Globalization; +using System.Threading; + +namespace UdsAdmin +{ + static class Program + { + /// + /// Punto de entrada principal para la aplicación. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + CultureInfo culture = new CultureInfo(UdsAdmin.Properties.Settings.Default.Locale); + Thread.CurrentThread.CurrentCulture = culture; + Thread.CurrentThread.CurrentUICulture = culture; + forms.LoginForm logForm = new forms.LoginForm(); + DialogResult res = logForm.ShowDialog(); + if (res == DialogResult.Cancel) + { + return; + } + Application.Run(new forms.MainForm()); + Properties.Settings.Default.Save(); + } + } +} diff --git a/client/administration/UdsAdmin/Properties/AssemblyInfo.cs b/client/administration/UdsAdmin/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..5686525ed --- /dev/null +++ b/client/administration/UdsAdmin/Properties/AssemblyInfo.cs @@ -0,0 +1,38 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Resources; + +// La información general sobre un ensamblado se controla mediante el siguiente +// conjunto de atributos. Cambie estos atributos para modificar la información +// asociada con un ensamblado. +[assembly: AssemblyTitle("UDS Administration Client")] +[assembly: AssemblyDescription("(c) 2012 Virtual Cable S.L.\nXML-RPC.NET Copyright (c) 2006 Charles Cook")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Virtual Cable S.L.")] +[assembly: AssemblyProduct("UDS Administration Client")] +[assembly: AssemblyCopyright("Copyright © Virtual Cable 2012")] +[assembly: AssemblyTrademark("UDS Admin")] +[assembly: AssemblyCulture("")] + +// Si establece ComVisible como false, los tipos de este ensamblado no estarán visibles +// para los componentes COM. Si necesita obtener acceso a un tipo de este ensamblado desde +// COM, establezca el atributo ComVisible como true en este tipo. +[assembly: ComVisible(false)] + +// El siguiente GUID sirve como identificador de typelib si este proyecto se expone a COM +[assembly: Guid("203d7325-5e07-455f-a27c-09d2c31d00a2")] + +// La información de versión de un ensamblado consta de los cuatro valores siguientes: +// +// Versión principal +// Versión secundaria +// Número de compilación +// Revisión +// +// Puede especificar todos los valores o establecer como predeterminados los números de versión de compilación y de revisión +// mediante el asterisco ('*'), como se muestra a continuación: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.7.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: NeutralResourcesLanguageAttribute("en")] diff --git a/client/administration/UdsAdmin/Properties/Resources.Designer.cs b/client/administration/UdsAdmin/Properties/Resources.Designer.cs new file mode 100644 index 000000000..8076a5335 --- /dev/null +++ b/client/administration/UdsAdmin/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// Este código fue generado por una herramienta. +// Versión de runtime:4.0.30319.225 +// +// Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si +// se vuelve a generar el código. +// +//------------------------------------------------------------------------------ + +namespace UdsAdmin.Properties { + using System; + + + /// + /// Clase de recurso con establecimiento inflexible de tipos, para buscar cadenas traducidas, etc. + /// + // StronglyTypedResourceBuilder generó automáticamente esta clase + // a través de una herramienta como ResGen o Visual Studio. + // Para agregar o quitar un miembro, edite el archivo .ResX y, a continuación, vuelva a ejecutar ResGen + // con la opción /str o vuelva a generar su proyecto de VS. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Devuelve la instancia de ResourceManager almacenada en caché utilizada por esta clase. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("UdsAdmin.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Reemplaza la propiedad CurrentUICulture del subproceso actual para todas las + /// búsquedas de recursos mediante esta clase de recurso con establecimiento inflexible de tipos. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/client/administration/UdsAdmin/Properties/Resources.resx b/client/administration/UdsAdmin/Properties/Resources.resx new file mode 100644 index 000000000..5ea0895e3 --- /dev/null +++ b/client/administration/UdsAdmin/Properties/Resources.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/Properties/Settings.Designer.cs b/client/administration/UdsAdmin/Properties/Settings.Designer.cs new file mode 100644 index 000000000..8a67fa8cf --- /dev/null +++ b/client/administration/UdsAdmin/Properties/Settings.Designer.cs @@ -0,0 +1,122 @@ +//------------------------------------------------------------------------------ +// +// Este código fue generado por una herramienta. +// Versión de runtime:4.0.30319.261 +// +// Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si +// se vuelve a generar el código. +// +//------------------------------------------------------------------------------ + +namespace UdsAdmin.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("en-US")] + public string Locale { + get { + return ((string)(this["Locale"])); + } + set { + this["Locale"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("20000")] + public int TimeOut { + get { + return ((int)(this["TimeOut"])); + } + set { + this["TimeOut"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("93")] + public int wUsernameCol { + get { + return ((int)(this["wUsernameCol"])); + } + set { + this["wUsernameCol"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("220")] + public int wNameCol { + get { + return ((int)(this["wNameCol"])); + } + set { + this["wNameCol"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("81")] + public int wStateCol { + get { + return ((int)(this["wStateCol"])); + } + set { + this["wStateCol"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("93")] + public int wLastAccessCol { + get { + return ((int)(this["wLastAccessCol"])); + } + set { + this["wLastAccessCol"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("250")] + public int wCommentsCol { + get { + return ((int)(this["wCommentsCol"])); + } + set { + this["wCommentsCol"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("320")] + public int MaxControlWidth { + get { + return ((int)(this["MaxControlWidth"])); + } + set { + this["MaxControlWidth"] = value; + } + } + } +} diff --git a/client/administration/UdsAdmin/Properties/Settings.settings b/client/administration/UdsAdmin/Properties/Settings.settings new file mode 100644 index 000000000..3296cf724 --- /dev/null +++ b/client/administration/UdsAdmin/Properties/Settings.settings @@ -0,0 +1,30 @@ + + + + + + en-US + + + 20000 + + + 93 + + + 220 + + + 81 + + + 93 + + + 250 + + + 320 + + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/Properties/app.manifest b/client/administration/UdsAdmin/Properties/app.manifest new file mode 100644 index 000000000..54b397fb3 --- /dev/null +++ b/client/administration/UdsAdmin/Properties/app.manifest @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/Resources/Image1.png b/client/administration/UdsAdmin/Resources/Image1.png new file mode 100644 index 000000000..c0525fbb1 Binary files /dev/null and b/client/administration/UdsAdmin/Resources/Image1.png differ diff --git a/client/administration/UdsAdmin/Resources/apply16.png b/client/administration/UdsAdmin/Resources/apply16.png new file mode 100644 index 000000000..fc9aa5249 Binary files /dev/null and b/client/administration/UdsAdmin/Resources/apply16.png differ diff --git a/client/administration/UdsAdmin/Resources/assignedServices16.png b/client/administration/UdsAdmin/Resources/assignedServices16.png new file mode 100644 index 000000000..6a761a26c Binary files /dev/null and b/client/administration/UdsAdmin/Resources/assignedServices16.png differ diff --git a/client/administration/UdsAdmin/Resources/authenticators16.png b/client/administration/UdsAdmin/Resources/authenticators16.png new file mode 100644 index 000000000..346f21e7b Binary files /dev/null and b/client/administration/UdsAdmin/Resources/authenticators16.png differ diff --git a/client/administration/UdsAdmin/Resources/cache16.png b/client/administration/UdsAdmin/Resources/cache16.png new file mode 100644 index 000000000..8651deba7 Binary files /dev/null and b/client/administration/UdsAdmin/Resources/cache16.png differ diff --git a/client/administration/UdsAdmin/Resources/cancel16.png b/client/administration/UdsAdmin/Resources/cancel16.png new file mode 100644 index 000000000..4f45e4f8f Binary files /dev/null and b/client/administration/UdsAdmin/Resources/cancel16.png differ diff --git a/client/administration/UdsAdmin/Resources/connectivity16.png b/client/administration/UdsAdmin/Resources/connectivity16.png new file mode 100644 index 000000000..5058e5c68 Binary files /dev/null and b/client/administration/UdsAdmin/Resources/connectivity16.png differ diff --git a/client/administration/UdsAdmin/Resources/delete16.png b/client/administration/UdsAdmin/Resources/delete16.png new file mode 100644 index 000000000..3fd390390 Binary files /dev/null and b/client/administration/UdsAdmin/Resources/delete16.png differ diff --git a/client/administration/UdsAdmin/Resources/deployedService16.png b/client/administration/UdsAdmin/Resources/deployedService16.png new file mode 100644 index 000000000..0dae987f1 Binary files /dev/null and b/client/administration/UdsAdmin/Resources/deployedService16.png differ diff --git a/client/administration/UdsAdmin/Resources/deployedServices16.ico b/client/administration/UdsAdmin/Resources/deployedServices16.ico new file mode 100644 index 000000000..0979e3d9e Binary files /dev/null and b/client/administration/UdsAdmin/Resources/deployedServices16.ico differ diff --git a/client/administration/UdsAdmin/Resources/deployedServices16.png b/client/administration/UdsAdmin/Resources/deployedServices16.png new file mode 100644 index 000000000..cc9410dd4 Binary files /dev/null and b/client/administration/UdsAdmin/Resources/deployedServices16.png differ diff --git a/client/administration/UdsAdmin/Resources/downarrow16.png b/client/administration/UdsAdmin/Resources/downarrow16.png new file mode 100644 index 000000000..aa83b05c5 Binary files /dev/null and b/client/administration/UdsAdmin/Resources/downarrow16.png differ diff --git a/client/administration/UdsAdmin/Resources/empty16.png b/client/administration/UdsAdmin/Resources/empty16.png new file mode 100644 index 000000000..679b980fa Binary files /dev/null and b/client/administration/UdsAdmin/Resources/empty16.png differ diff --git a/client/administration/UdsAdmin/Resources/find16.png b/client/administration/UdsAdmin/Resources/find16.png new file mode 100644 index 000000000..88ae58a94 Binary files /dev/null and b/client/administration/UdsAdmin/Resources/find16.png differ diff --git a/client/administration/UdsAdmin/Resources/groups16.ico b/client/administration/UdsAdmin/Resources/groups16.ico new file mode 100644 index 000000000..d8afba2d3 Binary files /dev/null and b/client/administration/UdsAdmin/Resources/groups16.ico differ diff --git a/client/administration/UdsAdmin/Resources/groups16.png b/client/administration/UdsAdmin/Resources/groups16.png new file mode 100644 index 000000000..03ccfcf20 Binary files /dev/null and b/client/administration/UdsAdmin/Resources/groups16.png differ diff --git a/client/administration/UdsAdmin/Resources/networks16.png b/client/administration/UdsAdmin/Resources/networks16.png new file mode 100644 index 000000000..e74a67f44 Binary files /dev/null and b/client/administration/UdsAdmin/Resources/networks16.png differ diff --git a/client/administration/UdsAdmin/Resources/new16.png b/client/administration/UdsAdmin/Resources/new16.png new file mode 100644 index 000000000..e04cfc1b3 Binary files /dev/null and b/client/administration/UdsAdmin/Resources/new16.png differ diff --git a/client/administration/UdsAdmin/Resources/osmanagers16.png b/client/administration/UdsAdmin/Resources/osmanagers16.png new file mode 100644 index 000000000..dd74d22fc Binary files /dev/null and b/client/administration/UdsAdmin/Resources/osmanagers16.png differ diff --git a/client/administration/UdsAdmin/Resources/publications16.png b/client/administration/UdsAdmin/Resources/publications16.png new file mode 100644 index 000000000..c2a06dcd9 Binary files /dev/null and b/client/administration/UdsAdmin/Resources/publications16.png differ diff --git a/client/administration/UdsAdmin/Resources/serviceProviders16.png b/client/administration/UdsAdmin/Resources/serviceProviders16.png new file mode 100644 index 000000000..76f08a851 Binary files /dev/null and b/client/administration/UdsAdmin/Resources/serviceProviders16.png differ diff --git a/client/administration/UdsAdmin/Resources/services16.png b/client/administration/UdsAdmin/Resources/services16.png new file mode 100644 index 000000000..305f01b43 Binary files /dev/null and b/client/administration/UdsAdmin/Resources/services16.png differ diff --git a/client/administration/UdsAdmin/Resources/stats16.png b/client/administration/UdsAdmin/Resources/stats16.png new file mode 100644 index 000000000..ec6c43747 Binary files /dev/null and b/client/administration/UdsAdmin/Resources/stats16.png differ diff --git a/client/administration/UdsAdmin/Resources/transports16.png b/client/administration/UdsAdmin/Resources/transports16.png new file mode 100644 index 000000000..e572c72f9 Binary files /dev/null and b/client/administration/UdsAdmin/Resources/transports16.png differ diff --git a/client/administration/UdsAdmin/Resources/uparrow16.png b/client/administration/UdsAdmin/Resources/uparrow16.png new file mode 100644 index 000000000..55737e461 Binary files /dev/null and b/client/administration/UdsAdmin/Resources/uparrow16.png differ diff --git a/client/administration/UdsAdmin/Resources/users16.ico b/client/administration/UdsAdmin/Resources/users16.ico new file mode 100644 index 000000000..e9363d37b Binary files /dev/null and b/client/administration/UdsAdmin/Resources/users16.ico differ diff --git a/client/administration/UdsAdmin/Resources/users16.png b/client/administration/UdsAdmin/Resources/users16.png new file mode 100644 index 000000000..5dfe9f44d Binary files /dev/null and b/client/administration/UdsAdmin/Resources/users16.png differ diff --git a/client/administration/UdsAdmin/Strings.Designer.cs b/client/administration/UdsAdmin/Strings.Designer.cs new file mode 100644 index 000000000..66049aad1 --- /dev/null +++ b/client/administration/UdsAdmin/Strings.Designer.cs @@ -0,0 +1,1215 @@ +//------------------------------------------------------------------------------ +// +// Este código fue generado por una herramienta. +// Versión de runtime:4.0.30319.269 +// +// Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si +// se vuelve a generar el código. +// +//------------------------------------------------------------------------------ + +namespace UdsAdmin { + using System; + + + /// + /// Clase de recurso con establecimiento inflexible de tipos, para buscar cadenas traducidas, etc. + /// + // StronglyTypedResourceBuilder generó automáticamente esta clase + // a través de una herramienta como ResGen o Visual Studio. + // Para agregar o quitar un miembro, edite el archivo .ResX y, a continuación, vuelva a ejecutar ResGen + // con la opción /str o vuelva a generar su proyecto de VS. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Strings { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Strings() { + } + + /// + /// Devuelve la instancia de ResourceManager almacenada en caché utilizada por esta clase. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("UdsAdmin.Strings", typeof(Strings).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Reemplaza la propiedad CurrentUICulture del subproceso actual para todas las + /// búsquedas de recursos mediante esta clase de recurso con establecimiento inflexible de tipos. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Busca una cadena traducida similar a Enabled. + /// + internal static string active { + get { + return ResourceManager.GetString("active", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Allowed Groups. + /// + internal static string allowedGroups { + get { + return ResourceManager.GetString("allowedGroups", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Groups allowed to access this service. + /// + internal static string allowedGroupsToolTip { + get { + return ResourceManager.GetString("allowedGroupsToolTip", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a The application will exit now. + /// + internal static string appWillTerminate { + get { + return ResourceManager.GetString("appWillTerminate", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Assigned Services. + /// + internal static string assignedServices { + get { + return ResourceManager.GetString("assignedServices", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Shows services of this kind currently assigned to users. + /// + internal static string assignedServicesToolTip { + get { + return ResourceManager.GetString("assignedServicesToolTip", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Assign Service to user. + /// + internal static string assignToUser { + get { + return ResourceManager.GetString("assignToUser", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Authenticators. + /// + internal static string authenticators { + get { + return ResourceManager.GetString("authenticators", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a The credentials provided are no longer valid. + /// + internal static string authFailed { + get { + return ResourceManager.GetString("authFailed", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Blocked. + /// + internal static string blocked { + get { + return ResourceManager.GetString("blocked", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Cache. + /// + internal static string cache { + get { + return ResourceManager.GetString("cache", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a The cache has been flushed. + /// + internal static string cacheFlushed { + get { + return ResourceManager.GetString("cacheFlushed", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Cache Level. + /// + internal static string cacheLevel { + get { + return ResourceManager.GetString("cacheLevel", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Services currently in cache. + /// + internal static string cacheServicesToolTip { + get { + return ResourceManager.GetString("cacheServicesToolTip", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Cancel. + /// + internal static string cancel { + get { + return ResourceManager.GetString("cancel", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Can't Connect to server. Please, check server and retry. + /// + internal static string cantConnect { + get { + return ResourceManager.GetString("cantConnect", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a This authenticator do not allows the creation of new groups at administration interface. + /// + internal static string cantCreateGroups { + get { + return ResourceManager.GetString("cantCreateGroups", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a This authenticator do not allows the creation of new users at administration interface. + /// + internal static string cantCreateUsers { + get { + return ResourceManager.GetString("cantCreateUsers", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a This authenticator do not allows the modification of users at administration interface. + /// + internal static string cantModifyUsers { + get { + return ResourceManager.GetString("cantModifyUsers", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Do you really want to change current interface language?. Changes will take effect on next restart. + /// + internal static string changeLanguage { + get { + return ResourceManager.GetString("changeLanguage", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Check authenticator. + /// + internal static string checkAuthenticator { + get { + return ResourceManager.GetString("checkAuthenticator", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Check OS Manager. + /// + internal static string checkOSManager { + get { + return ResourceManager.GetString("checkOSManager", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Check service provider. + /// + internal static string checkServiceProvider { + get { + return ResourceManager.GetString("checkServiceProvider", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Connectivity. + /// + internal static string connectivity { + get { + return ResourceManager.GetString("connectivity", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Delete. + /// + internal static string deleteItem { + get { + return ResourceManager.GetString("deleteItem", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Deletion failed. + /// + internal static string deletionFailed { + get { + return ResourceManager.GetString("deletionFailed", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Deployed Service. + /// + internal static string deployedService { + get { + return ResourceManager.GetString("deployedService", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Deployed Services. + /// + internal static string deployedServices { + get { + return ResourceManager.GetString("deployedServices", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Disable. + /// + internal static string disable { + get { + return ResourceManager.GetString("disable", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Downloaded {0} KB of {1} KB at {2:0.00} KB/s. + /// + internal static string downloadInfo { + get { + return ResourceManager.GetString("downloadInfo", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Do you want to download and install the new version?. + /// + internal static string downloadQuery { + get { + return ResourceManager.GetString("downloadQuery", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Duplicated item. + /// + internal static string duplicatedItem { + get { + return ResourceManager.GetString("duplicatedItem", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Enable. + /// + internal static string enable { + get { + return ResourceManager.GetString("enable", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Error. + /// + internal static string error { + get { + return ResourceManager.GetString("error", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Get Error Information. + /// + internal static string errorInfo { + get { + return ResourceManager.GetString("errorInfo", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Exit. + /// + internal static string exit { + get { + return ResourceManager.GetString("exit", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Field '{0}' is required. + /// + internal static string fieldRequired { + get { + return ResourceManager.GetString("fieldRequired", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a The item do not exists anymore. Please, refresh gui (F5). + /// + internal static string findFailed { + get { + return ResourceManager.GetString("findFailed", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Group. + /// + internal static string group { + get { + return ResourceManager.GetString("group", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a You need to select a group. + /// + internal static string groupRequired { + get { + return ResourceManager.GetString("groupRequired", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Groups. + /// + internal static string groups { + get { + return ResourceManager.GetString("groups", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Id. + /// + internal static string id { + get { + return ResourceManager.GetString("id", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Import text file. + /// + internal static string import { + get { + return ResourceManager.GetString("import", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Text Files|*.txt|All files|*.*. + /// + internal static string importFilter { + get { + return ResourceManager.GetString("importFilter", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Disabled. + /// + internal static string inactive { + get { + return ResourceManager.GetString("inactive", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Invalid credentials. + /// + internal static string invalidCredentials { + get { + return ResourceManager.GetString("invalidCredentials", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Invalid Ip Address. + /// + internal static string invalidIpAddress { + get { + return ResourceManager.GetString("invalidIpAddress", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Language. + /// + internal static string language { + get { + return ResourceManager.GetString("language", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Manage groups for this authenticator. + /// + internal static string manageGroups { + get { + return ResourceManager.GetString("manageGroups", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Manage users for this authenticator. + /// + internal static string manageUsers { + get { + return ResourceManager.GetString("manageUsers", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Modification failed. + /// + internal static string modificationFailed { + get { + return ResourceManager.GetString("modificationFailed", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Modifying. + /// + internal static string modifying { + get { + return ResourceManager.GetString("modifying", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Modify. + /// + internal static string modifyItem { + get { + return ResourceManager.GetString("modifyItem", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a The field 'name' is required. + /// + internal static string nameRequired { + get { + return ResourceManager.GetString("nameRequired", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a You need to set up at least an Authenticator before using this.. + /// + internal static string needsAuthenticators { + get { + return ResourceManager.GetString("needsAuthenticators", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a You need to set up at least an OS Manager before using this.. + /// + internal static string needsOsManagers { + get { + return ResourceManager.GetString("needsOsManagers", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a You need to set up at least a Service before using this.. + /// + internal static string needsServices { + get { + return ResourceManager.GetString("needsServices", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a You should set up at least a transport before using this.. + /// + internal static string needsTransports { + get { + return ResourceManager.GetString("needsTransports", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Transport not active for selected networks. + /// + internal static string negativeNetCheck { + get { + return ResourceManager.GetString("negativeNetCheck", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Network End. + /// + internal static string netEnd { + get { + return ResourceManager.GetString("netEnd", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Network end must be greater than network start. + /// + internal static string netRangeError { + get { + return ResourceManager.GetString("netRangeError", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Network Start. + /// + internal static string netStart { + get { + return ResourceManager.GetString("netStart", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Neworks. + /// + internal static string networks { + get { + return ResourceManager.GetString("networks", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a New. + /// + internal static string newItem { + get { + return ResourceManager.GetString("newItem", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a New Service Provider. + /// + internal static string newServiceProvider { + get { + return ResourceManager.GetString("newServiceProvider", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a A new version of UDS Admin is required to communicate with server. + /// + internal static string newVersionRequired { + get { + return ResourceManager.GetString("newVersionRequired", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a No. + /// + internal static string no { + get { + return ResourceManager.GetString("no", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Occupied. + /// + internal static string occopied { + get { + return ResourceManager.GetString("occopied", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a OS Manager. + /// + internal static string osManager { + get { + return ResourceManager.GetString("osManager", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a OS Managers. + /// + internal static string osManagers { + get { + return ResourceManager.GetString("osManagers", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Owner. + /// + internal static string owner { + get { + return ResourceManager.GetString("owner", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Transport active for selected networks. + /// + internal static string positiveNetCheck { + get { + return ResourceManager.GetString("positiveNetCheck", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Publication Failed. + /// + internal static string publicationFailed { + get { + return ResourceManager.GetString("publicationFailed", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Publications. + /// + internal static string publications { + get { + return ResourceManager.GetString("publications", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Publications done from this deployed service. + /// + internal static string publicationsToolTip { + get { + return ResourceManager.GetString("publicationsToolTip", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Publish. + /// + internal static string publish { + get { + return ResourceManager.GetString("publish", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Generate a new publication for this service?. + /// + internal static string publishQuestion { + get { + return ResourceManager.GetString("publishQuestion", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Are you sure do you want to remove this item?. + /// + internal static string removeQuestion { + get { + return ResourceManager.GetString("removeQuestion", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Test unsuccessful. + /// + internal static string resultTestError { + get { + return ResourceManager.GetString("resultTestError", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Test successful. + /// + internal static string resultTestOk { + get { + return ResourceManager.GetString("resultTestOk", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Search Group. + /// + internal static string searchGroup { + get { + return ResourceManager.GetString("searchGroup", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Search User. + /// + internal static string searchUser { + get { + return ResourceManager.GetString("searchUser", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Select only one item to perform this operation.. + /// + internal static string selectOnlyOne { + get { + return ResourceManager.GetString("selectOnlyOne", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Service Providers. + /// + internal static string serviceProviders { + get { + return ResourceManager.GetString("serviceProviders", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a You need to select a service. + /// + internal static string serviceRequired { + get { + return ResourceManager.GetString("serviceRequired", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Services. + /// + internal static string services { + get { + return ResourceManager.GetString("services", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a You need to specify the authenticator to be used. + /// + internal static string specifyAuthenticator { + get { + return ResourceManager.GetString("specifyAuthenticator", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a You need to specify the service to be used. + /// + internal static string specifyBaseService { + get { + return ResourceManager.GetString("specifyBaseService", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a You need to specify the OS Manager to be used. + /// + internal static string specifyOsManager { + get { + return ResourceManager.GetString("specifyOsManager", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Active. + /// + internal static string stateActive { + get { + return ResourceManager.GetString("stateActive", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Blocked. + /// + internal static string stateBlocked { + get { + return ResourceManager.GetString("stateBlocked", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Canceled. + /// + internal static string stateCanceled { + get { + return ResourceManager.GetString("stateCanceled", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Canceling. + /// + internal static string stateCanceling { + get { + return ResourceManager.GetString("stateCanceling", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Error. + /// + internal static string stateError { + get { + return ResourceManager.GetString("stateError", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Inactive. + /// + internal static string stateInactive { + get { + return ResourceManager.GetString("stateInactive", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Launching publication. + /// + internal static string stateLaunching { + get { + return ResourceManager.GetString("stateLaunching", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Generating. + /// + internal static string statePreparing { + get { + return ResourceManager.GetString("statePreparing", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Waiting for removal. + /// + internal static string stateRemovable { + get { + return ResourceManager.GetString("stateRemovable", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Removed. + /// + internal static string stateRemoved { + get { + return ResourceManager.GetString("stateRemoved", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Removing. + /// + internal static string stateRemoving { + get { + return ResourceManager.GetString("stateRemoving", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Unknown. + /// + internal static string stateUnknown { + get { + return ResourceManager.GetString("stateUnknown", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Ready. + /// + internal static string stateUsable { + get { + return ResourceManager.GetString("stateUsable", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Assign New Group. + /// + internal static string titleAssignNewGroup { + get { + return ResourceManager.GetString("titleAssignNewGroup", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Assign Service. + /// + internal static string titleAssignService { + get { + return ResourceManager.GetString("titleAssignService", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Authenticator. + /// + internal static string titleAuthenticator { + get { + return ResourceManager.GetString("titleAuthenticator", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Configuration. + /// + internal static string titleConfiguration { + get { + return ResourceManager.GetString("titleConfiguration", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Deployed Service. + /// + internal static string titleDeployedService { + get { + return ResourceManager.GetString("titleDeployedService", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Downloader. + /// + internal static string titleDownloader { + get { + return ResourceManager.GetString("titleDownloader", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Group. + /// + internal static string titleGroup { + get { + return ResourceManager.GetString("titleGroup", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Login to UDS Administration. + /// + internal static string titleLogin { + get { + return ResourceManager.GetString("titleLogin", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a UDS Administration Client. + /// + internal static string titleMain { + get { + return ResourceManager.GetString("titleMain", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Network. + /// + internal static string titleNetwork { + get { + return ResourceManager.GetString("titleNetwork", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a OS Manager. + /// + internal static string titleOsManager { + get { + return ResourceManager.GetString("titleOsManager", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Service. + /// + internal static string titleService { + get { + return ResourceManager.GetString("titleService", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Service Provider. + /// + internal static string titleServiceProvider { + get { + return ResourceManager.GetString("titleServiceProvider", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Transport. + /// + internal static string titleTransport { + get { + return ResourceManager.GetString("titleTransport", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a User. + /// + internal static string titleUser { + get { + return ResourceManager.GetString("titleUser", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a User Preferences. + /// + internal static string titleUserPreferences { + get { + return ResourceManager.GetString("titleUserPreferences", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a You need to select a transport. + /// + internal static string transportRequired { + get { + return ResourceManager.GetString("transportRequired", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Transports. + /// + internal static string transports { + get { + return ResourceManager.GetString("transports", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a User. + /// + internal static string user { + get { + return ResourceManager.GetString("user", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a User Preferences. + /// + internal static string userPreferences { + get { + return ResourceManager.GetString("userPreferences", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a You need to select an user. + /// + internal static string userRequired { + get { + return ResourceManager.GetString("userRequired", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Users. + /// + internal static string users { + get { + return ResourceManager.GetString("users", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a There are errors in the data provided. + /// + internal static string validationFailed { + get { + return ResourceManager.GetString("validationFailed", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a View. + /// + internal static string view { + get { + return ResourceManager.GetString("view", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Waiting OS To Get Ready. + /// + internal static string waitingOsReady { + get { + return ResourceManager.GetString("waitingOsReady", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Yes. + /// + internal static string yes { + get { + return ResourceManager.GetString("yes", resourceCulture); + } + } + } +} diff --git a/client/administration/UdsAdmin/Strings.de.Designer.cs b/client/administration/UdsAdmin/Strings.de.Designer.cs new file mode 100644 index 000000000..e69de29bb diff --git a/client/administration/UdsAdmin/Strings.de.resx b/client/administration/UdsAdmin/Strings.de.resx new file mode 100644 index 000000000..4a2630edf --- /dev/null +++ b/client/administration/UdsAdmin/Strings.de.resx @@ -0,0 +1,475 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Aktiviert + + + Gruppen erlaubt + + + Gruppen auf diesen Dienst zugreifen + + + Zugeordneten Services + + + Dienstleistungen dieser Art, die Benutzer derzeit zugewiesen zeigt + + + Blockiert + + + Cache + + + Dienstleistungen derzeit im cache + + + Kann keine Verbindung zum Server herstellen. Bitte überprüfen Sie Server und wiederholen + + + Wollen Sie wirklich aktuellen Sprache der Benutzeroberfläche ändern?. Änderungen werden beim nächsten Neustart wirksam + + + Kontrollkästchen Authentifikator + + + Überprüfen Sie OS-Manager + + + Prüfen Sie Service-provider + + + Löschen + + + Löschen ist fehlgeschlagen + + + Publikationen + + + Publikationen von diesem bereitgestellten Dienst getan + + + Deaktivieren + + + Doppelte Element + + + Aktivieren + + + Fehler + + + Gruppen + + + Behinderte + + + Sprache + + + Verwalten von Gruppen für diese Authentifikator + + + Verwalten von Benutzern für diese Authentifikator + + + Ändern + + + Ändern + + + Sie müssen mindestens ein Authentifikator einrichten, bevor Sie diese verwenden. + + + Sie müssen Sie mindestens eine OS-Manager festlegen, bevor mit diesem. + + + Sie müssen mindestens einen Dienst einrichten, bevor mit diesem. + + + Sie sollten mindestens einen Transport einrichten, bevor Sie mit diesem. + + + Neu + + + Neue Dienstleister + + + Eine neue Version der UDS-Admin wird zur Kommunikation mit Server benötigt + + + Dienstleistungen + + + Sie müssen den Authentifikator verwendet werden angeben + + + Sie müssen den Dienst zu verwendende angeben + + + Sie müssen den OS-Manager verwendet werden angeben + + + Benutzer + + + Ansicht + + + Cache-Stufe + + + ID + + + Eigentümer + + + Veröffentlichen + + + Veröffentlichung fehlgeschlagen + + + Generieren Sie eine neue Publikation für diesen Dienst? + + + Abbrechen + + + Wählen Sie nur ein Element, um diesen Vorgang auszuführen. + + + Bereitgestellte Dienst + + + Nr. + + + Besetzt + + + Sind Sie sicher wollen Sie dieses Element entfernen? + + + Ja + + + OS-Manager + + + Die Anwendung wird nun beendet. + + + Die bereitgestellten Anmeldeinformationen sind nicht mehr gültig + + + Das Element-Do ist nicht mehr vorhanden. Bitte aktualisieren Sie gui (F5) + + + Ungültiger Anmeldeinformationen + + + Fehler sind in den Angaben + + + Aktive + + + Blockiert + + + Abgebrochen + + + Abbrechen + + + Fehler + + + Inaktiv + + + Generieren + + + Warten auf Entfernung + + + Entfernt + + + Entfernen + + + Unbekannt + + + Bereit + + + Personen, die auf OS bereit + + + Benutzer Service zuweisen + + + Service-Provider + + + Feld '{0}' muss ausgefüllt werden + + + Das Feld 'Name' ist erforderlich + + + Sie müssen eine Gruppe auswählen + + + Sie müssen einen Dienst auswählen + + + Sie müssen einen Benutzer auswählen + + + Benutzereinstellungen + + + Transporte + + + Neworks + + + Ungültige IP-Adresse + + + Netzwerk-Ende + + + Netzwerk-Start + + + Netzwerk Ende muss größer als Netzwerk Start sein. + + + Verkehr nicht aktiv für ausgewählten Netzen + + + Transport für ausgewählten Netzwerken aktiv + + + Test nicht erfolgreich + + + Test erfolgreich + + + Authentifikatoren + + + Konnektivität + + + Bereitgestellten Dienste + + + OS-Managers + + + Informieren Sie sich Fehler + + + Möchten Sie die neue Version herunterladen und installieren? + + + Heruntergeladene {0} KB von {1} KB am {2:0.00} KB/s + + + Ausfahrt + + + Text Files|*.txt|Alle-Dateien| *. * + + + Textdatei importieren + + + Gruppe + + + Suche Gruppe + + + Benutzer suchen + + + Benutzer + + + Änderung ist fehlgeschlagen + + + Weisen Sie Service + + + Neue Gruppe zuweisen + + + Authentifikator + + + Bereitgestellte Dienst + + + Downloader + + + Gruppe + + + Anmeldung für UDS Administration + + + UDS-Verwaltungsclient + + + Netzwerk + + + OS-Manager + + + Service + + + Service-Provider + + + Verkehr + + + Benutzer + + + Benutzereinstellungen + + + Der Cache geleert worden ist + + + Start der Veröffentlichung + + + Sie müssen einen Transport wählen + + + Konfiguration + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/Strings.es.Designer.cs b/client/administration/UdsAdmin/Strings.es.Designer.cs new file mode 100644 index 000000000..e69de29bb diff --git a/client/administration/UdsAdmin/Strings.es.resx b/client/administration/UdsAdmin/Strings.es.resx new file mode 100644 index 000000000..9788dabaf --- /dev/null +++ b/client/administration/UdsAdmin/Strings.es.resx @@ -0,0 +1,495 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Activo + + + Grupos permitidos + + + Grupos con acceso a este servicio + + + Servicios Asignados + + + Muestra los Servicios de este tipo que estan asignados a usuarios en la actualidad + + + Bloqueado + + + Caché + + + Servicios actualmente en el caché + + + No se puede conectar al servidor. Por favor, compruebe el servidor y vuelva a intentarlo + + + ¿Realmente desea cambiar el idioma de la interfaz actual?. Los cambios surtirán efecto en el próximo reinicio + + + Verificar autenticador + + + Verificar OS Manager + + + Verificar proveedor de servicios + + + Borrar + + + Borrado fallido + + + Deshabilitar + + + Elemento duplicado + + + Habilitar + + + Error + + + Grupos + + + Desactivado + + + Idioma + + + Administrar grupos para este autenticador + + + Administrar los usuarios de este autenticador + + + Modificando + + + Modificar + + + Debe configurar al menos un autenticador antes de usar esto. + + + Debe instalar al menos un Manager OS antes de utilizar esta. + + + Debe configurar al menos un servicio antes de usar esto. + + + Debe configurar al menos un transporte antes de usar esto. + + + Nuevo + + + Nuevo proveedor de servicios + + + Se requiere una nueva versión de UDS Admin para comunicarse con el servidor + + + Publicaciones + + + Publicaciones desde este servicio desplegado + + + Servicios + + + Es necesario especificar el autenticador a utilizar + + + Es necesario especificar el servicio a utilizar + + + Es necesario especificar el OS Manager a utilizar + + + Usuarios + + + Ver + + + Nivel de caché + + + ID. + + + Propietario + + + Publicar + + + Error de publicación + + + ¿Generar una nueva publicación para este servicio? + + + Cancelar + + + Seleccione sólo un artículo para realizar esta operación. + + + Servicio desplegado + + + No + + + Ocupado + + + ¿Está seguro que desea eliminar este elemento? + + + + + + OS Manager + + + La aplicación se cerrará ahora + + + Las credenciales proporcionadas no son válidas + + + El elemento do no existe ya. Por favor, actualice el gui (F5) + + + Credenciales no válidas + + + Hay errores en los datos proporcionados + + + Activo + + + Bloqueado + + + Cancelado + + + Cancelando + + + Error + + + Inactivo + + + Generando + + + A la espera de la eliminación + + + Eliminado + + + Eliminando + + + Desconocido + + + Listo + + + Esperando al OS + + + Asignar el servicio al usuario + + + Proveedores de servicios + + + Se requiere el campo '{0}' + + + Se requiere el campo 'nombre' + + + Debe seleccionar un grupo + + + Debe seleccionar un servicio + + + Debe seleccionar un usuario + + + Preferencias de usuario + + + Transportes + + + Redes + + + Dirección Ip no válida + + + Final de red + + + Inicio de red + + + El final de red debe ser mayor que el inicio de la red + + + Transporte inactivo para redes seleccionadas + + + Transporte activo para redes seleccionadas + + + Prueba fallida + + + Prueba exitosa + + + Autenticadores + + + Conectividad + + + Servicios implementados + + + OS administradores + + + Obtener información de Error + + + ¿Desea descargar e instalar la nueva versión? + + + Descargado {0} KB de {1} KB en {2:0.00} KB/s + + + Salir + + + Texto Files|*.txt|Todos files| *. * + + + Importar archivo de texto + + + Grupo + + + Grupo de búsqueda + + + Buscar Usuario + + + Usuario + + + Error de modificación + + + Asignar servicio + + + Asignar nuevo grupo + + + Autenticador + + + Servicio desplegado + + + Downloader + + + Grupo + + + Inicio de sesión en el Administrador UDS + + + Cliente de administración de UDS + + + Red + + + OS Manager + + + Servicio + + + Proveedor de servicios + + + Transporte + + + Usuario + + + Preferencias de usuario + + + La caché ha sido vaciada + + + Lanzando publicación + + + Debe seleccionar un transporte + + + Configuración + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/Strings.fr.Designer.cs b/client/administration/UdsAdmin/Strings.fr.Designer.cs new file mode 100644 index 000000000..e69de29bb diff --git a/client/administration/UdsAdmin/Strings.fr.resx b/client/administration/UdsAdmin/Strings.fr.resx new file mode 100644 index 000000000..8dc1fc118 --- /dev/null +++ b/client/administration/UdsAdmin/Strings.fr.resx @@ -0,0 +1,475 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Activée + + + Accueilli des groupes + + + Groupes autorisés à accéder à ce service + + + Services assignées + + + Indique les services de ce type actuellement assigné aux utilisateurs + + + Bloqué + + + Cache + + + Services actuellement dans le cache + + + Impossible de se connecter au serveur. Vérifiez svp, serveur et réessayer + + + Vous voulez vraiment changer la langue d'interface cours?. Modifications prendront effet au prochain redémarrage + + + Vérifiez l'authentificateur + + + Vérifiez le gestionnaire de l'OS + + + Fournisseur de services de vérification + + + Supprimer + + + Suppression a échoué + + + Publications + + + Publications faites de ce service déployé + + + Désactiver + + + Élément dupliqué + + + Enable + + + Erreur + + + Groupes + + + Handicapés + + + Langue + + + Gérer des groupes pour cette authentificateur + + + Gestion des utilisateurs pour cette authentificateur + + + Modifiant + + + Modifier + + + Vous devez configurer au moins un authentificateur avant d'utiliser ce. + + + Vous devez définir le gestionnaire d'au moins un OS avant d'utiliser ce. + + + Vous devez configurer au moins un Service avant d'utiliser ce. + + + Vous devez définir jusqu'à au moins un transport avant d'utiliser ce. + + + Nouveau + + + Nouveau fournisseur de services + + + Une nouvelle version de l'UDS Admin est obligée de communiquer avec le serveur + + + Services + + + Vous devez spécifier l'authentificateur à utiliser + + + Vous devez spécifier le service à utiliser + + + Vous devez spécifier le OS Manager à utiliser + + + Utilisateurs + + + Avis + + + Niveau de cache + + + ID + + + Propriétaire + + + Publier + + + Publication a échoué + + + Générer une nouvelle publication pour ce service ? + + + Annuler + + + Sélectionner un seul élément pour effectuer cette opération. + + + Service déployée + + + Aucun + + + Occupée + + + Vous êtes certain que vous voulez supprimer cet élément ? + + + Oui + + + Gestionnaire de l'OS + + + L'application sera sortie maintenant + + + Les informations d'identification fournies ne sont plus valides + + + L'élément do il existe non plus. Veuillez actualiser gui (F5) + + + Informations d'identification non valides + + + Il y a des erreurs dans les données fournies + + + Active + + + Bloqué + + + Annulée + + + Annulation + + + Erreur + + + Inactif + + + Générant + + + Attente d'enlèvement + + + Supprimé + + + Suppression + + + Inconnu + + + Prêt + + + OS pour se préparer en attente + + + Assigner un Service à l'utilisateur + + + Fournisseurs de services + + + Champ « {0} » est requis + + + Le champ « nom » est requis + + + Vous devez sélectionner un groupe + + + Vous devez sélectionner un service + + + Vous devez sélectionner un utilisateur + + + Préférences de l'utilisateur + + + Transports + + + Réseaux + + + Adresse Ip non valide + + + Fin de réseau + + + Début du réseau + + + Fin du réseau doit être supérieure à démarrer réseau + + + Transport non active pour les réseaux sélectionnés + + + Transport actif pour les réseaux sélectionnés + + + Essai infructueux + + + Test réussie + + + Authentificateurs + + + Connectivité + + + Services de déploiements + + + Gestionnaires des OS + + + Obtenir des informations sur l'erreur + + + Vous voulez télécharger et installer la nouvelle version ? + + + Téléchargé {0} Ko {1} ko à {2:0.00} KB/s. + + + Sortie + + + Texte Files|*.txt|Tous les fichiers| *. * + + + Importer un fichier texte + + + Groupe + + + Groupe de recherche + + + Utilisateur de recherche + + + Utilisateur + + + Modification a échoué + + + Affecter le Service + + + Assigner le nouveau groupe + + + Authentificateur + + + Service de déploiement + + + Téléchargeur + + + Groupe + + + Connexion à l'Administration de l'UDS + + + UDS Administration Client + + + Réseau + + + Gestionnaire de l'OS + + + Service + + + Fournisseur de services + + + Transport + + + Utilisateur + + + Préférences de l'utilisateur + + + Le cache a été vidé. + + + Lancement de la publication + + + Vous devez sélectionner un transport + + + Configuration + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/Strings.resx b/client/administration/UdsAdmin/Strings.resx new file mode 100644 index 000000000..49364f565 --- /dev/null +++ b/client/administration/UdsAdmin/Strings.resx @@ -0,0 +1,504 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Enabled + + + Allowed Groups + + + Groups allowed to access this service + + + Assigned Services + + + Shows services of this kind currently assigned to users + + + Blocked + + + Cache + + + Services currently in cache + + + Can't Connect to server. Please, check server and retry + + + Do you really want to change current interface language?. Changes will take effect on next restart + + + Check authenticator + + + Check OS Manager + + + Check service provider + + + Delete + + + Deletion failed + + + Publications + + + Publications done from this deployed service + + + Disable + + + Duplicated item + + + Enable + + + Error + + + Groups + + + Disabled + + + Language + + + Manage groups for this authenticator + + + Manage users for this authenticator + + + Modifying + + + Modify + + + You need to set up at least an Authenticator before using this. + + + You need to set up at least an OS Manager before using this. + + + You need to set up at least a Service before using this. + + + You should set up at least a transport before using this. + + + New + + + New Service Provider + + + A new version of UDS Admin is required to communicate with server + + + Services + + + You need to specify the authenticator to be used + + + You need to specify the service to be used + + + You need to specify the OS Manager to be used + + + Users + + + View + + + Cache Level + + + Id + + + Owner + + + Publish + + + Publication Failed + + + Generate a new publication for this service? + + + Cancel + + + Select only one item to perform this operation. + + + Deployed Service + + + No + + + Occupied + + + Are you sure do you want to remove this item? + + + Yes + + + OS Manager + + + The application will exit now + + + The credentials provided are no longer valid + + + The item do not exists anymore. Please, refresh gui (F5) + + + Invalid credentials + + + There are errors in the data provided + + + Active + + + Blocked + + + Canceled + + + Canceling + + + Error + + + Inactive + + + Generating + + + Waiting for removal + + + Removed + + + Removing + + + Unknown + + + Ready + + + Waiting OS To Get Ready + + + Assign Service to user + + + Service Providers + + + Field '{0}' is required + + + The field 'name' is required + + + You need to select a group + + + You need to select a service + + + You need to select an user + + + User Preferences + + + Transports + + + Neworks + + + Invalid Ip Address + + + Network End + + + Network Start + + + Network end must be greater than network start + + + Transport not active for selected networks + + + Transport active for selected networks + + + Test unsuccessful + + + Test successful + + + Authenticators + + + Connectivity + + + Deployed Services + + + OS Managers + + + Get Error Information + + + Do you want to download and install the new version? + + + Downloaded {0} KB of {1} KB at {2:0.00} KB/s + + + Exit + + + Text Files|*.txt|All files|*.* + + + Import text file + + + Group + + + Search Group + + + Search User + + + User + + + Modification failed + + + Assign Service + + + Assign New Group + + + Authenticator + + + Deployed Service + + + Downloader + + + Group + + + Login to UDS Administration + + + UDS Administration Client + + + Network + + + OS Manager + + + Service + + + Service Provider + + + Transport + + + User + + + User Preferences + + + The cache has been flushed + + + Launching publication + + + You need to select a transport + + + Configuration + + + This authenticator do not allows the creation of new groups at administration interface + + + This authenticator do not allows the creation of new users at administration interface + + + This authenticator do not allows the modification of users at administration interface + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/UdsAdmin.csproj b/client/administration/UdsAdmin/UdsAdmin.csproj new file mode 100644 index 000000000..89a3fcb29 --- /dev/null +++ b/client/administration/UdsAdmin/UdsAdmin.csproj @@ -0,0 +1,847 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {F8DBFEC2-6B52-4A89-AD0B-1886B2ABC11D} + WinExe + Properties + UdsAdmin + UdsAdmin + 512 + false + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 1 + 1.0.0.%2a + false + true + true + v3.5 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + UdsAdmin.Program + + + 4D3CEB1F26E78F248C53715BFC18F75507F77C07 + + + UdsAdmin_TemporaryKey.pfx + + + true + + + true + + + Properties\app.manifest + + + LocalIntranet + + + + ..\xmlrpc\CookComputing.XmlRpcV2.dll + + + + + + + + + + + + + UserControl + + + ListEditor.cs + + + UserControl + + + AuthsPanel.cs + + + UserControl + + + NetworksPanel.cs + + + UserControl + + + ServicePanel.cs + + + UserControl + + + ServicesPanel.cs + + + UserControl + + + ServiceProvidersPanel.cs + + + UserControl + + + OsManagersPanel.cs + + + UserControl + + + TransportsPanel.cs + + + UserControl + + + DeployedServicesPanel.cs + + + UserControl + + + DeployedGroupsPanel.cs + + + UserControl + + + DeployedServicePanel.cs + + + UserControl + + + PublicationsPanel.cs + + + UserControl + + + DeployedPanel.cs + + + UserControl + + + GroupsPanel.cs + + + UserControl + + + PanelEmpty.cs + + + UserControl + + + UsersPanel.cs + + + + + + + Form + + + AboutBoxForm.cs + + + Form + + + ListEditorForm.cs + + + Form + + + AssignDeployed.cs + + + Form + + + AuthenticatorForm.cs + + + Form + + + ConfigurationForm.cs + + + Form + + + DeployedTransportForm.cs + + + Form + + + DeployedGroupForm.cs + + + Form + + + DeployedServiceForm.cs + + + Form + + + FileDownloader.cs + + + Form + + + NetworkForm.cs + + + Form + + + SearchForm.cs + + + Form + + + TransportForm.cs + + + Form + + + OSManagerForm.cs + + + Form + + + UserForm.cs + + + Form + + + GroupForm.cs + + + Form + + + ServiceForm.cs + + + Form + + + LoginForm.cs + + + Form + + + ServiceProviderForm.cs + + + Form + + + MainForm.cs + + + Form + + + UserPreferencesForm.cs + + + + + + + + + + True + True + Images.resx + + + True + True + Strings.de.resx + + + True + True + Strings.resx + + + True + True + Strings.es.resx + + + True + True + Strings.fr.resx + + + + + + + + + + + ListEditorForm.cs + + + ListEditorForm.cs + + + ListEditorForm.cs + + + ListEditor.cs + + + ListEditor.cs + + + ListEditor.cs + + + ListEditor.cs + + + AuthsPanel.cs + + + AuthsPanel.cs + + + AuthsPanel.cs + + + AuthsPanel.cs + + + DeployedGroupsPanel.cs + + + DeployedGroupsPanel.cs + + + DeployedGroupsPanel.cs + + + DeployedPanel.cs + + + DeployedPanel.cs + + + DeployedPanel.cs + + + DeployedServicePanel.cs + + + DeployedServicePanel.cs + + + DeployedServicePanel.cs + + + DeployedServicesPanel.cs + + + DeployedServicesPanel.cs + + + DeployedServicesPanel.cs + + + GroupsPanel.cs + + + GroupsPanel.cs + + + GroupsPanel.cs + + + NetworksPanel.cs + + + NetworksPanel.cs + + + NetworksPanel.cs + + + NetworksPanel.cs + + + OsManagersPanel.cs + + + OsManagersPanel.cs + + + OsManagersPanel.cs + + + PanelEmpty.cs + + + PanelEmpty.cs + + + PanelEmpty.cs + + + PublicationsPanel.cs + + + PublicationsPanel.cs + + + PublicationsPanel.cs + + + ServicePanel.cs + + + ServicePanel.cs + + + ServicePanel.cs + + + ServicePanel.cs + + + ServiceProvidersPanel.cs + + + ServiceProvidersPanel.cs + + + ServiceProvidersPanel.cs + + + ServicesPanel.cs + + + ServicesPanel.cs + + + ServicesPanel.cs + + + ServicesPanel.cs + + + ServiceProvidersPanel.cs + + + OsManagersPanel.cs + + + TransportsPanel.cs + + + TransportsPanel.cs + + + TransportsPanel.cs + + + TransportsPanel.cs + + + DeployedServicesPanel.cs + + + DeployedGroupsPanel.cs + + + DeployedServicePanel.cs + + + PublicationsPanel.cs + + + DeployedPanel.cs + + + GroupsPanel.cs + + + PanelEmpty.cs + + + UsersPanel.cs + + + UsersPanel.cs + + + UsersPanel.cs + + + UsersPanel.cs + + + AboutBoxForm.cs + + + AboutBoxForm.cs + + + AboutBoxForm.cs + + + AboutBoxForm.cs + + + ListEditorForm.cs + + + AssignDeployed.cs + + + AssignDeployed.cs + + + AssignDeployed.cs + + + AssignDeployed.cs + + + AuthenticatorForm.cs + + + AuthenticatorForm.cs + + + AuthenticatorForm.cs + + + AuthenticatorForm.cs + + + ConfigurationForm.cs + + + ConfigurationForm.cs + + + ConfigurationForm.cs + + + ConfigurationForm.cs + + + DeployedServiceForm.cs + + + DeployedTransportForm.cs + + + DeployedTransportForm.cs + + + DeployedTransportForm.cs + + + DeployedTransportForm.cs + + + DeployedGroupForm.cs + + + DeployedGroupForm.cs + + + DeployedGroupForm.cs + + + DeployedGroupForm.cs + + + DeployedServiceForm.cs + + + DeployedServiceForm.cs + + + DeployedServiceForm.cs + + + FileDownloader.cs + + + FileDownloader.cs + + + FileDownloader.cs + + + FileDownloader.cs + + + GroupForm.cs + + + GroupForm.cs + + + GroupForm.cs + + + LoginForm.cs + + + LoginForm.cs + + + MainForm.cs + + + MainForm.cs + + + MainForm.cs + + + NetworkForm.cs + + + NetworkForm.cs + + + NetworkForm.cs + + + NetworkForm.cs + + + OSManagerForm.cs + + + OSManagerForm.cs + + + OSManagerForm.cs + + + SearchForm.cs + + + ServiceForm.cs + + + ServiceForm.cs + + + ServiceForm.cs + + + ServiceProviderForm.cs + + + ServiceProviderForm.cs + + + ServiceProviderForm.cs + + + TransportForm.cs + + + OSManagerForm.cs + + + UserForm.cs + + + UserForm.cs + + + UserForm.cs + + + UserForm.cs + + + GroupForm.cs + + + ServiceForm.cs + + + LoginForm.cs + + + LoginForm.cs + + + ServiceProviderForm.cs + + + MainForm.cs + + + UserPreferencesForm.cs + + + UserPreferencesForm.cs + + + UserPreferencesForm.cs + + + UserPreferencesForm.cs + + + ResXFileCodeGenerator + Images.Designer.cs + + + ResXFileCodeGenerator + Strings.de.Designer.cs + + + ResXFileCodeGenerator + Strings.es.Designer.cs + Designer + + + ResXFileCodeGenerator + Strings.fr.Designer.cs + + + ResXFileCodeGenerator + Strings.Designer.cs + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/UdsAdmin_TemporaryKey.pfx b/client/administration/UdsAdmin/UdsAdmin_TemporaryKey.pfx new file mode 100644 index 000000000..bb50d1f22 Binary files /dev/null and b/client/administration/UdsAdmin/UdsAdmin_TemporaryKey.pfx differ diff --git a/client/administration/UdsAdmin/app.config b/client/administration/UdsAdmin/app.config new file mode 100644 index 000000000..bcded628f --- /dev/null +++ b/client/administration/UdsAdmin/app.config @@ -0,0 +1,36 @@ + + + + +
+ + + + + + en-US + + + 20000 + + + 93 + + + 220 + + + 81 + + + 93 + + + 250 + + + 320 + + + + diff --git a/client/administration/UdsAdmin/controls/ListEditor.Designer.cs b/client/administration/UdsAdmin/controls/ListEditor.Designer.cs new file mode 100644 index 000000000..ad86fc3fb --- /dev/null +++ b/client/administration/UdsAdmin/controls/ListEditor.Designer.cs @@ -0,0 +1,57 @@ +namespace UdsAdmin.controls +{ + public partial class ListEditor + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de componentes + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ListEditor)); + this.bntOpen = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // bntOpen + // + resources.ApplyResources(this.bntOpen, "bntOpen"); + this.bntOpen.Name = "bntOpen"; + this.bntOpen.UseVisualStyleBackColor = true; + this.bntOpen.Click += new System.EventHandler(this.bntOpen_Click); + // + // ListEditor + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.bntOpen); + this.Name = "ListEditor"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button bntOpen; + + } +} diff --git a/client/administration/UdsAdmin/controls/ListEditor.cs b/client/administration/UdsAdmin/controls/ListEditor.cs new file mode 100644 index 000000000..b0a1ff12d --- /dev/null +++ b/client/administration/UdsAdmin/controls/ListEditor.cs @@ -0,0 +1,93 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.controls +{ + public partial class ListEditor : UserControl + { + private forms.ListEditorForm _form; + public ListEditor() + { + InitializeComponent(); + _form = new forms.ListEditorForm(); + } + + private void bntOpen_Click(object sender, EventArgs e) + { + _form.ShowDialog(); + } + + private List readItems() + { + List res = new List(_form.Items.Count); + foreach (string v in _form.Items) + res.Add(v); + + return res; + } + + private void writeItems(List values) + { + _form.Items.Clear(); + foreach (string v in values) + _form.Items.Add(v); + } + + [Category("Design")] + [Description("Tittle of the opened list editor window")] + public override string Text + { + get + { + return base.Text; + } + set + { + _form.Text = value; + base.Text = value; + } + } + + public List Items + { + get { return readItems(); } + set { writeItems(value); } + } + + } +} diff --git a/client/administration/UdsAdmin/controls/ListEditor.de.resx b/client/administration/UdsAdmin/controls/ListEditor.de.resx new file mode 100644 index 000000000..de450cc6d --- /dev/null +++ b/client/administration/UdsAdmin/controls/ListEditor.de.resx @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Fill + + + + 0, 0 + + + 185, 23 + + + + 0 + + + Öffnen Sie den editor + + + bntOpen + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 185, 23 + + + ListEditor + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/ListEditor.es.resx b/client/administration/UdsAdmin/controls/ListEditor.es.resx new file mode 100644 index 000000000..1e2384be9 --- /dev/null +++ b/client/administration/UdsAdmin/controls/ListEditor.es.resx @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Fill + + + + 0, 0 + + + 185, 23 + + + + 0 + + + Abrir el editor + + + bntOpen + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 185, 23 + + + ListEditor + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/ListEditor.fr.resx b/client/administration/UdsAdmin/controls/ListEditor.fr.resx new file mode 100644 index 000000000..af1998595 --- /dev/null +++ b/client/administration/UdsAdmin/controls/ListEditor.fr.resx @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Fill + + + + 0, 0 + + + 185, 23 + + + + 0 + + + Ouvrez l'éditeur + + + bntOpen + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 185, 23 + + + ListEditor + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/ListEditor.resx b/client/administration/UdsAdmin/controls/ListEditor.resx new file mode 100644 index 000000000..8e6b0dcf2 --- /dev/null +++ b/client/administration/UdsAdmin/controls/ListEditor.resx @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Fill + + + + 0, 0 + + + 185, 23 + + + + 0 + + + Open the editor + + + bntOpen + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 185, 23 + + + ListEditor + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/forms/ListEditorForm.Designer.cs b/client/administration/UdsAdmin/controls/forms/ListEditorForm.Designer.cs new file mode 100644 index 000000000..5a9ca8a1a --- /dev/null +++ b/client/administration/UdsAdmin/controls/forms/ListEditorForm.Designer.cs @@ -0,0 +1,118 @@ +namespace UdsAdmin.controls.forms +{ + partial class ListEditorForm + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de Windows Forms + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ListEditorForm)); + this.lstItems = new System.Windows.Forms.ListBox(); + this.textItem = new System.Windows.Forms.TextBox(); + this.btnImport = new System.Windows.Forms.Button(); + this.layout = new System.Windows.Forms.TableLayoutPanel(); + this.btnRemove = new System.Windows.Forms.Button(); + this.btnAdd = new System.Windows.Forms.Button(); + this.btnClose = new System.Windows.Forms.Button(); + this.layout.SuspendLayout(); + this.SuspendLayout(); + // + // lstItems + // + this.layout.SetColumnSpan(this.lstItems, 2); + resources.ApplyResources(this.lstItems, "lstItems"); + this.lstItems.FormattingEnabled = true; + this.lstItems.Name = "lstItems"; + // + // textItem + // + resources.ApplyResources(this.textItem, "textItem"); + this.textItem.Name = "textItem"; + this.textItem.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textItem_KeyPress); + // + // btnImport + // + resources.ApplyResources(this.btnImport, "btnImport"); + this.btnImport.Name = "btnImport"; + this.btnImport.UseVisualStyleBackColor = true; + this.btnImport.Click += new System.EventHandler(this.btnImport_Click); + // + // layout + // + resources.ApplyResources(this.layout, "layout"); + this.layout.Controls.Add(this.lstItems, 0, 0); + this.layout.Controls.Add(this.textItem, 0, 1); + this.layout.Controls.Add(this.btnImport, 0, 2); + this.layout.Controls.Add(this.btnRemove, 1, 2); + this.layout.Controls.Add(this.btnAdd, 1, 1); + this.layout.Controls.Add(this.btnClose, 0, 3); + this.layout.Name = "layout"; + // + // btnRemove + // + resources.ApplyResources(this.btnRemove, "btnRemove"); + this.btnRemove.Name = "btnRemove"; + this.btnRemove.UseVisualStyleBackColor = true; + this.btnRemove.Click += new System.EventHandler(this.btnRemove_Click); + // + // btnAdd + // + resources.ApplyResources(this.btnAdd, "btnAdd"); + this.btnAdd.Name = "btnAdd"; + this.btnAdd.UseVisualStyleBackColor = true; + this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click); + // + // btnClose + // + this.layout.SetColumnSpan(this.btnClose, 2); + resources.ApplyResources(this.btnClose, "btnClose"); + this.btnClose.Name = "btnClose"; + this.btnClose.UseVisualStyleBackColor = true; + this.btnClose.Click += new System.EventHandler(this.btnClose_Click); + // + // ListEditorForm + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.layout); + this.Name = "ListEditorForm"; + this.Load += new System.EventHandler(this.ListEditorForm_Load); + this.layout.ResumeLayout(false); + this.layout.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListBox lstItems; + private System.Windows.Forms.TableLayoutPanel layout; + private System.Windows.Forms.TextBox textItem; + private System.Windows.Forms.Button btnImport; + private System.Windows.Forms.Button btnRemove; + private System.Windows.Forms.Button btnAdd; + private System.Windows.Forms.Button btnClose; + } +} \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/forms/ListEditorForm.cs b/client/administration/UdsAdmin/controls/forms/ListEditorForm.cs new file mode 100644 index 000000000..9d924f9e2 --- /dev/null +++ b/client/administration/UdsAdmin/controls/forms/ListEditorForm.cs @@ -0,0 +1,111 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.IO; + +namespace UdsAdmin.controls.forms +{ + public partial class ListEditorForm : Form + { + public ListEditorForm() + { + InitializeComponent(); + } + + private void addTxtItem(string txt) + { + lstItems.Items.Add(txt); + } + + private void addCommaSeparatedValues(string txt) + { + foreach (string item in txt.Split(',')) + { + addTxtItem(item); + } + } + + public ListBox.ObjectCollection Items + { + get { return lstItems.Items; } + } + + private void processTxt() + { + string item = textItem.Text; + if (item.Length == 0) + return; + + if (item.Contains(',')) + addCommaSeparatedValues(item); + else + addTxtItem(item); + + textItem.Text = ""; + textItem.Focus(); + } + + + private void textItem_KeyPress(object sender, KeyPressEventArgs e) + { + if (e.KeyChar == 13) + { + processTxt(); + } + } + + private void btnRemove_Click(object sender, EventArgs e) + { + if (lstItems.SelectedIndex != -1) + { + int sel = lstItems.SelectedIndex; + lstItems.Items.RemoveAt(sel); + if (sel > 0) + lstItems.SelectedIndex = sel - 1; + else if (lstItems.Items.Count > 0) + lstItems.SelectedIndex = 0; + } + } + + private void btnAdd_Click(object sender, EventArgs e) + { + processTxt(); + } + + private void btnClose_Click(object sender, EventArgs e) + { + DialogResult = System.Windows.Forms.DialogResult.OK; + } + + private void ListEditorForm_Load(object sender, EventArgs e) + { + this.Location = System.Windows.Forms.Cursor.Position; + } + + private void btnImport_Click(object sender, EventArgs e) + { + OpenFileDialog dlg = new OpenFileDialog(); + dlg.Filter = Strings.importFilter; + dlg.DefaultExt = "txt"; + dlg.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal); + if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) + { + StreamReader reader = File.OpenText(dlg.FileName); + string line; + while ((line = reader.ReadLine()) != null) + { + if( line.Contains(',') ) + addCommaSeparatedValues(line); + else + addTxtItem(line); + } + reader.Close(); + } + } + } +} diff --git a/client/administration/UdsAdmin/controls/forms/ListEditorForm.de.resx b/client/administration/UdsAdmin/controls/forms/ListEditorForm.de.resx new file mode 100644 index 000000000..10b18f87e --- /dev/null +++ b/client/administration/UdsAdmin/controls/forms/ListEditorForm.de.resx @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ListEditorFormfr + + + Entfernen + + + Hinzufügen + + + Datei importieren + + + Editor schließen + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/forms/ListEditorForm.es.resx b/client/administration/UdsAdmin/controls/forms/ListEditorForm.es.resx new file mode 100644 index 000000000..616244895 --- /dev/null +++ b/client/administration/UdsAdmin/controls/forms/ListEditorForm.es.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Añadir + + + Quitar + + + Archivo de importación + + + Cerrar editor + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/forms/ListEditorForm.fr.resx b/client/administration/UdsAdmin/controls/forms/ListEditorForm.fr.resx new file mode 100644 index 000000000..6ebc089d5 --- /dev/null +++ b/client/administration/UdsAdmin/controls/forms/ListEditorForm.fr.resx @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ListEditorFormfr + + + Supprimer + + + Ajouter + + + Fichier d'importation + + + Éditeur étroite + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/forms/ListEditorForm.resx b/client/administration/UdsAdmin/controls/forms/ListEditorForm.resx new file mode 100644 index 000000000..262c178d0 --- /dev/null +++ b/client/administration/UdsAdmin/controls/forms/ListEditorForm.resx @@ -0,0 +1,330 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 2 + + + + Fill + + + + 3, 187 + + + 157, 20 + + + 1 + + + textItem + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + layout + + + 1 + + + 3, 213 + + + 75, 20 + + + 2 + + + Import file + + + btnImport + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + layout + + + 2 + + + Top, Right + + + 206, 213 + + + 75, 20 + + + 3 + + + Remove + + + btnRemove + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + layout + + + 3 + + + Top, Right + + + 206, 187 + + + 75, 20 + + + 4 + + + Add + + + btnAdd + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + layout + + + 4 + + + Fill + + + 3, 239 + + + 278, 20 + + + 5 + + + Close editor + + + btnClose + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + layout + + + 5 + + + Fill + + + 0, 0 + + + 4 + + + 284, 262 + + + 2 + + + layout + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="lstItems" Row="0" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="textItem" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="btnImport" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="btnRemove" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="btnAdd" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="btnClose" Row="3" RowSpan="1" Column="0" ColumnSpan="2" /></Controls><Columns Styles="Percent,57,45614,Percent,42,54386" /><Rows Styles="Percent,100,Absolute,26,Absolute,26,Absolute,26" /></TableLayoutSettings> + + + Fill + + + 3, 3 + + + 278, 178 + + + 0 + + + lstItems + + + System.Windows.Forms.ListBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + layout + + + 0 + + + True + + + 6, 13 + + + 284, 262 + + + Manual + + + Editor + + + ListEditorForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/AuthsPanel.Designer.cs b/client/administration/UdsAdmin/controls/panel/AuthsPanel.Designer.cs new file mode 100644 index 000000000..552657e52 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/AuthsPanel.Designer.cs @@ -0,0 +1,93 @@ +namespace UdsAdmin.controls.panel +{ + partial class AuthsPanel + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de componentes + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AuthsPanel)); + this.listView = new System.Windows.Forms.ListView(); + this.name = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.typeName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.comments = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.priority = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.SuspendLayout(); + // + // listView + // + this.listView.AutoArrange = false; + this.listView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.name, + this.typeName, + this.comments, + this.priority}); + resources.ApplyResources(this.listView, "listView"); + this.listView.FullRowSelect = true; + this.listView.GridLines = true; + this.listView.Name = "listView"; + this.listView.UseCompatibleStateImageBehavior = false; + this.listView.View = System.Windows.Forms.View.Details; + this.listView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listView_ColumnClick); + this.listView.KeyUp += new System.Windows.Forms.KeyEventHandler(this.listView_KeyUp); + // + // name + // + resources.ApplyResources(this.name, "name"); + this.name.Width = global::UdsAdmin.Properties.Settings.Default.wNameCol; + // + // typeName + // + resources.ApplyResources(this.typeName, "typeName"); + // + // comments + // + resources.ApplyResources(this.comments, "comments"); + this.comments.Width = global::UdsAdmin.Properties.Settings.Default.wCommentsCol; + // + // priority + // + resources.ApplyResources(this.priority, "priority"); + // + // AuthsPanel + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.listView); + this.Name = "AuthsPanel"; + this.VisibleChanged += new System.EventHandler(this.UsersPanel_VisibleChanged); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListView listView; + private System.Windows.Forms.ColumnHeader name; + private System.Windows.Forms.ColumnHeader comments; + private System.Windows.Forms.ColumnHeader typeName; + private System.Windows.Forms.ColumnHeader priority; + } +} diff --git a/client/administration/UdsAdmin/controls/panel/AuthsPanel.cs b/client/administration/UdsAdmin/controls/panel/AuthsPanel.cs new file mode 100644 index 000000000..6e6704cb3 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/AuthsPanel.cs @@ -0,0 +1,105 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.controls.panel +{ + public partial class AuthsPanel : UserControl + { + gui.ListViewSorter _listSorter; + + public AuthsPanel() + { + InitializeComponent(); + + listView.ListViewItemSorter = _listSorter = new gui.ListViewSorter(listView); + updateList(); + } + + private void UsersPanel_VisibleChanged(object sender, EventArgs e) + { + if (Visible == true) + { + updateList(); + } + } + + private void updateList() + { + try + { + xmlrpc.Authenticator[] auths = xmlrpc.UdsAdminService.GetAuthenticators(); + List lst = new List(); + foreach (xmlrpc.Authenticator auth in auths) + { + ListViewItem itm = new ListViewItem(new string[] { auth.name, auth.typeName, auth.comments, auth.priority }); + itm.ForeColor = gui.Colors.ActiveColor; + itm.Tag = auth.id; + lst.Add(itm); + } + listView.Items.Clear(); + listView.Items.AddRange(lst.ToArray()); + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + + } + + private void listView_KeyUp(object sender, KeyEventArgs e) + { + switch (e.KeyCode) + { + case Keys.F5: + updateList(); + break; + case Keys.E: + if (e.Modifiers == Keys.Control) + foreach (ListViewItem i in listView.Items) + i.Selected = true; + break; + } + } + + private void listView_ColumnClick(object sender, ColumnClickEventArgs e) + { + _listSorter.ColumnClick(sender, e); + } + + } +} diff --git a/client/administration/UdsAdmin/controls/panel/AuthsPanel.de.resx b/client/administration/UdsAdmin/controls/panel/AuthsPanel.de.resx new file mode 100644 index 000000000..fcf0d1256 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/AuthsPanel.de.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Name + + + Kommentare + + + Typ + + + Priorität + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/AuthsPanel.es.resx b/client/administration/UdsAdmin/controls/panel/AuthsPanel.es.resx new file mode 100644 index 000000000..f128d3fba --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/AuthsPanel.es.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Nombre + + + Comentarios + + + Tipo + + + Prioridad + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/AuthsPanel.fr.resx b/client/administration/UdsAdmin/controls/panel/AuthsPanel.fr.resx new file mode 100644 index 000000000..ba36abc6f --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/AuthsPanel.fr.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Nom + + + Commentaires + + + Type + + + Priorité + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/AuthsPanel.resx b/client/administration/UdsAdmin/controls/panel/AuthsPanel.resx new file mode 100644 index 000000000..18b826e66 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/AuthsPanel.resx @@ -0,0 +1,207 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Name + + + Type + + + + 135 + + + Comments + + + Priority + + + 73 + + + + Fill + + + False + + + + 0, 0 + + + 699, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 699, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + typeName + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + priority + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + AuthsPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/DeployedGroupsPanel.Designer.cs b/client/administration/UdsAdmin/controls/panel/DeployedGroupsPanel.Designer.cs new file mode 100644 index 000000000..db0b68209 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/DeployedGroupsPanel.Designer.cs @@ -0,0 +1,95 @@ +namespace UdsAdmin.controls.panel +{ + partial class DeployedGroupsPanel + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de componentes + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DeployedGroupsPanel)); + this.listView = new System.Windows.Forms.ListView(); + this.name = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.state = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.comments = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.auth = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.SuspendLayout(); + // + // listView + // + this.listView.AutoArrange = false; + this.listView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.auth, + this.name, + this.state, + this.comments}); + resources.ApplyResources(this.listView, "listView"); + this.listView.FullRowSelect = true; + this.listView.GridLines = true; + this.listView.Name = "listView"; + this.listView.UseCompatibleStateImageBehavior = false; + this.listView.View = System.Windows.Forms.View.Details; + this.listView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listView_ColumnClick); + this.listView.KeyUp += new System.Windows.Forms.KeyEventHandler(this.listView_KeyUp); + this.listView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.listView_MouseUp); + // + // name + // + resources.ApplyResources(this.name, "name"); + this.name.Width = global::UdsAdmin.Properties.Settings.Default.wNameCol; + // + // state + // + resources.ApplyResources(this.state, "state"); + this.state.Width = global::UdsAdmin.Properties.Settings.Default.wStateCol; + // + // comments + // + resources.ApplyResources(this.comments, "comments"); + this.comments.Width = global::UdsAdmin.Properties.Settings.Default.wCommentsCol; + // + // auth + // + resources.ApplyResources(this.auth, "auth"); + // + // DeployedGroupsPanel + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.listView); + this.Name = "DeployedGroupsPanel"; + this.VisibleChanged += new System.EventHandler(this.UsersPanel_VisibleChanged); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListView listView; + private System.Windows.Forms.ColumnHeader name; + private System.Windows.Forms.ColumnHeader state; + private System.Windows.Forms.ColumnHeader comments; + private System.Windows.Forms.ColumnHeader auth; + } +} diff --git a/client/administration/UdsAdmin/controls/panel/DeployedGroupsPanel.cs b/client/administration/UdsAdmin/controls/panel/DeployedGroupsPanel.cs new file mode 100644 index 000000000..124befdad --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/DeployedGroupsPanel.cs @@ -0,0 +1,177 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.controls.panel +{ + public partial class DeployedGroupsPanel : UserControl + { + private xmlrpc.DeployedService _ds; + ContextMenuStrip _selectedMenu; + ContextMenuStrip _unselectedMenu; + gui.ListViewSorter _listSorter; + + public DeployedGroupsPanel(xmlrpc.DeployedService dps) + { + _ds = dps; + InitializeComponent(); + + _selectedMenu = new ContextMenuStrip(); + _unselectedMenu = new ContextMenuStrip(); + + ToolStripMenuItem enable = new ToolStripMenuItem(Strings.enable); enable.Click += enableItem; enable.Image = Images.apply16; + ToolStripMenuItem disable = new ToolStripMenuItem(Strings.disable); disable.Click += disableItem; disable.Image = Images.cancel16; + ToolStripSeparator sep = new ToolStripSeparator(); + ToolStripMenuItem newG = new ToolStripMenuItem(Strings.newItem); newG.Click += newItem; newG.Image = Images.new16; + ToolStripMenuItem delete = new ToolStripMenuItem(Strings.deleteItem); delete.Click += deleteItem; delete.Image = Images.delete16; + + ToolStripMenuItem newG2 = new ToolStripMenuItem(Strings.newItem); newG2.Click += newItem; newG2.Image = Images.new16; + ToolStripMenuItem delete2 = new ToolStripMenuItem(Strings.deleteItem); delete2.Click += deleteItem; delete2.Image = Images.delete16; + + _selectedMenu.Items.AddRange(new ToolStripItem[] { enable, disable, sep, newG, delete }); + _unselectedMenu.Items.AddRange(new ToolStripItem[] { newG2, delete2 }); + + listView.ListViewItemSorter = _listSorter = new gui.ListViewSorter(listView); + + updateList(); + } + + private void UsersPanel_VisibleChanged(object sender, EventArgs e) + { + if (Visible == true) + { + updateList(); + } + } + + private void updateList() + { + xmlrpc.Group[] grps = xmlrpc.UdsAdminService.GetGroupsAssignedToDeployedService(_ds.id); + List lst = new List(); + foreach (xmlrpc.Group grp in grps) + { + ListViewItem itm = new ListViewItem(new string[]{grp.nameParent, grp.name, grp.active ? Strings.active : Strings.inactive , grp.comments}); + itm.ForeColor = grp.active ? gui.Colors.ActiveColor : gui.Colors.InactiveColor; + itm.Tag = grp.id; + lst.Add(itm); + } + listView.Items.Clear(); + listView.Items.AddRange(lst.ToArray()); + } + + private void newItem(object sender, EventArgs e) + { + UdsAdmin.forms.DeployedGroupForm form = new UdsAdmin.forms.DeployedGroupForm(_ds); + if (form.ShowDialog() == DialogResult.OK) + updateList(); + } + + private void setSelectedStates(bool newState) + { + if( listView.SelectedItems.Count == 0 ) + return; + string info = newState == true ? Strings.active : Strings.inactive; + Color col = newState == true ? gui.Colors.ActiveColor : gui.Colors.InactiveColor; + string[] ids = new string[listView.SelectedItems.Count]; + int n = 0; + foreach (ListViewItem i in listView.SelectedItems) + { + ids[n++] = (string)i.Tag; + i.SubItems[2].Text = info; + i.ForeColor = col; + } + xmlrpc.UdsAdminService.ChangeGroupsState(ids, newState); + + } + + private void enableItem(object sender, EventArgs e) + { + setSelectedStates(true); + } + + private void disableItem(object sender, EventArgs e) + { + setSelectedStates(false); + } + + private void deleteItem(object sender, EventArgs e) + { + if (listView.SelectedItems.Count == 0) + return; + string[] ids = new string[listView.SelectedItems.Count]; + int n = 0; + foreach (ListViewItem i in listView.SelectedItems) + { + ids[n++] = (string)i.Tag; + listView.Items.Remove(i); + } + xmlrpc.UdsAdminService.RemoveGroupsFromDeployedService(_ds.id, ids); + } + + private void listView_ColumnClick(object sender, ColumnClickEventArgs e) + { + _listSorter.ColumnClick(sender, e); + } + + private void listView_MouseUp(object sender, MouseEventArgs e) + { + if (e.Button == System.Windows.Forms.MouseButtons.Right) + { + if (listView.SelectedItems.Count == 0) + _unselectedMenu.Show(Control.MousePosition.X, Control.MousePosition.Y); + else + _selectedMenu.Show(Control.MousePosition.X, Control.MousePosition.Y); + } + } + + private void listView_KeyUp(object sender, KeyEventArgs e) + { + switch (e.KeyCode) + { + case Keys.F5: + updateList(); + break; + case Keys.E: + if (e.Modifiers == Keys.Control) + foreach (ListViewItem i in listView.Items) + i.Selected = true; + break; + } + } + + } +} diff --git a/client/administration/UdsAdmin/controls/panel/DeployedGroupsPanel.de.resx b/client/administration/UdsAdmin/controls/panel/DeployedGroupsPanel.de.resx new file mode 100644 index 000000000..d597a1b5f --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/DeployedGroupsPanel.de.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Name + + + Staat + + + Kommentare + + + Authentifikator + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/DeployedGroupsPanel.es.resx b/client/administration/UdsAdmin/controls/panel/DeployedGroupsPanel.es.resx new file mode 100644 index 000000000..f1c9704a6 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/DeployedGroupsPanel.es.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Nombre + + + Estado + + + Comentarios + + + Autenticador + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/DeployedGroupsPanel.fr.resx b/client/administration/UdsAdmin/controls/panel/DeployedGroupsPanel.fr.resx new file mode 100644 index 000000000..ff49e44c0 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/DeployedGroupsPanel.fr.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Nom + + + État + + + Commentaires + + + Authentificateur + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/DeployedGroupsPanel.resx b/client/administration/UdsAdmin/controls/panel/DeployedGroupsPanel.resx new file mode 100644 index 000000000..a0a02743c --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/DeployedGroupsPanel.resx @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Authenticator + + + + 153 + + + Name + + + State + + + Comments + + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + state + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + auth + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + DeployedGroupsPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/DeployedPanel.Designer.cs b/client/administration/UdsAdmin/controls/panel/DeployedPanel.Designer.cs new file mode 100644 index 000000000..0df4e5c95 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/DeployedPanel.Designer.cs @@ -0,0 +1,106 @@ +namespace UdsAdmin.controls.panel +{ + partial class DeployedPanel + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de componentes + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DeployedPanel)); + this.Id = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.CreationDate = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.State = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.StatusDate = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.listView = new System.Windows.Forms.ListView(); + this.friendlyName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.Revision = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.SuspendLayout(); + // + // Id + // + resources.ApplyResources(this.Id, "Id"); + // + // CreationDate + // + resources.ApplyResources(this.CreationDate, "CreationDate"); + // + // State + // + resources.ApplyResources(this.State, "State"); + // + // StatusDate + // + resources.ApplyResources(this.StatusDate, "StatusDate"); + // + // listView + // + this.listView.AutoArrange = false; + this.listView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.Id, + this.friendlyName, + this.Revision, + this.CreationDate, + this.State, + this.StatusDate}); + resources.ApplyResources(this.listView, "listView"); + this.listView.FullRowSelect = true; + this.listView.GridLines = true; + this.listView.Name = "listView"; + this.listView.UseCompatibleStateImageBehavior = false; + this.listView.View = System.Windows.Forms.View.Details; + this.listView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listView_ColumnClick); + this.listView.KeyUp += new System.Windows.Forms.KeyEventHandler(this.listView_KeyUp); + this.listView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.listView_MouseUp); + // + // friendlyName + // + resources.ApplyResources(this.friendlyName, "friendlyName"); + // + // Revision + // + resources.ApplyResources(this.Revision, "Revision"); + // + // DeployedPanel + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.listView); + this.Name = "DeployedPanel"; + this.VisibleChanged += new System.EventHandler(this.DeployedPanel_VisibleChanged); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListView listView; + private System.Windows.Forms.ColumnHeader Id; + private System.Windows.Forms.ColumnHeader CreationDate; + private System.Windows.Forms.ColumnHeader State; + private System.Windows.Forms.ColumnHeader StatusDate; + private System.Windows.Forms.ColumnHeader Revision; + private System.Windows.Forms.ColumnHeader friendlyName; + } +} diff --git a/client/administration/UdsAdmin/controls/panel/DeployedPanel.cs b/client/administration/UdsAdmin/controls/panel/DeployedPanel.cs new file mode 100644 index 000000000..31f385e89 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/DeployedPanel.cs @@ -0,0 +1,212 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.controls.panel +{ + public partial class DeployedPanel : UserControl + { + private xmlrpc.DeployedService _parent; + private bool _cache; + ContextMenuStrip _deleteMenu; + ContextMenuStrip _assignMenu; + ContextMenuStrip _infoMenu; + gui.ListViewSorter _listSorter; + + public DeployedPanel(xmlrpc.DeployedService parent, bool cache = false) + { + _parent = parent; + _cache = cache; + _deleteMenu = new ContextMenuStrip(); + _assignMenu = new ContextMenuStrip(); + _infoMenu = new ContextMenuStrip(); + InitializeComponent(); + + ToolStripMenuItem delete = new ToolStripMenuItem(Strings.deleteItem); delete.Click += deleteItem; delete.Image = Images.delete16; + _deleteMenu.Items.AddRange(new ToolStripItem[] { delete }); + + ToolStripMenuItem info = new ToolStripMenuItem(Strings.errorInfo); info.Click += infoItem; info.Image = Images.find16; + _infoMenu.Items.AddRange(new ToolStripItem[] { info }); + + ToolStripMenuItem assign = new ToolStripMenuItem(Strings.assignToUser); assign.Click += assignToUser; assign.Image = Images.new16; + _assignMenu.Items.AddRange(new ToolStripItem[] { assign }); + + // Adapt listview to cache or users + if (cache) + { + cacheHeaders(); + } + else + { + assignedHeaders(); + } + + listView.ListViewItemSorter = _listSorter = new gui.ListViewSorter(listView, new int[] { 3, 5 } ); + + updateList(); + } + + private void DeployedPanel_VisibleChanged(object sender, EventArgs e) + { + if (Visible == true) + { + updateList(); + } + } + + private void cacheHeaders() + { + ColumnHeader he = new ColumnHeader(); + he.Text = Strings.cacheLevel; he.TextAlign = HorizontalAlignment.Left; he.Width = 128; + listView.Columns.Add(he); + } + + private void assignedHeaders() + { + ColumnHeader userHeader = new ColumnHeader(); userHeader.Text = Strings.owner; userHeader.TextAlign = HorizontalAlignment.Center; + ColumnHeader usedHeader = new ColumnHeader(); usedHeader.Text = Strings.occopied; usedHeader.TextAlign = HorizontalAlignment.Center; + listView.Columns.AddRange(new ColumnHeader[]{ userHeader, usedHeader}); + } + + private ListViewItem getListViewItemFrom(xmlrpc.UserDeployedService uds) + { + if (_cache == true) + return new ListViewItem(new string[] { uds.uniqueId, uds.friendlyName, uds.revision, uds.creationDate.ToString(), + xmlrpc.Util.GetStringFromState(uds.state, uds.osState), uds.stateDate.ToString(), + ((xmlrpc.CachedDeployedService)uds).cacheLevel}); + xmlrpc.AssignedDeployedService udss = (xmlrpc.AssignedDeployedService)uds; + return new ListViewItem(new string[] { uds.uniqueId, uds.friendlyName, uds.revision, uds.creationDate.ToString(), + xmlrpc.Util.GetStringFromState(uds.state, uds.osState), uds.stateDate.ToString(), udss.user, udss.inUse ? Strings.yes : Strings.no} ); + } + + private void updateList() + { + + xmlrpc.UserDeployedService[] servs; + if (_cache == true) + servs = xmlrpc.UdsAdminService.GetCachedDeployedServices(_parent); + else + servs = xmlrpc.UdsAdminService.GetAssignedDeployedServices(_parent); + + List lst = new List(); + foreach (xmlrpc.UserDeployedService uds in servs) + { + ListViewItem itm = getListViewItemFrom(uds); + itm.Tag = uds.id; + itm.ForeColor = gui.Colors.getColorForState(uds.state); + lst.Add(itm); + } + listView.Items.Clear(); + listView.Items.AddRange(lst.ToArray()); + } + + private void assignToUser(object sender, EventArgs e) + { + UdsAdmin.forms.AssignDeployed form = new UdsAdmin.forms.AssignDeployed(_parent); + if (form.ShowDialog() == DialogResult.OK) + updateList(); + } + + private void infoItem(object sender, EventArgs e) + { + string id = (string)listView.SelectedItems[0].Tag; + string error = xmlrpc.UdsAdminService.GetUserDeployedServiceError(id); + MessageBox.Show(error, Strings.error, MessageBoxButtons.OK, MessageBoxIcon.Information); + } + + private void deleteItem(object sender, EventArgs e) + { + if (listView.SelectedItems.Count == 0) + return; + string[] ids = new string[listView.SelectedItems.Count]; + int n = 0; + foreach (ListViewItem i in listView.SelectedItems) + { + ids[n++] = (string)i.Tag; + } + try + { + xmlrpc.UdsAdminService.RemoveUserService(ids); + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + updateList(); + } + + private void listView_ColumnClick(object sender, ColumnClickEventArgs e) + { + _listSorter.ColumnClick(sender, e); + } + + private void listView_MouseUp(object sender, MouseEventArgs e) + { + if (e.Button == System.Windows.Forms.MouseButtons.Right) + { + if (listView.SelectedItems.Count == 0) + { + if (_parent.info.mustAssignManually) + _assignMenu.Show(Control.MousePosition.X, Control.MousePosition.Y); + } + else + { + if (listView.SelectedItems.Count == 1 && listView.SelectedItems[0].SubItems[4].Text == xmlrpc.Util.GetStringFromState(xmlrpc.Constants.STATE_ERROR)) + _infoMenu.Show(Control.MousePosition.X, Control.MousePosition.Y); + else + _deleteMenu.Show(Control.MousePosition.X, Control.MousePosition.Y); + } + } + } + + private void listView_KeyUp(object sender, KeyEventArgs e) + { + switch (e.KeyCode) + { + case Keys.F5: + updateList(); + break; + case Keys.E: + if (e.Modifiers == Keys.Control) + foreach (ListViewItem i in listView.Items) + i.Selected = true; + break; + } + } + + } +} diff --git a/client/administration/UdsAdmin/controls/panel/DeployedPanel.de.resx b/client/administration/UdsAdmin/controls/panel/DeployedPanel.de.resx new file mode 100644 index 000000000..4f6eef408 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/DeployedPanel.de.resx @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ID + + + Erstellungsdatum + + + Staat + + + Statusdatum + + + Angezeigter Name + + + Überarbeitung + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + Id + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + CreationDate + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + State + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + StatusDate + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + friendlyName + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Revision + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + DeployedPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/DeployedPanel.es.resx b/client/administration/UdsAdmin/controls/panel/DeployedPanel.es.resx new file mode 100644 index 000000000..67c7f484d --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/DeployedPanel.es.resx @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ID + + + Fecha de creación + + + Estado + + + Fecha de Estado + + + Nombre descriptivo + + + Revisión + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + Id + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + CreationDate + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + State + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + StatusDate + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + friendlyName + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Revision + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + DeployedPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/DeployedPanel.fr.resx b/client/administration/UdsAdmin/controls/panel/DeployedPanel.fr.resx new file mode 100644 index 000000000..0ebabed54 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/DeployedPanel.fr.resx @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ID + + + Date de création + + + État + + + Date d'État + + + Nom convivial + + + Révision + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + Id + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + CreationDate + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + State + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + StatusDate + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + friendlyName + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Revision + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + DeployedPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/DeployedPanel.resx b/client/administration/UdsAdmin/controls/panel/DeployedPanel.resx new file mode 100644 index 000000000..823ac3567 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/DeployedPanel.resx @@ -0,0 +1,237 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Id + + + + 125 + + + Creation Date + + + 150 + + + State + + + 120 + + + Status Date + + + 143 + + + Friendly Name + + + 142 + + + Revision + + + 109 + + + + Fill + + + False + + + + 0, 0 + + + 784, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 784, 279 + + + Id + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + CreationDate + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + State + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + StatusDate + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + friendlyName + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Revision + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + DeployedPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/DeployedServicePanel.Designer.cs b/client/administration/UdsAdmin/controls/panel/DeployedServicePanel.Designer.cs new file mode 100644 index 000000000..23cef6d69 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/DeployedServicePanel.Designer.cs @@ -0,0 +1,232 @@ +namespace UdsAdmin.controls.panel +{ + partial class DeployedServicePanel + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de componentes + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DeployedServicePanel)); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.groupLabel = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.lName = new System.Windows.Forms.Label(); + this.lComments = new System.Windows.Forms.Label(); + this.lBaseService = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.lOsManager = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.lInitial = new System.Windows.Forms.Label(); + this.cacheLabel = new System.Windows.Forms.Label(); + this.lCache = new System.Windows.Forms.Label(); + this.cacheL2Label = new System.Windows.Forms.Label(); + this.lL2Cache = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.lMax = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.lState = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.tableLayoutPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // tableLayoutPanel1 + // + resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); + this.tableLayoutPanel1.Controls.Add(this.groupLabel, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.label1, 0, 2); + this.tableLayoutPanel1.Controls.Add(this.lName, 1, 0); + this.tableLayoutPanel1.Controls.Add(this.lComments, 1, 1); + this.tableLayoutPanel1.Controls.Add(this.lBaseService, 1, 2); + this.tableLayoutPanel1.Controls.Add(this.label3, 0, 3); + this.tableLayoutPanel1.Controls.Add(this.lOsManager, 1, 3); + this.tableLayoutPanel1.Controls.Add(this.lInitial, 1, 4); + this.tableLayoutPanel1.Controls.Add(this.cacheLabel, 0, 5); + this.tableLayoutPanel1.Controls.Add(this.lCache, 1, 5); + this.tableLayoutPanel1.Controls.Add(this.cacheL2Label, 0, 6); + this.tableLayoutPanel1.Controls.Add(this.lL2Cache, 1, 6); + this.tableLayoutPanel1.Controls.Add(this.lMax, 1, 7); + this.tableLayoutPanel1.Controls.Add(this.label6, 0, 8); + this.tableLayoutPanel1.Controls.Add(this.lState, 1, 8); + this.tableLayoutPanel1.Controls.Add(this.label10, 0, 4); + this.tableLayoutPanel1.Controls.Add(this.label7, 0, 7); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + // + // groupLabel + // + resources.ApplyResources(this.groupLabel, "groupLabel"); + this.groupLabel.CausesValidation = false; + this.groupLabel.Name = "groupLabel"; + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.CausesValidation = false; + this.label2.Name = "label2"; + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.CausesValidation = false; + this.label1.Name = "label1"; + // + // lName + // + resources.ApplyResources(this.lName, "lName"); + this.lName.BackColor = System.Drawing.SystemColors.Window; + this.lName.Name = "lName"; + // + // lComments + // + resources.ApplyResources(this.lComments, "lComments"); + this.lComments.BackColor = System.Drawing.SystemColors.Window; + this.lComments.Name = "lComments"; + // + // lBaseService + // + resources.ApplyResources(this.lBaseService, "lBaseService"); + this.lBaseService.BackColor = System.Drawing.SystemColors.Window; + this.lBaseService.Name = "lBaseService"; + // + // label3 + // + resources.ApplyResources(this.label3, "label3"); + this.label3.CausesValidation = false; + this.label3.Name = "label3"; + // + // lOsManager + // + resources.ApplyResources(this.lOsManager, "lOsManager"); + this.lOsManager.BackColor = System.Drawing.SystemColors.Window; + this.lOsManager.Name = "lOsManager"; + // + // label10 + // + resources.ApplyResources(this.label10, "label10"); + this.label10.CausesValidation = false; + this.label10.Name = "label10"; + // + // lInitial + // + resources.ApplyResources(this.lInitial, "lInitial"); + this.lInitial.BackColor = System.Drawing.SystemColors.Window; + this.lInitial.Name = "lInitial"; + // + // cacheLabel + // + resources.ApplyResources(this.cacheLabel, "cacheLabel"); + this.cacheLabel.CausesValidation = false; + this.cacheLabel.Name = "cacheLabel"; + // + // lCache + // + resources.ApplyResources(this.lCache, "lCache"); + this.lCache.BackColor = System.Drawing.SystemColors.Window; + this.lCache.Name = "lCache"; + // + // cacheL2Label + // + resources.ApplyResources(this.cacheL2Label, "cacheL2Label"); + this.cacheL2Label.CausesValidation = false; + this.cacheL2Label.Name = "cacheL2Label"; + // + // lL2Cache + // + resources.ApplyResources(this.lL2Cache, "lL2Cache"); + this.lL2Cache.BackColor = System.Drawing.SystemColors.Window; + this.lL2Cache.Name = "lL2Cache"; + // + // label7 + // + resources.ApplyResources(this.label7, "label7"); + this.label7.CausesValidation = false; + this.label7.Name = "label7"; + // + // lMax + // + resources.ApplyResources(this.lMax, "lMax"); + this.lMax.BackColor = System.Drawing.SystemColors.Window; + this.lMax.Name = "lMax"; + // + // label6 + // + resources.ApplyResources(this.label6, "label6"); + this.label6.CausesValidation = false; + this.label6.Name = "label6"; + // + // lState + // + resources.ApplyResources(this.lState, "lState"); + this.lState.BackColor = System.Drawing.SystemColors.Window; + this.lState.Name = "lState"; + // + // label4 + // + resources.ApplyResources(this.label4, "label4"); + this.label4.Name = "label4"; + this.label4.UseMnemonic = false; + // + // DeployedServicePanel + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Window; + this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.Controls.Add(this.label4); + this.Controls.Add(this.tableLayoutPanel1); + this.Name = "DeployedServicePanel"; + this.VisibleChanged += new System.EventHandler(this.DeployedServicePanel_VisibleChanged); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Label groupLabel; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label cacheLabel; + private System.Windows.Forms.Label cacheL2Label; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label lName; + private System.Windows.Forms.Label lComments; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label lBaseService; + private System.Windows.Forms.Label lOsManager; + private System.Windows.Forms.Label lInitial; + private System.Windows.Forms.Label lCache; + private System.Windows.Forms.Label lL2Cache; + private System.Windows.Forms.Label lState; + private System.Windows.Forms.Label lMax; + private System.Windows.Forms.Label label4; + } +} diff --git a/client/administration/UdsAdmin/controls/panel/DeployedServicePanel.cs b/client/administration/UdsAdmin/controls/panel/DeployedServicePanel.cs new file mode 100644 index 000000000..b05ee18c2 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/DeployedServicePanel.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.controls.panel +{ + public partial class DeployedServicePanel : UserControl + { + private string _dsId; + public DeployedServicePanel(xmlrpc.DeployedService ds) + { + _dsId = ds.id; + InitializeComponent(); + + updateData(); + } + + private void DeployedServicePanel_VisibleChanged(object sender, EventArgs e) + { + if (Visible == true) + updateData(); + } + + private void updateData() + { + xmlrpc.DeployedService ds = xmlrpc.UdsAdminService.GetDeployedService(_dsId); + lName.Text = ds.name; + lComments.Text = ds.comments; + lInitial.Text = ds.initialServices.ToString(); + lCache.Text = ds.cacheL1.ToString(); + lL2Cache.Text = ds.cacheL2.ToString(); + lMax.Text = ds.maxServices.ToString(); + lState.Text = ds.state; + lBaseService.Text = ds.serviceName; + lOsManager.Text = ds.osManagerName; + } + } +} diff --git a/client/administration/UdsAdmin/controls/panel/DeployedServicePanel.de.resx b/client/administration/UdsAdmin/controls/panel/DeployedServicePanel.de.resx new file mode 100644 index 000000000..c74b70016 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/DeployedServicePanel.de.resx @@ -0,0 +1,783 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 2 + + + True + + + + 3, 6 + + + + 3, 6, 3, 0 + + + 35, 13 + + + 2 + + + Name + + + groupLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + True + + + 3, 27 + + + 3, 6, 3, 0 + + + 56, 13 + + + 4 + + + Kommentare + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + True + + + 3, 48 + + + 3, 6, 3, 0 + + + 68, 13 + + + 3 + + + Basisdienst + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + True + + + 3, 69 + + + 3, 6, 3, 0 + + + 70, 13 + + + 6 + + + Authentifikator + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + True + + + 3, 90 + + + 3, 6, 3, 0 + + + 65, 13 + + + 5 + + + OS-Manager + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + Left + + + True + + + NoControl + + + 3, 109 + + + 126, 13 + + + 12 + + + Erste Services Availables + + + label10 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 5 + + + Left + + + True + + + NoControl + + + 3, 130 + + + 131, 13 + + + 13 + + + Dienstleistungen im Cache zu behalten + + + cacheLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 6 + + + Left + + + True + + + NoControl + + + 3, 151 + + + 146, 13 + + + 14 + + + Dienstleistungen im L2-Cache zu behalten + + + cacheL2Label + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 7 + + + Left + + + True + + + NoControl + + + 3, 172 + + + 143, 13 + + + 15 + + + Maximale Anzahl von Dienstleistungen + + + label7 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 8 + + + Left + + + NoControl + + + 184, 3 + + + 200, 15 + + + 16 + + + + + + lName + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 9 + + + Left + + + NoControl + + + 184, 24 + + + 200, 15 + + + 18 + + + + + + lComments + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 10 + + + Left + + + True + + + NoControl + + + 3, 195 + + + 32, 13 + + + 17 + + + Staat + + + label6 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 11 + + + Left + + + NoControl + + + 184, 45 + + + 200, 15 + + + 19 + + + + + + lBaseService + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 12 + + + Left + + + NoControl + + + 184, 66 + + + 200, 15 + + + 20 + + + + + + lAuthenticator + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 13 + + + Left + + + NoControl + + + 184, 87 + + + 200, 15 + + + 21 + + + + + + lOsManager + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 14 + + + Left + + + NoControl + + + 184, 108 + + + 200, 15 + + + 22 + + + + + + lInitial + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 15 + + + Left + + + NoControl + + + 184, 129 + + + 200, 15 + + + 23 + + + + + + lCache + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 16 + + + Left + + + NoControl + + + 184, 150 + + + 200, 15 + + + 24 + + + + + + lL2Cache + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 17 + + + Left + + + NoControl + + + 184, 194 + + + 200, 15 + + + 25 + + + + + + lState + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 18 + + + Left + + + NoControl + + + 184, 171 + + + 200, 15 + + + 26 + + + + + + lMax + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 19 + + + 4, 4 + + + 10 + + + 394, 215 + + + 0 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="groupLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label1" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label4" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label3" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label10" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cacheLabel" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cacheL2Label" Row="7" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label7" Row="8" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lName" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lComments" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label6" Row="9" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lBaseService" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lAuthenticator" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lOsManager" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lInitial" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lCache" Row="6" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lL2Cache" Row="7" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lState" Row="9" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lMax" Row="8" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,45,961,Percent,54,039" /><Rows Styles="Percent,10,Percent,10,Percent,10,Percent,10,Percent,10,Percent,10,Percent,10,Percent,10,Percent,10,Percent,10" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 401, 275 + + + DeployedServicePanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/DeployedServicePanel.es.resx b/client/administration/UdsAdmin/controls/panel/DeployedServicePanel.es.resx new file mode 100644 index 000000000..2ac131a87 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/DeployedServicePanel.es.resx @@ -0,0 +1,783 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 2 + + + True + + + + 3, 6 + + + + 3, 6, 3, 0 + + + 35, 13 + + + 2 + + + Nombre + + + groupLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + True + + + 3, 27 + + + 3, 6, 3, 0 + + + 56, 13 + + + 4 + + + Comentarios + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + True + + + 3, 48 + + + 3, 6, 3, 0 + + + 68, 13 + + + 3 + + + Servicio base + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + True + + + 3, 69 + + + 3, 6, 3, 0 + + + 70, 13 + + + 6 + + + Autenticador + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + True + + + 3, 90 + + + 3, 6, 3, 0 + + + 65, 13 + + + 5 + + + OS Manager + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + Left + + + True + + + NoControl + + + 3, 109 + + + 126, 13 + + + 12 + + + Servicios iniciales disponibles + + + label10 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 5 + + + Left + + + True + + + NoControl + + + 3, 130 + + + 131, 13 + + + 13 + + + Servicios para mantener en la memoria caché + + + cacheLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 6 + + + Left + + + True + + + NoControl + + + 3, 151 + + + 146, 13 + + + 14 + + + Servicios para mantener en la memoria caché L2 + + + cacheL2Label + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 7 + + + Left + + + True + + + NoControl + + + 3, 172 + + + 143, 13 + + + 15 + + + Número máximo de servicios + + + label7 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 8 + + + Left + + + NoControl + + + 184, 3 + + + 200, 15 + + + 16 + + + + + + lName + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 9 + + + Left + + + NoControl + + + 184, 24 + + + 200, 15 + + + 18 + + + + + + lComments + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 10 + + + Left + + + True + + + NoControl + + + 3, 195 + + + 32, 13 + + + 17 + + + Estado + + + label6 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 11 + + + Left + + + NoControl + + + 184, 45 + + + 200, 15 + + + 19 + + + + + + lBaseService + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 12 + + + Left + + + NoControl + + + 184, 66 + + + 200, 15 + + + 20 + + + + + + lAuthenticator + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 13 + + + Left + + + NoControl + + + 184, 87 + + + 200, 15 + + + 21 + + + + + + lOsManager + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 14 + + + Left + + + NoControl + + + 184, 108 + + + 200, 15 + + + 22 + + + + + + lInitial + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 15 + + + Left + + + NoControl + + + 184, 129 + + + 200, 15 + + + 23 + + + + + + lCache + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 16 + + + Left + + + NoControl + + + 184, 150 + + + 200, 15 + + + 24 + + + + + + lL2Cache + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 17 + + + Left + + + NoControl + + + 184, 194 + + + 200, 15 + + + 25 + + + + + + lState + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 18 + + + Left + + + NoControl + + + 184, 171 + + + 200, 15 + + + 26 + + + + + + lMax + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 19 + + + 4, 4 + + + 10 + + + 394, 215 + + + 0 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="groupLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label1" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label4" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label3" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label10" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cacheLabel" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cacheL2Label" Row="7" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label7" Row="8" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lName" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lComments" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label6" Row="9" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lBaseService" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lAuthenticator" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lOsManager" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lInitial" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lCache" Row="6" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lL2Cache" Row="7" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lState" Row="9" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lMax" Row="8" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,45,961,Percent,54,039" /><Rows Styles="Percent,10,Percent,10,Percent,10,Percent,10,Percent,10,Percent,10,Percent,10,Percent,10,Percent,10,Percent,10" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 401, 275 + + + DeployedServicePanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/DeployedServicePanel.fr.resx b/client/administration/UdsAdmin/controls/panel/DeployedServicePanel.fr.resx new file mode 100644 index 000000000..69bc34392 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/DeployedServicePanel.fr.resx @@ -0,0 +1,783 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 2 + + + True + + + + 3, 6 + + + + 3, 6, 3, 0 + + + 35, 13 + + + 2 + + + Nom + + + groupLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + True + + + 3, 27 + + + 3, 6, 3, 0 + + + 56, 13 + + + 4 + + + Commentaires + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + True + + + 3, 48 + + + 3, 6, 3, 0 + + + 68, 13 + + + 3 + + + Service de base + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + True + + + 3, 69 + + + 3, 6, 3, 0 + + + 70, 13 + + + 6 + + + Authentificateur + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + True + + + 3, 90 + + + 3, 6, 3, 0 + + + 65, 13 + + + 5 + + + OS Manager + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + Left + + + True + + + NoControl + + + 3, 109 + + + 126, 13 + + + 12 + + + Initial Services disponibles + + + label10 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 5 + + + Left + + + True + + + NoControl + + + 3, 130 + + + 131, 13 + + + 13 + + + Services de garder dans le cache + + + cacheLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 6 + + + Left + + + True + + + NoControl + + + 3, 151 + + + 146, 13 + + + 14 + + + Services de garder en mémoire cache L2 + + + cacheL2Label + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 7 + + + Left + + + True + + + NoControl + + + 3, 172 + + + 143, 13 + + + 15 + + + Nombre maximal de services + + + label7 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 8 + + + Left + + + NoControl + + + 184, 3 + + + 200, 15 + + + 16 + + + + + + lName + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 9 + + + Left + + + NoControl + + + 184, 24 + + + 200, 15 + + + 18 + + + + + + lComments + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 10 + + + Left + + + True + + + NoControl + + + 3, 195 + + + 32, 13 + + + 17 + + + État + + + label6 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 11 + + + Left + + + NoControl + + + 184, 45 + + + 200, 15 + + + 19 + + + + + + lBaseService + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 12 + + + Left + + + NoControl + + + 184, 66 + + + 200, 15 + + + 20 + + + + + + lAuthenticator + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 13 + + + Left + + + NoControl + + + 184, 87 + + + 200, 15 + + + 21 + + + + + + lOsManager + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 14 + + + Left + + + NoControl + + + 184, 108 + + + 200, 15 + + + 22 + + + + + + lInitial + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 15 + + + Left + + + NoControl + + + 184, 129 + + + 200, 15 + + + 23 + + + + + + lCache + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 16 + + + Left + + + NoControl + + + 184, 150 + + + 200, 15 + + + 24 + + + + + + lL2Cache + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 17 + + + Left + + + NoControl + + + 184, 194 + + + 200, 15 + + + 25 + + + + + + lState + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 18 + + + Left + + + NoControl + + + 184, 171 + + + 200, 15 + + + 26 + + + + + + lMax + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 19 + + + 4, 4 + + + 10 + + + 394, 215 + + + 0 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="groupLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label1" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label4" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label3" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label10" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cacheLabel" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cacheL2Label" Row="7" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label7" Row="8" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lName" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lComments" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label6" Row="9" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lBaseService" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lAuthenticator" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lOsManager" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lInitial" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lCache" Row="6" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lL2Cache" Row="7" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lState" Row="9" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lMax" Row="8" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,45,961,Percent,54,039" /><Rows Styles="Percent,10,Percent,10,Percent,10,Percent,10,Percent,10,Percent,10,Percent,10,Percent,10,Percent,10,Percent,10" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 401, 275 + + + DeployedServicePanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/DeployedServicePanel.resx b/client/administration/UdsAdmin/controls/panel/DeployedServicePanel.resx new file mode 100644 index 000000000..ac4ed506f --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/DeployedServicePanel.resx @@ -0,0 +1,852 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 2 + + + True + + + + Microsoft Sans Serif, 8.25pt + + + 3, 6 + + + + 3, 6, 3, 0 + + + 35, 13 + + + 2 + + + Name + + + groupLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + True + + + Microsoft Sans Serif, 8.25pt + + + 3, 27 + + + 3, 6, 3, 0 + + + 56, 13 + + + 4 + + + Comments + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + True + + + Microsoft Sans Serif, 8.25pt + + + 3, 48 + + + 3, 6, 3, 0 + + + 68, 13 + + + 3 + + + Base service + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + Left + + + True + + + Microsoft Sans Serif, 8.25pt, style=Bold + + + NoControl + + + 155, 4 + + + 11, 13 + + + 16 + + + + + + lName + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + Left + + + True + + + Microsoft Sans Serif, 8.25pt, style=Bold + + + NoControl + + + 155, 25 + + + 11, 13 + + + 18 + + + + + + lComments + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + Left + + + True + + + Microsoft Sans Serif, 8.25pt, style=Bold + + + NoControl + + + 155, 46 + + + 11, 13 + + + 19 + + + + + + lBaseService + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 5 + + + True + + + Microsoft Sans Serif, 8.25pt + + + 3, 69 + + + 3, 6, 3, 0 + + + 65, 13 + + + 5 + + + Os Manager + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 6 + + + Left + + + True + + + Microsoft Sans Serif, 8.25pt, style=Bold + + + NoControl + + + 155, 67 + + + 11, 13 + + + 21 + + + + + + lOsManager + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 7 + + + Left + + + True + + + Microsoft Sans Serif, 8.25pt, style=Bold + + + NoControl + + + 155, 88 + + + 11, 13 + + + 22 + + + + + + lInitial + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 8 + + + Left + + + True + + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 3, 112 + + + 3, 6, 3, 0 + + + 131, 13 + + + 13 + + + Services to keep in cache + + + cacheLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 9 + + + Left + + + True + + + Microsoft Sans Serif, 8.25pt, style=Bold + + + NoControl + + + 155, 109 + + + 11, 13 + + + 23 + + + + + + lCache + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 10 + + + Left + + + True + + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 3, 133 + + + 3, 6, 3, 0 + + + 146, 13 + + + 14 + + + Services to keep in L2 cache + + + cacheL2Label + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 11 + + + Left + + + True + + + Microsoft Sans Serif, 8.25pt, style=Bold + + + NoControl + + + 155, 130 + + + 11, 13 + + + 24 + + + + + + lL2Cache + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 12 + + + Left + + + True + + + Microsoft Sans Serif, 8.25pt, style=Bold + + + NoControl + + + 155, 151 + + + 11, 13 + + + 26 + + + + + + lMax + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 13 + + + Left + + + True + + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 3, 175 + + + 3, 6, 3, 0 + + + 32, 13 + + + 17 + + + State + + + label6 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 14 + + + Left + + + True + + + Microsoft Sans Serif, 8.25pt, style=Bold + + + NoControl + + + 155, 172 + + + 11, 13 + + + 25 + + + + + + lState + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 15 + + + Left + + + True + + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 3, 91 + + + 3, 6, 3, 0 + + + 126, 13 + + + 12 + + + Initial Services Availables + + + label10 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 16 + + + Left + + + True + + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 3, 154 + + + 3, 6, 3, 0 + + + 143, 13 + + + 15 + + + Maximum number of services + + + label7 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 17 + + + 17, 25 + + + 10 + + + 367, 215 + + + 0 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="groupLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label1" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lName" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lComments" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lBaseService" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label3" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lOsManager" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lInitial" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="cacheLabel" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lCache" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="cacheL2Label" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lL2Cache" Row="6" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="lMax" Row="7" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label6" Row="8" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="lState" Row="8" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label10" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label7" Row="7" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="Percent,10,Percent,10,Percent,10,Percent,10,Percent,10,Percent,10,Percent,10,Percent,10,Percent,10,Percent,10" /></TableLayoutSettings> + + + True + + + Microsoft Sans Serif, 8.25pt + + + 186, 6 + + + 3, 6, 3, 0 + + + 59, 13 + + + 1 + + + Information + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 442, 272 + + + DeployedServicePanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/DeployedServicesPanel.Designer.cs b/client/administration/UdsAdmin/controls/panel/DeployedServicesPanel.Designer.cs new file mode 100644 index 000000000..61f3a41d0 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/DeployedServicesPanel.Designer.cs @@ -0,0 +1,94 @@ +namespace UdsAdmin.controls.panel +{ + partial class DeployedServicesPanel + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de componentes + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DeployedServicesPanel)); + this.listView = new System.Windows.Forms.ListView(); + this.name = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.kind = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.state = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.comments = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.SuspendLayout(); + // + // listView + // + this.listView.AutoArrange = false; + this.listView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.name, + this.kind, + this.state, + this.comments}); + resources.ApplyResources(this.listView, "listView"); + this.listView.FullRowSelect = true; + this.listView.GridLines = true; + this.listView.Name = "listView"; + this.listView.UseCompatibleStateImageBehavior = false; + this.listView.View = System.Windows.Forms.View.Details; + this.listView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listView_ColumnClick); + this.listView.KeyUp += new System.Windows.Forms.KeyEventHandler(this.listView_KeyUp); + // + // name + // + resources.ApplyResources(this.name, "name"); + this.name.Width = global::UdsAdmin.Properties.Settings.Default.wNameCol; + // + // kind + // + resources.ApplyResources(this.kind, "kind"); + // + // state + // + resources.ApplyResources(this.state, "state"); + this.state.Width = global::UdsAdmin.Properties.Settings.Default.wStateCol; + // + // comments + // + resources.ApplyResources(this.comments, "comments"); + this.comments.Width = global::UdsAdmin.Properties.Settings.Default.wCommentsCol; + // + // DeployedServicesPanel + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.listView); + this.Name = "DeployedServicesPanel"; + this.VisibleChanged += new System.EventHandler(this.UsersPanel_VisibleChanged); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListView listView; + private System.Windows.Forms.ColumnHeader name; + private System.Windows.Forms.ColumnHeader state; + private System.Windows.Forms.ColumnHeader comments; + private System.Windows.Forms.ColumnHeader kind; + } +} diff --git a/client/administration/UdsAdmin/controls/panel/DeployedServicesPanel.cs b/client/administration/UdsAdmin/controls/panel/DeployedServicesPanel.cs new file mode 100644 index 000000000..b39f46f3b --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/DeployedServicesPanel.cs @@ -0,0 +1,107 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.controls.panel +{ + public partial class DeployedServicesPanel : UserControl + { + gui.ListViewSorter _listSorter; + + public DeployedServicesPanel() + { + InitializeComponent(); + + listView.ListViewItemSorter = _listSorter = new gui.ListViewSorter(listView); + updateList(); + } + + private void UsersPanel_VisibleChanged(object sender, EventArgs e) + { + if (Visible == true) + { + updateList(); + } + } + + private void updateList() + { + try + { + xmlrpc.DeployedService[] dps = xmlrpc.UdsAdminService.GetDeployedServices(true); + List lst = new List(); + foreach (xmlrpc.DeployedService ser in dps) + { + ListViewItem itm = new ListViewItem(new string[]{ser.name, ser.info.typeName, xmlrpc.Util.GetStringFromState(ser.state), ser.comments}); + itm.ForeColor = gui.Colors.getColorForState(ser.state); + itm.Tag = ser.id; + lst.Add(itm); + } + listView.BeginUpdate(); + listView.Items.Clear(); + listView.Items.AddRange(lst.ToArray()); + listView.EndUpdate(); + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + + } + + private void listView_KeyUp(object sender, KeyEventArgs e) + { + switch (e.KeyCode) + { + case Keys.F5: + updateList(); + break; + case Keys.E: + if (e.Modifiers == Keys.Control) + foreach (ListViewItem i in listView.Items) + i.Selected = true; + break; + } + } + + private void listView_ColumnClick(object sender, ColumnClickEventArgs e) + { + _listSorter.ColumnClick(sender, e); + } + + } +} diff --git a/client/administration/UdsAdmin/controls/panel/DeployedServicesPanel.de.resx b/client/administration/UdsAdmin/controls/panel/DeployedServicesPanel.de.resx new file mode 100644 index 000000000..97ff12aab --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/DeployedServicesPanel.de.resx @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Name + + + Typ + + + + 104 + + + Staat + + + Kommentare + + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + kind + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + state + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + DeployedServicesPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/DeployedServicesPanel.es.resx b/client/administration/UdsAdmin/controls/panel/DeployedServicesPanel.es.resx new file mode 100644 index 000000000..845662c71 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/DeployedServicesPanel.es.resx @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Nombre + + + Tipo + + + + 104 + + + Estado + + + Comentarios + + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + kind + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + state + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + DeployedServicesPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/DeployedServicesPanel.fr.resx b/client/administration/UdsAdmin/controls/panel/DeployedServicesPanel.fr.resx new file mode 100644 index 000000000..4ed10e9fd --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/DeployedServicesPanel.fr.resx @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Nom + + + Type + + + + 104 + + + État + + + Commentaires + + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + kind + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + state + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + DeployedServicesPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/DeployedServicesPanel.resx b/client/administration/UdsAdmin/controls/panel/DeployedServicesPanel.resx new file mode 100644 index 000000000..dbff7c4c1 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/DeployedServicesPanel.resx @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Name + + + Type + + + + 137 + + + State + + + Comments + + + + Fill + + + False + + + + 0, 0 + + + 660, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 660, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + kind + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + state + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + DeployedServicesPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/GroupsPanel.Designer.cs b/client/administration/UdsAdmin/controls/panel/GroupsPanel.Designer.cs new file mode 100644 index 000000000..58814c5d0 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/GroupsPanel.Designer.cs @@ -0,0 +1,88 @@ +namespace UdsAdmin.controls.panel +{ + partial class GroupsPanel + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de componentes + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GroupsPanel)); + this.listView = new System.Windows.Forms.ListView(); + this.name = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.state = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.comments = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.SuspendLayout(); + // + // listView + // + this.listView.AutoArrange = false; + this.listView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.name, + this.state, + this.comments}); + resources.ApplyResources(this.listView, "listView"); + this.listView.FullRowSelect = true; + this.listView.GridLines = true; + this.listView.Name = "listView"; + this.listView.UseCompatibleStateImageBehavior = false; + this.listView.View = System.Windows.Forms.View.Details; + this.listView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listView_ColumnClick); + this.listView.KeyUp += new System.Windows.Forms.KeyEventHandler(this.listView_KeyUp); + this.listView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.listView_MouseUp); + // + // name + // + resources.ApplyResources(this.name, "name"); + this.name.Width = global::UdsAdmin.Properties.Settings.Default.wNameCol; + // + // state + // + resources.ApplyResources(this.state, "state"); + this.state.Width = global::UdsAdmin.Properties.Settings.Default.wStateCol; + // + // comments + // + resources.ApplyResources(this.comments, "comments"); + this.comments.Width = global::UdsAdmin.Properties.Settings.Default.wCommentsCol; + // + // GroupsPanel + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.listView); + this.Name = "GroupsPanel"; + this.VisibleChanged += new System.EventHandler(this.UsersPanel_VisibleChanged); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListView listView; + private System.Windows.Forms.ColumnHeader name; + private System.Windows.Forms.ColumnHeader state; + private System.Windows.Forms.ColumnHeader comments; + } +} diff --git a/client/administration/UdsAdmin/controls/panel/GroupsPanel.cs b/client/administration/UdsAdmin/controls/panel/GroupsPanel.cs new file mode 100644 index 000000000..04b23839b --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/GroupsPanel.cs @@ -0,0 +1,189 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.controls.panel +{ + public partial class GroupsPanel : UserControl + { + private xmlrpc.Authenticator _auth; + private xmlrpc.AuthenticatorType _authType; + ContextMenuStrip _emptyMenu; + ContextMenuStrip _fullMenu; + gui.ListViewSorter _listSorter; + + + public GroupsPanel(xmlrpc.Authenticator auth, xmlrpc.AuthenticatorType authType) + { + _auth = auth; + _authType = authType; + InitializeComponent(); + + _emptyMenu = new ContextMenuStrip(); + _fullMenu = new ContextMenuStrip(); + + ToolStripMenuItem enable = new ToolStripMenuItem(Strings.enable); enable.Click += enableItem; enable.Image = Images.apply16; + ToolStripMenuItem disable = new ToolStripMenuItem(Strings.disable); disable.Click += disableItem; disable.Image = Images.cancel16; + ToolStripSeparator sep = new ToolStripSeparator(); + ToolStripMenuItem newG1 = new ToolStripMenuItem(Strings.newItem); newG1.Click += newItem; newG1.Image = Images.new16; + ToolStripMenuItem newG2 = new ToolStripMenuItem(Strings.newItem); newG2.Click += newItem; newG2.Image = Images.new16; + ToolStripMenuItem delete = new ToolStripMenuItem(Strings.deleteItem); delete.Click += deleteItem; delete.Image = Images.delete16; + + _emptyMenu.Items.Add(newG1); + _fullMenu.Items.AddRange(new ToolStripItem[] { enable, disable, sep, newG2, delete }); + + listView.Columns[0].Text = _authType.groupNameLabel; + + listView.ListViewItemSorter = _listSorter = new gui.ListViewSorter(listView); + updateList(); + } + + private void UsersPanel_VisibleChanged(object sender, EventArgs e) + { + if (Visible == true) + { + updateList(); + } + } + + private void updateList() + { + try + { + xmlrpc.Group[] grps = xmlrpc.UdsAdminService.GetGroups(_auth.id); + List lst = new List(); + foreach (xmlrpc.Group grp in grps) + { + ListViewItem itm = new ListViewItem(new string[]{grp.name, grp.active ? Strings.active : Strings.inactive , grp.comments}); + itm.ForeColor = grp.active ? gui.Colors.ActiveColor : gui.Colors.InactiveColor; + itm.Tag = grp.id; + lst.Add(itm); + } + listView.Items.Clear(); + listView.Items.AddRange(lst.ToArray()); + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + + } + + private void newItem(object sender, EventArgs e) + { + UdsAdmin.forms.GroupForm form = new UdsAdmin.forms.GroupForm(_auth, _authType); + if (form.ShowDialog() == DialogResult.OK) + { + updateList(); + } + } + + private void setSelectedStates(bool newState) + { + if( listView.SelectedItems.Count == 0 ) + return; + string info = newState == true ? Strings.active : Strings.inactive; + Color col = newState == true ? gui.Colors.ActiveColor : gui.Colors.InactiveColor; + string[] ids = new string[listView.SelectedItems.Count]; + int n = 0; + foreach (ListViewItem i in listView.SelectedItems) + { + ids[n++] = (string)i.Tag; + i.SubItems[1].Text = info; + i.ForeColor = col; + } + xmlrpc.UdsAdminService.ChangeGroupsState(ids, newState); + + } + + private void enableItem(object sender, EventArgs e) + { + setSelectedStates(true); + } + + private void disableItem(object sender, EventArgs e) + { + setSelectedStates(false); + } + + private void deleteItem(object sender, EventArgs e) + { + if (listView.SelectedItems.Count == 0) + return; + string[] ids = new string[listView.SelectedItems.Count]; + int n = 0; + foreach (ListViewItem i in listView.SelectedItems) + { + ids[n++] = (string)i.Tag; + listView.Items.Remove(i); + } + xmlrpc.UdsAdminService.RemoveGroups(ids); + } + + private void listView_ColumnClick(object sender, ColumnClickEventArgs e) + { + _listSorter.ColumnClick(sender, e); + } + + private void listView_MouseUp(object sender, MouseEventArgs e) + { + if (e.Button == System.Windows.Forms.MouseButtons.Right) + { + if (listView.SelectedItems.Count == 0) + _emptyMenu.Show(Control.MousePosition.X, Control.MousePosition.Y); + else + _fullMenu.Show(Control.MousePosition.X, Control.MousePosition.Y); + } + } + + private void listView_KeyUp(object sender, KeyEventArgs e) + { + switch (e.KeyCode) + { + case Keys.F5: + updateList(); + break; + case Keys.E: + if (e.Modifiers == Keys.Control) + foreach (ListViewItem i in listView.Items) + i.Selected = true; + break; + } + } + + } +} diff --git a/client/administration/UdsAdmin/controls/panel/GroupsPanel.de.resx b/client/administration/UdsAdmin/controls/panel/GroupsPanel.de.resx new file mode 100644 index 000000000..2e1d51f55 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/GroupsPanel.de.resx @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Name + + + Staat + + + Kommentare + + + + Fill + + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + state + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GroupsPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/GroupsPanel.es.resx b/client/administration/UdsAdmin/controls/panel/GroupsPanel.es.resx new file mode 100644 index 000000000..76de946e9 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/GroupsPanel.es.resx @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Nombre + + + Estado + + + Comentarios + + + + Fill + + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + state + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GroupsPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/GroupsPanel.fr.resx b/client/administration/UdsAdmin/controls/panel/GroupsPanel.fr.resx new file mode 100644 index 000000000..b8d28e224 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/GroupsPanel.fr.resx @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Nom + + + État + + + Commentaires + + + + Fill + + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + state + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GroupsPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/GroupsPanel.resx b/client/administration/UdsAdmin/controls/panel/GroupsPanel.resx new file mode 100644 index 000000000..1b31cfb1f --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/GroupsPanel.resx @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Name + + + State + + + Comments + + + + Fill + + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + state + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GroupsPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/NetworksPanel.Designer.cs b/client/administration/UdsAdmin/controls/panel/NetworksPanel.Designer.cs new file mode 100644 index 000000000..6bf3d7c64 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/NetworksPanel.Designer.cs @@ -0,0 +1,88 @@ +namespace UdsAdmin.controls.panel +{ + partial class NetworksPanel + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de componentes + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NetworksPanel)); + this.listView = new System.Windows.Forms.ListView(); + this.name = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.rangeStart = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.rangeEnd = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.SuspendLayout(); + // + // listView + // + this.listView.AutoArrange = false; + this.listView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.name, + this.rangeStart, + this.rangeEnd}); + resources.ApplyResources(this.listView, "listView"); + this.listView.FullRowSelect = true; + this.listView.GridLines = true; + this.listView.Name = "listView"; + this.listView.UseCompatibleStateImageBehavior = false; + this.listView.View = System.Windows.Forms.View.Details; + this.listView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listView_ColumnClick); + this.listView.KeyUp += new System.Windows.Forms.KeyEventHandler(this.listView_KeyUp); + this.listView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.listView_MouseUp); + // + // name + // + resources.ApplyResources(this.name, "name"); + this.name.Width = global::UdsAdmin.Properties.Settings.Default.wNameCol; + // + // rangeStart + // + resources.ApplyResources(this.rangeStart, "rangeStart"); + this.rangeStart.Width = global::UdsAdmin.Properties.Settings.Default.wStateCol; + // + // rangeEnd + // + resources.ApplyResources(this.rangeEnd, "rangeEnd"); + this.rangeEnd.Width = global::UdsAdmin.Properties.Settings.Default.wCommentsCol; + // + // NetworksPanel + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.listView); + this.Name = "NetworksPanel"; + this.VisibleChanged += new System.EventHandler(this.UsersPanel_VisibleChanged); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListView listView; + private System.Windows.Forms.ColumnHeader name; + private System.Windows.Forms.ColumnHeader rangeStart; + private System.Windows.Forms.ColumnHeader rangeEnd; + } +} diff --git a/client/administration/UdsAdmin/controls/panel/NetworksPanel.cs b/client/administration/UdsAdmin/controls/panel/NetworksPanel.cs new file mode 100644 index 000000000..c2d3ac81a --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/NetworksPanel.cs @@ -0,0 +1,151 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.controls.panel +{ + public partial class NetworksPanel : UserControl + { + ContextMenuStrip _emptyMenu; + ContextMenuStrip _fullMenu; + gui.ListViewSorter _listSorter; + + public NetworksPanel() + { + InitializeComponent(); + + _emptyMenu = new ContextMenuStrip(); + _fullMenu = new ContextMenuStrip(); + + ToolStripMenuItem newG1 = new ToolStripMenuItem(Strings.newItem); newG1.Click += newItem; newG1.Image = Images.new16; + ToolStripMenuItem newG2 = new ToolStripMenuItem(Strings.newItem); newG2.Click += newItem; newG2.Image = Images.new16; + ToolStripMenuItem delete = new ToolStripMenuItem(Strings.deleteItem); delete.Click += deleteItem; delete.Image = Images.delete16; + + _emptyMenu.Items.Add(newG1); + _fullMenu.Items.AddRange(new ToolStripItem[] { newG2, delete }); + + listView.ListViewItemSorter = _listSorter = new gui.ListViewSorter(listView); + + updateList(); + } + + private void UsersPanel_VisibleChanged(object sender, EventArgs e) + { + if (Visible == true) + { + updateList(); + } + } + + private void updateList() + { + try + { + xmlrpc.Network[] nets = xmlrpc.UdsAdminService.GetNetworks(); + List lst = new List(); + foreach (xmlrpc.Network net in nets) + { + ListViewItem itm = new ListViewItem(new string[]{net.name, net.netStart, net.netEnd}); + itm.ForeColor = gui.Colors.ActiveColor; + itm.Tag = net; + lst.Add(itm); + } + listView.Items.Clear(); + listView.Items.AddRange(lst.ToArray()); + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + } + + private void newItem(object sender, EventArgs e) + { + UdsAdmin.forms.NetworkForm form = new UdsAdmin.forms.NetworkForm(); + if (form.ShowDialog() == DialogResult.OK) + { + updateList(); + } + } + + private void deleteItem(object sender, EventArgs e) + { + if (listView.SelectedItems.Count == 0) + return; + string[] ids = new string[listView.SelectedItems.Count]; + int n = 0; + foreach (ListViewItem i in listView.SelectedItems) + { + ids[n++] = ((xmlrpc.Network)i.Tag).id; + listView.Items.Remove(i); + } + xmlrpc.UdsAdminService.RemoveNetworks(ids); + } + + private void listView_MouseUp(object sender, MouseEventArgs e) + { + if (e.Button == System.Windows.Forms.MouseButtons.Right) + { + if (listView.SelectedItems.Count == 0) + _emptyMenu.Show(Control.MousePosition.X, Control.MousePosition.Y); + else + _fullMenu.Show(Control.MousePosition.X, Control.MousePosition.Y); + } + } + + private void listView_KeyUp(object sender, KeyEventArgs e) + { + switch (e.KeyCode) + { + case Keys.F5: + updateList(); + break; + case Keys.E: + if (e.Modifiers == Keys.Control) + foreach (ListViewItem i in listView.Items) + i.Selected = true; + break; + } + } + + private void listView_ColumnClick(object sender, ColumnClickEventArgs e) + { + _listSorter.ColumnClick(sender, e); + } + + } +} diff --git a/client/administration/UdsAdmin/controls/panel/NetworksPanel.de.resx b/client/administration/UdsAdmin/controls/panel/NetworksPanel.de.resx new file mode 100644 index 000000000..96f748d45 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/NetworksPanel.de.resx @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Name + + + Anfang des Bereichs + + + Bereichsende + + + + Fill + + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + rangeStart + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + rangeEnd + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + NetworksPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/NetworksPanel.es.resx b/client/administration/UdsAdmin/controls/panel/NetworksPanel.es.resx new file mode 100644 index 000000000..199942d42 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/NetworksPanel.es.resx @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Nombre + + + Intervalo inicio + + + Fin de intervalo + + + + Fill + + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + rangeStart + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + rangeEnd + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + NetworksPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/NetworksPanel.fr.resx b/client/administration/UdsAdmin/controls/panel/NetworksPanel.fr.resx new file mode 100644 index 000000000..ea1114bc7 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/NetworksPanel.fr.resx @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Nom + + + Début de la gamme + + + Fin de la gamme + + + + Fill + + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + rangeStart + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + rangeEnd + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + NetworksPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/NetworksPanel.resx b/client/administration/UdsAdmin/controls/panel/NetworksPanel.resx new file mode 100644 index 000000000..b4ea11a54 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/NetworksPanel.resx @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Name + + + Range Start + + + Range End + + + + Fill + + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + rangeStart + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + rangeEnd + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + NetworksPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/OsManagersPanel.Designer.cs b/client/administration/UdsAdmin/controls/panel/OsManagersPanel.Designer.cs new file mode 100644 index 000000000..bcd1f17b4 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/OsManagersPanel.Designer.cs @@ -0,0 +1,86 @@ +namespace UdsAdmin.controls.panel +{ + partial class OsManagersPanel + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de componentes + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OsManagersPanel)); + this.listView = new System.Windows.Forms.ListView(); + this.name = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.typeName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.comments = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.SuspendLayout(); + // + // listView + // + this.listView.AutoArrange = false; + this.listView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.name, + this.typeName, + this.comments}); + resources.ApplyResources(this.listView, "listView"); + this.listView.FullRowSelect = true; + this.listView.GridLines = true; + this.listView.Name = "listView"; + this.listView.UseCompatibleStateImageBehavior = false; + this.listView.View = System.Windows.Forms.View.Details; + this.listView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listView_ColumnClick); + this.listView.KeyUp += new System.Windows.Forms.KeyEventHandler(this.listView_KeyUp); + // + // name + // + resources.ApplyResources(this.name, "name"); + this.name.Width = global::UdsAdmin.Properties.Settings.Default.wNameCol; + // + // typeName + // + resources.ApplyResources(this.typeName, "typeName"); + // + // comments + // + resources.ApplyResources(this.comments, "comments"); + this.comments.Width = global::UdsAdmin.Properties.Settings.Default.wCommentsCol; + // + // OsManagersPanel + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.listView); + this.Name = "OsManagersPanel"; + this.VisibleChanged += new System.EventHandler(this.UsersPanel_VisibleChanged); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListView listView; + private System.Windows.Forms.ColumnHeader name; + private System.Windows.Forms.ColumnHeader comments; + private System.Windows.Forms.ColumnHeader typeName; + } +} diff --git a/client/administration/UdsAdmin/controls/panel/OsManagersPanel.cs b/client/administration/UdsAdmin/controls/panel/OsManagersPanel.cs new file mode 100644 index 000000000..037992394 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/OsManagersPanel.cs @@ -0,0 +1,105 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.controls.panel +{ + public partial class OsManagersPanel : UserControl + { + gui.ListViewSorter _listSorter; + + public OsManagersPanel() + { + InitializeComponent(); + + listView.ListViewItemSorter = _listSorter = new gui.ListViewSorter(listView); + updateList(); + } + + private void UsersPanel_VisibleChanged(object sender, EventArgs e) + { + if (Visible == true) + { + updateList(); + } + } + + private void updateList() + { + try + { + xmlrpc.OSManager[] osms = xmlrpc.UdsAdminService.GetOSManagers(); + List lst = new List(); + foreach (xmlrpc.OSManager osm in osms) + { + ListViewItem itm = new ListViewItem(new string[]{osm.name, osm.typeName, osm.comments}); + itm.ForeColor = gui.Colors.ActiveColor; + itm.Tag = osm.id; + lst.Add(itm); + } + listView.Items.Clear(); + listView.Items.AddRange(lst.ToArray()); + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + + } + + private void listView_KeyUp(object sender, KeyEventArgs e) + { + switch (e.KeyCode) + { + case Keys.F5: + updateList(); + break; + case Keys.E: + if (e.Modifiers == Keys.Control) + foreach (ListViewItem i in listView.Items) + i.Selected = true; + break; + } + } + + private void listView_ColumnClick(object sender, ColumnClickEventArgs e) + { + _listSorter.ColumnClick(sender, e); + } + + } +} diff --git a/client/administration/UdsAdmin/controls/panel/OsManagersPanel.de.resx b/client/administration/UdsAdmin/controls/panel/OsManagersPanel.de.resx new file mode 100644 index 000000000..e725d0132 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/OsManagersPanel.de.resx @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Name + + + Typ + + + + 157 + + + Kommentare + + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + typeName + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + OsManagersPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/OsManagersPanel.es.resx b/client/administration/UdsAdmin/controls/panel/OsManagersPanel.es.resx new file mode 100644 index 000000000..8f248852d --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/OsManagersPanel.es.resx @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Nombre + + + Tipo + + + + 157 + + + Comentarios + + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + typeName + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + OsManagersPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/OsManagersPanel.fr.resx b/client/administration/UdsAdmin/controls/panel/OsManagersPanel.fr.resx new file mode 100644 index 000000000..5e9902e88 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/OsManagersPanel.fr.resx @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Nom + + + Type + + + + 157 + + + Commentaires + + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + typeName + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + OsManagersPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/OsManagersPanel.resx b/client/administration/UdsAdmin/controls/panel/OsManagersPanel.resx new file mode 100644 index 000000000..1f301bbd8 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/OsManagersPanel.resx @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Name + + + Type + + + + 157 + + + Comments + + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + typeName + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + OsManagersPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/PanelEmpty.Designer.cs b/client/administration/UdsAdmin/controls/panel/PanelEmpty.Designer.cs new file mode 100644 index 000000000..49d2d1004 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/PanelEmpty.Designer.cs @@ -0,0 +1,56 @@ +namespace UdsAdmin.controls.panel +{ + partial class PanelEmpty + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de componentes + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PanelEmpty)); + this.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // + // PanelEmpty + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Window; + this.Controls.Add(this.label1); + this.Name = "PanelEmpty"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + } +} diff --git a/client/administration/UdsAdmin/controls/panel/PanelEmpty.cs b/client/administration/UdsAdmin/controls/panel/PanelEmpty.cs new file mode 100644 index 000000000..428c89f6e --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/PanelEmpty.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.controls.panel +{ + public partial class PanelEmpty : UserControl + { + public PanelEmpty(string labelText) + { + InitializeComponent(); + Text = labelText; + } + + public override string Text + { + set { label1.Text = value; } + get { return label1.Text; } + } + } +} diff --git a/client/administration/UdsAdmin/controls/panel/PanelEmpty.de.resx b/client/administration/UdsAdmin/controls/panel/PanelEmpty.de.resx new file mode 100644 index 000000000..de6d81017 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/PanelEmpty.de.resx @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + True + + + + Top + + + + 0, 0 + + + 66, 13 + + + 0 + + + Leere Panel + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + PanelEmpty + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/PanelEmpty.es.resx b/client/administration/UdsAdmin/controls/panel/PanelEmpty.es.resx new file mode 100644 index 000000000..a23fb7cbf --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/PanelEmpty.es.resx @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + True + + + + Top + + + + 0, 0 + + + 66, 13 + + + 0 + + + Panel vacío + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + PanelEmpty + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/PanelEmpty.fr.resx b/client/administration/UdsAdmin/controls/panel/PanelEmpty.fr.resx new file mode 100644 index 000000000..184b2e2ca --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/PanelEmpty.fr.resx @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + True + + + + Top + + + + 0, 0 + + + 66, 13 + + + 0 + + + Panneau vide + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + PanelEmpty + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/PanelEmpty.resx b/client/administration/UdsAdmin/controls/panel/PanelEmpty.resx new file mode 100644 index 000000000..122b66449 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/PanelEmpty.resx @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + True + + + + Top + + + + 0, 0 + + + 66, 13 + + + 0 + + + Empty Panel + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + PanelEmpty + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/PublicationsPanel.Designer.cs b/client/administration/UdsAdmin/controls/panel/PublicationsPanel.Designer.cs new file mode 100644 index 000000000..7b1aa0165 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/PublicationsPanel.Designer.cs @@ -0,0 +1,94 @@ +namespace UdsAdmin.controls.panel +{ + partial class PublicationsPanel + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de componentes + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PublicationsPanel)); + this.CreationDate = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.State = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.listView = new System.Windows.Forms.ListView(); + this.Revision = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.Reason = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.SuspendLayout(); + // + // CreationDate + // + resources.ApplyResources(this.CreationDate, "CreationDate"); + // + // State + // + resources.ApplyResources(this.State, "State"); + // + // listView + // + this.listView.AutoArrange = false; + this.listView.CausesValidation = false; + this.listView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.Revision, + this.CreationDate, + this.State, + this.Reason}); + resources.ApplyResources(this.listView, "listView"); + this.listView.FullRowSelect = true; + this.listView.GridLines = true; + this.listView.MultiSelect = false; + this.listView.Name = "listView"; + this.listView.UseCompatibleStateImageBehavior = false; + this.listView.View = System.Windows.Forms.View.Details; + this.listView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listView_ColumnClick); + this.listView.KeyUp += new System.Windows.Forms.KeyEventHandler(this.listView_KeyUp); + this.listView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.listView_MouseUp); + // + // Revision + // + resources.ApplyResources(this.Revision, "Revision"); + // + // Reason + // + resources.ApplyResources(this.Reason, "Reason"); + // + // PublicationsPanel + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.listView); + this.Name = "PublicationsPanel"; + this.VisibleChanged += new System.EventHandler(this.DeployedPanel_VisibleChanged); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListView listView; + private System.Windows.Forms.ColumnHeader CreationDate; + private System.Windows.Forms.ColumnHeader State; + private System.Windows.Forms.ColumnHeader Reason; + private System.Windows.Forms.ColumnHeader Revision; + } +} diff --git a/client/administration/UdsAdmin/controls/panel/PublicationsPanel.cs b/client/administration/UdsAdmin/controls/panel/PublicationsPanel.cs new file mode 100644 index 000000000..07db674a1 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/PublicationsPanel.cs @@ -0,0 +1,154 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.controls.panel +{ + public partial class PublicationsPanel : UserControl + { + private xmlrpc.DeployedService _parent; + ContextMenuStrip _fullMenu; + gui.ListViewSorter _listSorter; + + public PublicationsPanel(xmlrpc.DeployedService parent) + { + _parent = parent; + _fullMenu = new ContextMenuStrip(); + InitializeComponent(); + + ToolStripMenuItem cancel = new ToolStripMenuItem(Strings.cancel); cancel.Click += cancelPublication; cancel.Image = Images.cancel16; + + _fullMenu.Items.AddRange(new ToolStripItem[] { cancel }); + + listView.ListViewItemSorter = _listSorter = new gui.ListViewSorter(listView, new int[] {1}); + + updateList(); + } + + private void DeployedPanel_VisibleChanged(object sender, EventArgs e) + { + if (Visible == true) + { + updateList(); + } + } + + private void updateList() + { + xmlrpc.DeployedServicePublication[] pubs = UdsAdmin.xmlrpc.UdsAdminService.getPublications(_parent); + List lst = new List(); + foreach (xmlrpc.DeployedServicePublication pub in pubs) + { + ListViewItem itm = new ListViewItem(new string[] { pub.revision, pub.publishDate.ToString(), xmlrpc.Util.GetStringFromState(pub.state), pub.reason }); + itm.Tag = pub.id; + switch (pub.state) + { + case xmlrpc.Constants.STATE_USABLE: + itm.ForeColor = gui.Colors.ActiveColor; + break; + case xmlrpc.Constants.STATE_ERROR: + itm.ForeColor = gui.Colors.ErrorColor; + break; + case xmlrpc.Constants.STATE_PREPARING: + itm.ForeColor = gui.Colors.RunningColor; + break; + default: + itm.ForeColor = gui.Colors.InactiveColor; + break; + } + lst.Add(itm); + } + listView.Items.Clear(); + listView.Items.AddRange(lst.ToArray()); + } + + private void cancelPublication(object sender, EventArgs e) + { + if (listView.SelectedItems.Count == 0) + return; + if (listView.SelectedItems.Count > 1) + { + MessageBox.Show(Strings.selectOnlyOne, Strings.error, MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + ListViewItem itm = listView.SelectedItems[0]; + string id = (string)itm.Tag; + try + { + xmlrpc.UdsAdminService.CancelPublication(id); + updateList(); + + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + } + + private void listView_ColumnClick(object sender, ColumnClickEventArgs e) + { + _listSorter.ColumnClick(sender, e); + } + + private void listView_MouseUp(object sender, MouseEventArgs e) + { + if (e.Button == System.Windows.Forms.MouseButtons.Right) + { + if (listView.SelectedItems.Count == 0) + return; + else + _fullMenu.Show(Control.MousePosition.X, Control.MousePosition.Y); + } + } + + private void listView_KeyUp(object sender, KeyEventArgs e) + { + switch (e.KeyCode) + { + case Keys.F5: + updateList(); + break; + case Keys.E: + if (e.Modifiers == Keys.Control) + foreach (ListViewItem i in listView.Items) + i.Selected = true; + break; + } + } + + } +} diff --git a/client/administration/UdsAdmin/controls/panel/PublicationsPanel.de.resx b/client/administration/UdsAdmin/controls/panel/PublicationsPanel.de.resx new file mode 100644 index 000000000..1678985bc --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/PublicationsPanel.de.resx @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Erstellungsdatum + + + + 144 + + + Staat + + + + Center + + + 71 + + + Überarbeitung + + + Grund + + + 339 + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + CreationDate + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + State + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Revision + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Reason + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + PublicationsPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/PublicationsPanel.es.resx b/client/administration/UdsAdmin/controls/panel/PublicationsPanel.es.resx new file mode 100644 index 000000000..d005895b1 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/PublicationsPanel.es.resx @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Fecha de creación + + + + 144 + + + Estado + + + + Center + + + 71 + + + Revisión + + + Razón + + + 339 + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + CreationDate + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + State + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Revision + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Reason + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + PublicationsPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/PublicationsPanel.fr.resx b/client/administration/UdsAdmin/controls/panel/PublicationsPanel.fr.resx new file mode 100644 index 000000000..fedd8f6b1 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/PublicationsPanel.fr.resx @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Date de création + + + + 144 + + + État + + + + Center + + + 71 + + + Révision + + + Raison + + + 339 + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + CreationDate + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + State + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Revision + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Reason + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + PublicationsPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/PublicationsPanel.resx b/client/administration/UdsAdmin/controls/panel/PublicationsPanel.resx new file mode 100644 index 000000000..1b3102e9d --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/PublicationsPanel.resx @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Creation Date + + + + 144 + + + State + + + + Center + + + 71 + + + Revision + + + Reason + + + 339 + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + CreationDate + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + State + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Revision + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Reason + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + PublicationsPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/ServicePanel.Designer.cs b/client/administration/UdsAdmin/controls/panel/ServicePanel.Designer.cs new file mode 100644 index 000000000..3ced594cf --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/ServicePanel.Designer.cs @@ -0,0 +1,86 @@ +namespace UdsAdmin.controls.panel +{ + partial class ServicePanel + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de componentes + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ServicePanel)); + this.listView = new System.Windows.Forms.ListView(); + this.name = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.typeName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.comments = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.SuspendLayout(); + // + // listView + // + this.listView.AutoArrange = false; + this.listView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.name, + this.typeName, + this.comments}); + resources.ApplyResources(this.listView, "listView"); + this.listView.FullRowSelect = true; + this.listView.GridLines = true; + this.listView.Name = "listView"; + this.listView.UseCompatibleStateImageBehavior = false; + this.listView.View = System.Windows.Forms.View.Details; + this.listView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listView_ColumnClick); + this.listView.KeyUp += new System.Windows.Forms.KeyEventHandler(this.listView_KeyUp); + // + // name + // + resources.ApplyResources(this.name, "name"); + this.name.Width = global::UdsAdmin.Properties.Settings.Default.wNameCol; + // + // typeName + // + resources.ApplyResources(this.typeName, "typeName"); + // + // comments + // + resources.ApplyResources(this.comments, "comments"); + this.comments.Width = global::UdsAdmin.Properties.Settings.Default.wCommentsCol; + // + // ServicePanel + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.listView); + this.Name = "ServicePanel"; + this.VisibleChanged += new System.EventHandler(this.UsersPanel_VisibleChanged); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListView listView; + private System.Windows.Forms.ColumnHeader name; + private System.Windows.Forms.ColumnHeader comments; + private System.Windows.Forms.ColumnHeader typeName; + } +} diff --git a/client/administration/UdsAdmin/controls/panel/ServicePanel.cs b/client/administration/UdsAdmin/controls/panel/ServicePanel.cs new file mode 100644 index 000000000..8143309d3 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/ServicePanel.cs @@ -0,0 +1,108 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.controls.panel +{ + public partial class ServicePanel : UserControl + { + private string _idParent; + gui.ListViewSorter _listSorter; + + public ServicePanel(xmlrpc.Service parent) + { + InitializeComponent(); + + _idParent = parent.id; + + listView.ListViewItemSorter = _listSorter = new gui.ListViewSorter(listView); + updateList(); + } + + private void UsersPanel_VisibleChanged(object sender, EventArgs e) + { + if (Visible == true) + { + updateList(); + } + } + + private void updateList() + { + try + { + xmlrpc.Service[] servs = xmlrpc.UdsAdminService.GetServices(_idParent); + List lst = new List(); + foreach (xmlrpc.Service serv in servs) + { + ListViewItem itm = new ListViewItem(new string[] { serv.name, serv.typeName, serv.comments }); + itm.ForeColor = gui.Colors.ActiveColor; + itm.Tag = serv.id; + lst.Add(itm); + } + listView.Items.Clear(); + listView.Items.AddRange(lst.ToArray()); + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + + } + + private void listView_KeyUp(object sender, KeyEventArgs e) + { + switch (e.KeyCode) + { + case Keys.F5: + updateList(); + break; + case Keys.E: + if (e.Modifiers == Keys.Control) + foreach (ListViewItem i in listView.Items) + i.Selected = true; + break; + } + } + + private void listView_ColumnClick(object sender, ColumnClickEventArgs e) + { + _listSorter.ColumnClick(sender, e); + } + + } +} diff --git a/client/administration/UdsAdmin/controls/panel/ServicePanel.de.resx b/client/administration/UdsAdmin/controls/panel/ServicePanel.de.resx new file mode 100644 index 000000000..33b8d9a92 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/ServicePanel.de.resx @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Name + + + Typ + + + + 135 + + + Kommentare + + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + typeName + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ServicePanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/ServicePanel.es.resx b/client/administration/UdsAdmin/controls/panel/ServicePanel.es.resx new file mode 100644 index 000000000..381b7ee0e --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/ServicePanel.es.resx @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Nombre + + + Tipo + + + + 135 + + + Comentarios + + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + typeName + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ServicePanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/ServicePanel.fr.resx b/client/administration/UdsAdmin/controls/panel/ServicePanel.fr.resx new file mode 100644 index 000000000..736dc61ed --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/ServicePanel.fr.resx @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Nom + + + Type + + + + 135 + + + Commentaires + + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + typeName + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ServicePanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/ServicePanel.resx b/client/administration/UdsAdmin/controls/panel/ServicePanel.resx new file mode 100644 index 000000000..96a0eeb4e --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/ServicePanel.resx @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Name + + + Type + + + + 135 + + + Comments + + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + typeName + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ServicePanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/ServiceProvidersPanel.Designer.cs b/client/administration/UdsAdmin/controls/panel/ServiceProvidersPanel.Designer.cs new file mode 100644 index 000000000..af4367235 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/ServiceProvidersPanel.Designer.cs @@ -0,0 +1,86 @@ +namespace UdsAdmin.controls.panel +{ + partial class ServiceProvidersPanel + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de componentes + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ServiceProvidersPanel)); + this.listView = new System.Windows.Forms.ListView(); + this.name = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.typeName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.comments = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.SuspendLayout(); + // + // listView + // + this.listView.AutoArrange = false; + this.listView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.name, + this.typeName, + this.comments}); + resources.ApplyResources(this.listView, "listView"); + this.listView.FullRowSelect = true; + this.listView.GridLines = true; + this.listView.Name = "listView"; + this.listView.UseCompatibleStateImageBehavior = false; + this.listView.View = System.Windows.Forms.View.Details; + this.listView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listView_ColumnClick); + this.listView.KeyUp += new System.Windows.Forms.KeyEventHandler(this.listView_KeyUp); + // + // name + // + resources.ApplyResources(this.name, "name"); + this.name.Width = global::UdsAdmin.Properties.Settings.Default.wNameCol; + // + // typeName + // + resources.ApplyResources(this.typeName, "typeName"); + // + // comments + // + resources.ApplyResources(this.comments, "comments"); + this.comments.Width = global::UdsAdmin.Properties.Settings.Default.wCommentsCol; + // + // ServiceProvidersPanel + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.listView); + this.Name = "ServiceProvidersPanel"; + this.VisibleChanged += new System.EventHandler(this.UsersPanel_VisibleChanged); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListView listView; + private System.Windows.Forms.ColumnHeader name; + private System.Windows.Forms.ColumnHeader comments; + private System.Windows.Forms.ColumnHeader typeName; + } +} diff --git a/client/administration/UdsAdmin/controls/panel/ServiceProvidersPanel.cs b/client/administration/UdsAdmin/controls/panel/ServiceProvidersPanel.cs new file mode 100644 index 000000000..487cc0e6f --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/ServiceProvidersPanel.cs @@ -0,0 +1,105 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.controls.panel +{ + public partial class ServiceProvidersPanel : UserControl + { + gui.ListViewSorter _listSorter; + + public ServiceProvidersPanel() + { + InitializeComponent(); + + listView.ListViewItemSorter = _listSorter = new gui.ListViewSorter(listView); + updateList(); + } + + private void UsersPanel_VisibleChanged(object sender, EventArgs e) + { + if (Visible == true) + { + updateList(); + } + } + + private void updateList() + { + try + { + xmlrpc.ServiceProvider[] sps = xmlrpc.UdsAdminService.GetServiceProviders(); + List lst = new List(); + foreach (xmlrpc.ServiceProvider sp in sps) + { + ListViewItem itm = new ListViewItem(new string[] { sp.name, sp.typeName, sp.comments }); + itm.ForeColor = gui.Colors.ActiveColor; + itm.Tag = sp.id; + lst.Add(itm); + } + listView.Items.Clear(); + listView.Items.AddRange(lst.ToArray()); + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + + } + + private void listView_KeyUp(object sender, KeyEventArgs e) + { + switch (e.KeyCode) + { + case Keys.F5: + updateList(); + break; + case Keys.E: + if (e.Modifiers == Keys.Control) + foreach (ListViewItem i in listView.Items) + i.Selected = true; + break; + } + } + + private void listView_ColumnClick(object sender, ColumnClickEventArgs e) + { + _listSorter.ColumnClick(sender, e); + } + + } +} diff --git a/client/administration/UdsAdmin/controls/panel/ServiceProvidersPanel.de.resx b/client/administration/UdsAdmin/controls/panel/ServiceProvidersPanel.de.resx new file mode 100644 index 000000000..4a7b5b4f1 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/ServiceProvidersPanel.de.resx @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Name + + + Typ + + + + 135 + + + Kommentare + + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + typeName + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ServiceProvidersPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/ServiceProvidersPanel.es.resx b/client/administration/UdsAdmin/controls/panel/ServiceProvidersPanel.es.resx new file mode 100644 index 000000000..342209772 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/ServiceProvidersPanel.es.resx @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Nombre + + + Tipo + + + + 135 + + + Comentarios + + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + typeName + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ServiceProvidersPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/ServiceProvidersPanel.fr.resx b/client/administration/UdsAdmin/controls/panel/ServiceProvidersPanel.fr.resx new file mode 100644 index 000000000..3d1386094 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/ServiceProvidersPanel.fr.resx @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Nom + + + Type + + + + 135 + + + Commentaires + + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + typeName + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ServiceProvidersPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/ServiceProvidersPanel.resx b/client/administration/UdsAdmin/controls/panel/ServiceProvidersPanel.resx new file mode 100644 index 000000000..7fa13f5dd --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/ServiceProvidersPanel.resx @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Name + + + Type + + + + 135 + + + Comments + + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + typeName + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ServiceProvidersPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/ServicesPanel.Designer.cs b/client/administration/UdsAdmin/controls/panel/ServicesPanel.Designer.cs new file mode 100644 index 000000000..63d42125a --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/ServicesPanel.Designer.cs @@ -0,0 +1,86 @@ +namespace UdsAdmin.controls.panel +{ + partial class ServicesPanel + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de componentes + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ServicesPanel)); + this.listView = new System.Windows.Forms.ListView(); + this.name = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.typeName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.comments = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.SuspendLayout(); + // + // listView + // + this.listView.AutoArrange = false; + this.listView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.name, + this.typeName, + this.comments}); + resources.ApplyResources(this.listView, "listView"); + this.listView.FullRowSelect = true; + this.listView.GridLines = true; + this.listView.Name = "listView"; + this.listView.UseCompatibleStateImageBehavior = false; + this.listView.View = System.Windows.Forms.View.Details; + this.listView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listView_ColumnClick); + this.listView.KeyUp += new System.Windows.Forms.KeyEventHandler(this.listView_KeyUp); + // + // name + // + resources.ApplyResources(this.name, "name"); + this.name.Width = global::UdsAdmin.Properties.Settings.Default.wNameCol; + // + // typeName + // + resources.ApplyResources(this.typeName, "typeName"); + // + // comments + // + resources.ApplyResources(this.comments, "comments"); + this.comments.Width = global::UdsAdmin.Properties.Settings.Default.wCommentsCol; + // + // ServicesPanel + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.listView); + this.Name = "ServicesPanel"; + this.VisibleChanged += new System.EventHandler(this.UsersPanel_VisibleChanged); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListView listView; + private System.Windows.Forms.ColumnHeader name; + private System.Windows.Forms.ColumnHeader comments; + private System.Windows.Forms.ColumnHeader typeName; + } +} diff --git a/client/administration/UdsAdmin/controls/panel/ServicesPanel.cs b/client/administration/UdsAdmin/controls/panel/ServicesPanel.cs new file mode 100644 index 000000000..bd2bdad5b --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/ServicesPanel.cs @@ -0,0 +1,108 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.controls.panel +{ + public partial class ServicesPanel : UserControl + { + private string _idParent; + gui.ListViewSorter _listSorter; + + public ServicesPanel(xmlrpc.ServiceProvider parent) + { + InitializeComponent(); + + _idParent = parent.id; + + listView.ListViewItemSorter = _listSorter = new gui.ListViewSorter(listView); + updateList(); + } + + private void UsersPanel_VisibleChanged(object sender, EventArgs e) + { + if (Visible == true) + { + updateList(); + } + } + + private void updateList() + { + try + { + xmlrpc.Service[] servs = xmlrpc.UdsAdminService.GetServices(_idParent); + List lst = new List(); + foreach (xmlrpc.Service serv in servs) + { + ListViewItem itm = new ListViewItem(new string[] { serv.name, serv.typeName, serv.comments }); + itm.ForeColor = gui.Colors.ActiveColor; + itm.Tag = serv.id; + lst.Add(itm); + } + listView.Items.Clear(); + listView.Items.AddRange(lst.ToArray()); + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + + } + + private void listView_KeyUp(object sender, KeyEventArgs e) + { + switch (e.KeyCode) + { + case Keys.F5: + updateList(); + break; + case Keys.E: + if (e.Modifiers == Keys.Control) + foreach (ListViewItem i in listView.Items) + i.Selected = true; + break; + } + } + + private void listView_ColumnClick(object sender, ColumnClickEventArgs e) + { + _listSorter.ColumnClick(sender, e); + } + + } +} diff --git a/client/administration/UdsAdmin/controls/panel/ServicesPanel.de.resx b/client/administration/UdsAdmin/controls/panel/ServicesPanel.de.resx new file mode 100644 index 000000000..b7984c339 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/ServicesPanel.de.resx @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Name + + + Typ + + + + 135 + + + Kommentare + + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + typeName + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ServicesPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/ServicesPanel.es.resx b/client/administration/UdsAdmin/controls/panel/ServicesPanel.es.resx new file mode 100644 index 000000000..f334a740a --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/ServicesPanel.es.resx @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Nombre + + + Tipo + + + + 135 + + + Comentarios + + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + typeName + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ServicesPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/ServicesPanel.fr.resx b/client/administration/UdsAdmin/controls/panel/ServicesPanel.fr.resx new file mode 100644 index 000000000..991f8a513 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/ServicesPanel.fr.resx @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Nom + + + Type + + + + 135 + + + Commentaires + + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + typeName + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ServicesPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/ServicesPanel.resx b/client/administration/UdsAdmin/controls/panel/ServicesPanel.resx new file mode 100644 index 000000000..9e0062e18 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/ServicesPanel.resx @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Name + + + Type + + + + 135 + + + Comments + + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + typeName + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ServicesPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/TransportsPanel.Designer.cs b/client/administration/UdsAdmin/controls/panel/TransportsPanel.Designer.cs new file mode 100644 index 000000000..3249b698f --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/TransportsPanel.Designer.cs @@ -0,0 +1,94 @@ +namespace UdsAdmin.controls.panel +{ + partial class TransportsPanel + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de componentes + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TransportsPanel)); + this.listView = new System.Windows.Forms.ListView(); + this.name = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.typeName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.comments = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.priority = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.SuspendLayout(); + // + // listView + // + this.listView.AutoArrange = false; + this.listView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.name, + this.typeName, + this.comments, + this.priority}); + resources.ApplyResources(this.listView, "listView"); + this.listView.FullRowSelect = true; + this.listView.GridLines = true; + this.listView.Name = "listView"; + this.listView.UseCompatibleStateImageBehavior = false; + this.listView.View = System.Windows.Forms.View.Details; + this.listView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listView_ColumnClick); + this.listView.KeyUp += new System.Windows.Forms.KeyEventHandler(this.listView_KeyUp); + this.listView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.listView_MouseUp); + // + // name + // + resources.ApplyResources(this.name, "name"); + this.name.Width = global::UdsAdmin.Properties.Settings.Default.wNameCol; + // + // typeName + // + resources.ApplyResources(this.typeName, "typeName"); + // + // comments + // + resources.ApplyResources(this.comments, "comments"); + this.comments.Width = global::UdsAdmin.Properties.Settings.Default.wCommentsCol; + // + // priority + // + resources.ApplyResources(this.priority, "priority"); + // + // TransportsPanel + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.listView); + this.Name = "TransportsPanel"; + this.VisibleChanged += new System.EventHandler(this.UsersPanel_VisibleChanged); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListView listView; + private System.Windows.Forms.ColumnHeader name; + private System.Windows.Forms.ColumnHeader comments; + private System.Windows.Forms.ColumnHeader typeName; + private System.Windows.Forms.ColumnHeader priority; + } +} diff --git a/client/administration/UdsAdmin/controls/panel/TransportsPanel.cs b/client/administration/UdsAdmin/controls/panel/TransportsPanel.cs new file mode 100644 index 000000000..002b1127d --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/TransportsPanel.cs @@ -0,0 +1,156 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.controls.panel +{ + public partial class TransportsPanel : UserControl + { + gui.ListViewSorter _listSorter; + xmlrpc.DeployedService _ds; + ContextMenuStrip _emptyMenu; + ContextMenuStrip _fullMenu; + + public TransportsPanel(xmlrpc.DeployedService ds = null) + { + InitializeComponent(); + + _emptyMenu = new ContextMenuStrip(); + _fullMenu = new ContextMenuStrip(); + + ToolStripMenuItem addTransport = new ToolStripMenuItem(Strings.newItem); addTransport.Click += addTransportItem; addTransport.Image = Images.new16; + ToolStripMenuItem addTransport2 = new ToolStripMenuItem(Strings.newItem); addTransport2.Click += addTransportItem; addTransport2.Image = Images.new16; + ToolStripMenuItem delTransport = new ToolStripMenuItem(Strings.deleteItem); delTransport.Click += delTransportItem; delTransport.Image = Images.delete16; + + _fullMenu.Items.AddRange( new ToolStripMenuItem[] { addTransport, delTransport }); + _emptyMenu.Items.Add(addTransport2); + + _ds = ds; + listView.ListViewItemSorter = _listSorter = new gui.ListViewSorter(listView); + updateList(); + } + + private void UsersPanel_VisibleChanged(object sender, EventArgs e) + { + if (Visible == true) + { + updateList(); + } + } + + private void updateList() + { + try + { + xmlrpc.Transport[] trans; + if (_ds == null) + trans = xmlrpc.UdsAdminService.GetTransports(); + else + trans = xmlrpc.UdsAdminService.GetTransportsAssignedToDeployedService(_ds.id); + + List lst = new List(); + foreach (xmlrpc.Transport tran in trans) + { + ListViewItem itm = new ListViewItem(new string[]{tran.name, tran.typeName, tran.comments, tran.priority}); + itm.ForeColor = gui.Colors.ActiveColor; + itm.Tag = tran.id; + lst.Add(itm); + } + listView.Items.Clear(); + listView.Items.AddRange(lst.ToArray()); + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + + } + + private void listView_KeyUp(object sender, KeyEventArgs e) + { + switch (e.KeyCode) + { + case Keys.F5: + updateList(); + break; + case Keys.E: + if (e.Modifiers == Keys.Control) + foreach (ListViewItem i in listView.Items) + i.Selected = true; + break; + } + } + + private void addTransportItem(object sender, EventArgs e) + { + UdsAdmin.forms.DeployedTransportForm form = new UdsAdmin.forms.DeployedTransportForm(_ds); + if (form.ShowDialog() == DialogResult.OK) + updateList(); + } + + private void delTransportItem(object sender, EventArgs e) + { + if (listView.SelectedItems.Count == 0) + return; + string[] ids = new string[listView.SelectedItems.Count]; + int n = 0; + foreach (ListViewItem i in listView.SelectedItems) + { + ids[n++] = (string)i.Tag; + listView.Items.Remove(i); + } + xmlrpc.UdsAdminService.RemoveTransportFromDeployedService(_ds.id, ids); + } + + private void listView_MouseUp(object sender, MouseEventArgs e) + { + if (e.Button == System.Windows.Forms.MouseButtons.Right && _ds != null ) + { + if (listView.SelectedItems.Count == 0) + _emptyMenu.Show(Control.MousePosition.X, Control.MousePosition.Y); + else + _fullMenu.Show(Control.MousePosition.X, Control.MousePosition.Y); + } + } + + private void listView_ColumnClick(object sender, ColumnClickEventArgs e) + { + _listSorter.ColumnClick(sender, e); + } + + } +} diff --git a/client/administration/UdsAdmin/controls/panel/TransportsPanel.de.resx b/client/administration/UdsAdmin/controls/panel/TransportsPanel.de.resx new file mode 100644 index 000000000..6ba232023 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/TransportsPanel.de.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Typ + + + Kommentare + + + Name + + + Priorität + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/TransportsPanel.es.resx b/client/administration/UdsAdmin/controls/panel/TransportsPanel.es.resx new file mode 100644 index 000000000..0c6f80875 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/TransportsPanel.es.resx @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Nombre + + + Tipo + + + + 141 + + + Comentarios + + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + typeName + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TransportsPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Prioridad + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/TransportsPanel.fr.resx b/client/administration/UdsAdmin/controls/panel/TransportsPanel.fr.resx new file mode 100644 index 000000000..820a47a92 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/TransportsPanel.fr.resx @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Nom + + + Type + + + + 141 + + + Commentaires + + + + Fill + + + False + + + + 0, 0 + + + 583, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 583, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + typeName + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TransportsPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Priorité + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/TransportsPanel.resx b/client/administration/UdsAdmin/controls/panel/TransportsPanel.resx new file mode 100644 index 000000000..39d9627f6 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/TransportsPanel.resx @@ -0,0 +1,207 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Name + + + Type + + + + 141 + + + Comments + + + Priority + + + 120 + + + + Fill + + + False + + + + 0, 0 + + + 675, 279 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 675, 279 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + typeName + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + priority + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + TransportsPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/UsersPanel.Designer.cs b/client/administration/UdsAdmin/controls/panel/UsersPanel.Designer.cs new file mode 100644 index 000000000..801c98355 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/UsersPanel.Designer.cs @@ -0,0 +1,103 @@ +namespace UdsAdmin.controls.panel +{ + partial class UsersPanel + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de componentes + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UsersPanel)); + this.listView = new System.Windows.Forms.ListView(); + this.username = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.name = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.state = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.lastAccess = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.comments = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.SuspendLayout(); + // + // listView + // + this.listView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.username, + this.name, + this.state, + this.lastAccess, + this.comments}); + resources.ApplyResources(this.listView, "listView"); + this.listView.FullRowSelect = true; + this.listView.GridLines = true; + this.listView.Name = "listView"; + this.listView.UseCompatibleStateImageBehavior = false; + this.listView.View = System.Windows.Forms.View.Details; + this.listView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listView_ColumnClick); + this.listView.DoubleClick += new System.EventHandler(this.modifyItem); + this.listView.KeyUp += new System.Windows.Forms.KeyEventHandler(this.listView_KeyUp); + this.listView.MouseUp += new System.Windows.Forms.MouseEventHandler(this.listView_MouseUp); + // + // username + // + resources.ApplyResources(this.username, "username"); + this.username.Width = global::UdsAdmin.Properties.Settings.Default.wUsernameCol; + // + // name + // + resources.ApplyResources(this.name, "name"); + this.name.Width = global::UdsAdmin.Properties.Settings.Default.wNameCol; + // + // state + // + resources.ApplyResources(this.state, "state"); + this.state.Width = global::UdsAdmin.Properties.Settings.Default.wStateCol; + // + // lastAccess + // + resources.ApplyResources(this.lastAccess, "lastAccess"); + this.lastAccess.Width = global::UdsAdmin.Properties.Settings.Default.wLastAccessCol; + // + // comments + // + resources.ApplyResources(this.comments, "comments"); + // + // UsersPanel + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.listView); + this.Name = "UsersPanel"; + this.VisibleChanged += new System.EventHandler(this.UsersPanel_VisibleChanged); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ListView listView; + private System.Windows.Forms.ColumnHeader username; + private System.Windows.Forms.ColumnHeader name; + private System.Windows.Forms.ColumnHeader state; + private System.Windows.Forms.ColumnHeader lastAccess; + private System.Windows.Forms.ColumnHeader comments; + } +} diff --git a/client/administration/UdsAdmin/controls/panel/UsersPanel.cs b/client/administration/UdsAdmin/controls/panel/UsersPanel.cs new file mode 100644 index 000000000..4a068e732 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/UsersPanel.cs @@ -0,0 +1,261 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.controls.panel +{ + public partial class UsersPanel : UserControl + { + private xmlrpc.Authenticator _auth; + private xmlrpc.AuthenticatorType _authType; + ContextMenuStrip _emptyMenu; + ContextMenuStrip _fullMenu; + gui.ListViewSorter _listSorter; + + public UsersPanel(xmlrpc.Authenticator auth, xmlrpc.AuthenticatorType authType) + { + _auth = auth; + _authType = authType; + InitializeComponent(); + + _emptyMenu = new ContextMenuStrip(); + _fullMenu = new ContextMenuStrip(); + + + ToolStripMenuItem newU1 = new ToolStripMenuItem(Strings.newItem); newU1.Click += newItem; newU1.Image = Images.new16; + + ToolStripMenuItem modify = new ToolStripMenuItem(Strings.modifyItem); modify.Click += modifyItem; + ToolStripMenuItem prefs = new ToolStripMenuItem(Strings.userPreferences); prefs.Click += preferences; + ToolStripMenuItem enable = new ToolStripMenuItem(Strings.enable); enable.Click += enableItem; enable.Image = Images.apply16; + ToolStripMenuItem disable = new ToolStripMenuItem(Strings.disable); disable.Click += disableItem; disable.Image = Images.cancel16; + ToolStripMenuItem newU2 = new ToolStripMenuItem(Strings.newItem); newU2.Click += newItem; newU2.Image = Images.new16; + ToolStripMenuItem delete = new ToolStripMenuItem(Strings.deleteItem); delete.Click += deleteItem; delete.Image = Images.delete16; + + _fullMenu.Items.AddRange(new ToolStripItem[] { modify, new ToolStripSeparator(), enable, disable, new ToolStripSeparator(), + prefs, new ToolStripSeparator()}); + + if (_authType.canCreateUsers == true) + { + _emptyMenu.Items.Add(newU1); + _fullMenu.Items.Add(newU2); + } + + _fullMenu.Items.Add(delete); + + listView.Columns[0].Text = _authType.userNameLabel; + + listView.ListViewItemSorter = _listSorter = new gui.ListViewSorter(listView, new int[]{3}); + updateList(); + } + + private void UsersPanel_VisibleChanged(object sender, EventArgs e) + { + if (Visible == true) + { + updateList(); + } + } + + + private string getStateString(string state) + { + string res; + switch (state) + { + case xmlrpc.Constants.STATE_ACTIVE: + res = Strings.active; + break; + case xmlrpc.Constants.STATE_INACTIVE: + res = Strings.inactive; + break; + default: + res = Strings.blocked; + break; + } + return res; + } + + private Color getStateColor(string state) + { + Color color; + switch (state) + { + case xmlrpc.Constants.STATE_ACTIVE: + color = gui.Colors.ActiveColor; + break; + case xmlrpc.Constants.STATE_INACTIVE: + color = gui.Colors.InactiveColor; + break; + default: + color = gui.Colors.BlockedColor; + break; + } + return color; + } + + private void updateList() + { + try + { + xmlrpc.User[] usrs = xmlrpc.UdsAdminService.GetUsers(_auth.id); + List lst = new List(); + foreach (xmlrpc.User usr in usrs) + { + + ListViewItem itm = new ListViewItem(new string[] { usr.name, usr.realName, getStateString(usr.state), usr.lastAccess.ToString(), usr.comments }); + itm.ForeColor = getStateColor(usr.state); + itm.Tag = usr.id; + lst.Add(itm); + } + listView.Items.Clear(); + listView.Items.AddRange(lst.ToArray()); + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + } + + private void newItem(object sender, EventArgs e) + { + if (_authType.canCreateUsers == false) + { + gui.UserNotifier.notifyError(Strings.cantCreateUsers); + return; + } + UdsAdmin.forms.UserForm form = new UdsAdmin.forms.UserForm(_auth, _authType, new xmlrpc.User()); + if (form.ShowDialog() == DialogResult.OK) + { + updateList(); + } + } + + private void modifyItem(object sender, EventArgs e) + { + xmlrpc.User usr = xmlrpc.UdsAdminService.GetUser((string)(listView.SelectedItems[0].Tag)); + UdsAdmin.forms.UserForm form = new UdsAdmin.forms.UserForm(_auth, _authType, usr); + if (form.ShowDialog() == DialogResult.OK ) + { + updateList(); + } + } + + private void preferences(object sender, EventArgs e) + { + xmlrpc.User usr = xmlrpc.UdsAdminService.GetUser((string)(listView.SelectedItems[0].Tag)); + UdsAdmin.forms.UserPreferencesForm form = new UdsAdmin.forms.UserPreferencesForm(usr.id); + form.ShowDialog(); + } + + private void setSelectedStates(string newState) + { + if( listView.SelectedItems.Count == 0 ) + return; + string info = getStateString(newState); + Color col = getStateColor(newState); + string[] ids = new string[listView.SelectedItems.Count]; + int n = 0; + foreach (ListViewItem i in listView.SelectedItems) + { + ids[n++] = (string)i.Tag; + i.SubItems[2].Text = info; + i.ForeColor = col; + } + xmlrpc.UdsAdminService.ChangeUsersState(ids, newState); + + } + + private void enableItem(object sender, EventArgs e) + { + setSelectedStates(xmlrpc.Constants.STATE_ACTIVE); + } + + private void disableItem(object sender, EventArgs e) + { + setSelectedStates(xmlrpc.Constants.STATE_INACTIVE); + } + + private void deleteItem(object sender, EventArgs e) + { + if (listView.SelectedItems.Count == 0) + return; + string[] ids = new string[listView.SelectedItems.Count]; + int n = 0; + foreach (ListViewItem i in listView.SelectedItems) + { + ids[n++] = (string)i.Tag; + listView.Items.Remove(i); + } + xmlrpc.UdsAdminService.RemoveUsers(ids); + } + + private void listView_ColumnClick(object sender, ColumnClickEventArgs e) + { + _listSorter.ColumnClick(sender, e); + } + + private void listView_MouseUp(object sender, MouseEventArgs e) + { + if (e.Button == System.Windows.Forms.MouseButtons.Right) + { + if (listView.SelectedItems.Count == 0) + { + if( _emptyMenu.Items.Count > 0 ) + _emptyMenu.Show(Control.MousePosition.X, Control.MousePosition.Y); + } + else + _fullMenu.Show(Control.MousePosition.X, Control.MousePosition.Y); + } + } + + private void listView_KeyUp(object sender, KeyEventArgs e) + { + switch (e.KeyCode) + { + case Keys.F5: + updateList(); + break; + case Keys.E: + if (e.Modifiers == Keys.Control) + foreach (ListViewItem i in listView.Items) + i.Selected = true; + break; + } + } + + } +} diff --git a/client/administration/UdsAdmin/controls/panel/UsersPanel.de.resx b/client/administration/UdsAdmin/controls/panel/UsersPanel.de.resx new file mode 100644 index 000000000..359fe9840 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/UsersPanel.de.resx @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Benutzername + + + Name + + + Staat + + + Letzter Zugriff + + + Kommentare + + + + Fill + + + + False + + + + 0, 0 + + + 597, 278 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 597, 278 + + + username + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + state + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lastAccess + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + UsersPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/UsersPanel.es.resx b/client/administration/UdsAdmin/controls/panel/UsersPanel.es.resx new file mode 100644 index 000000000..07c9d7bf5 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/UsersPanel.es.resx @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Nombre de usuario + + + Nombre + + + Estado + + + Último acceso + + + Comentarios + + + + Fill + + + + False + + + + 0, 0 + + + 597, 278 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 597, 278 + + + username + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + state + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lastAccess + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + UsersPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/UsersPanel.fr.resx b/client/administration/UdsAdmin/controls/panel/UsersPanel.fr.resx new file mode 100644 index 000000000..5704a2b19 --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/UsersPanel.fr.resx @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Nom d'utilisateur + + + Nom + + + État + + + Dernier accès + + + Commentaires + + + + Fill + + + + False + + + + 0, 0 + + + 597, 278 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 597, 278 + + + username + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + state + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lastAccess + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + UsersPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/controls/panel/UsersPanel.resx b/client/administration/UdsAdmin/controls/panel/UsersPanel.resx new file mode 100644 index 000000000..cc68258db --- /dev/null +++ b/client/administration/UdsAdmin/controls/panel/UsersPanel.resx @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Username + + + Name + + + State + + + Last Access + + + Comments + + + + Fill + + + + False + + + + 0, 0 + + + 597, 278 + + + 0 + + + listView + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 597, 278 + + + username + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + state + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + lastAccess + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + comments + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + UsersPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/exceptions/AuthenticationException.cs b/client/administration/UdsAdmin/exceptions/AuthenticationException.cs new file mode 100644 index 000000000..d0b5d8d85 --- /dev/null +++ b/client/administration/UdsAdmin/exceptions/AuthenticationException.cs @@ -0,0 +1,45 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UdsAdmin.exceptions +{ + [Serializable] + public class AuthenticationException : UdsException + { + public AuthenticationException(string msg) + : base(msg) + { + } + } +} diff --git a/client/administration/UdsAdmin/exceptions/CommunicationException.cs b/client/administration/UdsAdmin/exceptions/CommunicationException.cs new file mode 100644 index 000000000..15b25c894 --- /dev/null +++ b/client/administration/UdsAdmin/exceptions/CommunicationException.cs @@ -0,0 +1,45 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UdsAdmin.exceptions +{ + [Serializable] + public class CommunicationException : UdsException + { + public CommunicationException(string msg) + : base(msg) + { + } + } +} diff --git a/client/administration/UdsAdmin/exceptions/NewVersionRequiredException.cs b/client/administration/UdsAdmin/exceptions/NewVersionRequiredException.cs new file mode 100644 index 000000000..4fcde3760 --- /dev/null +++ b/client/administration/UdsAdmin/exceptions/NewVersionRequiredException.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UdsAdmin.exceptions +{ + [Serializable] + class NewVersionRequiredException : UdsException + { + private string _url; + public NewVersionRequiredException(string msg, string url) + : base(msg) + { + _url = url; + } + + public string Url { + get { return _url; } + } + } +} diff --git a/client/administration/UdsAdmin/exceptions/UdsException.cs b/client/administration/UdsAdmin/exceptions/UdsException.cs new file mode 100644 index 000000000..2a5a2815c --- /dev/null +++ b/client/administration/UdsAdmin/exceptions/UdsException.cs @@ -0,0 +1,45 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UdsAdmin.exceptions +{ + [Serializable] + public class UdsException : Exception + { + public UdsException(string msg) + : base(msg) + { + } + } +} diff --git a/client/administration/UdsAdmin/forms/AboutBoxForm.Designer.cs b/client/administration/UdsAdmin/forms/AboutBoxForm.Designer.cs new file mode 100644 index 000000000..64335df4f --- /dev/null +++ b/client/administration/UdsAdmin/forms/AboutBoxForm.Designer.cs @@ -0,0 +1,129 @@ +namespace UdsAdmin.forms +{ + partial class AboutBoxForm + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de Windows Forms + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutBoxForm)); + this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); + this.logoPictureBox = new System.Windows.Forms.PictureBox(); + this.labelProductName = new System.Windows.Forms.Label(); + this.labelVersion = new System.Windows.Forms.Label(); + this.labelCopyright = new System.Windows.Forms.Label(); + this.labelCompanyName = new System.Windows.Forms.Label(); + this.textBoxDescription = new System.Windows.Forms.TextBox(); + this.okButton = new System.Windows.Forms.Button(); + this.tableLayoutPanel.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).BeginInit(); + this.SuspendLayout(); + // + // tableLayoutPanel + // + resources.ApplyResources(this.tableLayoutPanel, "tableLayoutPanel"); + this.tableLayoutPanel.Controls.Add(this.logoPictureBox, 0, 0); + this.tableLayoutPanel.Controls.Add(this.labelProductName, 1, 0); + this.tableLayoutPanel.Controls.Add(this.labelVersion, 1, 1); + this.tableLayoutPanel.Controls.Add(this.labelCopyright, 1, 2); + this.tableLayoutPanel.Controls.Add(this.labelCompanyName, 1, 3); + this.tableLayoutPanel.Controls.Add(this.textBoxDescription, 1, 4); + this.tableLayoutPanel.Controls.Add(this.okButton, 1, 5); + this.tableLayoutPanel.Name = "tableLayoutPanel"; + // + // logoPictureBox + // + resources.ApplyResources(this.logoPictureBox, "logoPictureBox"); + this.logoPictureBox.Name = "logoPictureBox"; + this.tableLayoutPanel.SetRowSpan(this.logoPictureBox, 6); + this.logoPictureBox.TabStop = false; + // + // labelProductName + // + resources.ApplyResources(this.labelProductName, "labelProductName"); + this.labelProductName.MaximumSize = new System.Drawing.Size(0, 17); + this.labelProductName.Name = "labelProductName"; + // + // labelVersion + // + resources.ApplyResources(this.labelVersion, "labelVersion"); + this.labelVersion.MaximumSize = new System.Drawing.Size(0, 17); + this.labelVersion.Name = "labelVersion"; + // + // labelCopyright + // + resources.ApplyResources(this.labelCopyright, "labelCopyright"); + this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 17); + this.labelCopyright.Name = "labelCopyright"; + // + // labelCompanyName + // + resources.ApplyResources(this.labelCompanyName, "labelCompanyName"); + this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 17); + this.labelCompanyName.Name = "labelCompanyName"; + // + // textBoxDescription + // + resources.ApplyResources(this.textBoxDescription, "textBoxDescription"); + this.textBoxDescription.Name = "textBoxDescription"; + this.textBoxDescription.ReadOnly = true; + this.textBoxDescription.TabStop = false; + // + // okButton + // + resources.ApplyResources(this.okButton, "okButton"); + this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.okButton.Name = "okButton"; + // + // AboutBoxForm + // + this.AcceptButton = this.okButton; + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.tableLayoutPanel); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "AboutBoxForm"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.tableLayoutPanel.ResumeLayout(false); + this.tableLayoutPanel.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel; + private System.Windows.Forms.PictureBox logoPictureBox; + private System.Windows.Forms.Label labelProductName; + private System.Windows.Forms.Label labelVersion; + private System.Windows.Forms.Label labelCopyright; + private System.Windows.Forms.Label labelCompanyName; + private System.Windows.Forms.TextBox textBoxDescription; + private System.Windows.Forms.Button okButton; + } +} diff --git a/client/administration/UdsAdmin/forms/AboutBoxForm.cs b/client/administration/UdsAdmin/forms/AboutBoxForm.cs new file mode 100644 index 000000000..bf78e470e --- /dev/null +++ b/client/administration/UdsAdmin/forms/AboutBoxForm.cs @@ -0,0 +1,133 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Linq; +using System.Reflection; +using System.Windows.Forms; + +namespace UdsAdmin.forms +{ + partial class AboutBoxForm : Form + { + public AboutBoxForm() + { + InitializeComponent(); + this.Text = String.Format("Acerca de {0}", AssemblyTitle); + this.labelProductName.Text = AssemblyProduct; + this.labelVersion.Text = String.Format("Versión {0}", AssemblyVersion); + this.labelCopyright.Text = AssemblyCopyright; + this.labelCompanyName.Text = AssemblyCompany; + this.textBoxDescription.Text = AssemblyDescription; + } + + #region Descriptores de acceso de atributos de ensamblado + + public string AssemblyTitle + { + get + { + object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false); + if (attributes.Length > 0) + { + AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0]; + if (titleAttribute.Title != "") + { + return titleAttribute.Title; + } + } + return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); + } + } + + public string AssemblyVersion + { + get + { + return Assembly.GetExecutingAssembly().GetName().Version.ToString(); + } + } + + public string AssemblyDescription + { + get + { + object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false); + if (attributes.Length == 0) + { + return ""; + } + return ((AssemblyDescriptionAttribute)attributes[0]).Description; + } + } + + public string AssemblyProduct + { + get + { + object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false); + if (attributes.Length == 0) + { + return ""; + } + return ((AssemblyProductAttribute)attributes[0]).Product; + } + } + + public string AssemblyCopyright + { + get + { + object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); + if (attributes.Length == 0) + { + return ""; + } + return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; + } + } + + public string AssemblyCompany + { + get + { + object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); + if (attributes.Length == 0) + { + return ""; + } + return ((AssemblyCompanyAttribute)attributes[0]).Company; + } + } + #endregion + } +} diff --git a/client/administration/UdsAdmin/forms/AboutBoxForm.de.resx b/client/administration/UdsAdmin/forms/AboutBoxForm.de.resx new file mode 100644 index 000000000..d0324fcbd --- /dev/null +++ b/client/administration/UdsAdmin/forms/AboutBoxForm.de.resx @@ -0,0 +1,890 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 2 + + + + Fill + + + + + iVBORw0KGgoAAAANSUhEUgAAAHgAAAEGCAIAAAAhWcaAAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAcOdJREFUeF7tvQdY + lVe6Pc7z/O69czOJihE4vdF7Oxx6FwXFrtixd+yIKIKNImClSxdQsSv23luMMcaYXkwyiTF1MtW5Mzr/ + /9rfe9h+nAOIGZNoZs7zPjyIR4R11ll7vWXvbSGvkCsqFYoqhbJGqapTqRvU6q1qzXaNbrdOt09ne8jW + 9pit3Uk7uzN29ufs7c8LgU9O29uftLc7Zmd32M5uv53dPjvb3ba2O2xtt9nabrW1bbC1rbfV5mnVo9UK + b0VWVtZrr7325z//+a9//evf/va3//u///v73//+j3/848GDBw8fPvyn8Pj/fu0PCwZ0hUJZqVRVqVTV + KnWNWrNJo6nTaDdrdY063XadbpfOdq+t3UE7uyN2QBb4MpQRpwSsjwtfx982mWG9yda21labq1WPUiu8 + FLm5uW+99daf/vSnv/zlL/fv3/93g9sCKIPRBLS6Ws2ArtFoa7XaOq2uXqdr0NluEUi63dZ2ly2Yy/h7 + yM7uqB2DmEcz1nZ77Gx3ini9yVZXo9NV6zTZGtUwldxVXlxc/Nlnn/0bws2AfoRydTPKtVrdJh2LOh1E + gEnBZluGeGMz4nsFxEFkSAdARwBrvAAkI7vMsK7S6Sp1mqUa1QCV3Fa+ZcuWP/zhD/9WcFsAZWWVkc7g + sqaW0fkRynW2tjw44iA4tJg4zhEHyghAzyUbTyC9Jl4D6wqdrlynnq9WxiiTkpJOnjzJ4f7Va7eFskKp + qlSpq9TQDU21IBqbjEA/gtgEbhPEsQbuFlSlSUCZgi+PeBPg3cCxLtfpNup0xTr1ZLXCX7Fq1ar3339f + DDfWSZOl8texTFooS5XKcoY1Q7lGi9DV6lhs0rUOtDnBSVLA8Z220Ggj4gAd0EOyyYqYYF2m05XqtJla + 1RCV3EHe2Nj4+9//HnBzZ/LrsyUWyrVK1QaVukStLlNrKjTaKq22mmENDrYIMakfS3BICiEOYeHLI16P + umYNAa9LdboSgdpz1cpI5eLFi2/cuAG4//jHP7ZlS55ralsoc5XKPKUqT6Veq9YUaLQlWm2ZlolpJXML + 8GcdQhxiYq7gsB+QFAANi82tSH1LrIt1uiIdHLdqBPMkDQ0N33333Q8//EBwi4X7eXfcFspspSpHpV6l + VuepNas1CO06rW4D4xoTUyCORQxLWU3HOG4CN0QD0gETggDWfHmstWXflniN/6hQpy3QqueplVHKJUuW + 3L59+/vvv+dKYu64n0dqWygzlaoslTpHDaw1uRpNnkabr9WuEQKIFwhvcBHiHeK4GG6Sb8BNwVNHLI9i + rAt02g1aTY5GlaCSO8r37Nnz7bfftqokzym1LVQrVOpMtTpLjZwCv6d2lRa5HMOaw02IFwrsAwc7TnBz + uMFowppbERHWIDX+I+1arXqGWhGkWL169RdffAElIU+C9P25prYA9Eq1JlPDIkujzdGyILjzBLhXNxN8 + rRZYmEjKYwhuot3EbgqOdXWzhkCsNxix1izRKOOVMrns8uXL33zzjTm1n7s6iQVQ5kBrs7TGyBbBbU7w + 9QLcIHizgj8Z3JTvkIZw20d6zbEWtAtFErmLfPv27V999dXzTm0G9CM6c6DpE4K7LYJDT4qeRE9M2A2U + QWrCmmwfXjZgjYURvMa7h7CGjAQqNmzYcO/ePTG1YUier7zGQjlFqU5nWD+iswnc+GP7cLeU78ezG0k5 + FU+AMoU51usfYa1ZpFH2YEb7nXfe+frrr7kh4SXA50JGLIKDg2WOMkWYQjlEqZ6pbg9usZ6YyDdnd0fE + RExtKg3ioznWWBjJ/KzRYvFQDVTJVLILFy6A2jAk8NomK+Qz7kYs6uvrCwsLU1JShg8fHhgYqPBRqOJV + 6klq7dJmvTYheDvsJu1Geg24scTBepvkO22llECZgtIZriEirI2S7STfv3//l19++dzJiMWOHTt27dq1 + W3jAva5Zs2batGk9evRQeCpUvVQo/WhXtIa4OdzN7GPOhKx3R4wgWUBSEgQ+MdFrE6wnsR4CEkg4P6yQ + JCOUsj/jkm1x4MCBgwcPHjp06PDhw/gED1CmqakJNJ85cyZD3FeBIrJ6lpmqcCUxt95rTX13h6hNiD8W + 65ms7FdaWvr5559DRsiNoBplLtnPVAJpgaLwqVOnTgsPfHLixInjx48fPXqUcAfo4PiECRPkWrkyQqke + YyYp7Qg3KQmoLZRNHpPEc+EmrKmsShqCpLHZhBityDy1IkSxdu1aNGval+xnB2uLK8Lj6tWr+Ijs4OLF + i+fPnz979ixwx2vAQYeZRRWiX79+jOBDVJoFIpdi4gLFWeWPoDaJCT62i7VmoQYvfHZ29qeffiqWbHEC + +UwtjxZvvPHGrVu38PHmzZuvv/462tXXr19/5ZVXgDtAxyoP0MF0IH7s2DHQfP369WPGjJG7yVV9Vahw + tkhw2nLcYmqb16dMCrBEbQqOdQmrOrXg9WqtJk2jjFauWLHik08+uXv3LpwfTyC5y352sLZAg+OD5se7 + 77779ttvo1cN6IE7CsSvvvoqQAfTgfi5c+dAc2gLEK+qqsKaKXeSM4syR4AbvO6IanND0k69uy2skcjw + JRefAOt0DbpiS5cuvXPnDl8eeYmVL4/PwkSDxe+aH9A7vA3xE3/88cdA/r333uOgg+mg+bVr10Bzjjg4 + jtV/1qxZDO4+Ks08zSOs26I2GZLmylR7KyRoTnDjE+I1/hV4LcYaRZh8rSaDpTMZGRn4yWl55FZEnD3+ + 4lhbwCThTQdbik/wU0LvQA2AT6B/9NFHAJ2Y/uabb3LEieNQFej45s2b0WmVu8tVg1Saxc1lKROseS2Q + y0ir5q/VPo7AfbacAutinRZJI+c1xzpGuWzZMlAEPzm3ItQ6eEZ4bQFdQ5YFh4SP+BxuCaADeg46mA4R + JJoT4hAWQhxL6KVLl7B4QlJqamomTZqk8FNgOokpidhom5SlKI1EXgM38ljJJuiFWZxHWHNzLQDNeA0N + iVZmZmaCGWKsYfueEawt8LLzB5JaCJwJ6MR0orkYcUg5llDoOCSFCH7mzJmioqKhQ4eiUaKerm4Pa+5G + WpXstnhNfRmhic4q18RrjjXWxghlXl4esOa2jyz2s4C1Bf0QeKCsjs9h++GQAD1+Pg46VA/lBaI5IU6q + goVULCkgOOnJypUrmXAPUKGszErblNGYFbhZ+4ZqrY912URqPrOAdwOKfNxcc6xTNIpgRUFBwYcffvis + YW2B0hc9MHWIR6ugg+lEc0Kcc5x0HJKCuhoafTAqpCfwhUjrp0+fjkYJK5u0jTUWtxbLY/utdzHWlMhw + sSbznq+F41QYFJWVle1gTZ7vZ85lLGg5pgd+AjxaBZ1oLkYcUg6Cw8ASwfGLQcFJTzjcMN1yO7mqvwoa + 2havnwDr5peBKTv0HZMh3IQ0k5phPV2NQs22bdtMsBavjT8/1hYmL6wYdM50Mc2BOFcVLJ5EcHgVWCso + OPTEBG5UUWABlSGCarehIU+MNcSaEnQYPm5CONYYF56gRof3yJEjHGsqifyCWJsCLcbdnOYccUi5mOD4 + NUjBTeAmMYH7RsEETSn1cLVRrM0bkrB9YovdloaISc0NH18YmwWEjWYPV6N+DR17RrBuD2gOequI0+LJ + CU4KTnoihhvaDS+IDBPVEuTuyl5K5rU50OLmb0ewFr0AxsFJmBB0GmlhFJEa/4Wqn2ru3LlYrrnnw09I + eSM11Hlr5mfQ6w4BbY446bgJwcml4Jfh7CbtxlKJZAdVFLjA1NRUGAN1kkBtatOIseZro4kPERs+c6xh + QvjCyLHO1WpWaJTdldhvYI41rz39bFg/GdCEuJjg3KuAI6QnBDeJCbSblkoygrROorwp95Srx6oZ0G1h + Df01adBwrMWqQmJtsjDSi4fvDKwXaFC8hgnBi42cC281rChUeyKsaYfHz5Cg/xigxQQXGxUy4xxuiAng + xi8GZwIjiN8T6ySUBDkO+mfMjSSoHgEt5jVKIuSvxXNobZCaZYxUCeFZjIjUbGPHVLXcWY7+Bv53qj1R + nQ8OivdlfgYT8i8BbUJwricEN5kTciaU6cCWwHQTtdFVGDduHGqteIMbBUQ0G2XMZYQc3ThlaZIudkSs + BVIzrLEwymTQLsIaLzzWEvCA+jJUDPmpsX4KQLcFN18quXBDSZCwgdooDYLayGtmz56t7KlkCaSJWFOO + DvEVak8Ma/O8vH2xpm9IGekqLRbh9PR0LBUQMbze+Enw8osN308t1k8NaA43iQlfKgE3CTcpiQm14f8w + sIHaiCbVDGvUnqgTxqeH28Ha3FmTgDSTGt9fEaCoqKjAC4x3FaRMXOT7GUzIUwZaDLe5koBBUBK8bTm1 + 8V4Gy9AlUYYq1cnqVoYrgTX0ty1SN9dAjGUQ7qzJ7bUktXqKGrsLUEZH+srNNRk+k4Xxp3B7PwnQYmfC + 4SYlwRIEapNqwwOQIcFvjl2IzPbNF7DmY5UAC4YPCyMXa94NaM2EGJ01lZyoDMJJLdRbVINVSFPh67FO + iE3Iz7Aw/lRAmwg3KQlfJLlqkyGhFRLZIytCAWsALRphNU4MVwnjOOLOS1tYk9uj1JwEpFmpNcs1ynAl + /CVWY25C+MJIhcyfSKx/WqBbVRKu2mIZQfIGq8uwBq+hIWJSk1hzARF3FM2xFvcHuICQUgukxtQk3B4G + V9C+wJpssjBysX7q5b2fA2ixknBqk4xQagMZobwGLMvPz1eGKTHY2KIPSxkjOWtOahMZEZdBqD/A00UR + qdGOwLgEOstInWhhpMq1iVg/dbf3MwHdKrUptSEZQV4Dow2swTJMazAfgsoqLzfD7VGXAAICQPnsB3Vv + ebvLpI6K2h7Vm/iqKJBas0yDtXfdunVInSg7x2rxU2cxPyvQRG1e8oYgimUEvyolNVgeMUGgjFWyYWKO + NXd75ED4/FirWHMBQb1JvCpSCyJHSBft5RjIgr8UZzHkrH8KAfm5gW5LRiiHxLrEl8fk5GSU38SkNpat + K4RVkU9H0liTGa+NDoQ3B/iqKADNBKSvav78+SgrUhbDnbXY7T1FAfkFgDaREXIj3PmRy8avDa5NnToV + ZyK0IHVzumgkNQ2gisXaJF2ErKMGIl4Vm0nNUhhfRXV1NVJzctZYJ6jk9FO4vV8MaBMZETs/ctnAGq1e + 1J7QLjFiDbywKsKB0KoIfPmwb2tYPypYk602IzX2yIwaNQrNAThreB4qOeGV/ikE5JcE2lyyqRSF35Nj + DR8m95KzqTO+9ZF2ctCqSIdbcF63KiCw1eJVEVavWT2wGR22GrkSBARu7ycVkF8Y6I5gjTk/RajCaEI4 + qclWQzdoc4YJ1lxA+KoozhXJU0Ops7UsL9eyvBxuz0RA+EDIU0lhfnmg+fIoTtZNeI0RJGw7ZKQG0Hx3 + KSc133EkXhhNbDVWRW71xKTO1sLeoLAlFhAsyLy2J24O/Cs1kGcCaHMrAtsnxhrqiSkRSCptnDbu3uCk + Fu/uasuBUGeAWz0xqWepMe6DQRQTB0IpzNMqWD8rQLePNXwIhoZx/IF6tpoBTUuiUK1mSk1bFhGQkfZJ + TQUQShSb1QOTgpiGnTNnDuYI4UCo3kSrIupffEKBOl4/mtTPENDmWPO1kfx1XV0dy86RxaBfjiWRJ+UQ + aNr83LZYG+dATEhNk5hZWswcY7QeJz1hGJzqTVQDQXmAbPW/3oV5toBuC2swC1iDZZiDRqmTAY2MnLcF + IBcm2565gIhXRRRAypqHm8xJ3V81Y8YMNH3aXxV/NKmfOaDN10bwGhkE8gjk6CgDMWedpDYCLZSqmXpA + NOg8LdEJhyY1kBakJk8tUg9NMiM1Rusx7sNttfmq+KNzxWcRaBOsKW+kHB2ZG4bq4Pbwfjdu/OdLIp0K + Aqzp3ATzVZGmfkFqc6UWNq0i4wepkSXRqsgLe5Qr8mr1jyP1Mwq0ed5IWMMJIGlEm1U9VM2Abt45alwS + xWeviLEWWz1KyilR5D5PAJoptbN869atGPShwp55rvij++XPLtBirKkeQjVVLFDwBkAEb3YGtLBzgJWZ + gKxwUpnx7JVWHQiRWuypYT+EzIW2l2HvE6bIsIcB0/XiXFFcAPlx9uOZBtoEa6qpAmssjEgXsUfo0dZz + Kn0Q0Di/CdQ2ERATUlP5lDqKpNQC0Dh2AAdN7t2719zq8QLIjyP1sw40x5paM+KFEbU9lJUZoyHTGElA + oQPeQzjtkGHND8oycSDmpBYBDawxrpeWlgbbTlaPF0D+RVI/B0CbYM3FGrNOaOaClbSfzug96FhJfthe + W0qNf0LVD+7zmtUDWxR69eqFPayweib5y79C6ucDaMKaiiFcrFGOAPXUiWo6cYjJNNJCqAed30mHSDYf + Zt3C6hGpUdJD5cRsSQSp8fqhdfl0Sf08AU09MGqAoRKCLAaeFweBI1c0To6RTNPxy3Q4Kp3WaZa/ME+9 + sWXy0izTTKmHq0eMGPF0Sf3cAN2WWKOTiy7MI6AFmTaejwqsOalblqqNw77k88zUAz14JC/YOUmkNrcf + P8JTP09Ai7GmLAaiifUKxSbNSo1xEoGApsOWERCQtkiN+TEkL7x22nJJVPVmPg+khv3gnponiuLqRwfL + TM8Z0FysxQICPVUNVRmBFnJxdgQtUD4gCEg7pIa4i5dEsXpMZZO+OF6APDVPFKmpSD2BJ/J5zyXQfFoV + bg/pIt7aeKfDC7MVj9IWrId0RD6wbovUfEmkLJEKp83egy2JAew0Sey+pkSRmoomJb2OJy/PH9AmAkIp + DJQabQFju5aAxgHWdEg7bnkgUptVP4xLIi99tAQaZcKxY8eiy0XVD9SzqFOO2hbVqan50sEy03MJtLmA + oLYJ+6FbJ1z9QMaDgKZbHojU5j0BkBqtW54lUjrefCoaNuGinYjOC/a4w97QqA3q1Hx+jJovHST1cww0 + FxBKYZinnqw2FqbJ4dHtGsB6v0BqvAbmpMaSiNIHVw8R0CxLDGEnJuAsGJCa6tS8+WKSvDx2SXxegTYn + NU4OwSQqWxK5lQbQuJIHd5jgE5Aa1Q/hCDJx8kIbjYxbnalCLZJp1AhHjhyJyTGcJGCekT/Rkvh8A22y + KuLAEHWK2hToEwKvodSofpgnL7QkckPd0uSxwqlWjqMBzX2euMvVEfV4joE2XxXR9EOblc5gZ9IBdT7O + rkKyA9aHhNth2loSST0oc2mpHkjHoR5YEuHz+JJI06dPpB7PN9DAmuflWJrw+6PRBa9mLHcQ0Lhq6rRw + rRc8NS2JraoHZS5UNRWdEgrvgZ3V2L8vXhJpIhJdiI53Xp57oGkOmBebwD6U34x3ZkCaATSu9TorXOt1 + UFgSzbtcpB48czGR6Zksc8F+UCyJ1LqlzotJlvhY9XjugRaviiA1eIchc7vtwu07HGjcWHfWnik1lsRW + 1QPeA8W8ttTDR4GDR5AlovTBs8RWDXU73uNXArSY1Ci8YXrxEdBn7O0vCAFSw+e1pR4o5lHV1EymcRgu + jmnF4YqUJaJHLjbUXD3az1x+DUCbkBrH16JIzZJvXJgG6Thj73DBwemCEyP14Wb1MNlZDvWoEA6LbE2m + cT5Anz590GfghppPM9GIHtWY2lcPdtTPY832s/8EsVLj3Y0yBTMeSFUA9Fl7xwuOrhddATfz1G2ph4nJ + E7lpjKzLdaw7/q+ox68EaCI19RXBL2QZcGlMlE8woEFnj0sewBrsbk89uMlruR5SgSknJ4fUgyZsnlQ9 + LKAszz5hO/ITEqmpfIq1C/sEyETj7lZA7H3Z2+uSFyM1qYfY5IlO5WxTpvuo0Asm9TD3Hnw+rx31YED/ + OtSDPDX5PJQmMA7JLm6FiRaA9rns43fFz+2im1E9Wq17VIpkumXaoh7POrbYfiBWDxTzzDOXtsBk5979 + aoCmBi5NJfTu3RtdQWgF/AZ0AygHXg0E3GxJRDrelskT5+KitEWTopGpZTgWijIXTK2js4MtkZS5UCuA + V01bff9ZUEW1I+/NZ/854iURxTygQyuh5yXPgKsBoa+EAmvoNUvHTUweVw+xTLe8RQLXTGAHNdQD1Suo + h3krgKqmbSmERTt/9+wja/4TclKDfcieoRtAFgId9EpQ5KuREdciADrUgw00mck0OzUIbprSFrP1EIM1 + 8+bNw1n81Aowr5q2b/IY0L8y9aAlEe9rtALsjzCB9r3sCzp3v9495noMqM28x147Vp42O6eJuWkUPVpL + W9QJatygApnmVVO00DBxap4itirFFk/Uj3kuOM6XxEGDBjmUOUCgDVcM4HKv6736vNYHnzDvgRSxVZmG + m6at+mb5IcbPIiMjMZbHTR56LiYyzTu25kBZPFE/5rkAmqsHpnvtF9mTboDO/W70G/T6oNjrsYCemTzI + tLjhwmWa1kOU8VoaD5yLiPUQ1+Nyk0cDY+KObTsyzc6Pbn+5fC7AFf+Q3FADFN1wHfwGdAP4AuVhbwwb + cGMA1IPJdFtuup310JNdj/bjZNqigzWR5wtuUg8YA3WQGrBCLnq/1jvhZkLirURgjT9CptnA2GPXw5bG + A94cZkYs0zTvQTIt7gOYy7QFr4ngJ/uVGWq8kWUKWcCegOhXo6Ebo26Nmnh74tg3x0Ks4flYH0C4Cc20 + D4D1EGU8Mh4tgUb7Bt2yffv2cZnuuJu2oHP2fmVLIpdpNEcMxQYgO+TmkPG3x894e8a0t6cNfn0wM3no + A2A9NDu3EE0AZjyorSUqLbHhx1HqgQMH4kYxctM0LWZe9Gg1NbGgJuOvb0kk9Vi+fLlvmi/oPPLWyKlv + T53/7nzEmDfHMJk+0sZ6iCYAjAc5PBOgp6nDw8NxexsaLtxN84aLGEnztMXix83dPPuSTcU8HILqOdYT + dB735rjZ78xe/P7itA/SQOqoV6NQb2J98XaMh5nDw71RHh4eO3fuhEzzdi2GPXBYED9/oq20xeLHzd08 + F0AjEUPr2rmnM+g8+a3JKe+lrPhwReZHmcnvJsNQIztn+WGrQFNby8zhoXGD5i/OUmkrbeHroXkOaIH6 + k/gokI4Pkz3jWJPJQ9FH56kbe3PszLdngsu5H+euubMm44MMOBCsh60bD9yNQQ7PHGgUpj3ZrXMm6yH2 + ueCoMT5oSgueibOwaHWY7NdRZiKZxrWjiScSwWJwecMnG0o+Lcm9kzvh9gSWtsB4mDg8Slt4xaNlzkK7 + LnCwFtZD3F1AUzXUBOBlPLLL5uuhBT+M7F/ZCfNssptkesCAAYnbE9M/SAeXK35XUfNFTfGnxbPenoW8 + nCXiJg6PgMaQGC8tmVjpaCUG1LEeivNDPtFLJ0/QfgATslpwdyJeNH8dAkImD2cJjigdkfNxTulnpZvv + bt5xb0ftF7Vp76chbWGJeKsOD1a6DaDJSmPEVJwfiic9uIUzBZoWTeoUkKf+ERs0nllGA2i80xOyE9Z/ + sh747r63++DXB3fe2wnckZSjBdOmlW4rZ0lQDRs2jIwHdVswJ9YR42HBT9h7usdTPCPQg1bFxcX9F/Qv + /135ti+3HfnmyKnvTh36+lDBJwUDXx/IHB5KS+3kLGbJIQYZMHqAsUduPGikhtpa3FaYF58t6IhO8alv + vyZSA2iUlnpP6l33Rd3+r/ef+f7MlR+u4GP159XIyFnFo1Wga4RB3taycMybde/eHUDDePC2VkcK0+zO + 2Z/ieIpnhNGQadTpo4dGQy5OfHsCKFOA3ZNuT0L/heUsZgetY2iaDdO0CnSSGlfWo30jLkzTTub2HZ4F + +mA/6aFNvyziABqN1JBeIZCLS7+/xIEGu2E80OVixdLWgGYzj8jCzaRDM1fj6+uLM0O4w6MhsVYbtWIr + baFWe+L1EW96/jWtivhVYQn8Qv1INHhAqVPfS8X0AUsOza8OQPOwLaAXatzd3QlocaP2saUlCw+PaShx + 4WUxObSJyqfPWlUPwD32YdIEQCrh4eshRhmfg93LP1yOkRo2nd4q0OizUF2ppY/G1c2Ojo4AulUrLR6a + NslZLEJDG5ydE3CzksnB1T/RWahiFPDWwTKC2R+MtWEyEZfG4rYQvOpIMbDgBAUFeXl5OTk5abValUol + Fx74BH/EF/FXeEJ0dHT//v3xT3ByP2wc2h+4ABflHlgp/M5YCfHA/+Lo4nj595fFAayRjmPMg2XhrV2G + wTZbtAa0dqlWp9NhgW21hsedG+9p8d8XQG8ODCywt++OFJ724opPfXtax0bi+8ADwRLh+kwcJpyQkACY + PF1dekaEJg7qN3/S2JwFczZmLd1euOZYbdmVnQ23D+++c+bQvSun/vDahftvvvL3t68/fPc1BD7BH/FF + /BWecLup8Up92bGi3O2ZizYmT8ueNHJeQp/RMWE9/bw9He2QfOM/wsTty91eztucV3+x/uRnJy99d4nF + 95fWfrzWcMnAGM1PEhPtBGgT6BVatVoNoNvKWUyKpS2ABtZ6/XKNxhdFRWoZmJ98z++U6uDihlYk3iLg + Fw5Qg8O3t9X1CA+dOnLoqpS5W9blnm+sAUx/f/vVf75341+N25f/+drph5cPPTyz6+HxLQ8PVD/cVfxw + y+q/VS3/KHf2uZQxDeP7zQ12HRfmGeGuUysl0QOixy4Yu3Tj0pSmFMNpg26HcP4EwuQKLmw+bJXRmVqF + QgGgzYulIChtA2g1OQSjtwix2dt7nlLpAIFv9eT7jpywhxcT41Lg7OTJk+10uj4x0Qsmj6/IXn52S80X + F4//q4C285K88+o/b57/57XjDy80PTyx7eGhmoe7GdYPalY+KE97UJR8d9HQ+6vG3c8c9fGCfsfGRxX3 + N8wKc4l2U1hKftMpplO3kd1kC2XqIjVd6cw20NXYsl2eZO8yhRApNRQMWmeeHIq3IPKqtJjRjaGhWwlu + d/dJuL8K8078mpLHnnyPpQnucOPGjRi2dHN2GtGvDzi7v6Lo49OHfkJkzUF/9/o/b1365/WTDy8dZNQ+ + Uvdwb9nDbese1OU8qFx6d9nY+2unCliPvL90yF+X9P9ravwf50e/MtajMl47N1AS7dTZ2uZ/OkV2shpj + Jc+QYzstfLQmT6PJ1mhXNmNNiKMkLQBNySGfeQQ7Wy3/PwI6LGxbaOgjrF1cRmJFavXke/E1JVgq8X9g + Zw7+174x0cvnzNhXtuGTs0d+VnBN4H772j/fuNCM9U6GdVP5w52FDzfn381Nul86//76GffzJt7PHn1/ + 2dC/pg/8Y0rPe3MC7k73uTvZ4+5E1ytDHUp6KKforQy2L/6X5f/r2rurZIJEtYTdmcZiJQsG+komHZBE + eGLKwmljS1tAcyttAaBFWG8NCqp0chqIY375yfe0klIRFQTHd0fL3dnRYeyQASUrllzbs+WXBJewBsSg + 8+vngPI/rx59ePGAUa8P1jxs2vhgR8GX61PuV6ff35hyv2D2/TVTGLVXjvhzev97yeF3Z/nfnSZgPcHl + s/HOd8Y5fzjGqTFeszDQJsahc9du/9MlvIvNKBvVIhUuy2GIL9VgMcSBjwCaZ+HYVGtS7jBvaAHo7SKs + GbUDA4sdHeNxfxWKUnSaIbBGOxLLmqOD/bghgyqyl715aPeDd5gT+MlRxoLJeHrKiOC5vQ/P7Hx4ctvD + 41tZHNv88FjDw6P1jL+Iw5seHqp9yPCtfLhv48PdJQ93Fv2jce29DSn3Ny2/X7n4flny/cLZTEZyx/95 + 5fCv0nrcBdazg+5O19+d7AleM6zHOr+f6PTuaKe3RzruidcuDpT0sO/ctev/WEZZSsZJ4KPhL3EcLdZD + 5Cx87oDKHe3UlSzQ1TXDutHff529fQ+cyY4+Am5Tl0gkA2N7rF6cDOP1lzeu/O02/Nar/2i2XE8B69fP + sXUMqAGdxjUPajPZIlac/GDdrAerpz3InfQge/yDzDEPViY+WDGKxfKRwiejH2QmPsga+yBnPHtO3pQH + a2awf7JhzoPCeeyflyx8ULbo7yWp97ImM4hL5t8vmnu/YNb99dPvr57855zEr5b1+XIxsI5kWCcZ7k71 + vjvR7fPxLuD1B4lO74x0vD3C8dZwh9eHOWyJU8/xsw7SvfRfL/0/GxubVatWYZcuHB4lh5Tu8XIHHTJh + UsCziIw80CrWnp5ZNjYGO41m1thR2zbkf37+2FdXTn3/6tk/vn7xr7eu/t+/gDWzYiBdQ+6DkpQHuZMf + LBv+j0X9/zG35z9mRf/fjIg/Twv/w9Sw76aEfjMl9N7k0HuTQu5ODPliYsjnE0N+N4EFPsEfEV9OCsHf + fj059Nspob+fGoZ/9Zfp4X+bEf6PpIh/zI5m33BBPL7z/YUDvkqKub8s4f6K4fezRt/PSbyfMwbx56wR + 95bFf5kW+2VqzN3kiLtzgu/O9GdYT3b/YoLLJ2OcPxptxPqN4Q43hjm8OtThWoJDYaR8tH03H6UNiqV4 + i/PyPx/wwLufz6WLW7QW0dHHBaz3EK9DQrb6+dW6u5e5u5W4u2ZoVSGrU+e9c3QPXASw/vrq6d9fP/en + m5c41iQg7WsIY+uOAsavrLECpjGAA7gAI+D16YTgO+OCPxwb9P6YoHfHBL09JuitxKDbiUFvJgbeGh34 + xujAm60Fvo6/xXMQeDL+FQL//IOxQR+NC7ozPhjfFt8cr8SX4wI+SnD9YVrgX2YE/TUp9K9zov6a3OOv + C3v/MbXXlwsj7i6IZIyeH353bijjNbBmku15d7zrZ2MZ1u+PciJeA2sAfXWQ/dV4h+P9PFYG2/d2lEdF + RaWkpGDdovI/OTzKWXhDi9ZDAH1KwPpgSMhOvb7W2bnIy7Pc3686NLAeYfDJstOE56fMfffY3jtnDn9x + gWH9w/Xzj8Ea6B/f8qB62YOcCQzZmVF/mhZOsAICYEqAAiAxlK+PCvzXg78q9DLgNbs5zPdqP+e3x/i9 + P87w0XjDpxP8704K+Hpy4LdTDXcnu4K/jMXQaEgHBT5nvGZY/26My51EZ2ANvTZiPdj+Wl/HW8N8bg71 + vjHUpyTKOdFTbS+zWbBgAcrTUA/M4dFR6lgPxecuAegzERHH/P33uLtv0vtsCjTUhQVtbo6GsKAGg0+O + gy4qe97M947t++Ts4bsXj3/zyhnCGtkwaQjx+sHZPUxes8fjPfv3GRF4O+NdL0YWvzln6L+OaQe/w9XB + Xmf7Ol0f6Yu4MUp/c7T+zUT9W2P83hrj/dpoh1ujHd8e7fTBGCfoMhQD6+HdSe4M5Umedye43x3n+sVY + hvWHo5iMvDnC8fUhDq8PcH5rmM+bDGuf14f5vjbUpz7WbbrezlsjR8kIrXGUWZAf0q05/C4Gi8DAwz7e + uwIMe8NDDkSG7osI2RkWtMUE6wB9vqNtbEbS5PePNwHrLy+dEGP9t73lf1s/+/8WD/z7zEiAC+kEuHgL + vyOIAAe3g7g89addGuBxtp/LtRG+FK+OZAHQr470ODPM7nyC3aWh9leH2V8f4XBzpONb0IpEp4/HOkM3 + Ph/rApQRxOuPRjm9CxlJcLw90PW9Eb5vD/d9c7gv3i43hgJr3+vD9DviPecGOBhsldBuLI+8Kkc3b1kE + +h+MDDvePfJEdMSxqPDDUWFNESG7woO3toR7c6ChwMm+X/KExNebthHWXzes+T5r0g/zev1haigDdxzA + DWTgjvnlwRW/Whf6uZ0f4MaB5p9cHO5+Yqjt8cG2Jwfbnhpse3aI3QUB9GvDHa4Pd7g1wuGtkY4QDeAL + lBEfj2ZYvzfU6f0E9zujfD8YqX93pP72cP2t4b6vD9O/Nkz/6jC/a8P8dvX1nhvo5G+nwnla8HwQazgQ + UNuie+RpIU51jzwZHXE8KvxIVNj+yNA94cGNJlgHB1S4Og6b3Dv67OyEj6f3+HRc0PtjA95K9H9zlP/N + UQE3mcIG3GARiHjqxPzR3/BcH5eLg9zNgT4/zO34ENvjg5pjsO0JAfEzg+3ODbG7ONj+aoI9nAa8HRQD + ugHQWSQ43Rnm8Vmi/s5o/Yej/ID1OyP1b47Q3xzud2O4H8N6uOHqcMP2Pt4zAxy9dMqioiIkIpARDjRh + fQpYR0ccjQqDjADr7QLWgpIE1ofpq8K8N7qrh8g7davu7nIhQX8xwe/SUL/Lw/yuDDdcG+F/bUTA9ZEB + r7F4hrA+3dvp0hBPc6DPDXNtATRHfJDtiUG2pwbanh5od26g3UXYjCH28BtAHOvh7UGOd4Z5fp6o/12i + 36eJho9H+30w2u/dUX5vjTTcGmm4McLw6nDDK8MNV4YZLg83bOrlNUHv6KBWwHSLgebUhowcjQo/JEj2 + rvCA+jDfyjCv0lDPkhDPkmCPEnfteIWldkWQ7dGBvqeG6M8m6C8wuPEfAGt/c6yJ4zyEV4IFnvnqCBav + jAi4Otz/ynD/S8NYXEAMNSDODzWcSzCcFQX+iMDX6Ql4Jp5/Wfi3+A54pfHd8G2bfwb29joRa39lqPcr + I3wRYrjPDnNuHeiBtscGsDg+wPbEAIb4GTHi/ezfHep5Z5T+k9F+nyUaPk30u5No+CjR8P5o/3dGCW/u + kf7XRxiusR/JQL9LQYzHYE87AH1GkA76KJaRY1FB+yL9tkb4bAr1qgz2LAv2KA3yKKHwsp+rsfJJ8lId + 7O9zYpD+zBD9+aFgt+HqMIY1Ufv6yMDXRgWKMcXXAQf99wDrTILhZILf8SF+RwbrDw7UHxBi/0BfcTQN + 8DUJkyfQv8I/PzxIf2ww+26nEvzw2uBlYC/bUP3BHraXhvlcHu5zZbjPVSEI9FNDnY4NFklHM6OPEdD9 + jQG4OeJnB9qd722LMXashO+N9IV03Bnt90mi4ZMx/h+P8f9wTMC7iQG3Rwe8McofvzVwwMt/USANfk0C + umVEnO4efLi7f1O0365I/Y5wny2h3ptCvKqCPTcGepQFepQKUeLnvMJe2n2oo7QqxvXYIP1pUHuo38Wh + hsuAm+kUo9iV4QGgG8F6OsEgxhR4EYL7mmNvf989QuzuQNAz8U8Q/DvQN6RXgtDf18ezMdr26GCv40O8 + TiV4nR3qfX6Y96XhDPcTCfZHB+mODtQdG2RLQXptArQYcRD8ZKzulUGeNxK83xjq89YIwO334Wi/jxP9 + 74wJuDM24KOxge8nBr6TGHBrdMANhnUAYY1fvyXQgDjoSHf//dGGpig/0HlvpN/ucP3OMN/GUJ/6EO/a + IM+KoJZwu6iHyzsrVgTZQUZODvYF3KcHI/zw8cRgRtVDg3z3D9A3Cb88wUqAEpq7+vns7OezQxTb+/pQ + bDML/lf4RPxP8B0Q+Fb0PekFIPS3xbrWR9vu7u+B2Nvfs2mg56FBXscGe51M8GoaZLt/gPbgAN3hgboj + A0WID7Q9KmI0B5p90tf2RKzdlcFerwz2ejWBJSxvDPd9a4Tfe6P8Pkj0/3hswMdjAz8ei+wU7ivwzdHM + HUDKgDWo1qzRphADZURThH5fhH5PuO/OcN8doT6bQ7zrgr2qRXAzgnvazdFY6Se4KerjPPb1897d3xsW + h/3a+Jz98vgE4btLgJUAMuLYx2fbUwzh5eEvAEFf191xU4zD9n4eO/qz2CkgjtjZ362+r3prvHpHH83u + vpqm/tr9/bWHBgiID9Ad7Y+wpWgBdB/bk3EOlwd5AeurQ7yvDfG+PtTnJhzeCL+3RxreT4R6MKA/HheE + 7Pc9lkaw+gFUFFgLQJNQGPYJLGYRgdAzoCk43AK1G0DtR3B7AusyP9dce3lf65deXmjQ1ffyaIj33NLb + a0u819Z4ry19vBv7eLOP8T6NfVg8TXDb+W7CG6Ii3La2p9OWvu6NiH4eiG0C6Jv7OlX1VlXHqWriVLW9 + VJt7q7fFM8T39dPu76c91E93uJ/uKIUY8Xjb070cGdAMa++rg71fSfB5dajvjeH6N0YYbo80vDM64P0x + gR+ODUS95UPYX6HSgGQYWFt0D2jqziCGSrAgiHkwlJsjXL83XL87jFG7McS7PtirNtCzOtCzMsCjwt+j + HOGmS1J2805wlOVHOFfGelTHeW6K86zv5dXQ22tzb+8t8d5b441w/zxY40Ut8FfUxrnUx7s39HHf3Mcd + iG8VQK+Nt98YpyrvqaqIVVXGtkS8t2Z3vGZvH+3+PtpDfXVHxHD3sj0T79wC6CE+ryT4voqEZbjfTebw + /N8ajSUx8H0mIEZeA2sUXiyi/HZH+u1BRABlPUULrJuB3h/hh2gC3GH6XaG+24N9tgZ51wcCbq+aAM+q + ACDuWal3XWMnH2j9knSqp7qip0dVrEdtnGddnFcDg5thjfjZqN0Q51EcrAbK4iDEK3rrSmKVpT2UZT1V + G3saEa8C4rHK6p6qTbEqFKB39NKg8N/UR3uwr5HgR2J1Z/u6XhrkJaiHN9TjlSE+1xJ8rw1laeFrIwyv + jzDAcsB4vJ0Y+O6YQDAacENDgLVFhH5HhN8uCLEQLbAO1+9DPGI0UPbbH6ZH7Av13RPiszPEZ3uQ95ZA + r4YAz00BnoDbGB72CzU2oTEaq1R/O1C7JhbU9mqV2j+pktTGuJSF60yApj+WxGqKeiqLY5ToEyI44hU9 + lZU9lFVC1PRQNcSqG+PUu3tr9sYzgh/soT3Xz+3iQE8AfXmw95UhPlcFoF8dqr8+zO/6cMONkf6vj2R5 + MlzH7dGBAtysVImwCPPdGg4Pp98Zod/NsRZUgqFsDL8mgBumx0egfCDUGE0hvnuCfXYGM7i3BnptDvSq + D/CsE0Df5O9R7ayZLO/qPtBemhniWB3raU5tKMmWeJ+iHp5ZkW4pwc5TDU4jve37udt2d9YGOah9bNWu + GqW9SqFRyJXoActkCHyCP+KL+Cs8AU/Dk/FP8A/xz/FN8K2Ke3huFbS7MtKhIsreHOi6eLeiWFVhjLKw + O4uimEeIl4HjMcryGGVFjLIK0UNZ3UNVF6vaGqfeGafZG6U53c/9/ADPi4OMWF9NYNIBRhPQr43wvzHC + H2YDWL8xKoDqtKAzSkAWWNlgJ8J8t8NaAOtweAyGsjEYefV7Q31ZCJ83her3A+gwv4MIAXEGd4jvLgHu + RoHgQLyBws+t0EE5QtpFN9xZnhfuDGqvjnRbGOQ8Ue/Yz10X4qB2Vivd3NwwtRQXF4epogkTJmC4a9Gi + Reif4dh3jIhgkAG3NdXW1mK4Bw8063CZREVFBcbLMQeblZWFTjE2lWCSBGM6ON4nJCQEQ4guamWooyZC + 2XW0p2phiMOa7s5iuKt7OxX2VHKgCW4ECM6iu6K0u6Ksu3JjdwZ3ZTPctd1V26J0R/q4n+zncXaA54WB + XpeI1ABaqChxoOGgXx/JsIbl4GVxC/jiYK8aeIkwn21Y6ML1uwSs94QZ8d1DKIcIEcqwRnCsD4X5IQjx + fSG+u5sJDsSh4FsY7t5bPZ3z1LJBnX4rU3aztLG2wuZTnKQxZcoU9Noxh4Zte8Bu06ZNABFQopOPB4oD + eGB8Aj1QemCu0PyBVjQe5l8vKytLTk62llpjLsk/yt9aauWlk8a5qibodRlhjht62LYKNIM7WlkUrQDW + xdGK0uiWcEcq6yNtd/Vy3R/vdrSvx6kBnucY1j5XEnxfGaoH1gD6+gh/RmoBaPAahTBgTc0gC+R48GfB + XlXwyKE+W0HtUN+dob67ocIUAmGNQLeB9eEwPwQhTgTfHeC9w89rm49no6dHo5fXDl/fXe7u2BYy0tra + cfDgwdg5XF5eXllZCYjBVkCMBj5HFsABPkyoYBoID/RAMVGIB7rO9MAQeKsP/gQ8GTX4oO5B2XXZiKza + rDk5c0bNHtUzoad3sLdS8aLB/qXBHl3nB9gUNNPZyOtoZWGUAlEkBOAuaYa7PFxZH2W/Pc5lZ5zbnt5u + B/t4HO/veWag9wWGtf6VYax0x4AeyYBmWAtAE9YIAhqBrLoiyKsmyHtzsM82LHShvruAlxCE9SO4m3kN + GSENORxuOIII8zsSpD9s8Dng49Xk49Ok1x8wGA4GBh4KDj4cFMQiOPiIr+9GB4cJEok7pkBxcAmIDBYT + f4EvwAWsBCWmJtCLQ/cTDww7oN+MB7ry9ECf3+TB/4qeiRNKE6YkrN62enXj6vyt+Xlb8jDnmNuQu6p+ + lTZVaznY8sXgF//X/n/tlS/EOHWe6meVHykXGM1QZhHJgrA2sjtEWd/dsTHWBdnmjl6uu3q77+vjfqS/ + 56mB3ucG+14e6ncVWDNSY0lkQKNiLC7tWgS4FwV4FAe4l/gjPMoCPKuDvBqCvbdCc6EDbWHdTG2Gdajf + wUDfg/6+h319juj1JwMCzgQHnw0LOxcaegYREnIqJOQEIjiYfUSEhp7099/s7DxHqQyOiYnBiVBQD0BM + nAW+BCtacJgDwjwUHpjExXQvGvt4oFeEB05UNHnQ1+k5eHJAQEDK2pSCvQUb9mxYv3v9+l3r1+1ct2bH + mrl1c+W5ckmqRDJXIpkt6Ta8W+fozi+4vaCW/2+0Y+epvlZrIh4B/QhuIB6oqI9x3tzTZUus67Y4YO0G + rPfEexzs53V8oM/Zwb6oGF8dxsrFUA/Ga6E0j89hBFETt/B3LzK4Ffm7FxuMUSo44k2Q1zawfkTtIN99 + Bu+9Pl77fAG0/zEB34thYZfDw68IcTks7FJY2IWwsPNhYfgrFoQ+PgkPPxsScsTLK8vWdqC1tRoXcdBh + Z+ApkCVYASUO18fMFbZ042AuDAVipyq6RPTA7hv+4F/EE/A0rJ++Qb5lh8sQpYdKSw6WIIoPFBc1FQ2u + GSzLlcnSZNIFUul8IeZKGeIju3WO6PyC4wsOshf6OFkm+9sQysYIV5SFaOp6ONf3IKzdtsW5be/tvive + Y08fz6a+3kcH+qC8g3IxKtGokV4f6Q9DcqG/+7GedqfjXS4O8LIwuBUi/NyKEAaAzuAuMbiXwxTDP8BI + AG6YCjG1g333+Hvv8fXa4+mxG/oQGHg0JORkSMhpAUSgeQEQh4dfjcCWSRavCMFwR0REXGyOSxERiMuR + kVcDAupcXeep1eFEcLqkCngRmhi4QjMfQ8B4YHwCG0YwGoiBFZMHvogH/hbPgW8ZMnFI7dna2jO1Nadr + qk9VV52qqjpZVXG8Irg6WJGvwCSjfLFctkgmS5XJUmTSZAHu6RKbCTYvx7/8kv6lTl3/21/z0ljPl/PD + 5cC6IESxMcy2NsZ5U4xLfU+XhljXrXFu23q574j32NXHc29fLxR5Dg30OTlYDyU52c/tWC+nY3EOZ/u6 + XRoE8xeAANAFfiyANYtmrAF3qb8H8r06MbWDfHb7ee/29twNCYb+BgWBxccRpAmCSgBusJVhDXwjcdZc + 5GtRUTeEj4jrCHwxCsc4iCI6+rXu3W9ERV01GDa6uExXqYJg1LCaQb6BGuBD8w3DbRicwJgr9gPjgSFu + PNDe5w/6CvaS4IE9A+lF6Y2vNG69unXrla1brmxpuNSAQfTKc5VOtU7KtUrFSoViqUKRoZCnM8Tli+Sy + ZJl0hlQySYK5L8kYifVwa8sIyxecX3CQvzDQpWu6r6Qiwr6mu/OmHi51PRjQDbFuDOveHjvjPXf19YKS + NPZw2hxl1xipa4p1Pt7X68Jgv8sJ/leH+r8y1J8B7aAc4ue2QQhzuB9R29+rUe+5zdNju17fFBCA9Q0Q + UzCgCWuIrxBMGSAXwDoy8hUgGx39enT0G9HRt7p35/FGTMzNmBh8fBQ9etzq0ePNnj3f7t79emBgjavr + JK02DCegJSUlwTVj8hrDbRiNxQNzKjibCw8MzGOLiskDgq4P1gPfPW/s2X1z966bu3a9vmvnjZ3br29f + eGqhpl6jWqdSrlIqs5TKTKVyhVKxXCB4qlw2UyabIZNOkkonSCXjjYi/3Pvll9xfkr/4P0Oc5ZlB9sg2 + gXV9TwY0qL2pu2NNlH1lmLY6TFsf5bCtp+vueJ/9/XyPDdCfHuR3fojhUoL/FQFri67/+4KtLM7HeVVr + cDPh9nUr9XKrcHOt8fHZHhDQFBTEXERw8FEhGNAhIZzRIPXJsLBTYWGnBRU+D3GAMhDW3bu/GRPzVo8e + 7/To8S5Fz54U7wiBT96LjX0/Lg7xQVzcRzEx1xAhIZt9fJY6Og5XqXzi4+MhLPCFkG90PDFRiLEgPDBn + j0Es+ogH7ihLnJV48L2DB947sP/d/Sze2b/vrX37bu8bcGyAuk6tKlSpVqtU+SpVnkq1SqXKUSlXKhVp + Cvk8uXymXDZNJpsik00WEJ8olY6X2vSwQVaFoSQ7SbcBDrIMP/XGMF1psLo4ULUxVFsd6VAf49rYy3t7 + L+8d8T674n329PHZ18f3cH+/kwP9zg02XEzwB7UtskIde9vaqK2DPexTm7E2stvHtdDDpdDZqdDDo0Kv + rzMYtgUE7AoMBNYQDYZ1SMgxAWWiM2f0qfDw00KcCQ8/Fxl5ISrqcnT0NYgD+AvCEqCxsR8CTUSvXh8L + cUeIT4T4tFevz3r2vN2z51txce/Exb3Xq9cHsbE3w8N3+Ptne3iMt7MLk0rlMHDQYqSOWD8hLJgPwgOT + K0gR8xryjn187NidY/h49KOjiMMfHD70/iG/w36aTRp1iVpdoFavV6vXqRniq1XKHKViiUKxQKGYq1DM + UgBu+Qy5fJpcOllqPd66i08X7MRCwvniiy927dpN1unFvrY2KwNsa7u71vVwb4j1aIj13BrnxbDu7bPT + iLXv3r76g/38Tgz0OwushxgsCqLc1ka6DHOSyyxdXLRTCGtf1w0ezuudnda7u5f6+FRiGk+ITQbDloCA + 7YGBe4OCDgQHHwoJAdbHQ0MRDOWwMKKzEeiICMxAnYmMJKwvRUdfhSb06PE6EIyNfTcu7kMB2c969/5d + 796f9+59Nz7+bp8+iC/79LmHIPR79/60T59P+/b9tH//3w0c+LuEhM+HD/985MgvBg++FB/fGB29KjBw + mqdnvJ2dl8FgwOBhv379fJFl3d5z6INDhz86fPTjowxuxCfH8m7laQ9pAbSmTKMp1qgL1aoClXK9Ur5a + LsuS2SyysZ5n3W1mt65Tu3aZ1OWlcS+9mPjib0f99sVRL/2v4rfe3kG9eg0bMWLGtGnpY8bMjYzs4yyT + jHbXFkRAQzw2x3lujvPa2strW28fYL0DcPfx3dOXYb2/n/7YAD/IiEVJd/eCaIb1FE+1TSeZvWKIh/M6 + F6d17u5F3t4b9XpwuVKvr0Y0w13v778tMHBXUFCTgPWR0NBjYWEnhADEFKcJZQI6KgpxPirqYnT05ZiY + V3r0eK1nzzdiY9+GRADN3r0/EyC+17fv1337ftuv37f9+387YAA+fjFgwN1Bg74cPPjLhIR7w4bdGzHi + q9Gjvxo79qvx47+aNOnr6dO/njXrm/nzv0lN/SYt7d6CBTdnzTrq7z98bPKk/e8danrv4L539u99u2n3 + 7T273ty189bOHod6vFT10ourX3wx58UXM1m8tPKlTis7dVrWqfOiLp3ndu48y9JyxstdZ3R7eaa1VZKN + dZJUMlNuPUzWtatVUlLGjBnLkpKWz5qVOXdu9vz5uZMmLYyO7mvQKJJ8HepiGdBbegFrb2C9Ld5nR7wv + sN4twN3UV3+kv59FRU/30hiG9bpI11Hu6t/813/Z2HR3cVnp61uOaAaaYe3nV2Mw1BoM4HWdv39DYOD2 + oKA9ISEHQkOPhIUdCw8/ER5+MiLiVEQEUD4dGQmIz1IIQJ+Ljj4fHX0hOvpS9+5XevS4BrhjY9+Ii3sb + shAffyc+/nMBawbxoEHfJSR8N3ToV8OGfTVyJMD9OjHx63Hjvpk48dvJk7+dPv3bpKRvZ8/+Ljn5u0WL + vsvI+G7Fiu9Xrfr9mjW/z8//TKG2Kz1cffLzCyd/d/7k5+dPfXH+1N3zp4XwPWNQb9epqnSqcp2qjIWy + RKss1irWaxTZGvlStTxNJV+okqWoZAtUsvlKhHSe0jpGGhoaB3DnzMmZNy9nwYLVCxeuWbRo3ZIlRcuW + laJgEx7eO9ZRsyzYZUsvbwTDOt4XwbHeHufT2N3XArV5YJ0b4TrEQ2cvl0Dg+vbtK5MZnJzm+PpWUIDU + fn4II9b+/pv8/esCAoD11uDgXSEhTWFhh8LDjwJrAB0ZSSifiYoCxGKUAfT57t0vCHEpJuZKM7tvxsW9 + 1avX+7173+nT5/O+fb/q3/87YD106DejRn2TmPjd+PHfTZr0/ZQp3yclfT937g/JyT+kpv6QlvbDsmV/ + yMr6Q17eH9et+2Nx8Z8qKv48Z87WfqMTTt+9ePrLi2fuXTx779K5ry6dw8d7l1a+k6M5bqve0gw0sN4o + YF2sVa7XKrI0iuVqebpavlgtX6SWp6o54t28JQkJUxYsyEtJWZ2aum7x4oL09OJly8oyMytzcjbl5TWs + WbN1/PhkB7k80cu+LMZja2/vRghIvO/mWJ+6aJ9NkT61Ed51EV4WKBPPD3QKs1fBe6LkiCsDsAUIe7O6 + ddPY2g7z9t4gkNqItcFQbTDU+PvXAmsBaMTmoCBsN8J4NYasj0REYAL4ZFTU6agoBnR0NIhMwVDmQMfE + XBSCwd2jx9WePV/t2fNGXNybvXq927v3R/Hxn/Xt+yUEZMiQ70aM+H7MmN9PmvT7qVN/mD37D8nJf1i0 + 6A/p6X9YseKPq1b9ce3aPxUV/bm8/M81NX/ZuvWvcXFTM6vzzn11+dzXl89/c+WCEOfx+deX+10bpNlv + q26wVdfYqiuFqNAhGKnXEtAaxZLmSDMiLpui6iaXgM6LFm1ISyvMyACLy1asqMrJqc3P37x27bYNG3YV + Fu4tKWnKzq4eMmRiuJ0m2c+lJsq7KpxFZbhXVZhnTTjCw2KUt529Uo6dWLiAYN26dfBGeXl52DqABT02 + NlapjHB1XejnVyEwutJgqALW/v41AQG1SOcCA+uDggD0luDgrRivDgvbFx5+MAJTTlEnoqIwdn0mOpqw + BpEpiM6PohlxaDcQf6Vnz+uxsa8T4vHxH/Xp8zsQfMAAsPv7xEQGd1LSD/PmMaxB5+xsBnRJyZ8rK/9S + X/+X7OxzIT2iD394kqH8tRFlwnr/l4fczntpdtmq6wSgq4RgWNuqSnTKfK0yS6NcoVFkCJEuhAC6tJ8y + IiJ+yZJCsHjp0tLlyyuys2tyc+vXrGksKNhVXNwEy1NRcTQr68j06QcHDTro45Np9ZJ0gK0uP8CtItSj + MswY1QAah0+jxF5SUoKkABuyUWsH4nig8oCvjx8/3sbG3t5+lK9vgcEAoCv9/QF0dUBATWDgpsDAuqAg + hrUANAJ7jXaGhzdFRByKjDwWFXUyOvp09+5nu3c/J0SbcAP6lhxniDdz/B1wvE8fcPweJCUhgRF88uQf + Zs78YcECRm3AvW7dn0pL/zxwYPqcnNSz9y6fbcloAD3r9jzNcTt1o6261lZdLYSANRPrQp1yFYDWKldo + lUspHiFuY5CPGjVLYHF5ZiaIvCk/v2Ht2u1r1uxJT98/bdqhhIQjcXHQzCPQz6CgnXh/Ayi1ephBqpjv + 4VgR6l4Z5l4Rxj5aoFuBB7IAGFI8UDLHo1R4AH080OyAZ1KrI9zdU/z9qwICgDKLwMBaYB0cXBccXB8c + DKyxJRQbQ4E19tMR3Aejoo4JOwrM4TalthnNoSqXoSrNNIeO3xbR/B7RHKBPmcIkZfLk11y8DXWXdp36 + 4vLpu5dPf3n5DEf86yshlyM0TbbqzWZAY0lcr1PmCkAv1yqXiWKpVj5dba2QYd1LTy9PTq6aPr1m9Oja + gQMb4uK2R0TshgsIDt4bHIxPYMDgC7YAZSiq8KYvd3CYpewiGemgA8oUFih04UFtDtTg6SPKxPwjfRE7 + 5aVSWweHoXp9PvJjRFBQrRAM65CQ+pCQhpCQLeB1M9bbw8N3RkTsw6aNyEgmJgLiZ5qp3R7QHHQRzR+B + 3sz0t3v3ZnalT58vIC8eHtmJ82Ye+eTy0U8uH/v08rHPLh//3eUTn18++fnllW+tVhy1l222lVXp5BU6 + eTkLBT6WaeWFWtkqrSxLK1uulWVopOksJEs0Nmka68Uayx4KR8f+4eFFwcElKMLo9RRMQiGewBRLFMlm + UJAx8BUoKv4Wb31395UyWVxPtTrH4MKAJkCpjYTqO/WNxA0O9DhQLMYDDRH09NRqfze3aYGBlUFBNcHB + QJkHgxuHUmBbuUDtrbR9MSxsB3YiRUbuj4o6gs0yLeFuRbXNdbxV3Js1HavoaxERRzT27sUH6w99fOHQ + xxcPs7hkjDuXIk73e7lR93K59uUi7csF2pcLtd0KWLy8Vts1R2uZobFM01imaCwXaLokq0WhesFBYms7 + 1dMz29MzR4g8b+/Vvr4b/PxK/PzKBfEE0IB4e3DwjuDgncJHRCOoHRCAbAMmbaNGM8pPIk/xdLQAxOjR + oTuHBgd1N9DXQOmduhhUfcdHPPBH1IuxYKIXZWfX09s7NTi4VohNISFAmYJRW8DaqCTNcBPBm0DwqKij + 0dE/huBtraXOzvOHzZh06KNzhz46b4yPzx8SouB2jeKAc9catWWx2nKD2nK92nIdiy5rVV1yVZ2XKTun + KTsvVHaeT6Hg8VKC7De/sXJ1XeLmlu7uvtTDY4WXV463d76Pz3o/vzKDoSIgYFNQUCPwhXSEhu4NDd0H + LyB8Ar+7A38lsBtpR6WDwwxbS4kFhxjdIzSNgCaqX2hVoOKOB4rCqLijmk6ld3wFVTT8LfbVKhS2Tk6D + 9PqVBHdICOBuC3EId6MI8d0C4ocEBWcL5pNKihhx/J5qO7eCphoBaNOIO5NguU1luVFpWaC03KC0XK+0 + XMeiy2pFlyxF5zR551R55wXyzvNN47cBErm8t6vr4magMz09V/n4rNHrCyHBgm5sDgnZLvja/UgjhEzi + oOBxD4SF7YUHE6iNbKMK7wAXl/kW0ARiMTiLvgaaGgAU5XZsJEehHWctUZUdH1Eaxh9Rhkc9Hi8AKL9w + 4UKVyg379A2G3GZ2c9BNCE56wuGGpIDjTFJEiD+xiANxR8c5I2dNaRXl6nd2aA66WW5SWZYIQDejbLlW + 2SVX0WWZAPTCVlDuNFn2G5mVnd1UV9c0N7cMd/flHh5ZXl6gM3SjFCSFr8VRYSEh2HS8PzwcECOBOCrE + EQFosBu8xmZvSHmZXr/e1zfPAj06CAK6R+ApaAuIgS9gxXZ91NdRREdlHYVgPPAJvoKvA3eATohDweHB + 1WovV9fRBkNecDCEm+KJEN8lUhWu4/CFrbtvzmjQyt7dp/RIQ6tADzyX2HWH2rJCaVloRudsReclAp1T + WgH6xZ5SK6tQV9dFkA7ohrv7CtBZEOgCyC7WOqyBorzhCLwsIBbiYHg4BASqjVSuKjAQT4agF+j1ay1A + TGgFNAH6gI4RWkGAEvjiyEGU1ansiwf2KeJzlNhRbifEUZkEwUF8/EOsojNmzFCrvV1cRvv5rRLB/XjE + xaqClTMiYq+I5iZSbrp42tlNmbhoTqsob3p3l+6Qh2WdyrK0NTovb5POkJH/dbTWaEY268YyDw/SjbV6 + fZGgzkgdIIa7YGHJxQr47qXdxyigC34X2gITDJGBYwHQaywgF2jQEZGBHSBGCwMQA1wU0XFuBNV56YGt + iii0A3HADY5zuMFuiAlmMwS43Z2d4QJXtITbSPOWUt7WysmEpSXoWD/FTGfpD97FvmHhdZd2t0nnnW3Q + OUfROV3eeVHrdH5poMzS0pfo7OYGOkM3sr288oRlEKgxv4G8AdmZkKBBplGBoMUfNMfXG/BuhiULDMRL + UubvXwygDYb1FlBkwAQpQEcOVAWCBDFgxSG92GqLkzqwWQ4PfIJNitjoDPTxBHCc2I0+HsQErxNeLXw3 + rK6Y0cKpQU5O/by9F7YGtxh0cyk3sSvkESHokBe4ctJ0hrtKNWT+6qWtolzxdiNT51bpnKfosqKZzsmt + 6MYLPjYKRX+Bzmnu7rAcAHolLIePT75ev87PD4thCRAEjhAHwd1SDkG/CP4IYakKCsLfliOasS60wHsf + igywwFAoAxpCwBEQA1bsjsNmROxppgd2JeKPhDjgxgHgeDL+CTp4eB/gdYLsQHwg3NB6eBiUqHAHoJ1d + FI7WCwhY3zbiTF5EjgU/tynTW66iDHcXl+QeQwbsf+/UwY/O8jj00VkhzsWdGdJ1h6pLeWvq3D6dR0h/ + 06UbDBl8Av4LF5cUV9dUN7fFHh7pXl7LvL1z9PrVYCgEQcAaq2J1UFC16FfD5ywErPG3DO6AgI0BAaUW + ICMUAHJBB6CAyKAt7ffEnnHaXosHPqEHhxtPQ9+IxARSA00nJcGbg4QbioQFFlUq9Jwg3zhdz8cnrV24 + 25SXZm9utOf4PRVah5zNGw5+dMY8Vr9RotjvaFmr6FIq77JB3mWdMTqvkXfOlXdeIe+UJuuUKuuULOs0 + n0LaaZ4xfhtoJZFEODpOc3Sc4eQ0E1M+gNvNbaGHxxJPz+Xe3lnwD35+a/39gXWxgHU5yAtYBXy5EeBY + G6kNrNlB3VAA6AAgoyN9QGQ6w5GfDEa3yeNBl7rir/AEHGWHJ4P7eG24kuBtgTcHpgPICEK4CW4k8dAT + TN7a2oa7uY3388vuAOKtuheWE2m1w8fMn3bwo9OtRtiJWMut8i7lsi6Fsi7rZV3WybqsZdF5taxzlqzT + EmmnRdJOCx6By1F+aYzkN9Zd8c0dHKYAaycnYD3bxWWum9sCD4/Fnp5LvbzQD1mFlc1g2CAAvVEAmlAW + A42f3JTaFkAZlIQOkFzQxmWCGMjy+0TooEo6NZ+wBt9JSaDjXEloneTCbQI3TCQqghhKQrJjbx/j7j7F + zKJwUrT5iZtbSmBMdP2VXQc/PG0eC64ttdqntqyRdymWddkgRlnaeZW083Jpp8WSTgslneZLOs0zjRdC + ullbB9nbT3RwmERYOzsnCUCnuLszoMFovR6MXtesHgDanM7in9xIbb0+2wIo05lrXC7MUeZnihHWYmq3 + qiQk3CZwU3qJhAhuErk+2gu46xiI29lFg+M44bAjHMdvaC3TZJSvahVlfNHjSIDlZlmXMlmXgpZ0zpN2 + zpR2SpN0SpV0WtAKyi+Ns/mN1FKtHmxvP8HeHkBPBaOdnWdhhMrdHdIBjV7h40MaDToXQXYFOqPmY6Ib + j4DGL4VfDasUfk0LLsomckEUbvUKTBO4QW2uJHjBuAsUww0xIe3GUglngjwethJVFOSlQByHi0JVtNpA + 6LiX1zx//7VtgY739ai5k9tCediF8V13yy2rBNEQ0zlfoPOydukc2s3KKtDODihPcHCYLEgH6DwHuuHu + vkigc6avby4EWqAz6Qan8yPdwA+PXwG/CH4d/FKYrscRNaj1s7uyxKIslot2Tsc0wZouiYaS4FuRC2wV + bloq4UzICCJLgnyD4Mj+UcZCtwHniGJkQKm0h5S7uIzw9p7v77+Ggw5yhfWKbUs0NtwqVx9wtqyXdSlt + Sec1ss650s4rm1Fulc5jTOg8RaDzTIHOKVgJvbyWC3TOhyM2GDidjUDjh8SPih8YPzZ++J49e6LMiRlw + XnNG5c4Ca5r4oJSO317NVVusJO3AzXMcZJ4wlPDdWC1JT4jgUHAqEMKJo3WJoyHhDhUKtVYbAEvu6DhM + Y++YXb+2LTqHnOhhuU3WpcJsDQSds6WdMiSdFkk6pbQiGhDrF4KgzsEiOkM3QOfZrq7JAp0zBDqv8vMz + LoN+fvleXgvd3CY6OfXFj4cfEuOZeF/C0aJVIq48I4mj4qjxhk6Tpa+DJ73iaa3CTcJtwm6YbloqYQTJ + d1PNhAhO/gQKLkYcpS5UxtFUmzNnjqur64wVM5rea2p6/8D+9w/t/+DIgQ+OHfjg+IEPTx788NSEy0ld + 9yosq2VdSgTRgNkwOg0pozNfA5NbAfrFkda/sbLUaoc2qzOWwelEZ1oG3d3nubhMdXFJtLcfoNNFqVRe + crk6NDQUG0Rw9wg6UKjU85o+IUvg0o4QKu6zy31/NMriRbKtdZLDDdMNb0NGEL6br5ac4FzBxYhDVcBx + ZPajZo06/eVpxMkvTh7/3fGjnxw9fOfwwY8O7v9gf8HNQu1+206bLDuVWHZa/3Kntd06r7XqvMYa0SnX + ulOmTaclNp1SbTql2LR0Gvgji//VW1pZGTQatOt6q9U9VCqsXSFyuUEm85JKHW1sVOiZ6vV6cBazGJi4 + hCaAtuJNIXzfDd9uQ+Dy3QtgDLsXnI5na3Xp6zi1O8huyuApzaESFREc7hsKjtwSkgLEOcehKth6FTs4 + dvur289+dfbsPRZn7p15FF+e6XGph6xJZlNnY7XRqltxt5cLXrZcb2m5zrJzfudO2Z1eynjpxdQXf7vg + t7+d+9vfzm4Zc377Qv8X/vul/8b533Z2dnjT+Pj44NRpzDNiqYApgnxhGgAHLeJdhc41+qi074bvCKFq + vnjTDd+3QPtCaLQey74FifK/jnL77ObOhHw3pTmAG3qC0gohjmTHHHHonV+IX/H+4nNfnUMwrHkIoE+5 + OUV5QqnYoZBvksur5PIKubxcLt8ol5XKZEUy2RqZNEsqXSGVLpVK01lI0iWPIk3SzdANO++wRQyYTp8+ + HasxZAo7uoAvzqCCI8LwBVZpnNiDFjY6q4AY/CVNIM6KkaXmFAeXdoTQvgWLp4tyO3CTM4ER5AUTXqIi + xLmkcMTxU9o72WdWZZ7/5vz5r1mc+/ocCwF0xLr317mecVXuUSoaFIoahaJS8QjoEplsvUyaI2VALzei + TFjzsB5kDU2AzkKaADEK6xgLhhvDvjwcZA+UUT8AyhAKEBkvOUFM221Qx8eDOEttP9AWyOLBN4XQdhDa + tMCAfiJ9eKInmyyVPKuk1RKGh0pUIDgUnEsKIQ7tBgTJ+ckXvr3A4psLDG4KAfQjXx4JuRSiOqhSNiqV + tUpltRJAKyoUinKFvEwuL5SzMdFsmQzN6GUyWYZpSGdJu7l1g+xiCylYDIhxSCC2GWCvGBp1sD18RymI + jCWOeqoELpDF4sF3MdHmJdCWGn6wUgQub1EhjbB4IuB+3JM53CZZJSc4LZgkKRzxJUuWTEubdvG7iyy+ + ZWFEXAAdMfDVgZrjGvVOtapepapRKauUykqlskKp2KhQlCgU6xTyHLkcB1wvl8uXymVLZcZoRhzj5bRl + BkKBB9py+B9xoQOWBIgyJzKGA+hEf0AMfEFbUgMsHli0+RYm8V4bWCkYKr4XBBs+8B79OYBuS0/EZROS + FI442ISpfUw3G+8++O6SEfFm0JNuJ9metdXs0ai3qNW1anWNWlWlUlWqVBUqZZlSWaBU5CkUOQrsVZEv + k7NY2iKk46RWaivIBSgMOYb/hSLDqGEWDpt5se5hlghagc4RenXUsyZ8wVkiLFZs2sKEeg7WcCAL2tIu + G6w0BC5tAcEKhPfozwo0Id4qwXmhCojjl0yYlLDvzX2Xv7+MwA0TxqALJ767lPNhjvt5d+1+raZRgz0p + BLS6igWAVhWrVGtVylylMtu4RUWxTCEObA2SBEhQvIVKAF+wGBDjPEC8urhgBNYCE0XQCjpcHhBDc0Fe + 4EtqQLCKNy/xziqqzXxnDcCFs4KdxQoEVfwFgG6V4Dy9xG/Yf3R/mLlH16YIcHPQ6z6vC7gSoDuk0+7Q + ahuECf4ajaaahbpCrS5Tqzeo2eaUHJUqU4W9QCyWtwhpfynmNwEuljvgCxYDYtIKWAuky5BjugqLGta4 + BAr4AlwsGyAssRWulGAlziIXI2SxqgNZAhfOCnYWaz5U8ZcE2hxxqGGf4X02X9x85fdXECa31OCPuFis + +7Xutidsdbt02q04mlyr3aTV1rDQVGk05RpNkUa9Wq3OVauyVaoVrYRiskLiIIFiQIhhKiAU5N7wNoJB + puO3YdGolQqIIbggL/BFMRLgcimgrUq0QwmwIhfjyGKlAbhYdagLiDUfqvhMAE2Ig0fxQ+Prz9cTyiZB + oA+4McDutJ3tXltdo07XoNPV6XSbdLpaHcO6Qqsp0ajXqtX5avUqtTpLrV5pGrgcQRYiwxWbwBcPCAXq + ahjqhFYQkfmtvRAKYjHaRsCXdJakgGNKe5MIVjGyWGkIXOr/UaPqWQEaKRa4XH+h3uRSKzHco2+Ntjtn + Z7vfVre9BcrsVrwqrbZMi0sINas1mlx2rYcms0WoMxnoiv4KXFWP0WQ8CGJoBYgMg8zvgqSZABq7gETQ + QABJAYeVeta8bd0qsrwLiDUfj2cCaPyqAxIHMMUQXdBm8vmUt6bggmm7A3bsYjzcyEv3eQvXAelwNz3u + PS7U4qJYdnlKjinKBLpqokpmJ4NBhhYTxERkcm90WS8UGXaCrleCZwCLwV+SWoBLOkBsFROWOGuCLK8g + Ue79ywONX3vo5KHY1toOynPemeNy0cXukIAyruOlO6Y5yhU6dhFQG9fx0qVAmgUaub8cw8eAGMPgdKoN + Fl66XoyjDMcGl0aXWEF/6apv4Esle6onizGlzjVxltqqdBMaL2w8uoflx+UgT+Vf4RfAijRmzpimt5ra + QRk31LM7vHHjMS4QM0e5UqfDxfQ4dIWutso2vRiPgFbEKrAxBxBTyYJmaOmiTaQhMHDIlfkFmjQQAKGg + 244JYg5o+7C2lWn/YozG8oJMYUbGjOOfHG8H5UXvLzJFGaJBXMa9VlU6div9OiYarV5MTyirhqpkMhkd + z0SFITqHhW7ZBMpI8OiOXs5loEytaroTQVxJpjzgSWtEvwzQWNCd3Z1T16a2AzH+Cih7XvK0OyLisjnK + uIWXRMPsVnpCWT1ZLXeWwyzzCjKhzC8kFOuy+Nq7p3tv5i8ANFxqUFRQbl1u+ygbFQMo427HRkGXmxdA + I5fLhCt425fmeRqFQYE6Bj8iC4pBKCOxRlUIlSCYZX69MQwcv3KaFjfxXSr/imD+rEDjDYi1qO/IvhVH + K9pHGavfI8VoiTLuHmSKsVGnK3jcApihUUYrUWvmKNPqRzfkofyG2gX8MooVqFGIL+ymCyc6crNgx6H/ + +YBGZoU678SUiftu7Wsf5alvTWUeQ7z6cTMHlAUzxy7fJS6bXQvL7x5U9WG30vN9UKjD0fV4VIcjaTa5 + QZruqnm6okEvxs8ENOoG+iB9RnEGsrv2UU68lYhbpJmT4x7jR6GsHqqWqWTIrcXSDJtBtx+jPI/EBEWi + Vi8UfLqi8TMBDclDsot8ZOPhje1DfPK7kwNfH4hL0Y1ZCTm5tlBu9Z7S5ns01WPUckfjAgigycyJpRnV + ZKR/dMcuakPI/R57RWbHVaLVZ/60jMbbE+5iTuYcHErSPsoNdxtirsfYn7G32y/KSpo9BtNlsWK0a5nV + U9UKDwVKoOIF0ESa4ZpNbo1GyeInEg0jozeWrPgpIjc7efDAnlF9I3Lqs059caL9WHY73eu0h3y/RLZF + Iq21kVbYSMttpGU20lIWkmJrSYG1ZJ21ZJW1zUorm+VWNkutbJZY2aS1ElYTXu7q2jkmJjhxVP8xo/uP + HTNw/NhBkyYMmTxx6PSpw2cljZ47e1zK/ImLFk7NWDJjxdLZOZnz81ctWJOfumFtWuGG9OKCjJLCpaVF + y8qKlz9dWH4SRqN04Kn3nJc977FEBs1hMHARut1RO7s9drbbzOoYlJXw1a9dLmtg5oIU6JtwLvMFEBkg + STNcM6SZbpunSVq6Q+xpXczdlsJYiF+38tKVFBVlmc2RVbkRkY2oKkfkVFXkVFesQtRU5hqjKq+WRf6m + 6vz0tKTY2LD+iX037F53+u5J0/jy5GlRHPr8QN8r8aoTCvkumbxBKq+Vyiul8gqpvFwq38hCViqRFUlk + 6yWyPIk0SyJdKZEul0gzJNJ0iYwi41FIZ9lY+XfrFdd97pwp8+ZOnT9vekpyUurCWUvS5i7NWJC5YlFu + TvraNSuLCnPLy9bWVhdu2bxxx7aqvbvrDjRtPXJox/Fju0+e2HvmVNPZMwfPnz148fzhi+ePXLpw9NLF + o5cvHrt86fiVyyeuIq6cfOXKqWtXT1975fSrr5x59drZ66+ee+3V869dP3/jtQuvv3bx9RuXbt649Mbr + l9+4eeXWzau33rj65q1X3rx17akxGnVbdCti+sdk1WShkdq+IuNvSz4twcl3rYgyrxbxDJtnJW07Oc0i + jTJKidFCbuawAPI8m3ITLICYZeWuGQUNFD9NpPlppSfmvH4KjF6dt3jk8L4efm4zV8zYcWNbK0Tm1G6m + 8+QbE51POcqbpPJGqWyTVFbdTGTO5RKJrFAiWyeR5tpIs2yMXE5nXKYQM1o6z8YqpFt0dNjc2ZPnzgad + pyXPn7FwQVLaojnpS5JXLFuYk52Wn7e8YENWaXF+VcX6+k0ljVvKd++s3ben/tCBxqOHd5zgdD594NzZ + gxfOHXq2GI3KAIqc3v7eM5fP3HZt22NZjCds+3Jbvxv97C/YM6eM3NpMlJnBAJdR+URNjqpFdBG66Ap0 + 8eeaxRpld2ViYiIKRtwyk5nDUsEzQLIZdDW0uKDBy0YdnFf+0SbvRzI6JzN5xLA+Tu4O4+aPqTi+sT0W + i5R61s0kjzNuigMy+TaprE4iq5bIKqSycqlMUGQWZVJZsURWIJGtlkizBS6vsJEus+FENmG0dC7jclRk + 8OxZk+bMngJ1ZtK8YMaiVEjzvGUZKVmZi/Nyl65fu7K4MLdi45oaSHND2XYmzZv279t8+OC2Y0d2gs6n + Tuw9fbrp7On9UOfz5w49E4xGCQb9Y/9Q/9krZ2+9vLUjLMZzYJNBZIcLDkisje5iS8t8hJc9YTCoit9u + 5ZPV8lOYLmMqmbgsTkyomkGTAlQCFduMnzo3aT1h6aDrKFyfMWPaqKjIwKDuAbOzZjZcrjt990RzmLmL + ln5j/GtjmSLvFxTZSGSJrFwi2yiRgcIIGAyIMgzGOoksFwYDomwjXW4jXQouUzxSZ+PnM2ysDC/HxITP + njmJ6Dx/7rQFydMXpsyENC+DzViZuio7fe3qFQUbsjeW5ldXbmioK27cUrFrB5Pmg/u3HD28/diRHSeP + MzrDbJw53XTuzIFfktFwnWjLOzg5oOGUvzn/1O9OdZDFeNqqj1cxa3GupSKLE2uU8MWivL5ZlNvulbAS + 80w1/DLmP8UegyYQicuoGVEDED88SqCUZ9MWP7HNoCpoxzc5/GiBZkWlthi9LGMmkqugAO/AKP9p6ZPL + jpacuntCHO0zuviDwthLPdTHlfI9UvlWWAuJrAqK3ExkxmUWUu6UTUWZc9mU0ZKx1t3cu8bHx8xMmgg6 + CzZjyoL501JTZi5eNDsjff6K5bAZS1bnL92wDjYjr7JiXd2mIrjmndur9uzadKBpi+A0th8/ugt0Pn1y + 7+mT+6DOZ8/s/1kZjbIhjASELzg6eOqiqUX7is7dO9dxCuOZu+/tHnVrFOuMHLeza2ouXFDfWtS6NhIZ + Hb/S5soysr68NhslxnbJGFbHwEyiCZfhMUy4TOV8cBmFZrLMtF1V3J36ebj8qNaRnTkPdYD43pGeHk4B + EX5j5yXmbVl14L0mY4GiJZE5qc0Zvf3TxpHXhkOOma/YLpU1SGQ1ElmliMgCixmRS2ykxTbSDRLpmpbu + 4pEot8Jom35WL6sthyb0nZk0YdbMiZDmuXMmJ8+btjBlBuPyknkrl6dkZy7Oz1u6fl1mSdGqCiED3Fxf + ur2xctfO2qa9kGYkgdtgnI8f3XnqxB7EmVP7WDb4MzAaG+G8A7wTJiakFaRtOrvpsfXiVtm976t9E29P + 1F/R258SipwoJcMgi31Fc773qKla1ly8f5xTZgYjQ4MqPurLaP2J6xiU+5FfpoFPGpUz4bJ5p/Xn5LKR + 0ShKNL2zt73qWruMLv+wbNDVAc4nHeUHpPIdEsbi2pYsbpZjI5GLQGQb6RobidgmZ5jwt8UfJdNtrIJe + Dgk2TJ44UuDyhDmzJs1jXJ66cMGMxang8twVy4jLGetgmYtyysvW1FRtaGAZYAWkudk1MzrDaZw4xtUZ + fuPnYvQT6a/4yWvurMEkHOvsQYtRRG6XxS0UmbpQHSAy9bDRXeV9P9qog9YfmlLULqHcD2OfdPBIq1zm + lbmnuDPqSR2IxWOLxSZmY+cn26e+Ntn/nJ/imEy2RyLbKpHV2chqbJgWkzWmaJZjRmTIMYi83ka6GkS2 + lmRaS1bYSJDvtUtk2GdriLLWckD/2KTp45JmjDNyee7k5PnTUMpYnDqLcXlpSnZWM5cLczaWrq6pQjWj + eOuWjTsaK3fvYtJ86MCWwwfhNIx0BqOhzoLfeCYZnXcnb/Drg70ve9ufZr6YJXjbhdEhOApujUVabJRj + dEaocEEDGLAW7dYujBNcyPpilZh64aJMNz3x7TqoL2NsATU5dLJpyIgfPCI+EuNZ4LJRox/L6Px3cofg + 4uDT7vKjUkbhRom0zgZ9EFmljazcRrZRiDJESxaTryiwka61kebZMBavBJGtJcusJRnWkiU2CCnCmPi1 + +MRmlFU3z67RkcFTpyQmTR9r5PLsifPAZaPHmJWRPo/pctai/NwMoZSRXV4GLq+rqy3aygrNlbt31jTt + qT/QtBl0PnKIjDMzG/DOQjb4bDD67PdnV99ZDTscdDWIVdqOiVTYnMItWfxIjuErULXAVByfC2hjmIhX + 45i7GKiSO8gxKM6dsliUMfhCBoPa2Kgv8zO36DQoyv3Mp7medILrSSX4sc9vodElHxRNuzEl+kKE00kH + +ZFm/tbbSGtspFXNrbyNQjePUViI0uZPwOhSQY4LBTnO53JsLVluLVkKFoujFUbbjLPq5vdycLDfmMQh + 06clzpg2ZibT5fFzZk+aP2fKgmTkfklLFs9emj5v5YqFq7IXr85D7reiuHBV+cbV1UyXwWVY5gpwed+e + uv376g8yOsNpNB47wsoaJ46hUMf8xi/D6NLPSue+Mxf+IeBqABtAPmHH9HefkNHBC7fKX1C4LRaj9lbc + XEemTA+l5DYmPFsQebAKE3I4DoiILN4GTFkfPwiRzpokg4EJI5oVpzO3zI93eer7gh/L3DZ7hvIjEtle + iQwWGB1oIm+liLzN/CUWG0NoTjMu45MSa6MWrxO02GgqmlmcbkJk/sdHjLZJtOqm7xoY4DtqxMBpU0eD + y9DlmUnj5syaICR+U1MWTF+cOnNJ2pzlS5MzVy5clZO2Jn9ZwXoh99uYX1Np5PK2reW7djDL3LQXbcDN + B/dvPnKwUcgDt5E6/8KMboW5VJEwD2FYlgfrg5CjQLEC1pi0uMMspoIy8j25vZxu2jMnMp2bio4fnDLt + QaODEDErjh42JvKpiEGDzOZnbv2km4KflNoWUnC2VdqaUZimLIQyhbW00Fq63lq6hs1aMEeBgBCTo2iT + xSJ2p9lYD+z2sotlWKj/2MQhjMhTRwuiPHY2RHkWMxgL5k9NXTgjbREzGCuXL8jOhMFIX7dmeeGGzNJi + tEuYX26oK9raAF1GAxBcRqGZChponWxFHGV0hjob/cYvzehWyWuuwtQBIQrDTnAh5o6i7baeSbsPyZ4y + XIlzGrCZ0sRa8Hs6OZFRvuDnpvKDECHKHTnZ7ElJ95M+36KF+BKLibnNwQaFiqwlhcKs0GprSY6VJFMI + mGKyEx2hsGA5bCZZdQvv2lXSJS42YsrkkVOnjAKXZ0CUZ4ydNWPc7JkT5s2ZlDx/SmrK9EWpM9MhysuS + s1YszGWinCEYDCR+uVUVa2pr0C4hj1G+i1WZqwUuQ5oZnck4M+/8jDLaXIJpsqKc5XVsGJmrMA3LdsBO + PPIV8wQ5dpJjjx/2nXE5Fp/HDmtBh4XTSdbiA4DF56a2L8rPlC6L3yIWLfhbYmMkL8265VvbrLKyybRi + E28rrCTLrSTLrCQZVpJ0K0maVUtf3Ja7sLaZYWXV8+Wutl1CQvxGjOg3ZRKIPHLalFHTp41OEpwyRHnu + nInJ8yYvTJ62aGFSetrs5UvhlBesyl6Un7dk3ZplgijnlDODgcSvYHN9UeOWsh3b4DGQ/lVDmpv2om+C + JLDh4P4GoazBvPOzx2gSX05eWAjoL/XueGmC7PDj8joTLcYknKqfSu4mx5k52N1HLBZfTs0PGUGyh8E4 + nNDAt7fTSdacyFS+MDk39amcBvWT6nILRkvWW0tgHvKsbXIE5grkZRObNLSZYWWTbhzaZCwWR4tMrwWj + rSd06xbVtaumS1Cgb8KQ3pMnDp8yacTUySOng8hTE2dMF9zFrPHzQOT5UxYumLYoFUSetSxjbubylJys + 1PzctLVrlhasX1lSlFVemltZsXpTNfp+BVvq0cZmXN65vRK6TNK8fy+SwDpwWVBnJtDPKKONzCXzwMUX + 5H1cOtfq6JB6khpzQ3JbOQ4gRe+8VRajjoyeiPjuBn6xAG2/ph3u/GhaMZFpS6W4e/3MirLJe8WC0ZYz + t5m8rY4et8Nom9lWVv1e7urVxdnZLjoyaPSIAZMmDuNEhiLPgCJPHzN75tg5syfMmztxAYicMj0NRF4y + e1mGoMhZC/Ny0tatXrph/fLiwqyykpxKiHLV2k01MMuFWxtKtm0t29EILqOUYbQZjM776g7sgzrDbDz7 + jP5RzOV0xni9qjcTYlzzhGOfOIXpwDJ+wwsdqEUsplsF0BOh00YwRkRHNdA5AuSRyVrw2gUnMlokz075 + 4on03aJV8j6W0dZTunXr1bWrR5cuXTqFhvgNGdxr4rihk8YPnTRh+ORJw6dOHgFrMX3qqBnTR89KGjtn + 1rh5syfOnzt54YKpixZOX7I4KWMJsxZZK5JXZXNFXl5UkFlWgvJFXnXlmtrqdQ0Q5Ybixs3EZUxlVOze + waR5725yzahpYH7uOWJ0G1OarUowjAR2OylDlHItO0cWRxGJUzuiMN0DBSGGL+b3FPF7dOhmddTeMKcs + lmNULWiTOz9HQHwk+/NLZM76DjHaesLLjL9eXSxtOvv6uMX2CBs9sv+EcQkTxidMHJ/A5HjSMLB4+lTG + 4qQZibOSxsyeNW7u7Anz505KSZ6cmjJtySLBIGfMXbl8fnZmSm72otV5S9avzShYj3wPRM6p2Liqqnx1 + bdXa+k0bttQXbt1cBC5vbyQul4PLu3dW7mV0Rq0Z8StitCZVox6rVvVSKXwU6N3ROch0Jif0lySYHyVL + Z0YShfnJcHRyGebsUT5GK4S0GIU3MhWovWHfPckx+Qq0RegogVb3uT+RID6DT27BaOukblbDunaLtoT4 + Wko6u7rahwTr+/aJHjdm0PixgyeMGzxh/JCJExImN1N42hTGYgjxzOlgsaDFcyYkz5uYkjxl0cJpaakz + BHc8e+XyeVkrkemlrs5dvHZ1+vq1S4s2rCgpyiwvBZFzqytW11avrasVRFng8rYt0OXSHY1l4PIu0Hln + 5R7mNKqeb0bDNqgTmPllzFXLHnsOMj+Wk/OX8jqoMHrSRGE6HI4OL+O3QaEVQic/mbCYLiHhN2SYHNjw + DHLzx/1IFg52Gh9v14hwQ98+UYkj+48TNuYZyQv+jgd/h0KCp0waNm3K8GmCl0gChWckwhRjz968OeMF + CjNHsThVcBTpM5cvnQMWZzMWL1ydu2hNfpogx8tLCleWFWdtLMUeL1iLfIHI6xs2wSkXbG2AWS4Gl7c3 + Mi7v2FYGLu/aAacB4/yrYDTqZ3RrJD9hml8fyU/rFZ+DTMee0smcdLghnRxJKswpzIUYvhiVCjpci6wx + v0pH7I75nPLzkuk9Ka8tJowfPHH8EOwtncTEd+iUiYy8UyeDvIL+TgN/Rwn8HTNn1th5c8Ylz5uwYB55 + ialpqdPSF88AhSHEK5bNzVo5PydrQW7OwvzcxWtWp61fk1G4fllxIeR45cYSzF3AV+TVVEKR19TVMFHe + XLdhM0S5obBxC7jM6Exc3rkNTmPjr43RyNmgth0/B5mOPcXEJvEXNTY6fw9NPK7CmK+gAw35hVt0vhY5 + Cn6Vzq+exS2qd9OnjpgxDTFyJk53T0Iilzhn1pi5s8fOI/1ldYlJCxeAv1PSFk1bsnh6+pKkZemzViyd + k8m8xLycrORVoPCq1DV5oPCSDesyCjcsLSpYXlIMFqP2BjnGNlu2r7a2ajWIXF+7rn7TenB5S4Ogy8xj + FG/bWrKdhVGdf52Mhtt9onOQUSNGUQKHPNH5kSTBZCT4EXzioyLFQvxrdRQd0WuL+XNhG8YvmD8hJXli + 6oJJixZOXrywmbxpM5amz1q+dNaKZbMzl8/NBn8zwd+UvFXMS6xlKpy2YW16wXr44mXFBStKicVljMVV + bL84FDlvUzWqyWvqa9fCXWyuY1zeXL9B4HJhI9I/Uud/B0Y/6TnI4qN66QhJOj+S38knVuF/Zwqb1qOX + LpmxLCNpecbMFUtnrVyGLA7iK5AX4pu9IDc7JT934eq81LX5i9atXiyo8BLsOSzasLSkcHlpEXzxyo2l + WRVliBx29kF5bjVOPYAiV+fX1cBdMC4jiMtb6hGoyZE6/5sx+knPQRbrr9hF8A7ev5WX6Ig6G+ejcVRM + Xk5y3qoFOIhlde7CNXnwD6kCeaG/TIKJv0UFy0qLQOEVZezEGpzpgQM9wGLhHA/j8R3GUzuMXK41crlh + E4oYsMz/9oymW3s7fg6yybGn4gNPO/7y/hs+02I9o21awboliML16UUbMoqEc4WEYCzG6UJMiEvoWJqs + io1ZghYbz6FhR9GITqBhHqMGfnlN3X8YbXICzZOeg/yLj84/p+8Gi+KCpQiisEBeFtgg3ny+Eh2uxHxF + R85U+g+j2zxTqa3jpX+tVbRf6g1hwSksYvGPPyXsP4z+yU8J+6WY8rz8vz/yTKW2zr37D6P/w+hfmPr/ + YfTPdbrBL/xC/9v89/9h9H8Y/esi+38Y/R9G/7oY/f8DPTxUq2GibSkAAAAASUVORK5CYII= + + + + 3, 3 + + + 131, 259 + + + StretchImage + + + 12 + + + logoPictureBox + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel + + + 0 + + + Fill + + + 143, 0 + + + 6, 0, 3, 0 + + + 271, 17 + + + 19 + + + Nombre de producto + + + MiddleLeft + + + labelProductName + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel + + + 1 + + + Fill + + + 143, 26 + + + 6, 0, 3, 0 + + + 271, 17 + + + 0 + + + Versión + + + MiddleLeft + + + labelVersion + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel + + + 2 + + + Fill + + + 143, 52 + + + 6, 0, 3, 0 + + + 271, 17 + + + 21 + + + Urheberrecht + + + MiddleLeft + + + labelCopyright + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel + + + 3 + + + Fill + + + 143, 78 + + + 6, 0, 3, 0 + + + 271, 17 + + + 22 + + + Nombre De La compañía + + + MiddleLeft + + + labelCompanyName + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel + + + 4 + + + Fill + + + 143, 107 + + + 6, 3, 3, 3 + + + True + + + Both + + + 271, 126 + + + 23 + + + Descripción + + + textBoxDescription + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel + + + 5 + + + Bottom, Right + + + 339, 239 + + + 75, 23 + + + 24 + + + & Akzeptieren + + + okButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel + + + 6 + + + Fill + + + 9, 9 + + + 6 + + + 417, 265 + + + 0 + + + tableLayoutPanel + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="logoPictureBox" Row="0" RowSpan="6" Column="0" ColumnSpan="1" /><Control Name="labelProductName" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelVersion" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelCopyright" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelCompanyName" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="textBoxDescription" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="okButton" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,33,Percent,67" /><Rows Styles="Percent,10,Percent,10,Percent,10,Percent,10,Percent,50,Percent,10" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 435, 283 + + + 9, 9, 9, 9 + + + CenterParent + + + AboutBox + + + AboutBoxForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/AboutBoxForm.es.resx b/client/administration/UdsAdmin/forms/AboutBoxForm.es.resx new file mode 100644 index 000000000..f00774b21 --- /dev/null +++ b/client/administration/UdsAdmin/forms/AboutBoxForm.es.resx @@ -0,0 +1,627 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + iVBORw0KGgoAAAANSUhEUgAAAHgAAAEGCAIAAAAhWcaAAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAcOdJREFUeF7tvQdY + lVe6Pc7z/O69czOJihE4vdF7Oxx6FwXFrtixd+yIKIKNImClSxdQsSv23luMMcaYXkwyiTF1MtW5Mzr/ + /9rfe9h+nAOIGZNoZs7zPjyIR4R11ll7vWXvbSGvkCsqFYoqhbJGqapTqRvU6q1qzXaNbrdOt09ne8jW + 9pit3Uk7uzN29ufs7c8LgU9O29uftLc7Zmd32M5uv53dPjvb3ba2O2xtt9nabrW1bbC1rbfV5mnVo9UK + b0VWVtZrr7325z//+a9//evf/va3//u///v73//+j3/848GDBw8fPvyn8Pj/fu0PCwZ0hUJZqVRVqVTV + KnWNWrNJo6nTaDdrdY063XadbpfOdq+t3UE7uyN2QBb4MpQRpwSsjwtfx982mWG9yda21labq1WPUiu8 + FLm5uW+99daf/vSnv/zlL/fv3/93g9sCKIPRBLS6Ws2ArtFoa7XaOq2uXqdr0NluEUi63dZ2ly2Yy/h7 + yM7uqB2DmEcz1nZ77Gx3ini9yVZXo9NV6zTZGtUwldxVXlxc/Nlnn/0bws2AfoRydTPKtVrdJh2LOh1E + gEnBZluGeGMz4nsFxEFkSAdARwBrvAAkI7vMsK7S6Sp1mqUa1QCV3Fa+ZcuWP/zhD/9WcFsAZWWVkc7g + sqaW0fkRynW2tjw44iA4tJg4zhEHyghAzyUbTyC9Jl4D6wqdrlynnq9WxiiTkpJOnjzJ4f7Va7eFskKp + qlSpq9TQDU21IBqbjEA/gtgEbhPEsQbuFlSlSUCZgi+PeBPg3cCxLtfpNup0xTr1ZLXCX7Fq1ar3339f + DDfWSZOl8texTFooS5XKcoY1Q7lGi9DV6lhs0rUOtDnBSVLA8Z220Ggj4gAd0EOyyYqYYF2m05XqtJla + 1RCV3EHe2Nj4+9//HnBzZ/LrsyUWyrVK1QaVukStLlNrKjTaKq22mmENDrYIMakfS3BICiEOYeHLI16P + umYNAa9LdboSgdpz1cpI5eLFi2/cuAG4//jHP7ZlS55ralsoc5XKPKUqT6Veq9YUaLQlWm2ZlolpJXML + 8GcdQhxiYq7gsB+QFAANi82tSH1LrIt1uiIdHLdqBPMkDQ0N33333Q8//EBwi4X7eXfcFspspSpHpV6l + VuepNas1CO06rW4D4xoTUyCORQxLWU3HOG4CN0QD0gETggDWfHmstWXflniN/6hQpy3QqueplVHKJUuW + 3L59+/vvv+dKYu64n0dqWygzlaoslTpHDaw1uRpNnkabr9WuEQKIFwhvcBHiHeK4GG6Sb8BNwVNHLI9i + rAt02g1aTY5GlaCSO8r37Nnz7bfftqokzym1LVQrVOpMtTpLjZwCv6d2lRa5HMOaw02IFwrsAwc7TnBz + uMFowppbERHWIDX+I+1arXqGWhGkWL169RdffAElIU+C9P25prYA9Eq1JlPDIkujzdGyILjzBLhXNxN8 + rRZYmEjKYwhuot3EbgqOdXWzhkCsNxix1izRKOOVMrns8uXL33zzjTm1n7s6iQVQ5kBrs7TGyBbBbU7w + 9QLcIHizgj8Z3JTvkIZw20d6zbEWtAtFErmLfPv27V999dXzTm0G9CM6c6DpE4K7LYJDT4qeRE9M2A2U + QWrCmmwfXjZgjYURvMa7h7CGjAQqNmzYcO/ePTG1YUier7zGQjlFqU5nWD+iswnc+GP7cLeU78ezG0k5 + FU+AMoU51usfYa1ZpFH2YEb7nXfe+frrr7kh4SXA50JGLIKDg2WOMkWYQjlEqZ6pbg9usZ6YyDdnd0fE + RExtKg3ioznWWBjJ/KzRYvFQDVTJVLILFy6A2jAk8NomK+Qz7kYs6uvrCwsLU1JShg8fHhgYqPBRqOJV + 6klq7dJmvTYheDvsJu1Geg24scTBepvkO22llECZgtIZriEirI2S7STfv3//l19++dzJiMWOHTt27dq1 + W3jAva5Zs2batGk9evRQeCpUvVQo/WhXtIa4OdzN7GPOhKx3R4wgWUBSEgQ+MdFrE6wnsR4CEkg4P6yQ + JCOUsj/jkm1x4MCBgwcPHjp06PDhw/gED1CmqakJNJ85cyZD3FeBIrJ6lpmqcCUxt95rTX13h6hNiD8W + 65ms7FdaWvr5559DRsiNoBplLtnPVAJpgaLwqVOnTgsPfHLixInjx48fPXqUcAfo4PiECRPkWrkyQqke + YyYp7Qg3KQmoLZRNHpPEc+EmrKmsShqCpLHZhBityDy1IkSxdu1aNGval+xnB2uLK8Lj6tWr+Ijs4OLF + i+fPnz979ixwx2vAQYeZRRWiX79+jOBDVJoFIpdi4gLFWeWPoDaJCT62i7VmoQYvfHZ29qeffiqWbHEC + +UwtjxZvvPHGrVu38PHmzZuvv/462tXXr19/5ZVXgDtAxyoP0MF0IH7s2DHQfP369WPGjJG7yVV9Vahw + tkhw2nLcYmqb16dMCrBEbQqOdQmrOrXg9WqtJk2jjFauWLHik08+uXv3LpwfTyC5y352sLZAg+OD5se7 + 77779ttvo1cN6IE7CsSvvvoqQAfTgfi5c+dAc2gLEK+qqsKaKXeSM4syR4AbvO6IanND0k69uy2skcjw + JRefAOt0DbpiS5cuvXPnDl8eeYmVL4/PwkSDxe+aH9A7vA3xE3/88cdA/r333uOgg+mg+bVr10Bzjjg4 + jtV/1qxZDO4+Ks08zSOs26I2GZLmylR7KyRoTnDjE+I1/hV4LcYaRZh8rSaDpTMZGRn4yWl55FZEnD3+ + 4lhbwCThTQdbik/wU0LvQA2AT6B/9NFHAJ2Y/uabb3LEieNQFej45s2b0WmVu8tVg1Saxc1lKROseS2Q + y0ir5q/VPo7AfbacAutinRZJI+c1xzpGuWzZMlAEPzm3ItQ6eEZ4bQFdQ5YFh4SP+BxuCaADeg46mA4R + JJoT4hAWQhxL6KVLl7B4QlJqamomTZqk8FNgOokpidhom5SlKI1EXgM38ljJJuiFWZxHWHNzLQDNeA0N + iVZmZmaCGWKsYfueEawt8LLzB5JaCJwJ6MR0orkYcUg5llDoOCSFCH7mzJmioqKhQ4eiUaKerm4Pa+5G + WpXstnhNfRmhic4q18RrjjXWxghlXl4esOa2jyz2s4C1Bf0QeKCsjs9h++GQAD1+Pg46VA/lBaI5IU6q + goVULCkgOOnJypUrmXAPUKGszErblNGYFbhZ+4ZqrY912URqPrOAdwOKfNxcc6xTNIpgRUFBwYcffvis + YW2B0hc9MHWIR6ugg+lEc0Kcc5x0HJKCuhoafTAqpCfwhUjrp0+fjkYJK5u0jTUWtxbLY/utdzHWlMhw + sSbznq+F41QYFJWVle1gTZ7vZ85lLGg5pgd+AjxaBZ1oLkYcUg6Cw8ASwfGLQcFJTzjcMN1yO7mqvwoa + 2havnwDr5peBKTv0HZMh3IQ0k5phPV2NQs22bdtMsBavjT8/1hYmL6wYdM50Mc2BOFcVLJ5EcHgVWCso + OPTEBG5UUWABlSGCarehIU+MNcSaEnQYPm5CONYYF56gRof3yJEjHGsqifyCWJsCLcbdnOYccUi5mOD4 + NUjBTeAmMYH7RsEETSn1cLVRrM0bkrB9YovdloaISc0NH18YmwWEjWYPV6N+DR17RrBuD2gOequI0+LJ + CU4KTnoihhvaDS+IDBPVEuTuyl5K5rU50OLmb0ewFr0AxsFJmBB0GmlhFJEa/4Wqn2ru3LlYrrnnw09I + eSM11Hlr5mfQ6w4BbY446bgJwcml4Jfh7CbtxlKJZAdVFLjA1NRUGAN1kkBtatOIseZro4kPERs+c6xh + QvjCyLHO1WpWaJTdldhvYI41rz39bFg/GdCEuJjg3KuAI6QnBDeJCbSblkoygrROorwp95Srx6oZ0G1h + Df01adBwrMWqQmJtsjDSi4fvDKwXaFC8hgnBi42cC281rChUeyKsaYfHz5Cg/xigxQQXGxUy4xxuiAng + xi8GZwIjiN8T6ySUBDkO+mfMjSSoHgEt5jVKIuSvxXNobZCaZYxUCeFZjIjUbGPHVLXcWY7+Bv53qj1R + nQ8OivdlfgYT8i8BbUJwricEN5kTciaU6cCWwHQTtdFVGDduHGqteIMbBUQ0G2XMZYQc3ThlaZIudkSs + BVIzrLEwymTQLsIaLzzWEvCA+jJUDPmpsX4KQLcFN18quXBDSZCwgdooDYLayGtmz56t7KlkCaSJWFOO + DvEVak8Ma/O8vH2xpm9IGekqLRbh9PR0LBUQMbze+Enw8osN308t1k8NaA43iQlfKgE3CTcpiQm14f8w + sIHaiCbVDGvUnqgTxqeH28Ha3FmTgDSTGt9fEaCoqKjAC4x3FaRMXOT7GUzIUwZaDLe5koBBUBK8bTm1 + 8V4Gy9AlUYYq1cnqVoYrgTX0ty1SN9dAjGUQ7qzJ7bUktXqKGrsLUEZH+srNNRk+k4Xxp3B7PwnQYmfC + 4SYlwRIEapNqwwOQIcFvjl2IzPbNF7DmY5UAC4YPCyMXa94NaM2EGJ01lZyoDMJJLdRbVINVSFPh67FO + iE3Iz7Aw/lRAmwg3KQlfJLlqkyGhFRLZIytCAWsALRphNU4MVwnjOOLOS1tYk9uj1JwEpFmpNcs1ynAl + /CVWY25C+MJIhcyfSKx/WqBbVRKu2mIZQfIGq8uwBq+hIWJSk1hzARF3FM2xFvcHuICQUgukxtQk3B4G + V9C+wJpssjBysX7q5b2fA2ixknBqk4xQagMZobwGLMvPz1eGKTHY2KIPSxkjOWtOahMZEZdBqD/A00UR + qdGOwLgEOstInWhhpMq1iVg/dbf3MwHdKrUptSEZQV4Dow2swTJMazAfgsoqLzfD7VGXAAICQPnsB3Vv + ebvLpI6K2h7Vm/iqKJBas0yDtXfdunVInSg7x2rxU2cxPyvQRG1e8oYgimUEvyolNVgeMUGgjFWyYWKO + NXd75ED4/FirWHMBQb1JvCpSCyJHSBft5RjIgr8UZzHkrH8KAfm5gW5LRiiHxLrEl8fk5GSU38SkNpat + K4RVkU9H0liTGa+NDoQ3B/iqKADNBKSvav78+SgrUhbDnbXY7T1FAfkFgDaREXIj3PmRy8avDa5NnToV + ZyK0IHVzumgkNQ2gisXaJF2ErKMGIl4Vm0nNUhhfRXV1NVJzctZYJ6jk9FO4vV8MaBMZETs/ctnAGq1e + 1J7QLjFiDbywKsKB0KoIfPmwb2tYPypYk602IzX2yIwaNQrNAThreB4qOeGV/ikE5JcE2lyyqRSF35Nj + DR8m95KzqTO+9ZF2ctCqSIdbcF63KiCw1eJVEVavWT2wGR22GrkSBARu7ycVkF8Y6I5gjTk/RajCaEI4 + qclWQzdoc4YJ1lxA+KoozhXJU0Ops7UsL9eyvBxuz0RA+EDIU0lhfnmg+fIoTtZNeI0RJGw7ZKQG0Hx3 + KSc133EkXhhNbDVWRW71xKTO1sLeoLAlFhAsyLy2J24O/Cs1kGcCaHMrAtsnxhrqiSkRSCptnDbu3uCk + Fu/uasuBUGeAWz0xqWepMe6DQRQTB0IpzNMqWD8rQLePNXwIhoZx/IF6tpoBTUuiUK1mSk1bFhGQkfZJ + TQUQShSb1QOTgpiGnTNnDuYI4UCo3kSrIupffEKBOl4/mtTPENDmWPO1kfx1XV0dy86RxaBfjiWRJ+UQ + aNr83LZYG+dATEhNk5hZWswcY7QeJz1hGJzqTVQDQXmAbPW/3oV5toBuC2swC1iDZZiDRqmTAY2MnLcF + IBcm2565gIhXRRRAypqHm8xJ3V81Y8YMNH3aXxV/NKmfOaDN10bwGhkE8gjk6CgDMWedpDYCLZSqmXpA + NOg8LdEJhyY1kBakJk8tUg9NMiM1Rusx7sNttfmq+KNzxWcRaBOsKW+kHB2ZG4bq4Pbwfjdu/OdLIp0K + Aqzp3ATzVZGmfkFqc6UWNq0i4wepkSXRqsgLe5Qr8mr1jyP1Mwq0ed5IWMMJIGlEm1U9VM2Abt45alwS + xWeviLEWWz1KyilR5D5PAJoptbN869atGPShwp55rvij++XPLtBirKkeQjVVLFDwBkAEb3YGtLBzgJWZ + gKxwUpnx7JVWHQiRWuypYT+EzIW2l2HvE6bIsIcB0/XiXFFcAPlx9uOZBtoEa6qpAmssjEgXsUfo0dZz + Kn0Q0Di/CdQ2ERATUlP5lDqKpNQC0Dh2AAdN7t2719zq8QLIjyP1sw40x5paM+KFEbU9lJUZoyHTGElA + oQPeQzjtkGHND8oycSDmpBYBDawxrpeWlgbbTlaPF0D+RVI/B0CbYM3FGrNOaOaClbSfzug96FhJfthe + W0qNf0LVD+7zmtUDWxR69eqFPayweib5y79C6ucDaMKaiiFcrFGOAPXUiWo6cYjJNNJCqAed30mHSDYf + Zt3C6hGpUdJD5cRsSQSp8fqhdfl0Sf08AU09MGqAoRKCLAaeFweBI1c0To6RTNPxy3Q4Kp3WaZa/ME+9 + sWXy0izTTKmHq0eMGPF0Sf3cAN2WWKOTiy7MI6AFmTaejwqsOalblqqNw77k88zUAz14JC/YOUmkNrcf + P8JTP09Ai7GmLAaiifUKxSbNSo1xEoGApsOWERCQtkiN+TEkL7x22nJJVPVmPg+khv3gnponiuLqRwfL + TM8Z0FysxQICPVUNVRmBFnJxdgQtUD4gCEg7pIa4i5dEsXpMZZO+OF6APDVPFKmpSD2BJ/J5zyXQfFoV + bg/pIt7aeKfDC7MVj9IWrId0RD6wbovUfEmkLJEKp83egy2JAew0Sey+pkSRmoomJb2OJy/PH9AmAkIp + DJQabQFju5aAxgHWdEg7bnkgUptVP4xLIi99tAQaZcKxY8eiy0XVD9SzqFOO2hbVqan50sEy03MJtLmA + oLYJ+6FbJ1z9QMaDgKZbHojU5j0BkBqtW54lUjrefCoaNuGinYjOC/a4w97QqA3q1Hx+jJovHST1cww0 + FxBKYZinnqw2FqbJ4dHtGsB6v0BqvAbmpMaSiNIHVw8R0CxLDGEnJuAsGJCa6tS8+WKSvDx2SXxegTYn + NU4OwSQqWxK5lQbQuJIHd5jgE5Aa1Q/hCDJx8kIbjYxbnalCLZJp1AhHjhyJyTGcJGCekT/Rkvh8A22y + KuLAEHWK2hToEwKvodSofpgnL7QkckPd0uSxwqlWjqMBzX2euMvVEfV4joE2XxXR9EOblc5gZ9IBdT7O + rkKyA9aHhNth2loSST0oc2mpHkjHoR5YEuHz+JJI06dPpB7PN9DAmuflWJrw+6PRBa9mLHcQ0Lhq6rRw + rRc8NS2JraoHZS5UNRWdEgrvgZ3V2L8vXhJpIhJdiI53Xp57oGkOmBebwD6U34x3ZkCaATSu9TorXOt1 + UFgSzbtcpB48czGR6Zksc8F+UCyJ1LqlzotJlvhY9XjugRaviiA1eIchc7vtwu07HGjcWHfWnik1lsRW + 1QPeA8W8ttTDR4GDR5AlovTBs8RWDXU73uNXArSY1Ci8YXrxEdBn7O0vCAFSw+e1pR4o5lHV1EymcRgu + jmnF4YqUJaJHLjbUXD3az1x+DUCbkBrH16JIzZJvXJgG6Thj73DBwemCEyP14Wb1MNlZDvWoEA6LbE2m + cT5Anz590GfghppPM9GIHtWY2lcPdtTPY832s/8EsVLj3Y0yBTMeSFUA9Fl7xwuOrhddATfz1G2ph4nJ + E7lpjKzLdaw7/q+ox68EaCI19RXBL2QZcGlMlE8woEFnj0sewBrsbk89uMlruR5SgSknJ4fUgyZsnlQ9 + LKAszz5hO/ITEqmpfIq1C/sEyETj7lZA7H3Z2+uSFyM1qYfY5IlO5WxTpvuo0Asm9TD3Hnw+rx31YED/ + OtSDPDX5PJQmMA7JLm6FiRaA9rns43fFz+2im1E9Wq17VIpkumXaoh7POrbYfiBWDxTzzDOXtsBk5979 + aoCmBi5NJfTu3RtdQWgF/AZ0AygHXg0E3GxJRDrelskT5+KitEWTopGpZTgWijIXTK2js4MtkZS5UCuA + V01bff9ZUEW1I+/NZ/854iURxTygQyuh5yXPgKsBoa+EAmvoNUvHTUweVw+xTLe8RQLXTGAHNdQD1Suo + h3krgKqmbSmERTt/9+wja/4TclKDfcieoRtAFgId9EpQ5KuREdciADrUgw00mck0OzUIbprSFrP1EIM1 + 8+bNw1n81Aowr5q2b/IY0L8y9aAlEe9rtALsjzCB9r3sCzp3v9495noMqM28x147Vp42O6eJuWkUPVpL + W9QJatygApnmVVO00DBxap4itirFFk/Uj3kuOM6XxEGDBjmUOUCgDVcM4HKv6736vNYHnzDvgRSxVZmG + m6at+mb5IcbPIiMjMZbHTR56LiYyzTu25kBZPFE/5rkAmqsHpnvtF9mTboDO/W70G/T6oNjrsYCemTzI + tLjhwmWa1kOU8VoaD5yLiPUQ1+Nyk0cDY+KObTsyzc6Pbn+5fC7AFf+Q3FADFN1wHfwGdAP4AuVhbwwb + cGMA1IPJdFtuup310JNdj/bjZNqigzWR5wtuUg8YA3WQGrBCLnq/1jvhZkLirURgjT9CptnA2GPXw5bG + A94cZkYs0zTvQTIt7gOYy7QFr4ngJ/uVGWq8kWUKWcCegOhXo6Ebo26Nmnh74tg3x0Ks4flYH0C4Cc20 + D4D1EGU8Mh4tgUb7Bt2yffv2cZnuuJu2oHP2fmVLIpdpNEcMxQYgO+TmkPG3x894e8a0t6cNfn0wM3no + A2A9NDu3EE0AZjyorSUqLbHhx1HqgQMH4kYxctM0LWZe9Gg1NbGgJuOvb0kk9Vi+fLlvmi/oPPLWyKlv + T53/7nzEmDfHMJk+0sZ6iCYAjAc5PBOgp6nDw8NxexsaLtxN84aLGEnztMXix83dPPuSTcU8HILqOdYT + dB735rjZ78xe/P7itA/SQOqoV6NQb2J98XaMh5nDw71RHh4eO3fuhEzzdi2GPXBYED9/oq20xeLHzd08 + F0AjEUPr2rmnM+g8+a3JKe+lrPhwReZHmcnvJsNQIztn+WGrQFNby8zhoXGD5i/OUmkrbeHroXkOaIH6 + k/gokI4Pkz3jWJPJQ9FH56kbe3PszLdngsu5H+euubMm44MMOBCsh60bD9yNQQ7PHGgUpj3ZrXMm6yH2 + ueCoMT5oSgueibOwaHWY7NdRZiKZxrWjiScSwWJwecMnG0o+Lcm9kzvh9gSWtsB4mDg8Slt4xaNlzkK7 + LnCwFtZD3F1AUzXUBOBlPLLL5uuhBT+M7F/ZCfNssptkesCAAYnbE9M/SAeXK35XUfNFTfGnxbPenoW8 + nCXiJg6PgMaQGC8tmVjpaCUG1LEeivNDPtFLJ0/QfgATslpwdyJeNH8dAkImD2cJjigdkfNxTulnpZvv + bt5xb0ftF7Vp76chbWGJeKsOD1a6DaDJSmPEVJwfiic9uIUzBZoWTeoUkKf+ERs0nllGA2i80xOyE9Z/ + sh747r63++DXB3fe2wnckZSjBdOmlW4rZ0lQDRs2jIwHdVswJ9YR42HBT9h7usdTPCPQg1bFxcX9F/Qv + /135ti+3HfnmyKnvTh36+lDBJwUDXx/IHB5KS+3kLGbJIQYZMHqAsUduPGikhtpa3FaYF58t6IhO8alv + vyZSA2iUlnpP6l33Rd3+r/ef+f7MlR+u4GP159XIyFnFo1Wga4RB3taycMybde/eHUDDePC2VkcK0+zO + 2Z/ieIpnhNGQadTpo4dGQy5OfHsCKFOA3ZNuT0L/heUsZgetY2iaDdO0CnSSGlfWo30jLkzTTub2HZ4F + +mA/6aFNvyziABqN1JBeIZCLS7+/xIEGu2E80OVixdLWgGYzj8jCzaRDM1fj6+uLM0O4w6MhsVYbtWIr + baFWe+L1EW96/jWtivhVYQn8Qv1INHhAqVPfS8X0AUsOza8OQPOwLaAXatzd3QlocaP2saUlCw+PaShx + 4WUxObSJyqfPWlUPwD32YdIEQCrh4eshRhmfg93LP1yOkRo2nd4q0OizUF2ppY/G1c2Ojo4AulUrLR6a + NslZLEJDG5ydE3CzksnB1T/RWahiFPDWwTKC2R+MtWEyEZfG4rYQvOpIMbDgBAUFeXl5OTk5abValUol + Fx74BH/EF/FXeEJ0dHT//v3xT3ByP2wc2h+4ABflHlgp/M5YCfHA/+Lo4nj595fFAayRjmPMg2XhrV2G + wTZbtAa0dqlWp9NhgW21hsedG+9p8d8XQG8ODCywt++OFJ724opPfXtax0bi+8ADwRLh+kwcJpyQkACY + PF1dekaEJg7qN3/S2JwFczZmLd1euOZYbdmVnQ23D+++c+bQvSun/vDahftvvvL3t68/fPc1BD7BH/FF + /BWecLup8Up92bGi3O2ZizYmT8ueNHJeQp/RMWE9/bw9He2QfOM/wsTty91eztucV3+x/uRnJy99d4nF + 95fWfrzWcMnAGM1PEhPtBGgT6BVatVoNoNvKWUyKpS2ABtZ6/XKNxhdFRWoZmJ98z++U6uDihlYk3iLg + Fw5Qg8O3t9X1CA+dOnLoqpS5W9blnm+sAUx/f/vVf75341+N25f/+drph5cPPTyz6+HxLQ8PVD/cVfxw + y+q/VS3/KHf2uZQxDeP7zQ12HRfmGeGuUysl0QOixy4Yu3Tj0pSmFMNpg26HcP4EwuQKLmw+bJXRmVqF + QgGgzYulIChtA2g1OQSjtwix2dt7nlLpAIFv9eT7jpywhxcT41Lg7OTJk+10uj4x0Qsmj6/IXn52S80X + F4//q4C285K88+o/b57/57XjDy80PTyx7eGhmoe7GdYPalY+KE97UJR8d9HQ+6vG3c8c9fGCfsfGRxX3 + N8wKc4l2U1hKftMpplO3kd1kC2XqIjVd6cw20NXYsl2eZO8yhRApNRQMWmeeHIq3IPKqtJjRjaGhWwlu + d/dJuL8K8078mpLHnnyPpQnucOPGjRi2dHN2GtGvDzi7v6Lo49OHfkJkzUF/9/o/b1365/WTDy8dZNQ+ + Uvdwb9nDbese1OU8qFx6d9nY+2unCliPvL90yF+X9P9ravwf50e/MtajMl47N1AS7dTZ2uZ/OkV2shpj + Jc+QYzstfLQmT6PJ1mhXNmNNiKMkLQBNySGfeQQ7Wy3/PwI6LGxbaOgjrF1cRmJFavXke/E1JVgq8X9g + Zw7+174x0cvnzNhXtuGTs0d+VnBN4H772j/fuNCM9U6GdVP5w52FDzfn381Nul86//76GffzJt7PHn1/ + 2dC/pg/8Y0rPe3MC7k73uTvZ4+5E1ytDHUp6KKforQy2L/6X5f/r2rurZIJEtYTdmcZiJQsG+komHZBE + eGLKwmljS1tAcyttAaBFWG8NCqp0chqIY375yfe0klIRFQTHd0fL3dnRYeyQASUrllzbs+WXBJewBsSg + 8+vngPI/rx59ePGAUa8P1jxs2vhgR8GX61PuV6ff35hyv2D2/TVTGLVXjvhzev97yeF3Z/nfnSZgPcHl + s/HOd8Y5fzjGqTFeszDQJsahc9du/9MlvIvNKBvVIhUuy2GIL9VgMcSBjwCaZ+HYVGtS7jBvaAHo7SKs + GbUDA4sdHeNxfxWKUnSaIbBGOxLLmqOD/bghgyqyl715aPeDd5gT+MlRxoLJeHrKiOC5vQ/P7Hx4ctvD + 41tZHNv88FjDw6P1jL+Iw5seHqp9yPCtfLhv48PdJQ93Fv2jce29DSn3Ny2/X7n4flny/cLZTEZyx/95 + 5fCv0nrcBdazg+5O19+d7AleM6zHOr+f6PTuaKe3RzruidcuDpT0sO/ctev/WEZZSsZJ4KPhL3EcLdZD + 5Cx87oDKHe3UlSzQ1TXDutHff529fQ+cyY4+Am5Tl0gkA2N7rF6cDOP1lzeu/O02/Nar/2i2XE8B69fP + sXUMqAGdxjUPajPZIlac/GDdrAerpz3InfQge/yDzDEPViY+WDGKxfKRwiejH2QmPsga+yBnPHtO3pQH + a2awf7JhzoPCeeyflyx8ULbo7yWp97ImM4hL5t8vmnu/YNb99dPvr57855zEr5b1+XIxsI5kWCcZ7k71 + vjvR7fPxLuD1B4lO74x0vD3C8dZwh9eHOWyJU8/xsw7SvfRfL/0/GxubVatWYZcuHB4lh5Tu8XIHHTJh + UsCziIw80CrWnp5ZNjYGO41m1thR2zbkf37+2FdXTn3/6tk/vn7xr7eu/t+/gDWzYiBdQ+6DkpQHuZMf + LBv+j0X9/zG35z9mRf/fjIg/Twv/w9Sw76aEfjMl9N7k0HuTQu5ODPliYsjnE0N+N4EFPsEfEV9OCsHf + fj059Nspob+fGoZ/9Zfp4X+bEf6PpIh/zI5m33BBPL7z/YUDvkqKub8s4f6K4fezRt/PSbyfMwbx56wR + 95bFf5kW+2VqzN3kiLtzgu/O9GdYT3b/YoLLJ2OcPxptxPqN4Q43hjm8OtThWoJDYaR8tH03H6UNiqV4 + i/PyPx/wwLufz6WLW7QW0dHHBaz3EK9DQrb6+dW6u5e5u5W4u2ZoVSGrU+e9c3QPXASw/vrq6d9fP/en + m5c41iQg7WsIY+uOAsavrLECpjGAA7gAI+D16YTgO+OCPxwb9P6YoHfHBL09JuitxKDbiUFvJgbeGh34 + xujAm60Fvo6/xXMQeDL+FQL//IOxQR+NC7ozPhjfFt8cr8SX4wI+SnD9YVrgX2YE/TUp9K9zov6a3OOv + C3v/MbXXlwsj7i6IZIyeH353bijjNbBmku15d7zrZ2MZ1u+PciJeA2sAfXWQ/dV4h+P9PFYG2/d2lEdF + RaWkpGDdovI/OTzKWXhDi9ZDAH1KwPpgSMhOvb7W2bnIy7Pc3686NLAeYfDJstOE56fMfffY3jtnDn9x + gWH9w/Xzj8Ea6B/f8qB62YOcCQzZmVF/mhZOsAICYEqAAiAxlK+PCvzXg78q9DLgNbs5zPdqP+e3x/i9 + P87w0XjDpxP8704K+Hpy4LdTDXcnu4K/jMXQaEgHBT5nvGZY/26My51EZ2ANvTZiPdj+Wl/HW8N8bg71 + vjHUpyTKOdFTbS+zWbBgAcrTUA/M4dFR6lgPxecuAegzERHH/P33uLtv0vtsCjTUhQVtbo6GsKAGg0+O + gy4qe97M947t++Ts4bsXj3/zyhnCGtkwaQjx+sHZPUxes8fjPfv3GRF4O+NdL0YWvzln6L+OaQe/w9XB + Xmf7Ol0f6Yu4MUp/c7T+zUT9W2P83hrj/dpoh1ujHd8e7fTBGCfoMhQD6+HdSe4M5Umedye43x3n+sVY + hvWHo5iMvDnC8fUhDq8PcH5rmM+bDGuf14f5vjbUpz7WbbrezlsjR8kIrXGUWZAf0q05/C4Gi8DAwz7e + uwIMe8NDDkSG7osI2RkWtMUE6wB9vqNtbEbS5PePNwHrLy+dEGP9t73lf1s/+/8WD/z7zEiAC+kEuHgL + vyOIAAe3g7g89addGuBxtp/LtRG+FK+OZAHQr470ODPM7nyC3aWh9leH2V8f4XBzpONb0IpEp4/HOkM3 + Ph/rApQRxOuPRjm9CxlJcLw90PW9Eb5vD/d9c7gv3i43hgJr3+vD9DviPecGOBhsldBuLI+8Kkc3b1kE + +h+MDDvePfJEdMSxqPDDUWFNESG7woO3toR7c6ChwMm+X/KExNebthHWXzes+T5r0g/zev1haigDdxzA + DWTgjvnlwRW/Whf6uZ0f4MaB5p9cHO5+Yqjt8cG2Jwfbnhpse3aI3QUB9GvDHa4Pd7g1wuGtkY4QDeAL + lBEfj2ZYvzfU6f0E9zujfD8YqX93pP72cP2t4b6vD9O/Nkz/6jC/a8P8dvX1nhvo5G+nwnla8HwQazgQ + UNuie+RpIU51jzwZHXE8KvxIVNj+yNA94cGNJlgHB1S4Og6b3Dv67OyEj6f3+HRc0PtjA95K9H9zlP/N + UQE3mcIG3GARiHjqxPzR3/BcH5eLg9zNgT4/zO34ENvjg5pjsO0JAfEzg+3ODbG7ONj+aoI9nAa8HRQD + ugHQWSQ43Rnm8Vmi/s5o/Yej/ID1OyP1b47Q3xzud2O4H8N6uOHqcMP2Pt4zAxy9dMqioiIkIpARDjRh + fQpYR0ccjQqDjADr7QLWgpIE1ofpq8K8N7qrh8g7davu7nIhQX8xwe/SUL/Lw/yuDDdcG+F/bUTA9ZEB + r7F4hrA+3dvp0hBPc6DPDXNtATRHfJDtiUG2pwbanh5od26g3UXYjCH28BtAHOvh7UGOd4Z5fp6o/12i + 36eJho9H+30w2u/dUX5vjTTcGmm4McLw6nDDK8MNV4YZLg83bOrlNUHv6KBWwHSLgebUhowcjQo/JEj2 + rvCA+jDfyjCv0lDPkhDPkmCPEnfteIWldkWQ7dGBvqeG6M8m6C8wuPEfAGt/c6yJ4zyEV4IFnvnqCBav + jAi4Otz/ynD/S8NYXEAMNSDODzWcSzCcFQX+iMDX6Ql4Jp5/Wfi3+A54pfHd8G2bfwb29joRa39lqPcr + I3wRYrjPDnNuHeiBtscGsDg+wPbEAIb4GTHi/ezfHep5Z5T+k9F+nyUaPk30u5No+CjR8P5o/3dGCW/u + kf7XRxiusR/JQL9LQYzHYE87AH1GkA76KJaRY1FB+yL9tkb4bAr1qgz2LAv2KA3yKKHwsp+rsfJJ8lId + 7O9zYpD+zBD9+aFgt+HqMIY1Ufv6yMDXRgWKMcXXAQf99wDrTILhZILf8SF+RwbrDw7UHxBi/0BfcTQN + 8DUJkyfQv8I/PzxIf2ww+26nEvzw2uBlYC/bUP3BHraXhvlcHu5zZbjPVSEI9FNDnY4NFklHM6OPEdD9 + jQG4OeJnB9qd722LMXashO+N9IV03Bnt90mi4ZMx/h+P8f9wTMC7iQG3Rwe8McofvzVwwMt/USANfk0C + umVEnO4efLi7f1O0365I/Y5wny2h3ptCvKqCPTcGepQFepQKUeLnvMJe2n2oo7QqxvXYIP1pUHuo38Wh + hsuAm+kUo9iV4QGgG8F6OsEgxhR4EYL7mmNvf989QuzuQNAz8U8Q/DvQN6RXgtDf18ezMdr26GCv40O8 + TiV4nR3qfX6Y96XhDPcTCfZHB+mODtQdG2RLQXptArQYcRD8ZKzulUGeNxK83xjq89YIwO334Wi/jxP9 + 74wJuDM24KOxge8nBr6TGHBrdMANhnUAYY1fvyXQgDjoSHf//dGGpig/0HlvpN/ucP3OMN/GUJ/6EO/a + IM+KoJZwu6iHyzsrVgTZQUZODvYF3KcHI/zw8cRgRtVDg3z3D9A3Cb88wUqAEpq7+vns7OezQxTb+/pQ + bDML/lf4RPxP8B0Q+Fb0PekFIPS3xbrWR9vu7u+B2Nvfs2mg56FBXscGe51M8GoaZLt/gPbgAN3hgboj + A0WID7Q9KmI0B5p90tf2RKzdlcFerwz2ejWBJSxvDPd9a4Tfe6P8Pkj0/3hswMdjAz8ei+wU7ivwzdHM + HUDKgDWo1qzRphADZURThH5fhH5PuO/OcN8doT6bQ7zrgr2qRXAzgnvazdFY6Se4KerjPPb1897d3xsW + h/3a+Jz98vgE4btLgJUAMuLYx2fbUwzh5eEvAEFf191xU4zD9n4eO/qz2CkgjtjZ362+r3prvHpHH83u + vpqm/tr9/bWHBgiID9Ad7Y+wpWgBdB/bk3EOlwd5AeurQ7yvDfG+PtTnJhzeCL+3RxreT4R6MKA/HheE + 7Pc9lkaw+gFUFFgLQJNQGPYJLGYRgdAzoCk43AK1G0DtR3B7AusyP9dce3lf65deXmjQ1ffyaIj33NLb + a0u819Z4ry19vBv7eLOP8T6NfVg8TXDb+W7CG6Ii3La2p9OWvu6NiH4eiG0C6Jv7OlX1VlXHqWriVLW9 + VJt7q7fFM8T39dPu76c91E93uJ/uKIUY8Xjb070cGdAMa++rg71fSfB5dajvjeH6N0YYbo80vDM64P0x + gR+ODUS95UPYX6HSgGQYWFt0D2jqziCGSrAgiHkwlJsjXL83XL87jFG7McS7PtirNtCzOtCzMsCjwt+j + HOGmS1J2805wlOVHOFfGelTHeW6K86zv5dXQ22tzb+8t8d5b441w/zxY40Ut8FfUxrnUx7s39HHf3Mcd + iG8VQK+Nt98YpyrvqaqIVVXGtkS8t2Z3vGZvH+3+PtpDfXVHxHD3sj0T79wC6CE+ryT4voqEZbjfTebw + /N8ajSUx8H0mIEZeA2sUXiyi/HZH+u1BRABlPUULrJuB3h/hh2gC3GH6XaG+24N9tgZ51wcCbq+aAM+q + ACDuWal3XWMnH2j9knSqp7qip0dVrEdtnGddnFcDg5thjfjZqN0Q51EcrAbK4iDEK3rrSmKVpT2UZT1V + G3saEa8C4rHK6p6qTbEqFKB39NKg8N/UR3uwr5HgR2J1Z/u6XhrkJaiHN9TjlSE+1xJ8rw1laeFrIwyv + jzDAcsB4vJ0Y+O6YQDAacENDgLVFhH5HhN8uCLEQLbAO1+9DPGI0UPbbH6ZH7Av13RPiszPEZ3uQ95ZA + r4YAz00BnoDbGB72CzU2oTEaq1R/O1C7JhbU9mqV2j+pktTGuJSF60yApj+WxGqKeiqLY5ToEyI44hU9 + lZU9lFVC1PRQNcSqG+PUu3tr9sYzgh/soT3Xz+3iQE8AfXmw95UhPlcFoF8dqr8+zO/6cMONkf6vj2R5 + MlzH7dGBAtysVImwCPPdGg4Pp98Zod/NsRZUgqFsDL8mgBumx0egfCDUGE0hvnuCfXYGM7i3BnptDvSq + D/CsE0Df5O9R7ayZLO/qPtBemhniWB3raU5tKMmWeJ+iHp5ZkW4pwc5TDU4jve37udt2d9YGOah9bNWu + GqW9SqFRyJXoActkCHyCP+KL+Cs8AU/Dk/FP8A/xz/FN8K2Ke3huFbS7MtKhIsreHOi6eLeiWFVhjLKw + O4uimEeIl4HjMcryGGVFjLIK0UNZ3UNVF6vaGqfeGafZG6U53c/9/ADPi4OMWF9NYNIBRhPQr43wvzHC + H2YDWL8xKoDqtKAzSkAWWNlgJ8J8t8NaAOtweAyGsjEYefV7Q31ZCJ83her3A+gwv4MIAXEGd4jvLgHu + RoHgQLyBws+t0EE5QtpFN9xZnhfuDGqvjnRbGOQ8Ue/Yz10X4qB2Vivd3NwwtRQXF4epogkTJmC4a9Gi + Reif4dh3jIhgkAG3NdXW1mK4Bw8063CZREVFBcbLMQeblZWFTjE2lWCSBGM6ON4nJCQEQ4guamWooyZC + 2XW0p2phiMOa7s5iuKt7OxX2VHKgCW4ECM6iu6K0u6Ksu3JjdwZ3ZTPctd1V26J0R/q4n+zncXaA54WB + XpeI1ABaqChxoOGgXx/JsIbl4GVxC/jiYK8aeIkwn21Y6ML1uwSs94QZ8d1DKIcIEcqwRnCsD4X5IQjx + fSG+u5sJDsSh4FsY7t5bPZ3z1LJBnX4rU3aztLG2wuZTnKQxZcoU9Noxh4Zte8Bu06ZNABFQopOPB4oD + eGB8Aj1QemCu0PyBVjQe5l8vKytLTk62llpjLsk/yt9aauWlk8a5qibodRlhjht62LYKNIM7WlkUrQDW + xdGK0uiWcEcq6yNtd/Vy3R/vdrSvx6kBnucY1j5XEnxfGaoH1gD6+gh/RmoBaPAahTBgTc0gC+R48GfB + XlXwyKE+W0HtUN+dob67ocIUAmGNQLeB9eEwPwQhTgTfHeC9w89rm49no6dHo5fXDl/fXe7u2BYy0tra + cfDgwdg5XF5eXllZCYjBVkCMBj5HFsABPkyoYBoID/RAMVGIB7rO9MAQeKsP/gQ8GTX4oO5B2XXZiKza + rDk5c0bNHtUzoad3sLdS8aLB/qXBHl3nB9gUNNPZyOtoZWGUAlEkBOAuaYa7PFxZH2W/Pc5lZ5zbnt5u + B/t4HO/veWag9wWGtf6VYax0x4AeyYBmWAtAE9YIAhqBrLoiyKsmyHtzsM82LHShvruAlxCE9SO4m3kN + GSENORxuOIII8zsSpD9s8Dng49Xk49Ok1x8wGA4GBh4KDj4cFMQiOPiIr+9GB4cJEok7pkBxcAmIDBYT + f4EvwAWsBCWmJtCLQ/cTDww7oN+MB7ry9ECf3+TB/4qeiRNKE6YkrN62enXj6vyt+Xlb8jDnmNuQu6p+ + lTZVaznY8sXgF//X/n/tlS/EOHWe6meVHykXGM1QZhHJgrA2sjtEWd/dsTHWBdnmjl6uu3q77+vjfqS/ + 56mB3ucG+14e6ncVWDNSY0lkQKNiLC7tWgS4FwV4FAe4l/gjPMoCPKuDvBqCvbdCc6EDbWHdTG2Gdajf + wUDfg/6+h319juj1JwMCzgQHnw0LOxcaegYREnIqJOQEIjiYfUSEhp7099/s7DxHqQyOiYnBiVBQD0BM + nAW+BCtacJgDwjwUHpjExXQvGvt4oFeEB05UNHnQ1+k5eHJAQEDK2pSCvQUb9mxYv3v9+l3r1+1ct2bH + mrl1c+W5ckmqRDJXIpkt6Ta8W+fozi+4vaCW/2+0Y+epvlZrIh4B/QhuIB6oqI9x3tzTZUus67Y4YO0G + rPfEexzs53V8oM/Zwb6oGF8dxsrFUA/Ga6E0j89hBFETt/B3LzK4Ffm7FxuMUSo44k2Q1zawfkTtIN99 + Bu+9Pl77fAG0/zEB34thYZfDw68IcTks7FJY2IWwsPNhYfgrFoQ+PgkPPxsScsTLK8vWdqC1tRoXcdBh + Z+ApkCVYASUO18fMFbZ042AuDAVipyq6RPTA7hv+4F/EE/A0rJ++Qb5lh8sQpYdKSw6WIIoPFBc1FQ2u + GSzLlcnSZNIFUul8IeZKGeIju3WO6PyC4wsOshf6OFkm+9sQysYIV5SFaOp6ONf3IKzdtsW5be/tvive + Y08fz6a+3kcH+qC8g3IxKtGokV4f6Q9DcqG/+7GedqfjXS4O8LIwuBUi/NyKEAaAzuAuMbiXwxTDP8BI + AG6YCjG1g333+Hvv8fXa4+mxG/oQGHg0JORkSMhpAUSgeQEQh4dfjcCWSRavCMFwR0REXGyOSxERiMuR + kVcDAupcXeep1eFEcLqkCngRmhi4QjMfQ8B4YHwCG0YwGoiBFZMHvogH/hbPgW8ZMnFI7dna2jO1Nadr + qk9VV52qqjpZVXG8Irg6WJGvwCSjfLFctkgmS5XJUmTSZAHu6RKbCTYvx7/8kv6lTl3/21/z0ljPl/PD + 5cC6IESxMcy2NsZ5U4xLfU+XhljXrXFu23q574j32NXHc29fLxR5Dg30OTlYDyU52c/tWC+nY3EOZ/u6 + XRoE8xeAANAFfiyANYtmrAF3qb8H8r06MbWDfHb7ee/29twNCYb+BgWBxccRpAmCSgBusJVhDXwjcdZc + 5GtRUTeEj4jrCHwxCsc4iCI6+rXu3W9ERV01GDa6uExXqYJg1LCaQb6BGuBD8w3DbRicwJgr9gPjgSFu + PNDe5w/6CvaS4IE9A+lF6Y2vNG69unXrla1brmxpuNSAQfTKc5VOtU7KtUrFSoViqUKRoZCnM8Tli+Sy + ZJl0hlQySYK5L8kYifVwa8sIyxecX3CQvzDQpWu6r6Qiwr6mu/OmHi51PRjQDbFuDOveHjvjPXf19YKS + NPZw2hxl1xipa4p1Pt7X68Jgv8sJ/leH+r8y1J8B7aAc4ue2QQhzuB9R29+rUe+5zdNju17fFBCA9Q0Q + UzCgCWuIrxBMGSAXwDoy8hUgGx39enT0G9HRt7p35/FGTMzNmBh8fBQ9etzq0ePNnj3f7t79emBgjavr + JK02DCegJSUlwTVj8hrDbRiNxQNzKjibCw8MzGOLiskDgq4P1gPfPW/s2X1z966bu3a9vmvnjZ3br29f + eGqhpl6jWqdSrlIqs5TKTKVyhVKxXCB4qlw2UyabIZNOkkonSCXjjYi/3Pvll9xfkr/4P0Oc5ZlB9sg2 + gXV9TwY0qL2pu2NNlH1lmLY6TFsf5bCtp+vueJ/9/XyPDdCfHuR3fojhUoL/FQFri67/+4KtLM7HeVVr + cDPh9nUr9XKrcHOt8fHZHhDQFBTEXERw8FEhGNAhIZzRIPXJsLBTYWGnBRU+D3GAMhDW3bu/GRPzVo8e + 7/To8S5Fz54U7wiBT96LjX0/Lg7xQVzcRzEx1xAhIZt9fJY6Og5XqXzi4+MhLPCFkG90PDFRiLEgPDBn + j0Es+ogH7ihLnJV48L2DB947sP/d/Sze2b/vrX37bu8bcGyAuk6tKlSpVqtU+SpVnkq1SqXKUSlXKhVp + Cvk8uXymXDZNJpsik00WEJ8olY6X2vSwQVaFoSQ7SbcBDrIMP/XGMF1psLo4ULUxVFsd6VAf49rYy3t7 + L+8d8T674n329PHZ18f3cH+/kwP9zg02XEzwB7UtskIde9vaqK2DPexTm7E2stvHtdDDpdDZqdDDo0Kv + rzMYtgUE7AoMBNYQDYZ1SMgxAWWiM2f0qfDw00KcCQ8/Fxl5ISrqcnT0NYgD+AvCEqCxsR8CTUSvXh8L + cUeIT4T4tFevz3r2vN2z51txce/Exb3Xq9cHsbE3w8N3+Ptne3iMt7MLk0rlMHDQYqSOWD8hLJgPwgOT + K0gR8xryjn187NidY/h49KOjiMMfHD70/iG/w36aTRp1iVpdoFavV6vXqRniq1XKHKViiUKxQKGYq1DM + UgBu+Qy5fJpcOllqPd66i08X7MRCwvniiy927dpN1unFvrY2KwNsa7u71vVwb4j1aIj13BrnxbDu7bPT + iLXv3r76g/38Tgz0OwushxgsCqLc1ka6DHOSyyxdXLRTCGtf1w0ezuudnda7u5f6+FRiGk+ITQbDloCA + 7YGBe4OCDgQHHwoJAdbHQ0MRDOWwMKKzEeiICMxAnYmMJKwvRUdfhSb06PE6EIyNfTcu7kMB2c969/5d + 796f9+59Nz7+bp8+iC/79LmHIPR79/60T59P+/b9tH//3w0c+LuEhM+HD/985MgvBg++FB/fGB29KjBw + mqdnvJ2dl8FgwOBhv379fJFl3d5z6INDhz86fPTjowxuxCfH8m7laQ9pAbSmTKMp1qgL1aoClXK9Ur5a + LsuS2SyysZ5n3W1mt65Tu3aZ1OWlcS+9mPjib0f99sVRL/2v4rfe3kG9eg0bMWLGtGnpY8bMjYzs4yyT + jHbXFkRAQzw2x3lujvPa2strW28fYL0DcPfx3dOXYb2/n/7YAD/IiEVJd/eCaIb1FE+1TSeZvWKIh/M6 + F6d17u5F3t4b9XpwuVKvr0Y0w13v778tMHBXUFCTgPWR0NBjYWEnhADEFKcJZQI6KgpxPirqYnT05ZiY + V3r0eK1nzzdiY9+GRADN3r0/EyC+17fv1337ftuv37f9+387YAA+fjFgwN1Bg74cPPjLhIR7w4bdGzHi + q9Gjvxo79qvx47+aNOnr6dO/njXrm/nzv0lN/SYt7d6CBTdnzTrq7z98bPKk/e8danrv4L539u99u2n3 + 7T273ty189bOHod6vFT10ourX3wx58UXM1m8tPKlTis7dVrWqfOiLp3ndu48y9JyxstdZ3R7eaa1VZKN + dZJUMlNuPUzWtatVUlLGjBnLkpKWz5qVOXdu9vz5uZMmLYyO7mvQKJJ8HepiGdBbegFrb2C9Ld5nR7wv + sN4twN3UV3+kv59FRU/30hiG9bpI11Hu6t/813/Z2HR3cVnp61uOaAaaYe3nV2Mw1BoM4HWdv39DYOD2 + oKA9ISEHQkOPhIUdCw8/ER5+MiLiVEQEUD4dGQmIz1IIQJ+Ljj4fHX0hOvpS9+5XevS4BrhjY9+Ii3sb + shAffyc+/nMBawbxoEHfJSR8N3ToV8OGfTVyJMD9OjHx63Hjvpk48dvJk7+dPv3bpKRvZ8/+Ljn5u0WL + vsvI+G7Fiu9Xrfr9mjW/z8//TKG2Kz1cffLzCyd/d/7k5+dPfXH+1N3zp4XwPWNQb9epqnSqcp2qjIWy + RKss1irWaxTZGvlStTxNJV+okqWoZAtUsvlKhHSe0jpGGhoaB3DnzMmZNy9nwYLVCxeuWbRo3ZIlRcuW + laJgEx7eO9ZRsyzYZUsvbwTDOt4XwbHeHufT2N3XArV5YJ0b4TrEQ2cvl0Dg+vbtK5MZnJzm+PpWUIDU + fn4II9b+/pv8/esCAoD11uDgXSEhTWFhh8LDjwJrAB0ZSSifiYoCxGKUAfT57t0vCHEpJuZKM7tvxsW9 + 1avX+7173+nT5/O+fb/q3/87YD106DejRn2TmPjd+PHfTZr0/ZQp3yclfT937g/JyT+kpv6QlvbDsmV/ + yMr6Q17eH9et+2Nx8Z8qKv48Z87WfqMTTt+9ePrLi2fuXTx779K5ry6dw8d7l1a+k6M5bqve0gw0sN4o + YF2sVa7XKrI0iuVqebpavlgtX6SWp6o54t28JQkJUxYsyEtJWZ2aum7x4oL09OJly8oyMytzcjbl5TWs + WbN1/PhkB7k80cu+LMZja2/vRghIvO/mWJ+6aJ9NkT61Ed51EV4WKBPPD3QKs1fBe6LkiCsDsAUIe7O6 + ddPY2g7z9t4gkNqItcFQbTDU+PvXAmsBaMTmoCBsN8J4NYasj0REYAL4ZFTU6agoBnR0NIhMwVDmQMfE + XBSCwd2jx9WePV/t2fNGXNybvXq927v3R/Hxn/Xt+yUEZMiQ70aM+H7MmN9PmvT7qVN/mD37D8nJf1i0 + 6A/p6X9YseKPq1b9ce3aPxUV/bm8/M81NX/ZuvWvcXFTM6vzzn11+dzXl89/c+WCEOfx+deX+10bpNlv + q26wVdfYqiuFqNAhGKnXEtAaxZLmSDMiLpui6iaXgM6LFm1ISyvMyACLy1asqMrJqc3P37x27bYNG3YV + Fu4tKWnKzq4eMmRiuJ0m2c+lJsq7KpxFZbhXVZhnTTjCw2KUt529Uo6dWLiAYN26dfBGeXl52DqABT02 + NlapjHB1XejnVyEwutJgqALW/v41AQG1SOcCA+uDggD0luDgrRivDgvbFx5+MAJTTlEnoqIwdn0mOpqw + BpEpiM6PohlxaDcQf6Vnz+uxsa8T4vHxH/Xp8zsQfMAAsPv7xEQGd1LSD/PmMaxB5+xsBnRJyZ8rK/9S + X/+X7OxzIT2iD394kqH8tRFlwnr/l4fczntpdtmq6wSgq4RgWNuqSnTKfK0yS6NcoVFkCJEuhAC6tJ8y + IiJ+yZJCsHjp0tLlyyuys2tyc+vXrGksKNhVXNwEy1NRcTQr68j06QcHDTro45Np9ZJ0gK0uP8CtItSj + MswY1QAah0+jxF5SUoKkABuyUWsH4nig8oCvjx8/3sbG3t5+lK9vgcEAoCv9/QF0dUBATWDgpsDAuqAg + hrUANAJ7jXaGhzdFRByKjDwWFXUyOvp09+5nu3c/J0SbcAP6lhxniDdz/B1wvE8fcPweJCUhgRF88uQf + Zs78YcECRm3AvW7dn0pL/zxwYPqcnNSz9y6fbcloAD3r9jzNcTt1o6261lZdLYSANRPrQp1yFYDWKldo + lUspHiFuY5CPGjVLYHF5ZiaIvCk/v2Ht2u1r1uxJT98/bdqhhIQjcXHQzCPQz6CgnXh/Ayi1ephBqpjv + 4VgR6l4Z5l4Rxj5aoFuBB7IAGFI8UDLHo1R4AH080OyAZ1KrI9zdU/z9qwICgDKLwMBaYB0cXBccXB8c + DKyxJRQbQ4E19tMR3Aejoo4JOwrM4TalthnNoSqXoSrNNIeO3xbR/B7RHKBPmcIkZfLk11y8DXWXdp36 + 4vLpu5dPf3n5DEf86yshlyM0TbbqzWZAY0lcr1PmCkAv1yqXiWKpVj5dba2QYd1LTy9PTq6aPr1m9Oja + gQMb4uK2R0TshgsIDt4bHIxPYMDgC7YAZSiq8KYvd3CYpewiGemgA8oUFih04UFtDtTg6SPKxPwjfRE7 + 5aVSWweHoXp9PvJjRFBQrRAM65CQ+pCQhpCQLeB1M9bbw8N3RkTsw6aNyEgmJgLiZ5qp3R7QHHQRzR+B + 3sz0t3v3ZnalT58vIC8eHtmJ82Ye+eTy0U8uH/v08rHPLh//3eUTn18++fnllW+tVhy1l222lVXp5BU6 + eTkLBT6WaeWFWtkqrSxLK1uulWVopOksJEs0Nmka68Uayx4KR8f+4eFFwcElKMLo9RRMQiGewBRLFMlm + UJAx8BUoKv4Wb31395UyWVxPtTrH4MKAJkCpjYTqO/WNxA0O9DhQLMYDDRH09NRqfze3aYGBlUFBNcHB + QJkHgxuHUmBbuUDtrbR9MSxsB3YiRUbuj4o6gs0yLeFuRbXNdbxV3Js1HavoaxERRzT27sUH6w99fOHQ + xxcPs7hkjDuXIk73e7lR93K59uUi7csF2pcLtd0KWLy8Vts1R2uZobFM01imaCwXaLokq0WhesFBYms7 + 1dMz29MzR4g8b+/Vvr4b/PxK/PzKBfEE0IB4e3DwjuDgncJHRCOoHRCAbAMmbaNGM8pPIk/xdLQAxOjR + oTuHBgd1N9DXQOmduhhUfcdHPPBH1IuxYKIXZWfX09s7NTi4VohNISFAmYJRW8DaqCTNcBPBm0DwqKij + 0dE/huBtraXOzvOHzZh06KNzhz46b4yPzx8SouB2jeKAc9catWWx2nKD2nK92nIdiy5rVV1yVZ2XKTun + KTsvVHaeT6Hg8VKC7De/sXJ1XeLmlu7uvtTDY4WXV463d76Pz3o/vzKDoSIgYFNQUCPwhXSEhu4NDd0H + LyB8Ar+7A38lsBtpR6WDwwxbS4kFhxjdIzSNgCaqX2hVoOKOB4rCqLijmk6ld3wFVTT8LfbVKhS2Tk6D + 9PqVBHdICOBuC3EId6MI8d0C4ocEBWcL5pNKihhx/J5qO7eCphoBaNOIO5NguU1luVFpWaC03KC0XK+0 + XMeiy2pFlyxF5zR551R55wXyzvNN47cBErm8t6vr4magMz09V/n4rNHrCyHBgm5sDgnZLvja/UgjhEzi + oOBxD4SF7YUHE6iNbKMK7wAXl/kW0ARiMTiLvgaaGgAU5XZsJEehHWctUZUdH1Eaxh9Rhkc9Hi8AKL9w + 4UKVyg379A2G3GZ2c9BNCE56wuGGpIDjTFJEiD+xiANxR8c5I2dNaRXl6nd2aA66WW5SWZYIQDejbLlW + 2SVX0WWZAPTCVlDuNFn2G5mVnd1UV9c0N7cMd/flHh5ZXl6gM3SjFCSFr8VRYSEh2HS8PzwcECOBOCrE + EQFosBu8xmZvSHmZXr/e1zfPAj06CAK6R+ApaAuIgS9gxXZ91NdRREdlHYVgPPAJvoKvA3eATohDweHB + 1WovV9fRBkNecDCEm+KJEN8lUhWu4/CFrbtvzmjQyt7dp/RIQ6tADzyX2HWH2rJCaVloRudsReclAp1T + WgH6xZ5SK6tQV9dFkA7ohrv7CtBZEOgCyC7WOqyBorzhCLwsIBbiYHg4BASqjVSuKjAQT4agF+j1ay1A + TGgFNAH6gI4RWkGAEvjiyEGU1ansiwf2KeJzlNhRbifEUZkEwUF8/EOsojNmzFCrvV1cRvv5rRLB/XjE + xaqClTMiYq+I5iZSbrp42tlNmbhoTqsob3p3l+6Qh2WdyrK0NTovb5POkJH/dbTWaEY268YyDw/SjbV6 + fZGgzkgdIIa7YGHJxQr47qXdxyigC34X2gITDJGBYwHQaywgF2jQEZGBHSBGCwMQA1wU0XFuBNV56YGt + iii0A3HADY5zuMFuiAlmMwS43Z2d4QJXtITbSPOWUt7WysmEpSXoWD/FTGfpD97FvmHhdZd2t0nnnW3Q + OUfROV3eeVHrdH5poMzS0pfo7OYGOkM3sr288oRlEKgxv4G8AdmZkKBBplGBoMUfNMfXG/BuhiULDMRL + UubvXwygDYb1FlBkwAQpQEcOVAWCBDFgxSG92GqLkzqwWQ4PfIJNitjoDPTxBHCc2I0+HsQErxNeLXw3 + rK6Y0cKpQU5O/by9F7YGtxh0cyk3sSvkESHokBe4ctJ0hrtKNWT+6qWtolzxdiNT51bpnKfosqKZzsmt + 6MYLPjYKRX+Bzmnu7rAcAHolLIePT75ev87PD4thCRAEjhAHwd1SDkG/CP4IYakKCsLfliOasS60wHsf + igywwFAoAxpCwBEQA1bsjsNmROxppgd2JeKPhDjgxgHgeDL+CTp4eB/gdYLsQHwg3NB6eBiUqHAHoJ1d + FI7WCwhY3zbiTF5EjgU/tynTW66iDHcXl+QeQwbsf+/UwY/O8jj00VkhzsWdGdJ1h6pLeWvq3D6dR0h/ + 06UbDBl8Av4LF5cUV9dUN7fFHh7pXl7LvL1z9PrVYCgEQcAaq2J1UFC16FfD5ywErPG3DO6AgI0BAaUW + ICMUAHJBB6CAyKAt7ffEnnHaXosHPqEHhxtPQ9+IxARSA00nJcGbg4QbioQFFlUq9Jwg3zhdz8cnrV24 + 25SXZm9utOf4PRVah5zNGw5+dMY8Vr9RotjvaFmr6FIq77JB3mWdMTqvkXfOlXdeIe+UJuuUKuuULOs0 + n0LaaZ4xfhtoJZFEODpOc3Sc4eQ0E1M+gNvNbaGHxxJPz+Xe3lnwD35+a/39gXWxgHU5yAtYBXy5EeBY + G6kNrNlB3VAA6AAgoyN9QGQ6w5GfDEa3yeNBl7rir/AEHGWHJ4P7eG24kuBtgTcHpgPICEK4CW4k8dAT + TN7a2oa7uY3388vuAOKtuheWE2m1w8fMn3bwo9OtRtiJWMut8i7lsi6Fsi7rZV3WybqsZdF5taxzlqzT + EmmnRdJOCx6By1F+aYzkN9Zd8c0dHKYAaycnYD3bxWWum9sCD4/Fnp5LvbzQD1mFlc1g2CAAvVEAmlAW + A42f3JTaFkAZlIQOkFzQxmWCGMjy+0TooEo6NZ+wBt9JSaDjXEloneTCbQI3TCQqghhKQrJjbx/j7j7F + zKJwUrT5iZtbSmBMdP2VXQc/PG0eC64ttdqntqyRdymWddkgRlnaeZW083Jpp8WSTgslneZLOs0zjRdC + ullbB9nbT3RwmERYOzsnCUCnuLszoMFovR6MXtesHgDanM7in9xIbb0+2wIo05lrXC7MUeZnihHWYmq3 + qiQk3CZwU3qJhAhuErk+2gu46xiI29lFg+M44bAjHMdvaC3TZJSvahVlfNHjSIDlZlmXMlmXgpZ0zpN2 + zpR2SpN0SpV0WtAKyi+Ns/mN1FKtHmxvP8HeHkBPBaOdnWdhhMrdHdIBjV7h40MaDToXQXYFOqPmY6Ib + j4DGL4VfDasUfk0LLsomckEUbvUKTBO4QW2uJHjBuAsUww0xIe3GUglngjwethJVFOSlQByHi0JVtNpA + 6LiX1zx//7VtgY739ai5k9tCediF8V13yy2rBNEQ0zlfoPOydukc2s3KKtDODihPcHCYLEgH6DwHuuHu + vkigc6avby4EWqAz6Qan8yPdwA+PXwG/CH4d/FKYrscRNaj1s7uyxKIslot2Tsc0wZouiYaS4FuRC2wV + bloq4UzICCJLgnyD4Mj+UcZCtwHniGJkQKm0h5S7uIzw9p7v77+Ggw5yhfWKbUs0NtwqVx9wtqyXdSlt + Sec1ss650s4rm1Fulc5jTOg8RaDzTIHOKVgJvbyWC3TOhyM2GDidjUDjh8SPih8YPzZ++J49e6LMiRlw + XnNG5c4Ca5r4oJSO317NVVusJO3AzXMcZJ4wlPDdWC1JT4jgUHAqEMKJo3WJoyHhDhUKtVYbAEvu6DhM + Y++YXb+2LTqHnOhhuU3WpcJsDQSds6WdMiSdFkk6pbQiGhDrF4KgzsEiOkM3QOfZrq7JAp0zBDqv8vMz + LoN+fvleXgvd3CY6OfXFj4cfEuOZeF/C0aJVIq48I4mj4qjxhk6Tpa+DJ73iaa3CTcJtwm6YbloqYQTJ + d1PNhAhO/gQKLkYcpS5UxtFUmzNnjqur64wVM5rea2p6/8D+9w/t/+DIgQ+OHfjg+IEPTx788NSEy0ld + 9yosq2VdSgTRgNkwOg0pozNfA5NbAfrFkda/sbLUaoc2qzOWwelEZ1oG3d3nubhMdXFJtLcfoNNFqVRe + crk6NDQUG0Rw9wg6UKjU85o+IUvg0o4QKu6zy31/NMriRbKtdZLDDdMNb0NGEL6br5ac4FzBxYhDVcBx + ZPajZo06/eVpxMkvTh7/3fGjnxw9fOfwwY8O7v9gf8HNQu1+206bLDuVWHZa/3Kntd06r7XqvMYa0SnX + ulOmTaclNp1SbTql2LR0Gvgji//VW1pZGTQatOt6q9U9VCqsXSFyuUEm85JKHW1sVOiZ6vV6cBazGJi4 + hCaAtuJNIXzfDd9uQ+Dy3QtgDLsXnI5na3Xp6zi1O8huyuApzaESFREc7hsKjtwSkgLEOcehKth6FTs4 + dvur289+dfbsPRZn7p15FF+e6XGph6xJZlNnY7XRqltxt5cLXrZcb2m5zrJzfudO2Z1eynjpxdQXf7vg + t7+d+9vfzm4Zc377Qv8X/vul/8b533Z2dnjT+Pj44NRpzDNiqYApgnxhGgAHLeJdhc41+qi074bvCKFq + vnjTDd+3QPtCaLQey74FifK/jnL77ObOhHw3pTmAG3qC0gohjmTHHHHonV+IX/H+4nNfnUMwrHkIoE+5 + OUV5QqnYoZBvksur5PIKubxcLt8ol5XKZEUy2RqZNEsqXSGVLpVK01lI0iWPIk3SzdANO++wRQyYTp8+ + HasxZAo7uoAvzqCCI8LwBVZpnNiDFjY6q4AY/CVNIM6KkaXmFAeXdoTQvgWLp4tyO3CTM4ER5AUTXqIi + xLmkcMTxU9o72WdWZZ7/5vz5r1mc+/ocCwF0xLr317mecVXuUSoaFIoahaJS8QjoEplsvUyaI2VALzei + TFjzsB5kDU2AzkKaADEK6xgLhhvDvjwcZA+UUT8AyhAKEBkvOUFM221Qx8eDOEttP9AWyOLBN4XQdhDa + tMCAfiJ9eKInmyyVPKuk1RKGh0pUIDgUnEsKIQ7tBgTJ+ckXvr3A4psLDG4KAfQjXx4JuRSiOqhSNiqV + tUpltRJAKyoUinKFvEwuL5SzMdFsmQzN6GUyWYZpSGdJu7l1g+xiCylYDIhxSCC2GWCvGBp1sD18RymI + jCWOeqoELpDF4sF3MdHmJdCWGn6wUgQub1EhjbB4IuB+3JM53CZZJSc4LZgkKRzxJUuWTEubdvG7iyy+ + ZWFEXAAdMfDVgZrjGvVOtapepapRKauUykqlskKp2KhQlCgU6xTyHLkcB1wvl8uXymVLZcZoRhzj5bRl + BkKBB9py+B9xoQOWBIgyJzKGA+hEf0AMfEFbUgMsHli0+RYm8V4bWCkYKr4XBBs+8B79OYBuS0/EZROS + FI442ISpfUw3G+8++O6SEfFm0JNuJ9metdXs0ai3qNW1anWNWlWlUlWqVBUqZZlSWaBU5CkUOQrsVZEv + k7NY2iKk46RWaivIBSgMOYb/hSLDqGEWDpt5se5hlghagc4RenXUsyZ8wVkiLFZs2sKEeg7WcCAL2tIu + G6w0BC5tAcEKhPfozwo0Id4qwXmhCojjl0yYlLDvzX2Xv7+MwA0TxqALJ767lPNhjvt5d+1+raZRgz0p + BLS6igWAVhWrVGtVylylMtu4RUWxTCEObA2SBEhQvIVKAF+wGBDjPEC8urhgBNYCE0XQCjpcHhBDc0Fe + 4EtqQLCKNy/xziqqzXxnDcCFs4KdxQoEVfwFgG6V4Dy9xG/Yf3R/mLlH16YIcHPQ6z6vC7gSoDuk0+7Q + ahuECf4ajaaahbpCrS5Tqzeo2eaUHJUqU4W9QCyWtwhpfynmNwEuljvgCxYDYtIKWAuky5BjugqLGta4 + BAr4AlwsGyAssRWulGAlziIXI2SxqgNZAhfOCnYWaz5U8ZcE2hxxqGGf4X02X9x85fdXECa31OCPuFis + +7Xutidsdbt02q04mlyr3aTV1rDQVGk05RpNkUa9Wq3OVauyVaoVrYRiskLiIIFiQIhhKiAU5N7wNoJB + puO3YdGolQqIIbggL/BFMRLgcimgrUq0QwmwIhfjyGKlAbhYdagLiDUfqvhMAE2Ig0fxQ+Prz9cTyiZB + oA+4McDutJ3tXltdo07XoNPV6XSbdLpaHcO6Qqsp0ajXqtX5avUqtTpLrV5pGrgcQRYiwxWbwBcPCAXq + ahjqhFYQkfmtvRAKYjHaRsCXdJakgGNKe5MIVjGyWGkIXOr/UaPqWQEaKRa4XH+h3uRSKzHco2+Ntjtn + Z7vfVre9BcrsVrwqrbZMi0sINas1mlx2rYcms0WoMxnoiv4KXFWP0WQ8CGJoBYgMg8zvgqSZABq7gETQ + QABJAYeVeta8bd0qsrwLiDUfj2cCaPyqAxIHMMUQXdBm8vmUt6bggmm7A3bsYjzcyEv3eQvXAelwNz3u + PS7U4qJYdnlKjinKBLpqokpmJ4NBhhYTxERkcm90WS8UGXaCrleCZwCLwV+SWoBLOkBsFROWOGuCLK8g + Ue79ywONX3vo5KHY1toOynPemeNy0cXukIAyruOlO6Y5yhU6dhFQG9fx0qVAmgUaub8cw8eAGMPgdKoN + Fl66XoyjDMcGl0aXWEF/6apv4Esle6onizGlzjVxltqqdBMaL2w8uoflx+UgT+Vf4RfAijRmzpimt5ra + QRk31LM7vHHjMS4QM0e5UqfDxfQ4dIWutso2vRiPgFbEKrAxBxBTyYJmaOmiTaQhMHDIlfkFmjQQAKGg + 244JYg5o+7C2lWn/YozG8oJMYUbGjOOfHG8H5UXvLzJFGaJBXMa9VlU6div9OiYarV5MTyirhqpkMhkd + z0SFITqHhW7ZBMpI8OiOXs5loEytaroTQVxJpjzgSWtEvwzQWNCd3Z1T16a2AzH+Cih7XvK0OyLisjnK + uIWXRMPsVnpCWT1ZLXeWwyzzCjKhzC8kFOuy+Nq7p3tv5i8ANFxqUFRQbl1u+ygbFQMo427HRkGXmxdA + I5fLhCt425fmeRqFQYE6Bj8iC4pBKCOxRlUIlSCYZX69MQwcv3KaFjfxXSr/imD+rEDjDYi1qO/IvhVH + K9pHGavfI8VoiTLuHmSKsVGnK3jcApihUUYrUWvmKNPqRzfkofyG2gX8MooVqFGIL+ymCyc6crNgx6H/ + +YBGZoU678SUiftu7Wsf5alvTWUeQ7z6cTMHlAUzxy7fJS6bXQvL7x5U9WG30vN9UKjD0fV4VIcjaTa5 + QZruqnm6okEvxs8ENOoG+iB9RnEGsrv2UU68lYhbpJmT4x7jR6GsHqqWqWTIrcXSDJtBtx+jPI/EBEWi + Vi8UfLqi8TMBDclDsot8ZOPhje1DfPK7kwNfH4hL0Y1ZCTm5tlBu9Z7S5ns01WPUckfjAgigycyJpRnV + ZKR/dMcuakPI/R57RWbHVaLVZ/60jMbbE+5iTuYcHErSPsoNdxtirsfYn7G32y/KSpo9BtNlsWK0a5nV + U9UKDwVKoOIF0ESa4ZpNbo1GyeInEg0jozeWrPgpIjc7efDAnlF9I3Lqs059caL9WHY73eu0h3y/RLZF + Iq21kVbYSMttpGU20lIWkmJrSYG1ZJ21ZJW1zUorm+VWNkutbJZY2aS1ElYTXu7q2jkmJjhxVP8xo/uP + HTNw/NhBkyYMmTxx6PSpw2cljZ47e1zK/ImLFk7NWDJjxdLZOZnz81ctWJOfumFtWuGG9OKCjJLCpaVF + y8qKlz9dWH4SRqN04Kn3nJc977FEBs1hMHARut1RO7s9drbbzOoYlJXw1a9dLmtg5oIU6JtwLvMFEBkg + STNcM6SZbpunSVq6Q+xpXczdlsJYiF+38tKVFBVlmc2RVbkRkY2oKkfkVFXkVFesQtRU5hqjKq+WRf6m + 6vz0tKTY2LD+iX037F53+u5J0/jy5GlRHPr8QN8r8aoTCvkumbxBKq+Vyiul8gqpvFwq38hCViqRFUlk + 6yWyPIk0SyJdKZEul0gzJNJ0iYwi41FIZ9lY+XfrFdd97pwp8+ZOnT9vekpyUurCWUvS5i7NWJC5YlFu + TvraNSuLCnPLy9bWVhdu2bxxx7aqvbvrDjRtPXJox/Fju0+e2HvmVNPZMwfPnz148fzhi+ePXLpw9NLF + o5cvHrt86fiVyyeuIq6cfOXKqWtXT1975fSrr5x59drZ66+ee+3V869dP3/jtQuvv3bx9RuXbt649Mbr + l9+4eeXWzau33rj65q1X3rx17akxGnVbdCti+sdk1WShkdq+IuNvSz4twcl3rYgyrxbxDJtnJW07Oc0i + jTJKidFCbuawAPI8m3ITLICYZeWuGQUNFD9NpPlppSfmvH4KjF6dt3jk8L4efm4zV8zYcWNbK0Tm1G6m + 8+QbE51POcqbpPJGqWyTVFbdTGTO5RKJrFAiWyeR5tpIs2yMXE5nXKYQM1o6z8YqpFt0dNjc2ZPnzgad + pyXPn7FwQVLaojnpS5JXLFuYk52Wn7e8YENWaXF+VcX6+k0ljVvKd++s3ben/tCBxqOHd5zgdD594NzZ + gxfOHXq2GI3KAIqc3v7eM5fP3HZt22NZjCds+3Jbvxv97C/YM6eM3NpMlJnBAJdR+URNjqpFdBG66Ap0 + 8eeaxRpld2ViYiIKRtwyk5nDUsEzQLIZdDW0uKDBy0YdnFf+0SbvRzI6JzN5xLA+Tu4O4+aPqTi+sT0W + i5R61s0kjzNuigMy+TaprE4iq5bIKqSycqlMUGQWZVJZsURWIJGtlkizBS6vsJEus+FENmG0dC7jclRk + 8OxZk+bMngJ1ZtK8YMaiVEjzvGUZKVmZi/Nyl65fu7K4MLdi45oaSHND2XYmzZv279t8+OC2Y0d2gs6n + Tuw9fbrp7On9UOfz5w49E4xGCQb9Y/9Q/9krZ2+9vLUjLMZzYJNBZIcLDkisje5iS8t8hJc9YTCoit9u + 5ZPV8lOYLmMqmbgsTkyomkGTAlQCFduMnzo3aT1h6aDrKFyfMWPaqKjIwKDuAbOzZjZcrjt990RzmLmL + ln5j/GtjmSLvFxTZSGSJrFwi2yiRgcIIGAyIMgzGOoksFwYDomwjXW4jXQouUzxSZ+PnM2ysDC/HxITP + njmJ6Dx/7rQFydMXpsyENC+DzViZuio7fe3qFQUbsjeW5ldXbmioK27cUrFrB5Pmg/u3HD28/diRHSeP + MzrDbJw53XTuzIFfktFwnWjLOzg5oOGUvzn/1O9OdZDFeNqqj1cxa3GupSKLE2uU8MWivL5ZlNvulbAS + 80w1/DLmP8UegyYQicuoGVEDED88SqCUZ9MWP7HNoCpoxzc5/GiBZkWlthi9LGMmkqugAO/AKP9p6ZPL + jpacuntCHO0zuviDwthLPdTHlfI9UvlWWAuJrAqK3ExkxmUWUu6UTUWZc9mU0ZKx1t3cu8bHx8xMmgg6 + CzZjyoL501JTZi5eNDsjff6K5bAZS1bnL92wDjYjr7JiXd2mIrjmndur9uzadKBpi+A0th8/ugt0Pn1y + 7+mT+6DOZ8/s/1kZjbIhjASELzg6eOqiqUX7is7dO9dxCuOZu+/tHnVrFOuMHLeza2ouXFDfWtS6NhIZ + Hb/S5soysr68NhslxnbJGFbHwEyiCZfhMUy4TOV8cBmFZrLMtF1V3J36ebj8qNaRnTkPdYD43pGeHk4B + EX5j5yXmbVl14L0mY4GiJZE5qc0Zvf3TxpHXhkOOma/YLpU1SGQ1ElmliMgCixmRS2ykxTbSDRLpmpbu + 4pEot8Jom35WL6sthyb0nZk0YdbMiZDmuXMmJ8+btjBlBuPyknkrl6dkZy7Oz1u6fl1mSdGqCiED3Fxf + ur2xctfO2qa9kGYkgdtgnI8f3XnqxB7EmVP7WDb4MzAaG+G8A7wTJiakFaRtOrvpsfXiVtm976t9E29P + 1F/R258SipwoJcMgi31Fc773qKla1ly8f5xTZgYjQ4MqPurLaP2J6xiU+5FfpoFPGpUz4bJ5p/Xn5LKR + 0ShKNL2zt73qWruMLv+wbNDVAc4nHeUHpPIdEsbi2pYsbpZjI5GLQGQb6RobidgmZ5jwt8UfJdNtrIJe + Dgk2TJ44UuDyhDmzJs1jXJ66cMGMxang8twVy4jLGetgmYtyysvW1FRtaGAZYAWkudk1MzrDaZw4xtUZ + fuPnYvQT6a/4yWvurMEkHOvsQYtRRG6XxS0UmbpQHSAy9bDRXeV9P9qog9YfmlLULqHcD2OfdPBIq1zm + lbmnuDPqSR2IxWOLxSZmY+cn26e+Ntn/nJ/imEy2RyLbKpHV2chqbJgWkzWmaJZjRmTIMYi83ka6GkS2 + lmRaS1bYSJDvtUtk2GdriLLWckD/2KTp45JmjDNyee7k5PnTUMpYnDqLcXlpSnZWM5cLczaWrq6pQjWj + eOuWjTsaK3fvYtJ86MCWwwfhNIx0BqOhzoLfeCYZnXcnb/Drg70ve9ufZr6YJXjbhdEhOApujUVabJRj + dEaocEEDGLAW7dYujBNcyPpilZh64aJMNz3x7TqoL2NsATU5dLJpyIgfPCI+EuNZ4LJRox/L6Px3cofg + 4uDT7vKjUkbhRom0zgZ9EFmljazcRrZRiDJESxaTryiwka61kebZMBavBJGtJcusJRnWkiU2CCnCmPi1 + +MRmlFU3z67RkcFTpyQmTR9r5PLsifPAZaPHmJWRPo/pctai/NwMoZSRXV4GLq+rqy3aygrNlbt31jTt + qT/QtBl0PnKIjDMzG/DOQjb4bDD67PdnV99ZDTscdDWIVdqOiVTYnMItWfxIjuErULXAVByfC2hjmIhX + 45i7GKiSO8gxKM6dsliUMfhCBoPa2Kgv8zO36DQoyv3Mp7medILrSSX4sc9vodElHxRNuzEl+kKE00kH + +ZFm/tbbSGtspFXNrbyNQjePUViI0uZPwOhSQY4LBTnO53JsLVluLVkKFoujFUbbjLPq5vdycLDfmMQh + 06clzpg2ZibT5fFzZk+aP2fKgmTkfklLFs9emj5v5YqFq7IXr85D7reiuHBV+cbV1UyXwWVY5gpwed+e + uv376g8yOsNpNB47wsoaJ46hUMf8xi/D6NLPSue+Mxf+IeBqABtAPmHH9HefkNHBC7fKX1C4LRaj9lbc + XEemTA+l5DYmPFsQebAKE3I4DoiILN4GTFkfPwiRzpokg4EJI5oVpzO3zI93eer7gh/L3DZ7hvIjEtle + iQwWGB1oIm+liLzN/CUWG0NoTjMu45MSa6MWrxO02GgqmlmcbkJk/sdHjLZJtOqm7xoY4DtqxMBpU0eD + y9DlmUnj5syaICR+U1MWTF+cOnNJ2pzlS5MzVy5clZO2Jn9ZwXoh99uYX1Np5PK2reW7djDL3LQXbcDN + B/dvPnKwUcgDt5E6/8KMboW5VJEwD2FYlgfrg5CjQLEC1pi0uMMspoIy8j25vZxu2jMnMp2bio4fnDLt + QaODEDErjh42JvKpiEGDzOZnbv2km4KflNoWUnC2VdqaUZimLIQyhbW00Fq63lq6hs1aMEeBgBCTo2iT + xSJ2p9lYD+z2sotlWKj/2MQhjMhTRwuiPHY2RHkWMxgL5k9NXTgjbREzGCuXL8jOhMFIX7dmeeGGzNJi + tEuYX26oK9raAF1GAxBcRqGZChponWxFHGV0hjob/cYvzehWyWuuwtQBIQrDTnAh5o6i7baeSbsPyZ4y + XIlzGrCZ0sRa8Hs6OZFRvuDnpvKDECHKHTnZ7ElJ95M+36KF+BKLibnNwQaFiqwlhcKs0GprSY6VJFMI + mGKyEx2hsGA5bCZZdQvv2lXSJS42YsrkkVOnjAKXZ0CUZ4ydNWPc7JkT5s2ZlDx/SmrK9EWpM9MhysuS + s1YszGWinCEYDCR+uVUVa2pr0C4hj1G+i1WZqwUuQ5oZnck4M+/8jDLaXIJpsqKc5XVsGJmrMA3LdsBO + PPIV8wQ5dpJjjx/2nXE5Fp/HDmtBh4XTSdbiA4DF56a2L8rPlC6L3yIWLfhbYmMkL8265VvbrLKyybRi + E28rrCTLrSTLrCQZVpJ0K0maVUtf3Ja7sLaZYWXV8+Wutl1CQvxGjOg3ZRKIPHLalFHTp41OEpwyRHnu + nInJ8yYvTJ62aGFSetrs5UvhlBesyl6Un7dk3ZplgijnlDODgcSvYHN9UeOWsh3b4DGQ/lVDmpv2om+C + JLDh4P4GoazBvPOzx2gSX05eWAjoL/XueGmC7PDj8joTLcYknKqfSu4mx5k52N1HLBZfTs0PGUGyh8E4 + nNDAt7fTSdacyFS+MDk39amcBvWT6nILRkvWW0tgHvKsbXIE5grkZRObNLSZYWWTbhzaZCwWR4tMrwWj + rSd06xbVtaumS1Cgb8KQ3pMnDp8yacTUySOng8hTE2dMF9zFrPHzQOT5UxYumLYoFUSetSxjbubylJys + 1PzctLVrlhasX1lSlFVemltZsXpTNfp+BVvq0cZmXN65vRK6TNK8fy+SwDpwWVBnJtDPKKONzCXzwMUX + 5H1cOtfq6JB6khpzQ3JbOQ4gRe+8VRajjoyeiPjuBn6xAG2/ph3u/GhaMZFpS6W4e/3MirLJe8WC0ZYz + t5m8rY4et8Nom9lWVv1e7urVxdnZLjoyaPSIAZMmDuNEhiLPgCJPHzN75tg5syfMmztxAYicMj0NRF4y + e1mGoMhZC/Ny0tatXrph/fLiwqyykpxKiHLV2k01MMuFWxtKtm0t29EILqOUYbQZjM776g7sgzrDbDz7 + jP5RzOV0xni9qjcTYlzzhGOfOIXpwDJ+wwsdqEUsplsF0BOh00YwRkRHNdA5AuSRyVrw2gUnMlokz075 + 4on03aJV8j6W0dZTunXr1bWrR5cuXTqFhvgNGdxr4rihk8YPnTRh+ORJw6dOHgFrMX3qqBnTR89KGjtn + 1rh5syfOnzt54YKpixZOX7I4KWMJsxZZK5JXZXNFXl5UkFlWgvJFXnXlmtrqdQ0Q5Ybixs3EZUxlVOze + waR5725yzahpYH7uOWJ0G1OarUowjAR2OylDlHItO0cWRxGJUzuiMN0DBSGGL+b3FPF7dOhmddTeMKcs + lmNULWiTOz9HQHwk+/NLZM76DjHaesLLjL9eXSxtOvv6uMX2CBs9sv+EcQkTxidMHJ/A5HjSMLB4+lTG + 4qQZibOSxsyeNW7u7Anz505KSZ6cmjJtySLBIGfMXbl8fnZmSm72otV5S9avzShYj3wPRM6p2Liqqnx1 + bdXa+k0bttQXbt1cBC5vbyQul4PLu3dW7mV0Rq0Z8StitCZVox6rVvVSKXwU6N3ROch0Jif0lySYHyVL + Z0YShfnJcHRyGebsUT5GK4S0GIU3MhWovWHfPckx+Qq0RegogVb3uT+RID6DT27BaOukblbDunaLtoT4 + Wko6u7rahwTr+/aJHjdm0PixgyeMGzxh/JCJExImN1N42hTGYgjxzOlgsaDFcyYkz5uYkjxl0cJpaakz + BHc8e+XyeVkrkemlrs5dvHZ1+vq1S4s2rCgpyiwvBZFzqytW11avrasVRFng8rYt0OXSHY1l4PIu0Hln + 5R7mNKqeb0bDNqgTmPllzFXLHnsOMj+Wk/OX8jqoMHrSRGE6HI4OL+O3QaEVQic/mbCYLiHhN2SYHNjw + DHLzx/1IFg52Gh9v14hwQ98+UYkj+48TNuYZyQv+jgd/h0KCp0waNm3K8GmCl0gChWckwhRjz968OeMF + CjNHsThVcBTpM5cvnQMWZzMWL1ydu2hNfpogx8tLCleWFWdtLMUeL1iLfIHI6xs2wSkXbG2AWS4Gl7c3 + Mi7v2FYGLu/aAacB4/yrYDTqZ3RrJD9hml8fyU/rFZ+DTMee0smcdLghnRxJKswpzIUYvhiVCjpci6wx + v0pH7I75nPLzkuk9Ka8tJowfPHH8EOwtncTEd+iUiYy8UyeDvIL+TgN/Rwn8HTNn1th5c8Ylz5uwYB55 + ialpqdPSF88AhSHEK5bNzVo5PydrQW7OwvzcxWtWp61fk1G4fllxIeR45cYSzF3AV+TVVEKR19TVMFHe + XLdhM0S5obBxC7jM6Exc3rkNTmPjr43RyNmgth0/B5mOPcXEJvEXNTY6fw9NPK7CmK+gAw35hVt0vhY5 + Cn6Vzq+exS2qd9OnjpgxDTFyJk53T0Iilzhn1pi5s8fOI/1ldYlJCxeAv1PSFk1bsnh6+pKkZemzViyd + k8m8xLycrORVoPCq1DV5oPCSDesyCjcsLSpYXlIMFqP2BjnGNlu2r7a2ajWIXF+7rn7TenB5S4Ogy8xj + FG/bWrKdhVGdf52Mhtt9onOQUSNGUQKHPNH5kSTBZCT4EXzioyLFQvxrdRQd0WuL+XNhG8YvmD8hJXli + 6oJJixZOXrywmbxpM5amz1q+dNaKZbMzl8/NBn8zwd+UvFXMS6xlKpy2YW16wXr44mXFBStKicVljMVV + bL84FDlvUzWqyWvqa9fCXWyuY1zeXL9B4HJhI9I/Uud/B0Y/6TnI4qN66QhJOj+S38knVuF/Zwqb1qOX + LpmxLCNpecbMFUtnrVyGLA7iK5AX4pu9IDc7JT934eq81LX5i9atXiyo8BLsOSzasLSkcHlpEXzxyo2l + WRVliBx29kF5bjVOPYAiV+fX1cBdMC4jiMtb6hGoyZE6/5sx+knPQRbrr9hF8A7ev5WX6Ig6G+ejcVRM + Xk5y3qoFOIhlde7CNXnwD6kCeaG/TIKJv0UFy0qLQOEVZezEGpzpgQM9wGLhHA/j8R3GUzuMXK41crlh + E4oYsMz/9oymW3s7fg6yybGn4gNPO/7y/hs+02I9o21awboliML16UUbMoqEc4WEYCzG6UJMiEvoWJqs + io1ZghYbz6FhR9GITqBhHqMGfnlN3X8YbXICzZOeg/yLj84/p+8Gi+KCpQiisEBeFtgg3ny+Eh2uxHxF + R85U+g+j2zxTqa3jpX+tVbRf6g1hwSksYvGPPyXsP4z+yU8J+6WY8rz8vz/yTKW2zr37D6P/w+hfmPr/ + YfTPdbrBL/xC/9v89/9h9H8Y/esi+38Y/R9G/7oY/f8DPTxUq2GibSkAAAAASUVORK5CYII= + + + + Nombre del producto + + + English + + + Derechos de autor + + + Empresa + + + Descripción + + + & Aceptar + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/AboutBoxForm.fr.resx b/client/administration/UdsAdmin/forms/AboutBoxForm.fr.resx new file mode 100644 index 000000000..6a2e7bf38 --- /dev/null +++ b/client/administration/UdsAdmin/forms/AboutBoxForm.fr.resx @@ -0,0 +1,890 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 2 + + + + Fill + + + + + iVBORw0KGgoAAAANSUhEUgAAAHgAAAEGCAIAAAAhWcaAAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAcOdJREFUeF7tvQdY + lVe6Pc7z/O69czOJihE4vdF7Oxx6FwXFrtixd+yIKIKNImClSxdQsSv23luMMcaYXkwyiTF1MtW5Mzr/ + /9rfe9h+nAOIGZNoZs7zPjyIR4R11ll7vWXvbSGvkCsqFYoqhbJGqapTqRvU6q1qzXaNbrdOt09ne8jW + 9pit3Uk7uzN29ufs7c8LgU9O29uftLc7Zmd32M5uv53dPjvb3ba2O2xtt9nabrW1bbC1rbfV5mnVo9UK + b0VWVtZrr7325z//+a9//evf/va3//u///v73//+j3/848GDBw8fPvyn8Pj/fu0PCwZ0hUJZqVRVqVTV + KnWNWrNJo6nTaDdrdY063XadbpfOdq+t3UE7uyN2QBb4MpQRpwSsjwtfx982mWG9yda21labq1WPUiu8 + FLm5uW+99daf/vSnv/zlL/fv3/93g9sCKIPRBLS6Ws2ArtFoa7XaOq2uXqdr0NluEUi63dZ2ly2Yy/h7 + yM7uqB2DmEcz1nZ77Gx3ini9yVZXo9NV6zTZGtUwldxVXlxc/Nlnn/0bws2AfoRydTPKtVrdJh2LOh1E + gEnBZluGeGMz4nsFxEFkSAdARwBrvAAkI7vMsK7S6Sp1mqUa1QCV3Fa+ZcuWP/zhD/9WcFsAZWWVkc7g + sqaW0fkRynW2tjw44iA4tJg4zhEHyghAzyUbTyC9Jl4D6wqdrlynnq9WxiiTkpJOnjzJ4f7Va7eFskKp + qlSpq9TQDU21IBqbjEA/gtgEbhPEsQbuFlSlSUCZgi+PeBPg3cCxLtfpNup0xTr1ZLXCX7Fq1ar3339f + DDfWSZOl8texTFooS5XKcoY1Q7lGi9DV6lhs0rUOtDnBSVLA8Z220Ggj4gAd0EOyyYqYYF2m05XqtJla + 1RCV3EHe2Nj4+9//HnBzZ/LrsyUWyrVK1QaVukStLlNrKjTaKq22mmENDrYIMakfS3BICiEOYeHLI16P + umYNAa9LdboSgdpz1cpI5eLFi2/cuAG4//jHP7ZlS55ralsoc5XKPKUqT6Veq9YUaLQlWm2ZlolpJXML + 8GcdQhxiYq7gsB+QFAANi82tSH1LrIt1uiIdHLdqBPMkDQ0N33333Q8//EBwi4X7eXfcFspspSpHpV6l + VuepNas1CO06rW4D4xoTUyCORQxLWU3HOG4CN0QD0gETggDWfHmstWXflniN/6hQpy3QqueplVHKJUuW + 3L59+/vvv+dKYu64n0dqWygzlaoslTpHDaw1uRpNnkabr9WuEQKIFwhvcBHiHeK4GG6Sb8BNwVNHLI9i + rAt02g1aTY5GlaCSO8r37Nnz7bfftqokzym1LVQrVOpMtTpLjZwCv6d2lRa5HMOaw02IFwrsAwc7TnBz + uMFowppbERHWIDX+I+1arXqGWhGkWL169RdffAElIU+C9P25prYA9Eq1JlPDIkujzdGyILjzBLhXNxN8 + rRZYmEjKYwhuot3EbgqOdXWzhkCsNxix1izRKOOVMrns8uXL33zzjTm1n7s6iQVQ5kBrs7TGyBbBbU7w + 9QLcIHizgj8Z3JTvkIZw20d6zbEWtAtFErmLfPv27V999dXzTm0G9CM6c6DpE4K7LYJDT4qeRE9M2A2U + QWrCmmwfXjZgjYURvMa7h7CGjAQqNmzYcO/ePTG1YUier7zGQjlFqU5nWD+iswnc+GP7cLeU78ezG0k5 + FU+AMoU51usfYa1ZpFH2YEb7nXfe+frrr7kh4SXA50JGLIKDg2WOMkWYQjlEqZ6pbg9usZ6YyDdnd0fE + RExtKg3ioznWWBjJ/KzRYvFQDVTJVLILFy6A2jAk8NomK+Qz7kYs6uvrCwsLU1JShg8fHhgYqPBRqOJV + 6klq7dJmvTYheDvsJu1Geg24scTBepvkO22llECZgtIZriEirI2S7STfv3//l19++dzJiMWOHTt27dq1 + W3jAva5Zs2batGk9evRQeCpUvVQo/WhXtIa4OdzN7GPOhKx3R4wgWUBSEgQ+MdFrE6wnsR4CEkg4P6yQ + JCOUsj/jkm1x4MCBgwcPHjp06PDhw/gED1CmqakJNJ85cyZD3FeBIrJ6lpmqcCUxt95rTX13h6hNiD8W + 65ms7FdaWvr5559DRsiNoBplLtnPVAJpgaLwqVOnTgsPfHLixInjx48fPXqUcAfo4PiECRPkWrkyQqke + YyYp7Qg3KQmoLZRNHpPEc+EmrKmsShqCpLHZhBityDy1IkSxdu1aNGval+xnB2uLK8Lj6tWr+Ijs4OLF + i+fPnz979ixwx2vAQYeZRRWiX79+jOBDVJoFIpdi4gLFWeWPoDaJCT62i7VmoQYvfHZ29qeffiqWbHEC + +UwtjxZvvPHGrVu38PHmzZuvv/462tXXr19/5ZVXgDtAxyoP0MF0IH7s2DHQfP369WPGjJG7yVV9Vahw + tkhw2nLcYmqb16dMCrBEbQqOdQmrOrXg9WqtJk2jjFauWLHik08+uXv3LpwfTyC5y352sLZAg+OD5se7 + 77779ttvo1cN6IE7CsSvvvoqQAfTgfi5c+dAc2gLEK+qqsKaKXeSM4syR4AbvO6IanND0k69uy2skcjw + JRefAOt0DbpiS5cuvXPnDl8eeYmVL4/PwkSDxe+aH9A7vA3xE3/88cdA/r333uOgg+mg+bVr10Bzjjg4 + jtV/1qxZDO4+Ks08zSOs26I2GZLmylR7KyRoTnDjE+I1/hV4LcYaRZh8rSaDpTMZGRn4yWl55FZEnD3+ + 4lhbwCThTQdbik/wU0LvQA2AT6B/9NFHAJ2Y/uabb3LEieNQFej45s2b0WmVu8tVg1Saxc1lKROseS2Q + y0ir5q/VPo7AfbacAutinRZJI+c1xzpGuWzZMlAEPzm3ItQ6eEZ4bQFdQ5YFh4SP+BxuCaADeg46mA4R + JJoT4hAWQhxL6KVLl7B4QlJqamomTZqk8FNgOokpidhom5SlKI1EXgM38ljJJuiFWZxHWHNzLQDNeA0N + iVZmZmaCGWKsYfueEawt8LLzB5JaCJwJ6MR0orkYcUg5llDoOCSFCH7mzJmioqKhQ4eiUaKerm4Pa+5G + WpXstnhNfRmhic4q18RrjjXWxghlXl4esOa2jyz2s4C1Bf0QeKCsjs9h++GQAD1+Pg46VA/lBaI5IU6q + goVULCkgOOnJypUrmXAPUKGszErblNGYFbhZ+4ZqrY912URqPrOAdwOKfNxcc6xTNIpgRUFBwYcffvis + YW2B0hc9MHWIR6ugg+lEc0Kcc5x0HJKCuhoafTAqpCfwhUjrp0+fjkYJK5u0jTUWtxbLY/utdzHWlMhw + sSbznq+F41QYFJWVle1gTZ7vZ85lLGg5pgd+AjxaBZ1oLkYcUg6Cw8ASwfGLQcFJTzjcMN1yO7mqvwoa + 2havnwDr5peBKTv0HZMh3IQ0k5phPV2NQs22bdtMsBavjT8/1hYmL6wYdM50Mc2BOFcVLJ5EcHgVWCso + OPTEBG5UUWABlSGCarehIU+MNcSaEnQYPm5CONYYF56gRof3yJEjHGsqifyCWJsCLcbdnOYccUi5mOD4 + NUjBTeAmMYH7RsEETSn1cLVRrM0bkrB9YovdloaISc0NH18YmwWEjWYPV6N+DR17RrBuD2gOequI0+LJ + CU4KTnoihhvaDS+IDBPVEuTuyl5K5rU50OLmb0ewFr0AxsFJmBB0GmlhFJEa/4Wqn2ru3LlYrrnnw09I + eSM11Hlr5mfQ6w4BbY446bgJwcml4Jfh7CbtxlKJZAdVFLjA1NRUGAN1kkBtatOIseZro4kPERs+c6xh + QvjCyLHO1WpWaJTdldhvYI41rz39bFg/GdCEuJjg3KuAI6QnBDeJCbSblkoygrROorwp95Srx6oZ0G1h + Df01adBwrMWqQmJtsjDSi4fvDKwXaFC8hgnBi42cC281rChUeyKsaYfHz5Cg/xigxQQXGxUy4xxuiAng + xi8GZwIjiN8T6ySUBDkO+mfMjSSoHgEt5jVKIuSvxXNobZCaZYxUCeFZjIjUbGPHVLXcWY7+Bv53qj1R + nQ8OivdlfgYT8i8BbUJwricEN5kTciaU6cCWwHQTtdFVGDduHGqteIMbBUQ0G2XMZYQc3ThlaZIudkSs + BVIzrLEwymTQLsIaLzzWEvCA+jJUDPmpsX4KQLcFN18quXBDSZCwgdooDYLayGtmz56t7KlkCaSJWFOO + DvEVak8Ma/O8vH2xpm9IGekqLRbh9PR0LBUQMbze+Enw8osN308t1k8NaA43iQlfKgE3CTcpiQm14f8w + sIHaiCbVDGvUnqgTxqeH28Ha3FmTgDSTGt9fEaCoqKjAC4x3FaRMXOT7GUzIUwZaDLe5koBBUBK8bTm1 + 8V4Gy9AlUYYq1cnqVoYrgTX0ty1SN9dAjGUQ7qzJ7bUktXqKGrsLUEZH+srNNRk+k4Xxp3B7PwnQYmfC + 4SYlwRIEapNqwwOQIcFvjl2IzPbNF7DmY5UAC4YPCyMXa94NaM2EGJ01lZyoDMJJLdRbVINVSFPh67FO + iE3Iz7Aw/lRAmwg3KQlfJLlqkyGhFRLZIytCAWsALRphNU4MVwnjOOLOS1tYk9uj1JwEpFmpNcs1ynAl + /CVWY25C+MJIhcyfSKx/WqBbVRKu2mIZQfIGq8uwBq+hIWJSk1hzARF3FM2xFvcHuICQUgukxtQk3B4G + V9C+wJpssjBysX7q5b2fA2ixknBqk4xQagMZobwGLMvPz1eGKTHY2KIPSxkjOWtOahMZEZdBqD/A00UR + qdGOwLgEOstInWhhpMq1iVg/dbf3MwHdKrUptSEZQV4Dow2swTJMazAfgsoqLzfD7VGXAAICQPnsB3Vv + ebvLpI6K2h7Vm/iqKJBas0yDtXfdunVInSg7x2rxU2cxPyvQRG1e8oYgimUEvyolNVgeMUGgjFWyYWKO + NXd75ED4/FirWHMBQb1JvCpSCyJHSBft5RjIgr8UZzHkrH8KAfm5gW5LRiiHxLrEl8fk5GSU38SkNpat + K4RVkU9H0liTGa+NDoQ3B/iqKADNBKSvav78+SgrUhbDnbXY7T1FAfkFgDaREXIj3PmRy8avDa5NnToV + ZyK0IHVzumgkNQ2gisXaJF2ErKMGIl4Vm0nNUhhfRXV1NVJzctZYJ6jk9FO4vV8MaBMZETs/ctnAGq1e + 1J7QLjFiDbywKsKB0KoIfPmwb2tYPypYk602IzX2yIwaNQrNAThreB4qOeGV/ikE5JcE2lyyqRSF35Nj + DR8m95KzqTO+9ZF2ctCqSIdbcF63KiCw1eJVEVavWT2wGR22GrkSBARu7ycVkF8Y6I5gjTk/RajCaEI4 + qclWQzdoc4YJ1lxA+KoozhXJU0Ops7UsL9eyvBxuz0RA+EDIU0lhfnmg+fIoTtZNeI0RJGw7ZKQG0Hx3 + KSc133EkXhhNbDVWRW71xKTO1sLeoLAlFhAsyLy2J24O/Cs1kGcCaHMrAtsnxhrqiSkRSCptnDbu3uCk + Fu/uasuBUGeAWz0xqWepMe6DQRQTB0IpzNMqWD8rQLePNXwIhoZx/IF6tpoBTUuiUK1mSk1bFhGQkfZJ + TQUQShSb1QOTgpiGnTNnDuYI4UCo3kSrIupffEKBOl4/mtTPENDmWPO1kfx1XV0dy86RxaBfjiWRJ+UQ + aNr83LZYG+dATEhNk5hZWswcY7QeJz1hGJzqTVQDQXmAbPW/3oV5toBuC2swC1iDZZiDRqmTAY2MnLcF + IBcm2565gIhXRRRAypqHm8xJ3V81Y8YMNH3aXxV/NKmfOaDN10bwGhkE8gjk6CgDMWedpDYCLZSqmXpA + NOg8LdEJhyY1kBakJk8tUg9NMiM1Rusx7sNttfmq+KNzxWcRaBOsKW+kHB2ZG4bq4Pbwfjdu/OdLIp0K + Aqzp3ATzVZGmfkFqc6UWNq0i4wepkSXRqsgLe5Qr8mr1jyP1Mwq0ed5IWMMJIGlEm1U9VM2Abt45alwS + xWeviLEWWz1KyilR5D5PAJoptbN869atGPShwp55rvij++XPLtBirKkeQjVVLFDwBkAEb3YGtLBzgJWZ + gKxwUpnx7JVWHQiRWuypYT+EzIW2l2HvE6bIsIcB0/XiXFFcAPlx9uOZBtoEa6qpAmssjEgXsUfo0dZz + Kn0Q0Di/CdQ2ERATUlP5lDqKpNQC0Dh2AAdN7t2719zq8QLIjyP1sw40x5paM+KFEbU9lJUZoyHTGElA + oQPeQzjtkGHND8oycSDmpBYBDawxrpeWlgbbTlaPF0D+RVI/B0CbYM3FGrNOaOaClbSfzug96FhJfthe + W0qNf0LVD+7zmtUDWxR69eqFPayweib5y79C6ucDaMKaiiFcrFGOAPXUiWo6cYjJNNJCqAed30mHSDYf + Zt3C6hGpUdJD5cRsSQSp8fqhdfl0Sf08AU09MGqAoRKCLAaeFweBI1c0To6RTNPxy3Q4Kp3WaZa/ME+9 + sWXy0izTTKmHq0eMGPF0Sf3cAN2WWKOTiy7MI6AFmTaejwqsOalblqqNw77k88zUAz14JC/YOUmkNrcf + P8JTP09Ai7GmLAaiifUKxSbNSo1xEoGApsOWERCQtkiN+TEkL7x22nJJVPVmPg+khv3gnponiuLqRwfL + TM8Z0FysxQICPVUNVRmBFnJxdgQtUD4gCEg7pIa4i5dEsXpMZZO+OF6APDVPFKmpSD2BJ/J5zyXQfFoV + bg/pIt7aeKfDC7MVj9IWrId0RD6wbovUfEmkLJEKp83egy2JAew0Sey+pkSRmoomJb2OJy/PH9AmAkIp + DJQabQFju5aAxgHWdEg7bnkgUptVP4xLIi99tAQaZcKxY8eiy0XVD9SzqFOO2hbVqan50sEy03MJtLmA + oLYJ+6FbJ1z9QMaDgKZbHojU5j0BkBqtW54lUjrefCoaNuGinYjOC/a4w97QqA3q1Hx+jJovHST1cww0 + FxBKYZinnqw2FqbJ4dHtGsB6v0BqvAbmpMaSiNIHVw8R0CxLDGEnJuAsGJCa6tS8+WKSvDx2SXxegTYn + NU4OwSQqWxK5lQbQuJIHd5jgE5Aa1Q/hCDJx8kIbjYxbnalCLZJp1AhHjhyJyTGcJGCekT/Rkvh8A22y + KuLAEHWK2hToEwKvodSofpgnL7QkckPd0uSxwqlWjqMBzX2euMvVEfV4joE2XxXR9EOblc5gZ9IBdT7O + rkKyA9aHhNth2loSST0oc2mpHkjHoR5YEuHz+JJI06dPpB7PN9DAmuflWJrw+6PRBa9mLHcQ0Lhq6rRw + rRc8NS2JraoHZS5UNRWdEgrvgZ3V2L8vXhJpIhJdiI53Xp57oGkOmBebwD6U34x3ZkCaATSu9TorXOt1 + UFgSzbtcpB48czGR6Zksc8F+UCyJ1LqlzotJlvhY9XjugRaviiA1eIchc7vtwu07HGjcWHfWnik1lsRW + 1QPeA8W8ttTDR4GDR5AlovTBs8RWDXU73uNXArSY1Ci8YXrxEdBn7O0vCAFSw+e1pR4o5lHV1EymcRgu + jmnF4YqUJaJHLjbUXD3az1x+DUCbkBrH16JIzZJvXJgG6Thj73DBwemCEyP14Wb1MNlZDvWoEA6LbE2m + cT5Anz590GfghppPM9GIHtWY2lcPdtTPY832s/8EsVLj3Y0yBTMeSFUA9Fl7xwuOrhddATfz1G2ph4nJ + E7lpjKzLdaw7/q+ox68EaCI19RXBL2QZcGlMlE8woEFnj0sewBrsbk89uMlruR5SgSknJ4fUgyZsnlQ9 + LKAszz5hO/ITEqmpfIq1C/sEyETj7lZA7H3Z2+uSFyM1qYfY5IlO5WxTpvuo0Asm9TD3Hnw+rx31YED/ + OtSDPDX5PJQmMA7JLm6FiRaA9rns43fFz+2im1E9Wq17VIpkumXaoh7POrbYfiBWDxTzzDOXtsBk5979 + aoCmBi5NJfTu3RtdQWgF/AZ0AygHXg0E3GxJRDrelskT5+KitEWTopGpZTgWijIXTK2js4MtkZS5UCuA + V01bff9ZUEW1I+/NZ/854iURxTygQyuh5yXPgKsBoa+EAmvoNUvHTUweVw+xTLe8RQLXTGAHNdQD1Suo + h3krgKqmbSmERTt/9+wja/4TclKDfcieoRtAFgId9EpQ5KuREdciADrUgw00mck0OzUIbprSFrP1EIM1 + 8+bNw1n81Aowr5q2b/IY0L8y9aAlEe9rtALsjzCB9r3sCzp3v9495noMqM28x147Vp42O6eJuWkUPVpL + W9QJatygApnmVVO00DBxap4itirFFk/Uj3kuOM6XxEGDBjmUOUCgDVcM4HKv6736vNYHnzDvgRSxVZmG + m6at+mb5IcbPIiMjMZbHTR56LiYyzTu25kBZPFE/5rkAmqsHpnvtF9mTboDO/W70G/T6oNjrsYCemTzI + tLjhwmWa1kOU8VoaD5yLiPUQ1+Nyk0cDY+KObTsyzc6Pbn+5fC7AFf+Q3FADFN1wHfwGdAP4AuVhbwwb + cGMA1IPJdFtuup310JNdj/bjZNqigzWR5wtuUg8YA3WQGrBCLnq/1jvhZkLirURgjT9CptnA2GPXw5bG + A94cZkYs0zTvQTIt7gOYy7QFr4ngJ/uVGWq8kWUKWcCegOhXo6Ebo26Nmnh74tg3x0Ks4flYH0C4Cc20 + D4D1EGU8Mh4tgUb7Bt2yffv2cZnuuJu2oHP2fmVLIpdpNEcMxQYgO+TmkPG3x894e8a0t6cNfn0wM3no + A2A9NDu3EE0AZjyorSUqLbHhx1HqgQMH4kYxctM0LWZe9Gg1NbGgJuOvb0kk9Vi+fLlvmi/oPPLWyKlv + T53/7nzEmDfHMJk+0sZ6iCYAjAc5PBOgp6nDw8NxexsaLtxN84aLGEnztMXix83dPPuSTcU8HILqOdYT + dB735rjZ78xe/P7itA/SQOqoV6NQb2J98XaMh5nDw71RHh4eO3fuhEzzdi2GPXBYED9/oq20xeLHzd08 + F0AjEUPr2rmnM+g8+a3JKe+lrPhwReZHmcnvJsNQIztn+WGrQFNby8zhoXGD5i/OUmkrbeHroXkOaIH6 + k/gokI4Pkz3jWJPJQ9FH56kbe3PszLdngsu5H+euubMm44MMOBCsh60bD9yNQQ7PHGgUpj3ZrXMm6yH2 + ueCoMT5oSgueibOwaHWY7NdRZiKZxrWjiScSwWJwecMnG0o+Lcm9kzvh9gSWtsB4mDg8Slt4xaNlzkK7 + LnCwFtZD3F1AUzXUBOBlPLLL5uuhBT+M7F/ZCfNssptkesCAAYnbE9M/SAeXK35XUfNFTfGnxbPenoW8 + nCXiJg6PgMaQGC8tmVjpaCUG1LEeivNDPtFLJ0/QfgATslpwdyJeNH8dAkImD2cJjigdkfNxTulnpZvv + bt5xb0ftF7Vp76chbWGJeKsOD1a6DaDJSmPEVJwfiic9uIUzBZoWTeoUkKf+ERs0nllGA2i80xOyE9Z/ + sh747r63++DXB3fe2wnckZSjBdOmlW4rZ0lQDRs2jIwHdVswJ9YR42HBT9h7usdTPCPQg1bFxcX9F/Qv + /135ti+3HfnmyKnvTh36+lDBJwUDXx/IHB5KS+3kLGbJIQYZMHqAsUduPGikhtpa3FaYF58t6IhO8alv + vyZSA2iUlnpP6l33Rd3+r/ef+f7MlR+u4GP159XIyFnFo1Wga4RB3taycMybde/eHUDDePC2VkcK0+zO + 2Z/ieIpnhNGQadTpo4dGQy5OfHsCKFOA3ZNuT0L/heUsZgetY2iaDdO0CnSSGlfWo30jLkzTTub2HZ4F + +mA/6aFNvyziABqN1JBeIZCLS7+/xIEGu2E80OVixdLWgGYzj8jCzaRDM1fj6+uLM0O4w6MhsVYbtWIr + baFWe+L1EW96/jWtivhVYQn8Qv1INHhAqVPfS8X0AUsOza8OQPOwLaAXatzd3QlocaP2saUlCw+PaShx + 4WUxObSJyqfPWlUPwD32YdIEQCrh4eshRhmfg93LP1yOkRo2nd4q0OizUF2ppY/G1c2Ojo4AulUrLR6a + NslZLEJDG5ydE3CzksnB1T/RWahiFPDWwTKC2R+MtWEyEZfG4rYQvOpIMbDgBAUFeXl5OTk5abValUol + Fx74BH/EF/FXeEJ0dHT//v3xT3ByP2wc2h+4ABflHlgp/M5YCfHA/+Lo4nj595fFAayRjmPMg2XhrV2G + wTZbtAa0dqlWp9NhgW21hsedG+9p8d8XQG8ODCywt++OFJ724opPfXtax0bi+8ADwRLh+kwcJpyQkACY + PF1dekaEJg7qN3/S2JwFczZmLd1euOZYbdmVnQ23D+++c+bQvSun/vDahftvvvL3t68/fPc1BD7BH/FF + /BWecLup8Up92bGi3O2ZizYmT8ueNHJeQp/RMWE9/bw9He2QfOM/wsTty91eztucV3+x/uRnJy99d4nF + 95fWfrzWcMnAGM1PEhPtBGgT6BVatVoNoNvKWUyKpS2ABtZ6/XKNxhdFRWoZmJ98z++U6uDihlYk3iLg + Fw5Qg8O3t9X1CA+dOnLoqpS5W9blnm+sAUx/f/vVf75341+N25f/+drph5cPPTyz6+HxLQ8PVD/cVfxw + y+q/VS3/KHf2uZQxDeP7zQ12HRfmGeGuUysl0QOixy4Yu3Tj0pSmFMNpg26HcP4EwuQKLmw+bJXRmVqF + QgGgzYulIChtA2g1OQSjtwix2dt7nlLpAIFv9eT7jpywhxcT41Lg7OTJk+10uj4x0Qsmj6/IXn52S80X + F4//q4C285K88+o/b57/57XjDy80PTyx7eGhmoe7GdYPalY+KE97UJR8d9HQ+6vG3c8c9fGCfsfGRxX3 + N8wKc4l2U1hKftMpplO3kd1kC2XqIjVd6cw20NXYsl2eZO8yhRApNRQMWmeeHIq3IPKqtJjRjaGhWwlu + d/dJuL8K8078mpLHnnyPpQnucOPGjRi2dHN2GtGvDzi7v6Lo49OHfkJkzUF/9/o/b1365/WTDy8dZNQ+ + Uvdwb9nDbese1OU8qFx6d9nY+2unCliPvL90yF+X9P9ravwf50e/MtajMl47N1AS7dTZ2uZ/OkV2shpj + Jc+QYzstfLQmT6PJ1mhXNmNNiKMkLQBNySGfeQQ7Wy3/PwI6LGxbaOgjrF1cRmJFavXke/E1JVgq8X9g + Zw7+174x0cvnzNhXtuGTs0d+VnBN4H772j/fuNCM9U6GdVP5w52FDzfn381Nul86//76GffzJt7PHn1/ + 2dC/pg/8Y0rPe3MC7k73uTvZ4+5E1ytDHUp6KKforQy2L/6X5f/r2rurZIJEtYTdmcZiJQsG+komHZBE + eGLKwmljS1tAcyttAaBFWG8NCqp0chqIY375yfe0klIRFQTHd0fL3dnRYeyQASUrllzbs+WXBJewBsSg + 8+vngPI/rx59ePGAUa8P1jxs2vhgR8GX61PuV6ff35hyv2D2/TVTGLVXjvhzev97yeF3Z/nfnSZgPcHl + s/HOd8Y5fzjGqTFeszDQJsahc9du/9MlvIvNKBvVIhUuy2GIL9VgMcSBjwCaZ+HYVGtS7jBvaAHo7SKs + GbUDA4sdHeNxfxWKUnSaIbBGOxLLmqOD/bghgyqyl715aPeDd5gT+MlRxoLJeHrKiOC5vQ/P7Hx4ctvD + 41tZHNv88FjDw6P1jL+Iw5seHqp9yPCtfLhv48PdJQ93Fv2jce29DSn3Ny2/X7n4flny/cLZTEZyx/95 + 5fCv0nrcBdazg+5O19+d7AleM6zHOr+f6PTuaKe3RzruidcuDpT0sO/ctev/WEZZSsZJ4KPhL3EcLdZD + 5Cx87oDKHe3UlSzQ1TXDutHff529fQ+cyY4+Am5Tl0gkA2N7rF6cDOP1lzeu/O02/Nar/2i2XE8B69fP + sXUMqAGdxjUPajPZIlac/GDdrAerpz3InfQge/yDzDEPViY+WDGKxfKRwiejH2QmPsga+yBnPHtO3pQH + a2awf7JhzoPCeeyflyx8ULbo7yWp97ImM4hL5t8vmnu/YNb99dPvr57855zEr5b1+XIxsI5kWCcZ7k71 + vjvR7fPxLuD1B4lO74x0vD3C8dZwh9eHOWyJU8/xsw7SvfRfL/0/GxubVatWYZcuHB4lh5Tu8XIHHTJh + UsCziIw80CrWnp5ZNjYGO41m1thR2zbkf37+2FdXTn3/6tk/vn7xr7eu/t+/gDWzYiBdQ+6DkpQHuZMf + LBv+j0X9/zG35z9mRf/fjIg/Twv/w9Sw76aEfjMl9N7k0HuTQu5ODPliYsjnE0N+N4EFPsEfEV9OCsHf + fj059Nspob+fGoZ/9Zfp4X+bEf6PpIh/zI5m33BBPL7z/YUDvkqKub8s4f6K4fezRt/PSbyfMwbx56wR + 95bFf5kW+2VqzN3kiLtzgu/O9GdYT3b/YoLLJ2OcPxptxPqN4Q43hjm8OtThWoJDYaR8tH03H6UNiqV4 + i/PyPx/wwLufz6WLW7QW0dHHBaz3EK9DQrb6+dW6u5e5u5W4u2ZoVSGrU+e9c3QPXASw/vrq6d9fP/en + m5c41iQg7WsIY+uOAsavrLECpjGAA7gAI+D16YTgO+OCPxwb9P6YoHfHBL09JuitxKDbiUFvJgbeGh34 + xujAm60Fvo6/xXMQeDL+FQL//IOxQR+NC7ozPhjfFt8cr8SX4wI+SnD9YVrgX2YE/TUp9K9zov6a3OOv + C3v/MbXXlwsj7i6IZIyeH353bijjNbBmku15d7zrZ2MZ1u+PciJeA2sAfXWQ/dV4h+P9PFYG2/d2lEdF + RaWkpGDdovI/OTzKWXhDi9ZDAH1KwPpgSMhOvb7W2bnIy7Pc3686NLAeYfDJstOE56fMfffY3jtnDn9x + gWH9w/Xzj8Ea6B/f8qB62YOcCQzZmVF/mhZOsAICYEqAAiAxlK+PCvzXg78q9DLgNbs5zPdqP+e3x/i9 + P87w0XjDpxP8704K+Hpy4LdTDXcnu4K/jMXQaEgHBT5nvGZY/26My51EZ2ANvTZiPdj+Wl/HW8N8bg71 + vjHUpyTKOdFTbS+zWbBgAcrTUA/M4dFR6lgPxecuAegzERHH/P33uLtv0vtsCjTUhQVtbo6GsKAGg0+O + gy4qe97M947t++Ts4bsXj3/zyhnCGtkwaQjx+sHZPUxes8fjPfv3GRF4O+NdL0YWvzln6L+OaQe/w9XB + Xmf7Ol0f6Yu4MUp/c7T+zUT9W2P83hrj/dpoh1ujHd8e7fTBGCfoMhQD6+HdSe4M5Umedye43x3n+sVY + hvWHo5iMvDnC8fUhDq8PcH5rmM+bDGuf14f5vjbUpz7WbbrezlsjR8kIrXGUWZAf0q05/C4Gi8DAwz7e + uwIMe8NDDkSG7osI2RkWtMUE6wB9vqNtbEbS5PePNwHrLy+dEGP9t73lf1s/+/8WD/z7zEiAC+kEuHgL + vyOIAAe3g7g89addGuBxtp/LtRG+FK+OZAHQr470ODPM7nyC3aWh9leH2V8f4XBzpONb0IpEp4/HOkM3 + Ph/rApQRxOuPRjm9CxlJcLw90PW9Eb5vD/d9c7gv3i43hgJr3+vD9DviPecGOBhsldBuLI+8Kkc3b1kE + +h+MDDvePfJEdMSxqPDDUWFNESG7woO3toR7c6ChwMm+X/KExNebthHWXzes+T5r0g/zev1haigDdxzA + DWTgjvnlwRW/Whf6uZ0f4MaB5p9cHO5+Yqjt8cG2Jwfbnhpse3aI3QUB9GvDHa4Pd7g1wuGtkY4QDeAL + lBEfj2ZYvzfU6f0E9zujfD8YqX93pP72cP2t4b6vD9O/Nkz/6jC/a8P8dvX1nhvo5G+nwnla8HwQazgQ + UNuie+RpIU51jzwZHXE8KvxIVNj+yNA94cGNJlgHB1S4Og6b3Dv67OyEj6f3+HRc0PtjA95K9H9zlP/N + UQE3mcIG3GARiHjqxPzR3/BcH5eLg9zNgT4/zO34ENvjg5pjsO0JAfEzg+3ODbG7ONj+aoI9nAa8HRQD + ugHQWSQ43Rnm8Vmi/s5o/Yej/ID1OyP1b47Q3xzud2O4H8N6uOHqcMP2Pt4zAxy9dMqioiIkIpARDjRh + fQpYR0ccjQqDjADr7QLWgpIE1ofpq8K8N7qrh8g7davu7nIhQX8xwe/SUL/Lw/yuDDdcG+F/bUTA9ZEB + r7F4hrA+3dvp0hBPc6DPDXNtATRHfJDtiUG2pwbanh5od26g3UXYjCH28BtAHOvh7UGOd4Z5fp6o/12i + 36eJho9H+30w2u/dUX5vjTTcGmm4McLw6nDDK8MNV4YZLg83bOrlNUHv6KBWwHSLgebUhowcjQo/JEj2 + rvCA+jDfyjCv0lDPkhDPkmCPEnfteIWldkWQ7dGBvqeG6M8m6C8wuPEfAGt/c6yJ4zyEV4IFnvnqCBav + jAi4Otz/ynD/S8NYXEAMNSDODzWcSzCcFQX+iMDX6Ql4Jp5/Wfi3+A54pfHd8G2bfwb29joRa39lqPcr + I3wRYrjPDnNuHeiBtscGsDg+wPbEAIb4GTHi/ezfHep5Z5T+k9F+nyUaPk30u5No+CjR8P5o/3dGCW/u + kf7XRxiusR/JQL9LQYzHYE87AH1GkA76KJaRY1FB+yL9tkb4bAr1qgz2LAv2KA3yKKHwsp+rsfJJ8lId + 7O9zYpD+zBD9+aFgt+HqMIY1Ufv6yMDXRgWKMcXXAQf99wDrTILhZILf8SF+RwbrDw7UHxBi/0BfcTQN + 8DUJkyfQv8I/PzxIf2ww+26nEvzw2uBlYC/bUP3BHraXhvlcHu5zZbjPVSEI9FNDnY4NFklHM6OPEdD9 + jQG4OeJnB9qd722LMXashO+N9IV03Bnt90mi4ZMx/h+P8f9wTMC7iQG3Rwe8McofvzVwwMt/USANfk0C + umVEnO4efLi7f1O0365I/Y5wny2h3ptCvKqCPTcGepQFepQKUeLnvMJe2n2oo7QqxvXYIP1pUHuo38Wh + hsuAm+kUo9iV4QGgG8F6OsEgxhR4EYL7mmNvf989QuzuQNAz8U8Q/DvQN6RXgtDf18ezMdr26GCv40O8 + TiV4nR3qfX6Y96XhDPcTCfZHB+mODtQdG2RLQXptArQYcRD8ZKzulUGeNxK83xjq89YIwO334Wi/jxP9 + 74wJuDM24KOxge8nBr6TGHBrdMANhnUAYY1fvyXQgDjoSHf//dGGpig/0HlvpN/ucP3OMN/GUJ/6EO/a + IM+KoJZwu6iHyzsrVgTZQUZODvYF3KcHI/zw8cRgRtVDg3z3D9A3Cb88wUqAEpq7+vns7OezQxTb+/pQ + bDML/lf4RPxP8B0Q+Fb0PekFIPS3xbrWR9vu7u+B2Nvfs2mg56FBXscGe51M8GoaZLt/gPbgAN3hgboj + A0WID7Q9KmI0B5p90tf2RKzdlcFerwz2ejWBJSxvDPd9a4Tfe6P8Pkj0/3hswMdjAz8ei+wU7ivwzdHM + HUDKgDWo1qzRphADZURThH5fhH5PuO/OcN8doT6bQ7zrgr2qRXAzgnvazdFY6Se4KerjPPb1897d3xsW + h/3a+Jz98vgE4btLgJUAMuLYx2fbUwzh5eEvAEFf191xU4zD9n4eO/qz2CkgjtjZ362+r3prvHpHH83u + vpqm/tr9/bWHBgiID9Ad7Y+wpWgBdB/bk3EOlwd5AeurQ7yvDfG+PtTnJhzeCL+3RxreT4R6MKA/HheE + 7Pc9lkaw+gFUFFgLQJNQGPYJLGYRgdAzoCk43AK1G0DtR3B7AusyP9dce3lf65deXmjQ1ffyaIj33NLb + a0u819Z4ry19vBv7eLOP8T6NfVg8TXDb+W7CG6Ii3La2p9OWvu6NiH4eiG0C6Jv7OlX1VlXHqWriVLW9 + VJt7q7fFM8T39dPu76c91E93uJ/uKIUY8Xjb070cGdAMa++rg71fSfB5dajvjeH6N0YYbo80vDM64P0x + gR+ODUS95UPYX6HSgGQYWFt0D2jqziCGSrAgiHkwlJsjXL83XL87jFG7McS7PtirNtCzOtCzMsCjwt+j + HOGmS1J2805wlOVHOFfGelTHeW6K86zv5dXQ22tzb+8t8d5b441w/zxY40Ut8FfUxrnUx7s39HHf3Mcd + iG8VQK+Nt98YpyrvqaqIVVXGtkS8t2Z3vGZvH+3+PtpDfXVHxHD3sj0T79wC6CE+ryT4voqEZbjfTebw + /N8ajSUx8H0mIEZeA2sUXiyi/HZH+u1BRABlPUULrJuB3h/hh2gC3GH6XaG+24N9tgZ51wcCbq+aAM+q + ACDuWal3XWMnH2j9knSqp7qip0dVrEdtnGddnFcDg5thjfjZqN0Q51EcrAbK4iDEK3rrSmKVpT2UZT1V + G3saEa8C4rHK6p6qTbEqFKB39NKg8N/UR3uwr5HgR2J1Z/u6XhrkJaiHN9TjlSE+1xJ8rw1laeFrIwyv + jzDAcsB4vJ0Y+O6YQDAacENDgLVFhH5HhN8uCLEQLbAO1+9DPGI0UPbbH6ZH7Av13RPiszPEZ3uQ95ZA + r4YAz00BnoDbGB72CzU2oTEaq1R/O1C7JhbU9mqV2j+pktTGuJSF60yApj+WxGqKeiqLY5ToEyI44hU9 + lZU9lFVC1PRQNcSqG+PUu3tr9sYzgh/soT3Xz+3iQE8AfXmw95UhPlcFoF8dqr8+zO/6cMONkf6vj2R5 + MlzH7dGBAtysVImwCPPdGg4Pp98Zod/NsRZUgqFsDL8mgBumx0egfCDUGE0hvnuCfXYGM7i3BnptDvSq + D/CsE0Df5O9R7ayZLO/qPtBemhniWB3raU5tKMmWeJ+iHp5ZkW4pwc5TDU4jve37udt2d9YGOah9bNWu + GqW9SqFRyJXoActkCHyCP+KL+Cs8AU/Dk/FP8A/xz/FN8K2Ke3huFbS7MtKhIsreHOi6eLeiWFVhjLKw + O4uimEeIl4HjMcryGGVFjLIK0UNZ3UNVF6vaGqfeGafZG6U53c/9/ADPi4OMWF9NYNIBRhPQr43wvzHC + H2YDWL8xKoDqtKAzSkAWWNlgJ8J8t8NaAOtweAyGsjEYefV7Q31ZCJ83her3A+gwv4MIAXEGd4jvLgHu + RoHgQLyBws+t0EE5QtpFN9xZnhfuDGqvjnRbGOQ8Ue/Yz10X4qB2Vivd3NwwtRQXF4epogkTJmC4a9Gi + Reif4dh3jIhgkAG3NdXW1mK4Bw8063CZREVFBcbLMQeblZWFTjE2lWCSBGM6ON4nJCQEQ4guamWooyZC + 2XW0p2phiMOa7s5iuKt7OxX2VHKgCW4ECM6iu6K0u6Ksu3JjdwZ3ZTPctd1V26J0R/q4n+zncXaA54WB + XpeI1ABaqChxoOGgXx/JsIbl4GVxC/jiYK8aeIkwn21Y6ML1uwSs94QZ8d1DKIcIEcqwRnCsD4X5IQjx + fSG+u5sJDsSh4FsY7t5bPZ3z1LJBnX4rU3aztLG2wuZTnKQxZcoU9Noxh4Zte8Bu06ZNABFQopOPB4oD + eGB8Aj1QemCu0PyBVjQe5l8vKytLTk62llpjLsk/yt9aauWlk8a5qibodRlhjht62LYKNIM7WlkUrQDW + xdGK0uiWcEcq6yNtd/Vy3R/vdrSvx6kBnucY1j5XEnxfGaoH1gD6+gh/RmoBaPAahTBgTc0gC+R48GfB + XlXwyKE+W0HtUN+dob67ocIUAmGNQLeB9eEwPwQhTgTfHeC9w89rm49no6dHo5fXDl/fXe7u2BYy0tra + cfDgwdg5XF5eXllZCYjBVkCMBj5HFsABPkyoYBoID/RAMVGIB7rO9MAQeKsP/gQ8GTX4oO5B2XXZiKza + rDk5c0bNHtUzoad3sLdS8aLB/qXBHl3nB9gUNNPZyOtoZWGUAlEkBOAuaYa7PFxZH2W/Pc5lZ5zbnt5u + B/t4HO/veWag9wWGtf6VYax0x4AeyYBmWAtAE9YIAhqBrLoiyKsmyHtzsM82LHShvruAlxCE9SO4m3kN + GSENORxuOIII8zsSpD9s8Dng49Xk49Ok1x8wGA4GBh4KDj4cFMQiOPiIr+9GB4cJEok7pkBxcAmIDBYT + f4EvwAWsBCWmJtCLQ/cTDww7oN+MB7ry9ECf3+TB/4qeiRNKE6YkrN62enXj6vyt+Xlb8jDnmNuQu6p+ + lTZVaznY8sXgF//X/n/tlS/EOHWe6meVHykXGM1QZhHJgrA2sjtEWd/dsTHWBdnmjl6uu3q77+vjfqS/ + 56mB3ucG+14e6ncVWDNSY0lkQKNiLC7tWgS4FwV4FAe4l/gjPMoCPKuDvBqCvbdCc6EDbWHdTG2Gdajf + wUDfg/6+h319juj1JwMCzgQHnw0LOxcaegYREnIqJOQEIjiYfUSEhp7099/s7DxHqQyOiYnBiVBQD0BM + nAW+BCtacJgDwjwUHpjExXQvGvt4oFeEB05UNHnQ1+k5eHJAQEDK2pSCvQUb9mxYv3v9+l3r1+1ct2bH + mrl1c+W5ckmqRDJXIpkt6Ta8W+fozi+4vaCW/2+0Y+epvlZrIh4B/QhuIB6oqI9x3tzTZUus67Y4YO0G + rPfEexzs53V8oM/Zwb6oGF8dxsrFUA/Ga6E0j89hBFETt/B3LzK4Ffm7FxuMUSo44k2Q1zawfkTtIN99 + Bu+9Pl77fAG0/zEB34thYZfDw68IcTks7FJY2IWwsPNhYfgrFoQ+PgkPPxsScsTLK8vWdqC1tRoXcdBh + Z+ApkCVYASUO18fMFbZ042AuDAVipyq6RPTA7hv+4F/EE/A0rJ++Qb5lh8sQpYdKSw6WIIoPFBc1FQ2u + GSzLlcnSZNIFUul8IeZKGeIju3WO6PyC4wsOshf6OFkm+9sQysYIV5SFaOp6ONf3IKzdtsW5be/tvive + Y08fz6a+3kcH+qC8g3IxKtGokV4f6Q9DcqG/+7GedqfjXS4O8LIwuBUi/NyKEAaAzuAuMbiXwxTDP8BI + AG6YCjG1g333+Hvv8fXa4+mxG/oQGHg0JORkSMhpAUSgeQEQh4dfjcCWSRavCMFwR0REXGyOSxERiMuR + kVcDAupcXeep1eFEcLqkCngRmhi4QjMfQ8B4YHwCG0YwGoiBFZMHvogH/hbPgW8ZMnFI7dna2jO1Nadr + qk9VV52qqjpZVXG8Irg6WJGvwCSjfLFctkgmS5XJUmTSZAHu6RKbCTYvx7/8kv6lTl3/21/z0ljPl/PD + 5cC6IESxMcy2NsZ5U4xLfU+XhljXrXFu23q574j32NXHc29fLxR5Dg30OTlYDyU52c/tWC+nY3EOZ/u6 + XRoE8xeAANAFfiyANYtmrAF3qb8H8r06MbWDfHb7ee/29twNCYb+BgWBxccRpAmCSgBusJVhDXwjcdZc + 5GtRUTeEj4jrCHwxCsc4iCI6+rXu3W9ERV01GDa6uExXqYJg1LCaQb6BGuBD8w3DbRicwJgr9gPjgSFu + PNDe5w/6CvaS4IE9A+lF6Y2vNG69unXrla1brmxpuNSAQfTKc5VOtU7KtUrFSoViqUKRoZCnM8Tli+Sy + ZJl0hlQySYK5L8kYifVwa8sIyxecX3CQvzDQpWu6r6Qiwr6mu/OmHi51PRjQDbFuDOveHjvjPXf19YKS + NPZw2hxl1xipa4p1Pt7X68Jgv8sJ/leH+r8y1J8B7aAc4ue2QQhzuB9R29+rUe+5zdNju17fFBCA9Q0Q + UzCgCWuIrxBMGSAXwDoy8hUgGx39enT0G9HRt7p35/FGTMzNmBh8fBQ9etzq0ePNnj3f7t79emBgjavr + JK02DCegJSUlwTVj8hrDbRiNxQNzKjibCw8MzGOLiskDgq4P1gPfPW/s2X1z966bu3a9vmvnjZ3br29f + eGqhpl6jWqdSrlIqs5TKTKVyhVKxXCB4qlw2UyabIZNOkkonSCXjjYi/3Pvll9xfkr/4P0Oc5ZlB9sg2 + gXV9TwY0qL2pu2NNlH1lmLY6TFsf5bCtp+vueJ/9/XyPDdCfHuR3fojhUoL/FQFri67/+4KtLM7HeVVr + cDPh9nUr9XKrcHOt8fHZHhDQFBTEXERw8FEhGNAhIZzRIPXJsLBTYWGnBRU+D3GAMhDW3bu/GRPzVo8e + 7/To8S5Fz54U7wiBT96LjX0/Lg7xQVzcRzEx1xAhIZt9fJY6Og5XqXzi4+MhLPCFkG90PDFRiLEgPDBn + j0Es+ogH7ihLnJV48L2DB947sP/d/Sze2b/vrX37bu8bcGyAuk6tKlSpVqtU+SpVnkq1SqXKUSlXKhVp + Cvk8uXymXDZNJpsik00WEJ8olY6X2vSwQVaFoSQ7SbcBDrIMP/XGMF1psLo4ULUxVFsd6VAf49rYy3t7 + L+8d8T674n329PHZ18f3cH+/kwP9zg02XEzwB7UtskIde9vaqK2DPexTm7E2stvHtdDDpdDZqdDDo0Kv + rzMYtgUE7AoMBNYQDYZ1SMgxAWWiM2f0qfDw00KcCQ8/Fxl5ISrqcnT0NYgD+AvCEqCxsR8CTUSvXh8L + cUeIT4T4tFevz3r2vN2z51txce/Exb3Xq9cHsbE3w8N3+Ptne3iMt7MLk0rlMHDQYqSOWD8hLJgPwgOT + K0gR8xryjn187NidY/h49KOjiMMfHD70/iG/w36aTRp1iVpdoFavV6vXqRniq1XKHKViiUKxQKGYq1DM + UgBu+Qy5fJpcOllqPd66i08X7MRCwvniiy927dpN1unFvrY2KwNsa7u71vVwb4j1aIj13BrnxbDu7bPT + iLXv3r76g/38Tgz0OwushxgsCqLc1ka6DHOSyyxdXLRTCGtf1w0ezuudnda7u5f6+FRiGk+ITQbDloCA + 7YGBe4OCDgQHHwoJAdbHQ0MRDOWwMKKzEeiICMxAnYmMJKwvRUdfhSb06PE6EIyNfTcu7kMB2c969/5d + 796f9+59Nz7+bp8+iC/79LmHIPR79/60T59P+/b9tH//3w0c+LuEhM+HD/985MgvBg++FB/fGB29KjBw + mqdnvJ2dl8FgwOBhv379fJFl3d5z6INDhz86fPTjowxuxCfH8m7laQ9pAbSmTKMp1qgL1aoClXK9Ur5a + LsuS2SyysZ5n3W1mt65Tu3aZ1OWlcS+9mPjib0f99sVRL/2v4rfe3kG9eg0bMWLGtGnpY8bMjYzs4yyT + jHbXFkRAQzw2x3lujvPa2strW28fYL0DcPfx3dOXYb2/n/7YAD/IiEVJd/eCaIb1FE+1TSeZvWKIh/M6 + F6d17u5F3t4b9XpwuVKvr0Y0w13v778tMHBXUFCTgPWR0NBjYWEnhADEFKcJZQI6KgpxPirqYnT05ZiY + V3r0eK1nzzdiY9+GRADN3r0/EyC+17fv1337ftuv37f9+387YAA+fjFgwN1Bg74cPPjLhIR7w4bdGzHi + q9Gjvxo79qvx47+aNOnr6dO/njXrm/nzv0lN/SYt7d6CBTdnzTrq7z98bPKk/e8danrv4L539u99u2n3 + 7T273ty189bOHod6vFT10ourX3wx58UXM1m8tPKlTis7dVrWqfOiLp3ndu48y9JyxstdZ3R7eaa1VZKN + dZJUMlNuPUzWtatVUlLGjBnLkpKWz5qVOXdu9vz5uZMmLYyO7mvQKJJ8HepiGdBbegFrb2C9Ld5nR7wv + sN4twN3UV3+kv59FRU/30hiG9bpI11Hu6t/813/Z2HR3cVnp61uOaAaaYe3nV2Mw1BoM4HWdv39DYOD2 + oKA9ISEHQkOPhIUdCw8/ER5+MiLiVEQEUD4dGQmIz1IIQJ+Ljj4fHX0hOvpS9+5XevS4BrhjY9+Ii3sb + shAffyc+/nMBawbxoEHfJSR8N3ToV8OGfTVyJMD9OjHx63Hjvpk48dvJk7+dPv3bpKRvZ8/+Ljn5u0WL + vsvI+G7Fiu9Xrfr9mjW/z8//TKG2Kz1cffLzCyd/d/7k5+dPfXH+1N3zp4XwPWNQb9epqnSqcp2qjIWy + RKss1irWaxTZGvlStTxNJV+okqWoZAtUsvlKhHSe0jpGGhoaB3DnzMmZNy9nwYLVCxeuWbRo3ZIlRcuW + laJgEx7eO9ZRsyzYZUsvbwTDOt4XwbHeHufT2N3XArV5YJ0b4TrEQ2cvl0Dg+vbtK5MZnJzm+PpWUIDU + fn4II9b+/pv8/esCAoD11uDgXSEhTWFhh8LDjwJrAB0ZSSifiYoCxGKUAfT57t0vCHEpJuZKM7tvxsW9 + 1avX+7173+nT5/O+fb/q3/87YD106DejRn2TmPjd+PHfTZr0/ZQp3yclfT937g/JyT+kpv6QlvbDsmV/ + yMr6Q17eH9et+2Nx8Z8qKv48Z87WfqMTTt+9ePrLi2fuXTx779K5ry6dw8d7l1a+k6M5bqve0gw0sN4o + YF2sVa7XKrI0iuVqebpavlgtX6SWp6o54t28JQkJUxYsyEtJWZ2aum7x4oL09OJly8oyMytzcjbl5TWs + WbN1/PhkB7k80cu+LMZja2/vRghIvO/mWJ+6aJ9NkT61Ed51EV4WKBPPD3QKs1fBe6LkiCsDsAUIe7O6 + ddPY2g7z9t4gkNqItcFQbTDU+PvXAmsBaMTmoCBsN8J4NYasj0REYAL4ZFTU6agoBnR0NIhMwVDmQMfE + XBSCwd2jx9WePV/t2fNGXNybvXq927v3R/Hxn/Xt+yUEZMiQ70aM+H7MmN9PmvT7qVN/mD37D8nJf1i0 + 6A/p6X9YseKPq1b9ce3aPxUV/bm8/M81NX/ZuvWvcXFTM6vzzn11+dzXl89/c+WCEOfx+deX+10bpNlv + q26wVdfYqiuFqNAhGKnXEtAaxZLmSDMiLpui6iaXgM6LFm1ISyvMyACLy1asqMrJqc3P37x27bYNG3YV + Fu4tKWnKzq4eMmRiuJ0m2c+lJsq7KpxFZbhXVZhnTTjCw2KUt529Uo6dWLiAYN26dfBGeXl52DqABT02 + NlapjHB1XejnVyEwutJgqALW/v41AQG1SOcCA+uDggD0luDgrRivDgvbFx5+MAJTTlEnoqIwdn0mOpqw + BpEpiM6PohlxaDcQf6Vnz+uxsa8T4vHxH/Xp8zsQfMAAsPv7xEQGd1LSD/PmMaxB5+xsBnRJyZ8rK/9S + X/+X7OxzIT2iD394kqH8tRFlwnr/l4fczntpdtmq6wSgq4RgWNuqSnTKfK0yS6NcoVFkCJEuhAC6tJ8y + IiJ+yZJCsHjp0tLlyyuys2tyc+vXrGksKNhVXNwEy1NRcTQr68j06QcHDTro45Np9ZJ0gK0uP8CtItSj + MswY1QAah0+jxF5SUoKkABuyUWsH4nig8oCvjx8/3sbG3t5+lK9vgcEAoCv9/QF0dUBATWDgpsDAuqAg + hrUANAJ7jXaGhzdFRByKjDwWFXUyOvp09+5nu3c/J0SbcAP6lhxniDdz/B1wvE8fcPweJCUhgRF88uQf + Zs78YcECRm3AvW7dn0pL/zxwYPqcnNSz9y6fbcloAD3r9jzNcTt1o6261lZdLYSANRPrQp1yFYDWKldo + lUspHiFuY5CPGjVLYHF5ZiaIvCk/v2Ht2u1r1uxJT98/bdqhhIQjcXHQzCPQz6CgnXh/Ayi1ephBqpjv + 4VgR6l4Z5l4Rxj5aoFuBB7IAGFI8UDLHo1R4AH080OyAZ1KrI9zdU/z9qwICgDKLwMBaYB0cXBccXB8c + DKyxJRQbQ4E19tMR3Aejoo4JOwrM4TalthnNoSqXoSrNNIeO3xbR/B7RHKBPmcIkZfLk11y8DXWXdp36 + 4vLpu5dPf3n5DEf86yshlyM0TbbqzWZAY0lcr1PmCkAv1yqXiWKpVj5dba2QYd1LTy9PTq6aPr1m9Oja + gQMb4uK2R0TshgsIDt4bHIxPYMDgC7YAZSiq8KYvd3CYpewiGemgA8oUFih04UFtDtTg6SPKxPwjfRE7 + 5aVSWweHoXp9PvJjRFBQrRAM65CQ+pCQhpCQLeB1M9bbw8N3RkTsw6aNyEgmJgLiZ5qp3R7QHHQRzR+B + 3sz0t3v3ZnalT58vIC8eHtmJ82Ye+eTy0U8uH/v08rHPLh//3eUTn18++fnllW+tVhy1l222lVXp5BU6 + eTkLBT6WaeWFWtkqrSxLK1uulWVopOksJEs0Nmka68Uayx4KR8f+4eFFwcElKMLo9RRMQiGewBRLFMlm + UJAx8BUoKv4Wb31395UyWVxPtTrH4MKAJkCpjYTqO/WNxA0O9DhQLMYDDRH09NRqfze3aYGBlUFBNcHB + QJkHgxuHUmBbuUDtrbR9MSxsB3YiRUbuj4o6gs0yLeFuRbXNdbxV3Js1HavoaxERRzT27sUH6w99fOHQ + xxcPs7hkjDuXIk73e7lR93K59uUi7csF2pcLtd0KWLy8Vts1R2uZobFM01imaCwXaLokq0WhesFBYms7 + 1dMz29MzR4g8b+/Vvr4b/PxK/PzKBfEE0IB4e3DwjuDgncJHRCOoHRCAbAMmbaNGM8pPIk/xdLQAxOjR + oTuHBgd1N9DXQOmduhhUfcdHPPBH1IuxYKIXZWfX09s7NTi4VohNISFAmYJRW8DaqCTNcBPBm0DwqKij + 0dE/huBtraXOzvOHzZh06KNzhz46b4yPzx8SouB2jeKAc9catWWx2nKD2nK92nIdiy5rVV1yVZ2XKTun + KTsvVHaeT6Hg8VKC7De/sXJ1XeLmlu7uvtTDY4WXV463d76Pz3o/vzKDoSIgYFNQUCPwhXSEhu4NDd0H + LyB8Ar+7A38lsBtpR6WDwwxbS4kFhxjdIzSNgCaqX2hVoOKOB4rCqLijmk6ld3wFVTT8LfbVKhS2Tk6D + 9PqVBHdICOBuC3EId6MI8d0C4ocEBWcL5pNKihhx/J5qO7eCphoBaNOIO5NguU1luVFpWaC03KC0XK+0 + XMeiy2pFlyxF5zR551R55wXyzvNN47cBErm8t6vr4magMz09V/n4rNHrCyHBgm5sDgnZLvja/UgjhEzi + oOBxD4SF7YUHE6iNbKMK7wAXl/kW0ARiMTiLvgaaGgAU5XZsJEehHWctUZUdH1Eaxh9Rhkc9Hi8AKL9w + 4UKVyg379A2G3GZ2c9BNCE56wuGGpIDjTFJEiD+xiANxR8c5I2dNaRXl6nd2aA66WW5SWZYIQDejbLlW + 2SVX0WWZAPTCVlDuNFn2G5mVnd1UV9c0N7cMd/flHh5ZXl6gM3SjFCSFr8VRYSEh2HS8PzwcECOBOCrE + EQFosBu8xmZvSHmZXr/e1zfPAj06CAK6R+ApaAuIgS9gxXZ91NdRREdlHYVgPPAJvoKvA3eATohDweHB + 1WovV9fRBkNecDCEm+KJEN8lUhWu4/CFrbtvzmjQyt7dp/RIQ6tADzyX2HWH2rJCaVloRudsReclAp1T + WgH6xZ5SK6tQV9dFkA7ohrv7CtBZEOgCyC7WOqyBorzhCLwsIBbiYHg4BASqjVSuKjAQT4agF+j1ay1A + TGgFNAH6gI4RWkGAEvjiyEGU1ansiwf2KeJzlNhRbifEUZkEwUF8/EOsojNmzFCrvV1cRvv5rRLB/XjE + xaqClTMiYq+I5iZSbrp42tlNmbhoTqsob3p3l+6Qh2WdyrK0NTovb5POkJH/dbTWaEY268YyDw/SjbV6 + fZGgzkgdIIa7YGHJxQr47qXdxyigC34X2gITDJGBYwHQaywgF2jQEZGBHSBGCwMQA1wU0XFuBNV56YGt + iii0A3HADY5zuMFuiAlmMwS43Z2d4QJXtITbSPOWUt7WysmEpSXoWD/FTGfpD97FvmHhdZd2t0nnnW3Q + OUfROV3eeVHrdH5poMzS0pfo7OYGOkM3sr288oRlEKgxv4G8AdmZkKBBplGBoMUfNMfXG/BuhiULDMRL + UubvXwygDYb1FlBkwAQpQEcOVAWCBDFgxSG92GqLkzqwWQ4PfIJNitjoDPTxBHCc2I0+HsQErxNeLXw3 + rK6Y0cKpQU5O/by9F7YGtxh0cyk3sSvkESHokBe4ctJ0hrtKNWT+6qWtolzxdiNT51bpnKfosqKZzsmt + 6MYLPjYKRX+Bzmnu7rAcAHolLIePT75ev87PD4thCRAEjhAHwd1SDkG/CP4IYakKCsLfliOasS60wHsf + igywwFAoAxpCwBEQA1bsjsNmROxppgd2JeKPhDjgxgHgeDL+CTp4eB/gdYLsQHwg3NB6eBiUqHAHoJ1d + FI7WCwhY3zbiTF5EjgU/tynTW66iDHcXl+QeQwbsf+/UwY/O8jj00VkhzsWdGdJ1h6pLeWvq3D6dR0h/ + 06UbDBl8Av4LF5cUV9dUN7fFHh7pXl7LvL1z9PrVYCgEQcAaq2J1UFC16FfD5ywErPG3DO6AgI0BAaUW + ICMUAHJBB6CAyKAt7ffEnnHaXosHPqEHhxtPQ9+IxARSA00nJcGbg4QbioQFFlUq9Jwg3zhdz8cnrV24 + 25SXZm9utOf4PRVah5zNGw5+dMY8Vr9RotjvaFmr6FIq77JB3mWdMTqvkXfOlXdeIe+UJuuUKuuULOs0 + n0LaaZ4xfhtoJZFEODpOc3Sc4eQ0E1M+gNvNbaGHxxJPz+Xe3lnwD35+a/39gXWxgHU5yAtYBXy5EeBY + G6kNrNlB3VAA6AAgoyN9QGQ6w5GfDEa3yeNBl7rir/AEHGWHJ4P7eG24kuBtgTcHpgPICEK4CW4k8dAT + TN7a2oa7uY3388vuAOKtuheWE2m1w8fMn3bwo9OtRtiJWMut8i7lsi6Fsi7rZV3WybqsZdF5taxzlqzT + EmmnRdJOCx6By1F+aYzkN9Zd8c0dHKYAaycnYD3bxWWum9sCD4/Fnp5LvbzQD1mFlc1g2CAAvVEAmlAW + A42f3JTaFkAZlIQOkFzQxmWCGMjy+0TooEo6NZ+wBt9JSaDjXEloneTCbQI3TCQqghhKQrJjbx/j7j7F + zKJwUrT5iZtbSmBMdP2VXQc/PG0eC64ttdqntqyRdymWddkgRlnaeZW083Jpp8WSTgslneZLOs0zjRdC + ullbB9nbT3RwmERYOzsnCUCnuLszoMFovR6MXtesHgDanM7in9xIbb0+2wIo05lrXC7MUeZnihHWYmq3 + qiQk3CZwU3qJhAhuErk+2gu46xiI29lFg+M44bAjHMdvaC3TZJSvahVlfNHjSIDlZlmXMlmXgpZ0zpN2 + zpR2SpN0SpV0WtAKyi+Ns/mN1FKtHmxvP8HeHkBPBaOdnWdhhMrdHdIBjV7h40MaDToXQXYFOqPmY6Ib + j4DGL4VfDasUfk0LLsomckEUbvUKTBO4QW2uJHjBuAsUww0xIe3GUglngjwethJVFOSlQByHi0JVtNpA + 6LiX1zx//7VtgY739ai5k9tCediF8V13yy2rBNEQ0zlfoPOydukc2s3KKtDODihPcHCYLEgH6DwHuuHu + vkigc6avby4EWqAz6Qan8yPdwA+PXwG/CH4d/FKYrscRNaj1s7uyxKIslot2Tsc0wZouiYaS4FuRC2wV + bloq4UzICCJLgnyD4Mj+UcZCtwHniGJkQKm0h5S7uIzw9p7v77+Ggw5yhfWKbUs0NtwqVx9wtqyXdSlt + Sec1ss650s4rm1Fulc5jTOg8RaDzTIHOKVgJvbyWC3TOhyM2GDidjUDjh8SPih8YPzZ++J49e6LMiRlw + XnNG5c4Ca5r4oJSO317NVVusJO3AzXMcZJ4wlPDdWC1JT4jgUHAqEMKJo3WJoyHhDhUKtVYbAEvu6DhM + Y++YXb+2LTqHnOhhuU3WpcJsDQSds6WdMiSdFkk6pbQiGhDrF4KgzsEiOkM3QOfZrq7JAp0zBDqv8vMz + LoN+fvleXgvd3CY6OfXFj4cfEuOZeF/C0aJVIq48I4mj4qjxhk6Tpa+DJ73iaa3CTcJtwm6YbloqYQTJ + d1PNhAhO/gQKLkYcpS5UxtFUmzNnjqur64wVM5rea2p6/8D+9w/t/+DIgQ+OHfjg+IEPTx788NSEy0ld + 9yosq2VdSgTRgNkwOg0pozNfA5NbAfrFkda/sbLUaoc2qzOWwelEZ1oG3d3nubhMdXFJtLcfoNNFqVRe + crk6NDQUG0Rw9wg6UKjU85o+IUvg0o4QKu6zy31/NMriRbKtdZLDDdMNb0NGEL6br5ac4FzBxYhDVcBx + ZPajZo06/eVpxMkvTh7/3fGjnxw9fOfwwY8O7v9gf8HNQu1+206bLDuVWHZa/3Kntd06r7XqvMYa0SnX + ulOmTaclNp1SbTql2LR0Gvgji//VW1pZGTQatOt6q9U9VCqsXSFyuUEm85JKHW1sVOiZ6vV6cBazGJi4 + hCaAtuJNIXzfDd9uQ+Dy3QtgDLsXnI5na3Xp6zi1O8huyuApzaESFREc7hsKjtwSkgLEOcehKth6FTs4 + dvur289+dfbsPRZn7p15FF+e6XGph6xJZlNnY7XRqltxt5cLXrZcb2m5zrJzfudO2Z1eynjpxdQXf7vg + t7+d+9vfzm4Zc377Qv8X/vul/8b533Z2dnjT+Pj44NRpzDNiqYApgnxhGgAHLeJdhc41+qi074bvCKFq + vnjTDd+3QPtCaLQey74FifK/jnL77ObOhHw3pTmAG3qC0gohjmTHHHHonV+IX/H+4nNfnUMwrHkIoE+5 + OUV5QqnYoZBvksur5PIKubxcLt8ol5XKZEUy2RqZNEsqXSGVLpVK01lI0iWPIk3SzdANO++wRQyYTp8+ + HasxZAo7uoAvzqCCI8LwBVZpnNiDFjY6q4AY/CVNIM6KkaXmFAeXdoTQvgWLp4tyO3CTM4ER5AUTXqIi + xLmkcMTxU9o72WdWZZ7/5vz5r1mc+/ocCwF0xLr317mecVXuUSoaFIoahaJS8QjoEplsvUyaI2VALzei + TFjzsB5kDU2AzkKaADEK6xgLhhvDvjwcZA+UUT8AyhAKEBkvOUFM221Qx8eDOEttP9AWyOLBN4XQdhDa + tMCAfiJ9eKInmyyVPKuk1RKGh0pUIDgUnEsKIQ7tBgTJ+ckXvr3A4psLDG4KAfQjXx4JuRSiOqhSNiqV + tUpltRJAKyoUinKFvEwuL5SzMdFsmQzN6GUyWYZpSGdJu7l1g+xiCylYDIhxSCC2GWCvGBp1sD18RymI + jCWOeqoELpDF4sF3MdHmJdCWGn6wUgQub1EhjbB4IuB+3JM53CZZJSc4LZgkKRzxJUuWTEubdvG7iyy+ + ZWFEXAAdMfDVgZrjGvVOtapepapRKauUykqlskKp2KhQlCgU6xTyHLkcB1wvl8uXymVLZcZoRhzj5bRl + BkKBB9py+B9xoQOWBIgyJzKGA+hEf0AMfEFbUgMsHli0+RYm8V4bWCkYKr4XBBs+8B79OYBuS0/EZROS + FI442ISpfUw3G+8++O6SEfFm0JNuJ9metdXs0ai3qNW1anWNWlWlUlWqVBUqZZlSWaBU5CkUOQrsVZEv + k7NY2iKk46RWaivIBSgMOYb/hSLDqGEWDpt5se5hlghagc4RenXUsyZ8wVkiLFZs2sKEeg7WcCAL2tIu + G6w0BC5tAcEKhPfozwo0Id4qwXmhCojjl0yYlLDvzX2Xv7+MwA0TxqALJ767lPNhjvt5d+1+raZRgz0p + BLS6igWAVhWrVGtVylylMtu4RUWxTCEObA2SBEhQvIVKAF+wGBDjPEC8urhgBNYCE0XQCjpcHhBDc0Fe + 4EtqQLCKNy/xziqqzXxnDcCFs4KdxQoEVfwFgG6V4Dy9xG/Yf3R/mLlH16YIcHPQ6z6vC7gSoDuk0+7Q + ahuECf4ajaaahbpCrS5Tqzeo2eaUHJUqU4W9QCyWtwhpfynmNwEuljvgCxYDYtIKWAuky5BjugqLGta4 + BAr4AlwsGyAssRWulGAlziIXI2SxqgNZAhfOCnYWaz5U8ZcE2hxxqGGf4X02X9x85fdXECa31OCPuFis + +7Xutidsdbt02q04mlyr3aTV1rDQVGk05RpNkUa9Wq3OVauyVaoVrYRiskLiIIFiQIhhKiAU5N7wNoJB + puO3YdGolQqIIbggL/BFMRLgcimgrUq0QwmwIhfjyGKlAbhYdagLiDUfqvhMAE2Ig0fxQ+Prz9cTyiZB + oA+4McDutJ3tXltdo07XoNPV6XSbdLpaHcO6Qqsp0ajXqtX5avUqtTpLrV5pGrgcQRYiwxWbwBcPCAXq + ahjqhFYQkfmtvRAKYjHaRsCXdJakgGNKe5MIVjGyWGkIXOr/UaPqWQEaKRa4XH+h3uRSKzHco2+Ntjtn + Z7vfVre9BcrsVrwqrbZMi0sINas1mlx2rYcms0WoMxnoiv4KXFWP0WQ8CGJoBYgMg8zvgqSZABq7gETQ + QABJAYeVeta8bd0qsrwLiDUfj2cCaPyqAxIHMMUQXdBm8vmUt6bggmm7A3bsYjzcyEv3eQvXAelwNz3u + PS7U4qJYdnlKjinKBLpqokpmJ4NBhhYTxERkcm90WS8UGXaCrleCZwCLwV+SWoBLOkBsFROWOGuCLK8g + Ue79ywONX3vo5KHY1toOynPemeNy0cXukIAyruOlO6Y5yhU6dhFQG9fx0qVAmgUaub8cw8eAGMPgdKoN + Fl66XoyjDMcGl0aXWEF/6apv4Esle6onizGlzjVxltqqdBMaL2w8uoflx+UgT+Vf4RfAijRmzpimt5ra + QRk31LM7vHHjMS4QM0e5UqfDxfQ4dIWutso2vRiPgFbEKrAxBxBTyYJmaOmiTaQhMHDIlfkFmjQQAKGg + 244JYg5o+7C2lWn/YozG8oJMYUbGjOOfHG8H5UXvLzJFGaJBXMa9VlU6div9OiYarV5MTyirhqpkMhkd + z0SFITqHhW7ZBMpI8OiOXs5loEytaroTQVxJpjzgSWtEvwzQWNCd3Z1T16a2AzH+Cih7XvK0OyLisjnK + uIWXRMPsVnpCWT1ZLXeWwyzzCjKhzC8kFOuy+Nq7p3tv5i8ANFxqUFRQbl1u+ygbFQMo427HRkGXmxdA + I5fLhCt425fmeRqFQYE6Bj8iC4pBKCOxRlUIlSCYZX69MQwcv3KaFjfxXSr/imD+rEDjDYi1qO/IvhVH + K9pHGavfI8VoiTLuHmSKsVGnK3jcApihUUYrUWvmKNPqRzfkofyG2gX8MooVqFGIL+ymCyc6crNgx6H/ + +YBGZoU678SUiftu7Wsf5alvTWUeQ7z6cTMHlAUzxy7fJS6bXQvL7x5U9WG30vN9UKjD0fV4VIcjaTa5 + QZruqnm6okEvxs8ENOoG+iB9RnEGsrv2UU68lYhbpJmT4x7jR6GsHqqWqWTIrcXSDJtBtx+jPI/EBEWi + Vi8UfLqi8TMBDclDsot8ZOPhje1DfPK7kwNfH4hL0Y1ZCTm5tlBu9Z7S5ns01WPUckfjAgigycyJpRnV + ZKR/dMcuakPI/R57RWbHVaLVZ/60jMbbE+5iTuYcHErSPsoNdxtirsfYn7G32y/KSpo9BtNlsWK0a5nV + U9UKDwVKoOIF0ESa4ZpNbo1GyeInEg0jozeWrPgpIjc7efDAnlF9I3Lqs059caL9WHY73eu0h3y/RLZF + Iq21kVbYSMttpGU20lIWkmJrSYG1ZJ21ZJW1zUorm+VWNkutbJZY2aS1ElYTXu7q2jkmJjhxVP8xo/uP + HTNw/NhBkyYMmTxx6PSpw2cljZ47e1zK/ImLFk7NWDJjxdLZOZnz81ctWJOfumFtWuGG9OKCjJLCpaVF + y8qKlz9dWH4SRqN04Kn3nJc977FEBs1hMHARut1RO7s9drbbzOoYlJXw1a9dLmtg5oIU6JtwLvMFEBkg + STNcM6SZbpunSVq6Q+xpXczdlsJYiF+38tKVFBVlmc2RVbkRkY2oKkfkVFXkVFesQtRU5hqjKq+WRf6m + 6vz0tKTY2LD+iX037F53+u5J0/jy5GlRHPr8QN8r8aoTCvkumbxBKq+Vyiul8gqpvFwq38hCViqRFUlk + 6yWyPIk0SyJdKZEul0gzJNJ0iYwi41FIZ9lY+XfrFdd97pwp8+ZOnT9vekpyUurCWUvS5i7NWJC5YlFu + TvraNSuLCnPLy9bWVhdu2bxxx7aqvbvrDjRtPXJox/Fju0+e2HvmVNPZMwfPnz148fzhi+ePXLpw9NLF + o5cvHrt86fiVyyeuIq6cfOXKqWtXT1975fSrr5x59drZ66+ee+3V869dP3/jtQuvv3bx9RuXbt649Mbr + l9+4eeXWzau33rj65q1X3rx17akxGnVbdCti+sdk1WShkdq+IuNvSz4twcl3rYgyrxbxDJtnJW07Oc0i + jTJKidFCbuawAPI8m3ITLICYZeWuGQUNFD9NpPlppSfmvH4KjF6dt3jk8L4efm4zV8zYcWNbK0Tm1G6m + 8+QbE51POcqbpPJGqWyTVFbdTGTO5RKJrFAiWyeR5tpIs2yMXE5nXKYQM1o6z8YqpFt0dNjc2ZPnzgad + pyXPn7FwQVLaojnpS5JXLFuYk52Wn7e8YENWaXF+VcX6+k0ljVvKd++s3ben/tCBxqOHd5zgdD594NzZ + gxfOHXq2GI3KAIqc3v7eM5fP3HZt22NZjCds+3Jbvxv97C/YM6eM3NpMlJnBAJdR+URNjqpFdBG66Ap0 + 8eeaxRpld2ViYiIKRtwyk5nDUsEzQLIZdDW0uKDBy0YdnFf+0SbvRzI6JzN5xLA+Tu4O4+aPqTi+sT0W + i5R61s0kjzNuigMy+TaprE4iq5bIKqSycqlMUGQWZVJZsURWIJGtlkizBS6vsJEus+FENmG0dC7jclRk + 8OxZk+bMngJ1ZtK8YMaiVEjzvGUZKVmZi/Nyl65fu7K4MLdi45oaSHND2XYmzZv279t8+OC2Y0d2gs6n + Tuw9fbrp7On9UOfz5w49E4xGCQb9Y/9Q/9krZ2+9vLUjLMZzYJNBZIcLDkisje5iS8t8hJc9YTCoit9u + 5ZPV8lOYLmMqmbgsTkyomkGTAlQCFduMnzo3aT1h6aDrKFyfMWPaqKjIwKDuAbOzZjZcrjt990RzmLmL + ln5j/GtjmSLvFxTZSGSJrFwi2yiRgcIIGAyIMgzGOoksFwYDomwjXW4jXQouUzxSZ+PnM2ysDC/HxITP + njmJ6Dx/7rQFydMXpsyENC+DzViZuio7fe3qFQUbsjeW5ldXbmioK27cUrFrB5Pmg/u3HD28/diRHSeP + MzrDbJw53XTuzIFfktFwnWjLOzg5oOGUvzn/1O9OdZDFeNqqj1cxa3GupSKLE2uU8MWivL5ZlNvulbAS + 80w1/DLmP8UegyYQicuoGVEDED88SqCUZ9MWP7HNoCpoxzc5/GiBZkWlthi9LGMmkqugAO/AKP9p6ZPL + jpacuntCHO0zuviDwthLPdTHlfI9UvlWWAuJrAqK3ExkxmUWUu6UTUWZc9mU0ZKx1t3cu8bHx8xMmgg6 + CzZjyoL501JTZi5eNDsjff6K5bAZS1bnL92wDjYjr7JiXd2mIrjmndur9uzadKBpi+A0th8/ugt0Pn1y + 7+mT+6DOZ8/s/1kZjbIhjASELzg6eOqiqUX7is7dO9dxCuOZu+/tHnVrFOuMHLeza2ouXFDfWtS6NhIZ + Hb/S5soysr68NhslxnbJGFbHwEyiCZfhMUy4TOV8cBmFZrLMtF1V3J36ebj8qNaRnTkPdYD43pGeHk4B + EX5j5yXmbVl14L0mY4GiJZE5qc0Zvf3TxpHXhkOOma/YLpU1SGQ1ElmliMgCixmRS2ykxTbSDRLpmpbu + 4pEot8Jom35WL6sthyb0nZk0YdbMiZDmuXMmJ8+btjBlBuPyknkrl6dkZy7Oz1u6fl1mSdGqCiED3Fxf + ur2xctfO2qa9kGYkgdtgnI8f3XnqxB7EmVP7WDb4MzAaG+G8A7wTJiakFaRtOrvpsfXiVtm976t9E29P + 1F/R258SipwoJcMgi31Fc773qKla1ly8f5xTZgYjQ4MqPurLaP2J6xiU+5FfpoFPGpUz4bJ5p/Xn5LKR + 0ShKNL2zt73qWruMLv+wbNDVAc4nHeUHpPIdEsbi2pYsbpZjI5GLQGQb6RobidgmZ5jwt8UfJdNtrIJe + Dgk2TJ44UuDyhDmzJs1jXJ66cMGMxang8twVy4jLGetgmYtyysvW1FRtaGAZYAWkudk1MzrDaZw4xtUZ + fuPnYvQT6a/4yWvurMEkHOvsQYtRRG6XxS0UmbpQHSAy9bDRXeV9P9qog9YfmlLULqHcD2OfdPBIq1zm + lbmnuDPqSR2IxWOLxSZmY+cn26e+Ntn/nJ/imEy2RyLbKpHV2chqbJgWkzWmaJZjRmTIMYi83ka6GkS2 + lmRaS1bYSJDvtUtk2GdriLLWckD/2KTp45JmjDNyee7k5PnTUMpYnDqLcXlpSnZWM5cLczaWrq6pQjWj + eOuWjTsaK3fvYtJ86MCWwwfhNIx0BqOhzoLfeCYZnXcnb/Drg70ve9ufZr6YJXjbhdEhOApujUVabJRj + dEaocEEDGLAW7dYujBNcyPpilZh64aJMNz3x7TqoL2NsATU5dLJpyIgfPCI+EuNZ4LJRox/L6Px3cofg + 4uDT7vKjUkbhRom0zgZ9EFmljazcRrZRiDJESxaTryiwka61kebZMBavBJGtJcusJRnWkiU2CCnCmPi1 + +MRmlFU3z67RkcFTpyQmTR9r5PLsifPAZaPHmJWRPo/pctai/NwMoZSRXV4GLq+rqy3aygrNlbt31jTt + qT/QtBl0PnKIjDMzG/DOQjb4bDD67PdnV99ZDTscdDWIVdqOiVTYnMItWfxIjuErULXAVByfC2hjmIhX + 45i7GKiSO8gxKM6dsliUMfhCBoPa2Kgv8zO36DQoyv3Mp7medILrSSX4sc9vodElHxRNuzEl+kKE00kH + +ZFm/tbbSGtspFXNrbyNQjePUViI0uZPwOhSQY4LBTnO53JsLVluLVkKFoujFUbbjLPq5vdycLDfmMQh + 06clzpg2ZibT5fFzZk+aP2fKgmTkfklLFs9emj5v5YqFq7IXr85D7reiuHBV+cbV1UyXwWVY5gpwed+e + uv376g8yOsNpNB47wsoaJ46hUMf8xi/D6NLPSue+Mxf+IeBqABtAPmHH9HefkNHBC7fKX1C4LRaj9lbc + XEemTA+l5DYmPFsQebAKE3I4DoiILN4GTFkfPwiRzpokg4EJI5oVpzO3zI93eer7gh/L3DZ7hvIjEtle + iQwWGB1oIm+liLzN/CUWG0NoTjMu45MSa6MWrxO02GgqmlmcbkJk/sdHjLZJtOqm7xoY4DtqxMBpU0eD + y9DlmUnj5syaICR+U1MWTF+cOnNJ2pzlS5MzVy5clZO2Jn9ZwXoh99uYX1Np5PK2reW7djDL3LQXbcDN + B/dvPnKwUcgDt5E6/8KMboW5VJEwD2FYlgfrg5CjQLEC1pi0uMMspoIy8j25vZxu2jMnMp2bio4fnDLt + QaODEDErjh42JvKpiEGDzOZnbv2km4KflNoWUnC2VdqaUZimLIQyhbW00Fq63lq6hs1aMEeBgBCTo2iT + xSJ2p9lYD+z2sotlWKj/2MQhjMhTRwuiPHY2RHkWMxgL5k9NXTgjbREzGCuXL8jOhMFIX7dmeeGGzNJi + tEuYX26oK9raAF1GAxBcRqGZChponWxFHGV0hjob/cYvzehWyWuuwtQBIQrDTnAh5o6i7baeSbsPyZ4y + XIlzGrCZ0sRa8Hs6OZFRvuDnpvKDECHKHTnZ7ElJ95M+36KF+BKLibnNwQaFiqwlhcKs0GprSY6VJFMI + mGKyEx2hsGA5bCZZdQvv2lXSJS42YsrkkVOnjAKXZ0CUZ4ydNWPc7JkT5s2ZlDx/SmrK9EWpM9MhysuS + s1YszGWinCEYDCR+uVUVa2pr0C4hj1G+i1WZqwUuQ5oZnck4M+/8jDLaXIJpsqKc5XVsGJmrMA3LdsBO + PPIV8wQ5dpJjjx/2nXE5Fp/HDmtBh4XTSdbiA4DF56a2L8rPlC6L3yIWLfhbYmMkL8265VvbrLKyybRi + E28rrCTLrSTLrCQZVpJ0K0maVUtf3Ja7sLaZYWXV8+Wutl1CQvxGjOg3ZRKIPHLalFHTp41OEpwyRHnu + nInJ8yYvTJ62aGFSetrs5UvhlBesyl6Un7dk3ZplgijnlDODgcSvYHN9UeOWsh3b4DGQ/lVDmpv2om+C + JLDh4P4GoazBvPOzx2gSX05eWAjoL/XueGmC7PDj8joTLcYknKqfSu4mx5k52N1HLBZfTs0PGUGyh8E4 + nNDAt7fTSdacyFS+MDk39amcBvWT6nILRkvWW0tgHvKsbXIE5grkZRObNLSZYWWTbhzaZCwWR4tMrwWj + rSd06xbVtaumS1Cgb8KQ3pMnDp8yacTUySOng8hTE2dMF9zFrPHzQOT5UxYumLYoFUSetSxjbubylJys + 1PzctLVrlhasX1lSlFVemltZsXpTNfp+BVvq0cZmXN65vRK6TNK8fy+SwDpwWVBnJtDPKKONzCXzwMUX + 5H1cOtfq6JB6khpzQ3JbOQ4gRe+8VRajjoyeiPjuBn6xAG2/ph3u/GhaMZFpS6W4e/3MirLJe8WC0ZYz + t5m8rY4et8Nom9lWVv1e7urVxdnZLjoyaPSIAZMmDuNEhiLPgCJPHzN75tg5syfMmztxAYicMj0NRF4y + e1mGoMhZC/Ny0tatXrph/fLiwqyykpxKiHLV2k01MMuFWxtKtm0t29EILqOUYbQZjM776g7sgzrDbDz7 + jP5RzOV0xni9qjcTYlzzhGOfOIXpwDJ+wwsdqEUsplsF0BOh00YwRkRHNdA5AuSRyVrw2gUnMlokz075 + 4on03aJV8j6W0dZTunXr1bWrR5cuXTqFhvgNGdxr4rihk8YPnTRh+ORJw6dOHgFrMX3qqBnTR89KGjtn + 1rh5syfOnzt54YKpixZOX7I4KWMJsxZZK5JXZXNFXl5UkFlWgvJFXnXlmtrqdQ0Q5Ybixs3EZUxlVOze + waR5725yzahpYH7uOWJ0G1OarUowjAR2OylDlHItO0cWRxGJUzuiMN0DBSGGL+b3FPF7dOhmddTeMKcs + lmNULWiTOz9HQHwk+/NLZM76DjHaesLLjL9eXSxtOvv6uMX2CBs9sv+EcQkTxidMHJ/A5HjSMLB4+lTG + 4qQZibOSxsyeNW7u7Anz505KSZ6cmjJtySLBIGfMXbl8fnZmSm72otV5S9avzShYj3wPRM6p2Liqqnx1 + bdXa+k0bttQXbt1cBC5vbyQul4PLu3dW7mV0Rq0Z8StitCZVox6rVvVSKXwU6N3ROch0Jif0lySYHyVL + Z0YShfnJcHRyGebsUT5GK4S0GIU3MhWovWHfPckx+Qq0RegogVb3uT+RID6DT27BaOukblbDunaLtoT4 + Wko6u7rahwTr+/aJHjdm0PixgyeMGzxh/JCJExImN1N42hTGYgjxzOlgsaDFcyYkz5uYkjxl0cJpaakz + BHc8e+XyeVkrkemlrs5dvHZ1+vq1S4s2rCgpyiwvBZFzqytW11avrasVRFng8rYt0OXSHY1l4PIu0Hln + 5R7mNKqeb0bDNqgTmPllzFXLHnsOMj+Wk/OX8jqoMHrSRGE6HI4OL+O3QaEVQic/mbCYLiHhN2SYHNjw + DHLzx/1IFg52Gh9v14hwQ98+UYkj+48TNuYZyQv+jgd/h0KCp0waNm3K8GmCl0gChWckwhRjz968OeMF + CjNHsThVcBTpM5cvnQMWZzMWL1ydu2hNfpogx8tLCleWFWdtLMUeL1iLfIHI6xs2wSkXbG2AWS4Gl7c3 + Mi7v2FYGLu/aAacB4/yrYDTqZ3RrJD9hml8fyU/rFZ+DTMee0smcdLghnRxJKswpzIUYvhiVCjpci6wx + v0pH7I75nPLzkuk9Ka8tJowfPHH8EOwtncTEd+iUiYy8UyeDvIL+TgN/Rwn8HTNn1th5c8Ylz5uwYB55 + ialpqdPSF88AhSHEK5bNzVo5PydrQW7OwvzcxWtWp61fk1G4fllxIeR45cYSzF3AV+TVVEKR19TVMFHe + XLdhM0S5obBxC7jM6Exc3rkNTmPjr43RyNmgth0/B5mOPcXEJvEXNTY6fw9NPK7CmK+gAw35hVt0vhY5 + Cn6Vzq+exS2qd9OnjpgxDTFyJk53T0Iilzhn1pi5s8fOI/1ldYlJCxeAv1PSFk1bsnh6+pKkZemzViyd + k8m8xLycrORVoPCq1DV5oPCSDesyCjcsLSpYXlIMFqP2BjnGNlu2r7a2ajWIXF+7rn7TenB5S4Ogy8xj + FG/bWrKdhVGdf52Mhtt9onOQUSNGUQKHPNH5kSTBZCT4EXzioyLFQvxrdRQd0WuL+XNhG8YvmD8hJXli + 6oJJixZOXrywmbxpM5amz1q+dNaKZbMzl8/NBn8zwd+UvFXMS6xlKpy2YW16wXr44mXFBStKicVljMVV + bL84FDlvUzWqyWvqa9fCXWyuY1zeXL9B4HJhI9I/Uud/B0Y/6TnI4qN66QhJOj+S38knVuF/Zwqb1qOX + LpmxLCNpecbMFUtnrVyGLA7iK5AX4pu9IDc7JT934eq81LX5i9atXiyo8BLsOSzasLSkcHlpEXzxyo2l + WRVliBx29kF5bjVOPYAiV+fX1cBdMC4jiMtb6hGoyZE6/5sx+knPQRbrr9hF8A7ev5WX6Ig6G+ejcVRM + Xk5y3qoFOIhlde7CNXnwD6kCeaG/TIKJv0UFy0qLQOEVZezEGpzpgQM9wGLhHA/j8R3GUzuMXK41crlh + E4oYsMz/9oymW3s7fg6yybGn4gNPO/7y/hs+02I9o21awboliML16UUbMoqEc4WEYCzG6UJMiEvoWJqs + io1ZghYbz6FhR9GITqBhHqMGfnlN3X8YbXICzZOeg/yLj84/p+8Gi+KCpQiisEBeFtgg3ny+Eh2uxHxF + R85U+g+j2zxTqa3jpX+tVbRf6g1hwSksYvGPPyXsP4z+yU8J+6WY8rz8vz/yTKW2zr37D6P/w+hfmPr/ + YfTPdbrBL/xC/9v89/9h9H8Y/esi+38Y/R9G/7oY/f8DPTxUq2GibSkAAAAASUVORK5CYII= + + + + 3, 3 + + + 131, 259 + + + StretchImage + + + 12 + + + logoPictureBox + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel + + + 0 + + + Fill + + + 143, 0 + + + 6, 0, 3, 0 + + + 271, 17 + + + 19 + + + Nom du produit + + + MiddleLeft + + + labelProductName + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel + + + 1 + + + Fill + + + 143, 26 + + + 6, 0, 3, 0 + + + 271, 17 + + + 0 + + + Versión + + + MiddleLeft + + + labelVersion + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel + + + 2 + + + Fill + + + 143, 52 + + + 6, 0, 3, 0 + + + 271, 17 + + + 21 + + + Droit d'auteur + + + MiddleLeft + + + labelCopyright + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel + + + 3 + + + Fill + + + 143, 78 + + + 6, 0, 3, 0 + + + 271, 17 + + + 22 + + + Entreprise + + + MiddleLeft + + + labelCompanyName + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel + + + 4 + + + Fill + + + 143, 107 + + + 6, 3, 3, 3 + + + True + + + Both + + + 271, 126 + + + 23 + + + Description + + + textBoxDescription + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel + + + 5 + + + Bottom, Right + + + 339, 239 + + + 75, 23 + + + 24 + + + & Accepter + + + okButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel + + + 6 + + + Fill + + + 9, 9 + + + 6 + + + 417, 265 + + + 0 + + + tableLayoutPanel + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="logoPictureBox" Row="0" RowSpan="6" Column="0" ColumnSpan="1" /><Control Name="labelProductName" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelVersion" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelCopyright" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelCompanyName" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="textBoxDescription" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="okButton" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,33,Percent,67" /><Rows Styles="Percent,10,Percent,10,Percent,10,Percent,10,Percent,50,Percent,10" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 435, 283 + + + 9, 9, 9, 9 + + + CenterParent + + + AboutBox + + + AboutBoxForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/AboutBoxForm.resx b/client/administration/UdsAdmin/forms/AboutBoxForm.resx new file mode 100644 index 000000000..3149d4615 --- /dev/null +++ b/client/administration/UdsAdmin/forms/AboutBoxForm.resx @@ -0,0 +1,890 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 2 + + + + Fill + + + + + iVBORw0KGgoAAAANSUhEUgAAAHgAAAEGCAIAAAAhWcaAAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAcOdJREFUeF7tvQdY + lVe6Pc7z/O69czOJihE4vdF7Oxx6FwXFrtixd+yIKIKNImClSxdQsSv23luMMcaYXkwyiTF1MtW5Mzr/ + /9rfe9h+nAOIGZNoZs7zPjyIR4R11ll7vWXvbSGvkCsqFYoqhbJGqapTqRvU6q1qzXaNbrdOt09ne8jW + 9pit3Uk7uzN29ufs7c8LgU9O29uftLc7Zmd32M5uv53dPjvb3ba2O2xtt9nabrW1bbC1rbfV5mnVo9UK + b0VWVtZrr7325z//+a9//evf/va3//u///v73//+j3/848GDBw8fPvyn8Pj/fu0PCwZ0hUJZqVRVqVTV + KnWNWrNJo6nTaDdrdY063XadbpfOdq+t3UE7uyN2QBb4MpQRpwSsjwtfx982mWG9yda21labq1WPUiu8 + FLm5uW+99daf/vSnv/zlL/fv3/93g9sCKIPRBLS6Ws2ArtFoa7XaOq2uXqdr0NluEUi63dZ2ly2Yy/h7 + yM7uqB2DmEcz1nZ77Gx3ini9yVZXo9NV6zTZGtUwldxVXlxc/Nlnn/0bws2AfoRydTPKtVrdJh2LOh1E + gEnBZluGeGMz4nsFxEFkSAdARwBrvAAkI7vMsK7S6Sp1mqUa1QCV3Fa+ZcuWP/zhD/9WcFsAZWWVkc7g + sqaW0fkRynW2tjw44iA4tJg4zhEHyghAzyUbTyC9Jl4D6wqdrlynnq9WxiiTkpJOnjzJ4f7Va7eFskKp + qlSpq9TQDU21IBqbjEA/gtgEbhPEsQbuFlSlSUCZgi+PeBPg3cCxLtfpNup0xTr1ZLXCX7Fq1ar3339f + DDfWSZOl8texTFooS5XKcoY1Q7lGi9DV6lhs0rUOtDnBSVLA8Z220Ggj4gAd0EOyyYqYYF2m05XqtJla + 1RCV3EHe2Nj4+9//HnBzZ/LrsyUWyrVK1QaVukStLlNrKjTaKq22mmENDrYIMakfS3BICiEOYeHLI16P + umYNAa9LdboSgdpz1cpI5eLFi2/cuAG4//jHP7ZlS55ralsoc5XKPKUqT6Veq9YUaLQlWm2ZlolpJXML + 8GcdQhxiYq7gsB+QFAANi82tSH1LrIt1uiIdHLdqBPMkDQ0N33333Q8//EBwi4X7eXfcFspspSpHpV6l + VuepNas1CO06rW4D4xoTUyCORQxLWU3HOG4CN0QD0gETggDWfHmstWXflniN/6hQpy3QqueplVHKJUuW + 3L59+/vvv+dKYu64n0dqWygzlaoslTpHDaw1uRpNnkabr9WuEQKIFwhvcBHiHeK4GG6Sb8BNwVNHLI9i + rAt02g1aTY5GlaCSO8r37Nnz7bfftqokzym1LVQrVOpMtTpLjZwCv6d2lRa5HMOaw02IFwrsAwc7TnBz + uMFowppbERHWIDX+I+1arXqGWhGkWL169RdffAElIU+C9P25prYA9Eq1JlPDIkujzdGyILjzBLhXNxN8 + rRZYmEjKYwhuot3EbgqOdXWzhkCsNxix1izRKOOVMrns8uXL33zzjTm1n7s6iQVQ5kBrs7TGyBbBbU7w + 9QLcIHizgj8Z3JTvkIZw20d6zbEWtAtFErmLfPv27V999dXzTm0G9CM6c6DpE4K7LYJDT4qeRE9M2A2U + QWrCmmwfXjZgjYURvMa7h7CGjAQqNmzYcO/ePTG1YUier7zGQjlFqU5nWD+iswnc+GP7cLeU78ezG0k5 + FU+AMoU51usfYa1ZpFH2YEb7nXfe+frrr7kh4SXA50JGLIKDg2WOMkWYQjlEqZ6pbg9usZ6YyDdnd0fE + RExtKg3ioznWWBjJ/KzRYvFQDVTJVLILFy6A2jAk8NomK+Qz7kYs6uvrCwsLU1JShg8fHhgYqPBRqOJV + 6klq7dJmvTYheDvsJu1Geg24scTBepvkO22llECZgtIZriEirI2S7STfv3//l19++dzJiMWOHTt27dq1 + W3jAva5Zs2batGk9evRQeCpUvVQo/WhXtIa4OdzN7GPOhKx3R4wgWUBSEgQ+MdFrE6wnsR4CEkg4P6yQ + JCOUsj/jkm1x4MCBgwcPHjp06PDhw/gED1CmqakJNJ85cyZD3FeBIrJ6lpmqcCUxt95rTX13h6hNiD8W + 65ms7FdaWvr5559DRsiNoBplLtnPVAJpgaLwqVOnTgsPfHLixInjx48fPXqUcAfo4PiECRPkWrkyQqke + YyYp7Qg3KQmoLZRNHpPEc+EmrKmsShqCpLHZhBityDy1IkSxdu1aNGval+xnB2uLK8Lj6tWr+Ijs4OLF + i+fPnz979ixwx2vAQYeZRRWiX79+jOBDVJoFIpdi4gLFWeWPoDaJCT62i7VmoQYvfHZ29qeffiqWbHEC + +UwtjxZvvPHGrVu38PHmzZuvv/462tXXr19/5ZVXgDtAxyoP0MF0IH7s2DHQfP369WPGjJG7yVV9Vahw + tkhw2nLcYmqb16dMCrBEbQqOdQmrOrXg9WqtJk2jjFauWLHik08+uXv3LpwfTyC5y352sLZAg+OD5se7 + 77779ttvo1cN6IE7CsSvvvoqQAfTgfi5c+dAc2gLEK+qqsKaKXeSM4syR4AbvO6IanND0k69uy2skcjw + JRefAOt0DbpiS5cuvXPnDl8eeYmVL4/PwkSDxe+aH9A7vA3xE3/88cdA/r333uOgg+mg+bVr10Bzjjg4 + jtV/1qxZDO4+Ks08zSOs26I2GZLmylR7KyRoTnDjE+I1/hV4LcYaRZh8rSaDpTMZGRn4yWl55FZEnD3+ + 4lhbwCThTQdbik/wU0LvQA2AT6B/9NFHAJ2Y/uabb3LEieNQFej45s2b0WmVu8tVg1Saxc1lKROseS2Q + y0ir5q/VPo7AfbacAutinRZJI+c1xzpGuWzZMlAEPzm3ItQ6eEZ4bQFdQ5YFh4SP+BxuCaADeg46mA4R + JJoT4hAWQhxL6KVLl7B4QlJqamomTZqk8FNgOokpidhom5SlKI1EXgM38ljJJuiFWZxHWHNzLQDNeA0N + iVZmZmaCGWKsYfueEawt8LLzB5JaCJwJ6MR0orkYcUg5llDoOCSFCH7mzJmioqKhQ4eiUaKerm4Pa+5G + WpXstnhNfRmhic4q18RrjjXWxghlXl4esOa2jyz2s4C1Bf0QeKCsjs9h++GQAD1+Pg46VA/lBaI5IU6q + goVULCkgOOnJypUrmXAPUKGszErblNGYFbhZ+4ZqrY912URqPrOAdwOKfNxcc6xTNIpgRUFBwYcffvis + YW2B0hc9MHWIR6ugg+lEc0Kcc5x0HJKCuhoafTAqpCfwhUjrp0+fjkYJK5u0jTUWtxbLY/utdzHWlMhw + sSbznq+F41QYFJWVle1gTZ7vZ85lLGg5pgd+AjxaBZ1oLkYcUg6Cw8ASwfGLQcFJTzjcMN1yO7mqvwoa + 2havnwDr5peBKTv0HZMh3IQ0k5phPV2NQs22bdtMsBavjT8/1hYmL6wYdM50Mc2BOFcVLJ5EcHgVWCso + OPTEBG5UUWABlSGCarehIU+MNcSaEnQYPm5CONYYF56gRof3yJEjHGsqifyCWJsCLcbdnOYccUi5mOD4 + NUjBTeAmMYH7RsEETSn1cLVRrM0bkrB9YovdloaISc0NH18YmwWEjWYPV6N+DR17RrBuD2gOequI0+LJ + CU4KTnoihhvaDS+IDBPVEuTuyl5K5rU50OLmb0ewFr0AxsFJmBB0GmlhFJEa/4Wqn2ru3LlYrrnnw09I + eSM11Hlr5mfQ6w4BbY446bgJwcml4Jfh7CbtxlKJZAdVFLjA1NRUGAN1kkBtatOIseZro4kPERs+c6xh + QvjCyLHO1WpWaJTdldhvYI41rz39bFg/GdCEuJjg3KuAI6QnBDeJCbSblkoygrROorwp95Srx6oZ0G1h + Df01adBwrMWqQmJtsjDSi4fvDKwXaFC8hgnBi42cC281rChUeyKsaYfHz5Cg/xigxQQXGxUy4xxuiAng + xi8GZwIjiN8T6ySUBDkO+mfMjSSoHgEt5jVKIuSvxXNobZCaZYxUCeFZjIjUbGPHVLXcWY7+Bv53qj1R + nQ8OivdlfgYT8i8BbUJwricEN5kTciaU6cCWwHQTtdFVGDduHGqteIMbBUQ0G2XMZYQc3ThlaZIudkSs + BVIzrLEwymTQLsIaLzzWEvCA+jJUDPmpsX4KQLcFN18quXBDSZCwgdooDYLayGtmz56t7KlkCaSJWFOO + DvEVak8Ma/O8vH2xpm9IGekqLRbh9PR0LBUQMbze+Enw8osN308t1k8NaA43iQlfKgE3CTcpiQm14f8w + sIHaiCbVDGvUnqgTxqeH28Ha3FmTgDSTGt9fEaCoqKjAC4x3FaRMXOT7GUzIUwZaDLe5koBBUBK8bTm1 + 8V4Gy9AlUYYq1cnqVoYrgTX0ty1SN9dAjGUQ7qzJ7bUktXqKGrsLUEZH+srNNRk+k4Xxp3B7PwnQYmfC + 4SYlwRIEapNqwwOQIcFvjl2IzPbNF7DmY5UAC4YPCyMXa94NaM2EGJ01lZyoDMJJLdRbVINVSFPh67FO + iE3Iz7Aw/lRAmwg3KQlfJLlqkyGhFRLZIytCAWsALRphNU4MVwnjOOLOS1tYk9uj1JwEpFmpNcs1ynAl + /CVWY25C+MJIhcyfSKx/WqBbVRKu2mIZQfIGq8uwBq+hIWJSk1hzARF3FM2xFvcHuICQUgukxtQk3B4G + V9C+wJpssjBysX7q5b2fA2ixknBqk4xQagMZobwGLMvPz1eGKTHY2KIPSxkjOWtOahMZEZdBqD/A00UR + qdGOwLgEOstInWhhpMq1iVg/dbf3MwHdKrUptSEZQV4Dow2swTJMazAfgsoqLzfD7VGXAAICQPnsB3Vv + ebvLpI6K2h7Vm/iqKJBas0yDtXfdunVInSg7x2rxU2cxPyvQRG1e8oYgimUEvyolNVgeMUGgjFWyYWKO + NXd75ED4/FirWHMBQb1JvCpSCyJHSBft5RjIgr8UZzHkrH8KAfm5gW5LRiiHxLrEl8fk5GSU38SkNpat + K4RVkU9H0liTGa+NDoQ3B/iqKADNBKSvav78+SgrUhbDnbXY7T1FAfkFgDaREXIj3PmRy8avDa5NnToV + ZyK0IHVzumgkNQ2gisXaJF2ErKMGIl4Vm0nNUhhfRXV1NVJzctZYJ6jk9FO4vV8MaBMZETs/ctnAGq1e + 1J7QLjFiDbywKsKB0KoIfPmwb2tYPypYk602IzX2yIwaNQrNAThreB4qOeGV/ikE5JcE2lyyqRSF35Nj + DR8m95KzqTO+9ZF2ctCqSIdbcF63KiCw1eJVEVavWT2wGR22GrkSBARu7ycVkF8Y6I5gjTk/RajCaEI4 + qclWQzdoc4YJ1lxA+KoozhXJU0Ops7UsL9eyvBxuz0RA+EDIU0lhfnmg+fIoTtZNeI0RJGw7ZKQG0Hx3 + KSc133EkXhhNbDVWRW71xKTO1sLeoLAlFhAsyLy2J24O/Cs1kGcCaHMrAtsnxhrqiSkRSCptnDbu3uCk + Fu/uasuBUGeAWz0xqWepMe6DQRQTB0IpzNMqWD8rQLePNXwIhoZx/IF6tpoBTUuiUK1mSk1bFhGQkfZJ + TQUQShSb1QOTgpiGnTNnDuYI4UCo3kSrIupffEKBOl4/mtTPENDmWPO1kfx1XV0dy86RxaBfjiWRJ+UQ + aNr83LZYG+dATEhNk5hZWswcY7QeJz1hGJzqTVQDQXmAbPW/3oV5toBuC2swC1iDZZiDRqmTAY2MnLcF + IBcm2565gIhXRRRAypqHm8xJ3V81Y8YMNH3aXxV/NKmfOaDN10bwGhkE8gjk6CgDMWedpDYCLZSqmXpA + NOg8LdEJhyY1kBakJk8tUg9NMiM1Rusx7sNttfmq+KNzxWcRaBOsKW+kHB2ZG4bq4Pbwfjdu/OdLIp0K + Aqzp3ATzVZGmfkFqc6UWNq0i4wepkSXRqsgLe5Qr8mr1jyP1Mwq0ed5IWMMJIGlEm1U9VM2Abt45alwS + xWeviLEWWz1KyilR5D5PAJoptbN869atGPShwp55rvij++XPLtBirKkeQjVVLFDwBkAEb3YGtLBzgJWZ + gKxwUpnx7JVWHQiRWuypYT+EzIW2l2HvE6bIsIcB0/XiXFFcAPlx9uOZBtoEa6qpAmssjEgXsUfo0dZz + Kn0Q0Di/CdQ2ERATUlP5lDqKpNQC0Dh2AAdN7t2719zq8QLIjyP1sw40x5paM+KFEbU9lJUZoyHTGElA + oQPeQzjtkGHND8oycSDmpBYBDawxrpeWlgbbTlaPF0D+RVI/B0CbYM3FGrNOaOaClbSfzug96FhJfthe + W0qNf0LVD+7zmtUDWxR69eqFPayweib5y79C6ucDaMKaiiFcrFGOAPXUiWo6cYjJNNJCqAed30mHSDYf + Zt3C6hGpUdJD5cRsSQSp8fqhdfl0Sf08AU09MGqAoRKCLAaeFweBI1c0To6RTNPxy3Q4Kp3WaZa/ME+9 + sWXy0izTTKmHq0eMGPF0Sf3cAN2WWKOTiy7MI6AFmTaejwqsOalblqqNw77k88zUAz14JC/YOUmkNrcf + P8JTP09Ai7GmLAaiifUKxSbNSo1xEoGApsOWERCQtkiN+TEkL7x22nJJVPVmPg+khv3gnponiuLqRwfL + TM8Z0FysxQICPVUNVRmBFnJxdgQtUD4gCEg7pIa4i5dEsXpMZZO+OF6APDVPFKmpSD2BJ/J5zyXQfFoV + bg/pIt7aeKfDC7MVj9IWrId0RD6wbovUfEmkLJEKp83egy2JAew0Sey+pkSRmoomJb2OJy/PH9AmAkIp + DJQabQFju5aAxgHWdEg7bnkgUptVP4xLIi99tAQaZcKxY8eiy0XVD9SzqFOO2hbVqan50sEy03MJtLmA + oLYJ+6FbJ1z9QMaDgKZbHojU5j0BkBqtW54lUjrefCoaNuGinYjOC/a4w97QqA3q1Hx+jJovHST1cww0 + FxBKYZinnqw2FqbJ4dHtGsB6v0BqvAbmpMaSiNIHVw8R0CxLDGEnJuAsGJCa6tS8+WKSvDx2SXxegTYn + NU4OwSQqWxK5lQbQuJIHd5jgE5Aa1Q/hCDJx8kIbjYxbnalCLZJp1AhHjhyJyTGcJGCekT/Rkvh8A22y + KuLAEHWK2hToEwKvodSofpgnL7QkckPd0uSxwqlWjqMBzX2euMvVEfV4joE2XxXR9EOblc5gZ9IBdT7O + rkKyA9aHhNth2loSST0oc2mpHkjHoR5YEuHz+JJI06dPpB7PN9DAmuflWJrw+6PRBa9mLHcQ0Lhq6rRw + rRc8NS2JraoHZS5UNRWdEgrvgZ3V2L8vXhJpIhJdiI53Xp57oGkOmBebwD6U34x3ZkCaATSu9TorXOt1 + UFgSzbtcpB48czGR6Zksc8F+UCyJ1LqlzotJlvhY9XjugRaviiA1eIchc7vtwu07HGjcWHfWnik1lsRW + 1QPeA8W8ttTDR4GDR5AlovTBs8RWDXU73uNXArSY1Ci8YXrxEdBn7O0vCAFSw+e1pR4o5lHV1EymcRgu + jmnF4YqUJaJHLjbUXD3az1x+DUCbkBrH16JIzZJvXJgG6Thj73DBwemCEyP14Wb1MNlZDvWoEA6LbE2m + cT5Anz590GfghppPM9GIHtWY2lcPdtTPY832s/8EsVLj3Y0yBTMeSFUA9Fl7xwuOrhddATfz1G2ph4nJ + E7lpjKzLdaw7/q+ox68EaCI19RXBL2QZcGlMlE8woEFnj0sewBrsbk89uMlruR5SgSknJ4fUgyZsnlQ9 + LKAszz5hO/ITEqmpfIq1C/sEyETj7lZA7H3Z2+uSFyM1qYfY5IlO5WxTpvuo0Asm9TD3Hnw+rx31YED/ + OtSDPDX5PJQmMA7JLm6FiRaA9rns43fFz+2im1E9Wq17VIpkumXaoh7POrbYfiBWDxTzzDOXtsBk5979 + aoCmBi5NJfTu3RtdQWgF/AZ0AygHXg0E3GxJRDrelskT5+KitEWTopGpZTgWijIXTK2js4MtkZS5UCuA + V01bff9ZUEW1I+/NZ/854iURxTygQyuh5yXPgKsBoa+EAmvoNUvHTUweVw+xTLe8RQLXTGAHNdQD1Suo + h3krgKqmbSmERTt/9+wja/4TclKDfcieoRtAFgId9EpQ5KuREdciADrUgw00mck0OzUIbprSFrP1EIM1 + 8+bNw1n81Aowr5q2b/IY0L8y9aAlEe9rtALsjzCB9r3sCzp3v9495noMqM28x147Vp42O6eJuWkUPVpL + W9QJatygApnmVVO00DBxap4itirFFk/Uj3kuOM6XxEGDBjmUOUCgDVcM4HKv6736vNYHnzDvgRSxVZmG + m6at+mb5IcbPIiMjMZbHTR56LiYyzTu25kBZPFE/5rkAmqsHpnvtF9mTboDO/W70G/T6oNjrsYCemTzI + tLjhwmWa1kOU8VoaD5yLiPUQ1+Nyk0cDY+KObTsyzc6Pbn+5fC7AFf+Q3FADFN1wHfwGdAP4AuVhbwwb + cGMA1IPJdFtuup310JNdj/bjZNqigzWR5wtuUg8YA3WQGrBCLnq/1jvhZkLirURgjT9CptnA2GPXw5bG + A94cZkYs0zTvQTIt7gOYy7QFr4ngJ/uVGWq8kWUKWcCegOhXo6Ebo26Nmnh74tg3x0Ks4flYH0C4Cc20 + D4D1EGU8Mh4tgUb7Bt2yffv2cZnuuJu2oHP2fmVLIpdpNEcMxQYgO+TmkPG3x894e8a0t6cNfn0wM3no + A2A9NDu3EE0AZjyorSUqLbHhx1HqgQMH4kYxctM0LWZe9Gg1NbGgJuOvb0kk9Vi+fLlvmi/oPPLWyKlv + T53/7nzEmDfHMJk+0sZ6iCYAjAc5PBOgp6nDw8NxexsaLtxN84aLGEnztMXix83dPPuSTcU8HILqOdYT + dB735rjZ78xe/P7itA/SQOqoV6NQb2J98XaMh5nDw71RHh4eO3fuhEzzdi2GPXBYED9/oq20xeLHzd08 + F0AjEUPr2rmnM+g8+a3JKe+lrPhwReZHmcnvJsNQIztn+WGrQFNby8zhoXGD5i/OUmkrbeHroXkOaIH6 + k/gokI4Pkz3jWJPJQ9FH56kbe3PszLdngsu5H+euubMm44MMOBCsh60bD9yNQQ7PHGgUpj3ZrXMm6yH2 + ueCoMT5oSgueibOwaHWY7NdRZiKZxrWjiScSwWJwecMnG0o+Lcm9kzvh9gSWtsB4mDg8Slt4xaNlzkK7 + LnCwFtZD3F1AUzXUBOBlPLLL5uuhBT+M7F/ZCfNssptkesCAAYnbE9M/SAeXK35XUfNFTfGnxbPenoW8 + nCXiJg6PgMaQGC8tmVjpaCUG1LEeivNDPtFLJ0/QfgATslpwdyJeNH8dAkImD2cJjigdkfNxTulnpZvv + bt5xb0ftF7Vp76chbWGJeKsOD1a6DaDJSmPEVJwfiic9uIUzBZoWTeoUkKf+ERs0nllGA2i80xOyE9Z/ + sh747r63++DXB3fe2wnckZSjBdOmlW4rZ0lQDRs2jIwHdVswJ9YR42HBT9h7usdTPCPQg1bFxcX9F/Qv + /135ti+3HfnmyKnvTh36+lDBJwUDXx/IHB5KS+3kLGbJIQYZMHqAsUduPGikhtpa3FaYF58t6IhO8alv + vyZSA2iUlnpP6l33Rd3+r/ef+f7MlR+u4GP159XIyFnFo1Wga4RB3taycMybde/eHUDDePC2VkcK0+zO + 2Z/ieIpnhNGQadTpo4dGQy5OfHsCKFOA3ZNuT0L/heUsZgetY2iaDdO0CnSSGlfWo30jLkzTTub2HZ4F + +mA/6aFNvyziABqN1JBeIZCLS7+/xIEGu2E80OVixdLWgGYzj8jCzaRDM1fj6+uLM0O4w6MhsVYbtWIr + baFWe+L1EW96/jWtivhVYQn8Qv1INHhAqVPfS8X0AUsOza8OQPOwLaAXatzd3QlocaP2saUlCw+PaShx + 4WUxObSJyqfPWlUPwD32YdIEQCrh4eshRhmfg93LP1yOkRo2nd4q0OizUF2ppY/G1c2Ojo4AulUrLR6a + NslZLEJDG5ydE3CzksnB1T/RWahiFPDWwTKC2R+MtWEyEZfG4rYQvOpIMbDgBAUFeXl5OTk5abValUol + Fx74BH/EF/FXeEJ0dHT//v3xT3ByP2wc2h+4ABflHlgp/M5YCfHA/+Lo4nj595fFAayRjmPMg2XhrV2G + wTZbtAa0dqlWp9NhgW21hsedG+9p8d8XQG8ODCywt++OFJ724opPfXtax0bi+8ADwRLh+kwcJpyQkACY + PF1dekaEJg7qN3/S2JwFczZmLd1euOZYbdmVnQ23D+++c+bQvSun/vDahftvvvL3t68/fPc1BD7BH/FF + /BWecLup8Up92bGi3O2ZizYmT8ueNHJeQp/RMWE9/bw9He2QfOM/wsTty91eztucV3+x/uRnJy99d4nF + 95fWfrzWcMnAGM1PEhPtBGgT6BVatVoNoNvKWUyKpS2ABtZ6/XKNxhdFRWoZmJ98z++U6uDihlYk3iLg + Fw5Qg8O3t9X1CA+dOnLoqpS5W9blnm+sAUx/f/vVf75341+N25f/+drph5cPPTyz6+HxLQ8PVD/cVfxw + y+q/VS3/KHf2uZQxDeP7zQ12HRfmGeGuUysl0QOixy4Yu3Tj0pSmFMNpg26HcP4EwuQKLmw+bJXRmVqF + QgGgzYulIChtA2g1OQSjtwix2dt7nlLpAIFv9eT7jpywhxcT41Lg7OTJk+10uj4x0Qsmj6/IXn52S80X + F4//q4C285K88+o/b57/57XjDy80PTyx7eGhmoe7GdYPalY+KE97UJR8d9HQ+6vG3c8c9fGCfsfGRxX3 + N8wKc4l2U1hKftMpplO3kd1kC2XqIjVd6cw20NXYsl2eZO8yhRApNRQMWmeeHIq3IPKqtJjRjaGhWwlu + d/dJuL8K8078mpLHnnyPpQnucOPGjRi2dHN2GtGvDzi7v6Lo49OHfkJkzUF/9/o/b1365/WTDy8dZNQ+ + Uvdwb9nDbese1OU8qFx6d9nY+2unCliPvL90yF+X9P9ravwf50e/MtajMl47N1AS7dTZ2uZ/OkV2shpj + Jc+QYzstfLQmT6PJ1mhXNmNNiKMkLQBNySGfeQQ7Wy3/PwI6LGxbaOgjrF1cRmJFavXke/E1JVgq8X9g + Zw7+174x0cvnzNhXtuGTs0d+VnBN4H772j/fuNCM9U6GdVP5w52FDzfn381Nul86//76GffzJt7PHn1/ + 2dC/pg/8Y0rPe3MC7k73uTvZ4+5E1ytDHUp6KKforQy2L/6X5f/r2rurZIJEtYTdmcZiJQsG+komHZBE + eGLKwmljS1tAcyttAaBFWG8NCqp0chqIY375yfe0klIRFQTHd0fL3dnRYeyQASUrllzbs+WXBJewBsSg + 8+vngPI/rx59ePGAUa8P1jxs2vhgR8GX61PuV6ff35hyv2D2/TVTGLVXjvhzev97yeF3Z/nfnSZgPcHl + s/HOd8Y5fzjGqTFeszDQJsahc9du/9MlvIvNKBvVIhUuy2GIL9VgMcSBjwCaZ+HYVGtS7jBvaAHo7SKs + GbUDA4sdHeNxfxWKUnSaIbBGOxLLmqOD/bghgyqyl715aPeDd5gT+MlRxoLJeHrKiOC5vQ/P7Hx4ctvD + 41tZHNv88FjDw6P1jL+Iw5seHqp9yPCtfLhv48PdJQ93Fv2jce29DSn3Ny2/X7n4flny/cLZTEZyx/95 + 5fCv0nrcBdazg+5O19+d7AleM6zHOr+f6PTuaKe3RzruidcuDpT0sO/ctev/WEZZSsZJ4KPhL3EcLdZD + 5Cx87oDKHe3UlSzQ1TXDutHff529fQ+cyY4+Am5Tl0gkA2N7rF6cDOP1lzeu/O02/Nar/2i2XE8B69fP + sXUMqAGdxjUPajPZIlac/GDdrAerpz3InfQge/yDzDEPViY+WDGKxfKRwiejH2QmPsga+yBnPHtO3pQH + a2awf7JhzoPCeeyflyx8ULbo7yWp97ImM4hL5t8vmnu/YNb99dPvr57855zEr5b1+XIxsI5kWCcZ7k71 + vjvR7fPxLuD1B4lO74x0vD3C8dZwh9eHOWyJU8/xsw7SvfRfL/0/GxubVatWYZcuHB4lh5Tu8XIHHTJh + UsCziIw80CrWnp5ZNjYGO41m1thR2zbkf37+2FdXTn3/6tk/vn7xr7eu/t+/gDWzYiBdQ+6DkpQHuZMf + LBv+j0X9/zG35z9mRf/fjIg/Twv/w9Sw76aEfjMl9N7k0HuTQu5ODPliYsjnE0N+N4EFPsEfEV9OCsHf + fj059Nspob+fGoZ/9Zfp4X+bEf6PpIh/zI5m33BBPL7z/YUDvkqKub8s4f6K4fezRt/PSbyfMwbx56wR + 95bFf5kW+2VqzN3kiLtzgu/O9GdYT3b/YoLLJ2OcPxptxPqN4Q43hjm8OtThWoJDYaR8tH03H6UNiqV4 + i/PyPx/wwLufz6WLW7QW0dHHBaz3EK9DQrb6+dW6u5e5u5W4u2ZoVSGrU+e9c3QPXASw/vrq6d9fP/en + m5c41iQg7WsIY+uOAsavrLECpjGAA7gAI+D16YTgO+OCPxwb9P6YoHfHBL09JuitxKDbiUFvJgbeGh34 + xujAm60Fvo6/xXMQeDL+FQL//IOxQR+NC7ozPhjfFt8cr8SX4wI+SnD9YVrgX2YE/TUp9K9zov6a3OOv + C3v/MbXXlwsj7i6IZIyeH353bijjNbBmku15d7zrZ2MZ1u+PciJeA2sAfXWQ/dV4h+P9PFYG2/d2lEdF + RaWkpGDdovI/OTzKWXhDi9ZDAH1KwPpgSMhOvb7W2bnIy7Pc3686NLAeYfDJstOE56fMfffY3jtnDn9x + gWH9w/Xzj8Ea6B/f8qB62YOcCQzZmVF/mhZOsAICYEqAAiAxlK+PCvzXg78q9DLgNbs5zPdqP+e3x/i9 + P87w0XjDpxP8704K+Hpy4LdTDXcnu4K/jMXQaEgHBT5nvGZY/26My51EZ2ANvTZiPdj+Wl/HW8N8bg71 + vjHUpyTKOdFTbS+zWbBgAcrTUA/M4dFR6lgPxecuAegzERHH/P33uLtv0vtsCjTUhQVtbo6GsKAGg0+O + gy4qe97M947t++Ts4bsXj3/zyhnCGtkwaQjx+sHZPUxes8fjPfv3GRF4O+NdL0YWvzln6L+OaQe/w9XB + Xmf7Ol0f6Yu4MUp/c7T+zUT9W2P83hrj/dpoh1ujHd8e7fTBGCfoMhQD6+HdSe4M5Umedye43x3n+sVY + hvWHo5iMvDnC8fUhDq8PcH5rmM+bDGuf14f5vjbUpz7WbbrezlsjR8kIrXGUWZAf0q05/C4Gi8DAwz7e + uwIMe8NDDkSG7osI2RkWtMUE6wB9vqNtbEbS5PePNwHrLy+dEGP9t73lf1s/+/8WD/z7zEiAC+kEuHgL + vyOIAAe3g7g89addGuBxtp/LtRG+FK+OZAHQr470ODPM7nyC3aWh9leH2V8f4XBzpONb0IpEp4/HOkM3 + Ph/rApQRxOuPRjm9CxlJcLw90PW9Eb5vD/d9c7gv3i43hgJr3+vD9DviPecGOBhsldBuLI+8Kkc3b1kE + +h+MDDvePfJEdMSxqPDDUWFNESG7woO3toR7c6ChwMm+X/KExNebthHWXzes+T5r0g/zev1haigDdxzA + DWTgjvnlwRW/Whf6uZ0f4MaB5p9cHO5+Yqjt8cG2Jwfbnhpse3aI3QUB9GvDHa4Pd7g1wuGtkY4QDeAL + lBEfj2ZYvzfU6f0E9zujfD8YqX93pP72cP2t4b6vD9O/Nkz/6jC/a8P8dvX1nhvo5G+nwnla8HwQazgQ + UNuie+RpIU51jzwZHXE8KvxIVNj+yNA94cGNJlgHB1S4Og6b3Dv67OyEj6f3+HRc0PtjA95K9H9zlP/N + UQE3mcIG3GARiHjqxPzR3/BcH5eLg9zNgT4/zO34ENvjg5pjsO0JAfEzg+3ODbG7ONj+aoI9nAa8HRQD + ugHQWSQ43Rnm8Vmi/s5o/Yej/ID1OyP1b47Q3xzud2O4H8N6uOHqcMP2Pt4zAxy9dMqioiIkIpARDjRh + fQpYR0ccjQqDjADr7QLWgpIE1ofpq8K8N7qrh8g7davu7nIhQX8xwe/SUL/Lw/yuDDdcG+F/bUTA9ZEB + r7F4hrA+3dvp0hBPc6DPDXNtATRHfJDtiUG2pwbanh5od26g3UXYjCH28BtAHOvh7UGOd4Z5fp6o/12i + 36eJho9H+30w2u/dUX5vjTTcGmm4McLw6nDDK8MNV4YZLg83bOrlNUHv6KBWwHSLgebUhowcjQo/JEj2 + rvCA+jDfyjCv0lDPkhDPkmCPEnfteIWldkWQ7dGBvqeG6M8m6C8wuPEfAGt/c6yJ4zyEV4IFnvnqCBav + jAi4Otz/ynD/S8NYXEAMNSDODzWcSzCcFQX+iMDX6Ql4Jp5/Wfi3+A54pfHd8G2bfwb29joRa39lqPcr + I3wRYrjPDnNuHeiBtscGsDg+wPbEAIb4GTHi/ezfHep5Z5T+k9F+nyUaPk30u5No+CjR8P5o/3dGCW/u + kf7XRxiusR/JQL9LQYzHYE87AH1GkA76KJaRY1FB+yL9tkb4bAr1qgz2LAv2KA3yKKHwsp+rsfJJ8lId + 7O9zYpD+zBD9+aFgt+HqMIY1Ufv6yMDXRgWKMcXXAQf99wDrTILhZILf8SF+RwbrDw7UHxBi/0BfcTQN + 8DUJkyfQv8I/PzxIf2ww+26nEvzw2uBlYC/bUP3BHraXhvlcHu5zZbjPVSEI9FNDnY4NFklHM6OPEdD9 + jQG4OeJnB9qd722LMXashO+N9IV03Bnt90mi4ZMx/h+P8f9wTMC7iQG3Rwe8McofvzVwwMt/USANfk0C + umVEnO4efLi7f1O0365I/Y5wny2h3ptCvKqCPTcGepQFepQKUeLnvMJe2n2oo7QqxvXYIP1pUHuo38Wh + hsuAm+kUo9iV4QGgG8F6OsEgxhR4EYL7mmNvf989QuzuQNAz8U8Q/DvQN6RXgtDf18ezMdr26GCv40O8 + TiV4nR3qfX6Y96XhDPcTCfZHB+mODtQdG2RLQXptArQYcRD8ZKzulUGeNxK83xjq89YIwO334Wi/jxP9 + 74wJuDM24KOxge8nBr6TGHBrdMANhnUAYY1fvyXQgDjoSHf//dGGpig/0HlvpN/ucP3OMN/GUJ/6EO/a + IM+KoJZwu6iHyzsrVgTZQUZODvYF3KcHI/zw8cRgRtVDg3z3D9A3Cb88wUqAEpq7+vns7OezQxTb+/pQ + bDML/lf4RPxP8B0Q+Fb0PekFIPS3xbrWR9vu7u+B2Nvfs2mg56FBXscGe51M8GoaZLt/gPbgAN3hgboj + A0WID7Q9KmI0B5p90tf2RKzdlcFerwz2ejWBJSxvDPd9a4Tfe6P8Pkj0/3hswMdjAz8ei+wU7ivwzdHM + HUDKgDWo1qzRphADZURThH5fhH5PuO/OcN8doT6bQ7zrgr2qRXAzgnvazdFY6Se4KerjPPb1897d3xsW + h/3a+Jz98vgE4btLgJUAMuLYx2fbUwzh5eEvAEFf191xU4zD9n4eO/qz2CkgjtjZ362+r3prvHpHH83u + vpqm/tr9/bWHBgiID9Ad7Y+wpWgBdB/bk3EOlwd5AeurQ7yvDfG+PtTnJhzeCL+3RxreT4R6MKA/HheE + 7Pc9lkaw+gFUFFgLQJNQGPYJLGYRgdAzoCk43AK1G0DtR3B7AusyP9dce3lf65deXmjQ1ffyaIj33NLb + a0u819Z4ry19vBv7eLOP8T6NfVg8TXDb+W7CG6Ii3La2p9OWvu6NiH4eiG0C6Jv7OlX1VlXHqWriVLW9 + VJt7q7fFM8T39dPu76c91E93uJ/uKIUY8Xjb070cGdAMa++rg71fSfB5dajvjeH6N0YYbo80vDM64P0x + gR+ODUS95UPYX6HSgGQYWFt0D2jqziCGSrAgiHkwlJsjXL83XL87jFG7McS7PtirNtCzOtCzMsCjwt+j + HOGmS1J2805wlOVHOFfGelTHeW6K86zv5dXQ22tzb+8t8d5b441w/zxY40Ut8FfUxrnUx7s39HHf3Mcd + iG8VQK+Nt98YpyrvqaqIVVXGtkS8t2Z3vGZvH+3+PtpDfXVHxHD3sj0T79wC6CE+ryT4voqEZbjfTebw + /N8ajSUx8H0mIEZeA2sUXiyi/HZH+u1BRABlPUULrJuB3h/hh2gC3GH6XaG+24N9tgZ51wcCbq+aAM+q + ACDuWal3XWMnH2j9knSqp7qip0dVrEdtnGddnFcDg5thjfjZqN0Q51EcrAbK4iDEK3rrSmKVpT2UZT1V + G3saEa8C4rHK6p6qTbEqFKB39NKg8N/UR3uwr5HgR2J1Z/u6XhrkJaiHN9TjlSE+1xJ8rw1laeFrIwyv + jzDAcsB4vJ0Y+O6YQDAacENDgLVFhH5HhN8uCLEQLbAO1+9DPGI0UPbbH6ZH7Av13RPiszPEZ3uQ95ZA + r4YAz00BnoDbGB72CzU2oTEaq1R/O1C7JhbU9mqV2j+pktTGuJSF60yApj+WxGqKeiqLY5ToEyI44hU9 + lZU9lFVC1PRQNcSqG+PUu3tr9sYzgh/soT3Xz+3iQE8AfXmw95UhPlcFoF8dqr8+zO/6cMONkf6vj2R5 + MlzH7dGBAtysVImwCPPdGg4Pp98Zod/NsRZUgqFsDL8mgBumx0egfCDUGE0hvnuCfXYGM7i3BnptDvSq + D/CsE0Df5O9R7ayZLO/qPtBemhniWB3raU5tKMmWeJ+iHp5ZkW4pwc5TDU4jve37udt2d9YGOah9bNWu + GqW9SqFRyJXoActkCHyCP+KL+Cs8AU/Dk/FP8A/xz/FN8K2Ke3huFbS7MtKhIsreHOi6eLeiWFVhjLKw + O4uimEeIl4HjMcryGGVFjLIK0UNZ3UNVF6vaGqfeGafZG6U53c/9/ADPi4OMWF9NYNIBRhPQr43wvzHC + H2YDWL8xKoDqtKAzSkAWWNlgJ8J8t8NaAOtweAyGsjEYefV7Q31ZCJ83her3A+gwv4MIAXEGd4jvLgHu + RoHgQLyBws+t0EE5QtpFN9xZnhfuDGqvjnRbGOQ8Ue/Yz10X4qB2Vivd3NwwtRQXF4epogkTJmC4a9Gi + Reif4dh3jIhgkAG3NdXW1mK4Bw8063CZREVFBcbLMQeblZWFTjE2lWCSBGM6ON4nJCQEQ4guamWooyZC + 2XW0p2phiMOa7s5iuKt7OxX2VHKgCW4ECM6iu6K0u6Ksu3JjdwZ3ZTPctd1V26J0R/q4n+zncXaA54WB + XpeI1ABaqChxoOGgXx/JsIbl4GVxC/jiYK8aeIkwn21Y6ML1uwSs94QZ8d1DKIcIEcqwRnCsD4X5IQjx + fSG+u5sJDsSh4FsY7t5bPZ3z1LJBnX4rU3aztLG2wuZTnKQxZcoU9Noxh4Zte8Bu06ZNABFQopOPB4oD + eGB8Aj1QemCu0PyBVjQe5l8vKytLTk62llpjLsk/yt9aauWlk8a5qibodRlhjht62LYKNIM7WlkUrQDW + xdGK0uiWcEcq6yNtd/Vy3R/vdrSvx6kBnucY1j5XEnxfGaoH1gD6+gh/RmoBaPAahTBgTc0gC+R48GfB + XlXwyKE+W0HtUN+dob67ocIUAmGNQLeB9eEwPwQhTgTfHeC9w89rm49no6dHo5fXDl/fXe7u2BYy0tra + cfDgwdg5XF5eXllZCYjBVkCMBj5HFsABPkyoYBoID/RAMVGIB7rO9MAQeKsP/gQ8GTX4oO5B2XXZiKza + rDk5c0bNHtUzoad3sLdS8aLB/qXBHl3nB9gUNNPZyOtoZWGUAlEkBOAuaYa7PFxZH2W/Pc5lZ5zbnt5u + B/t4HO/veWag9wWGtf6VYax0x4AeyYBmWAtAE9YIAhqBrLoiyKsmyHtzsM82LHShvruAlxCE9SO4m3kN + GSENORxuOIII8zsSpD9s8Dng49Xk49Ok1x8wGA4GBh4KDj4cFMQiOPiIr+9GB4cJEok7pkBxcAmIDBYT + f4EvwAWsBCWmJtCLQ/cTDww7oN+MB7ry9ECf3+TB/4qeiRNKE6YkrN62enXj6vyt+Xlb8jDnmNuQu6p+ + lTZVaznY8sXgF//X/n/tlS/EOHWe6meVHykXGM1QZhHJgrA2sjtEWd/dsTHWBdnmjl6uu3q77+vjfqS/ + 56mB3ucG+14e6ncVWDNSY0lkQKNiLC7tWgS4FwV4FAe4l/gjPMoCPKuDvBqCvbdCc6EDbWHdTG2Gdajf + wUDfg/6+h319juj1JwMCzgQHnw0LOxcaegYREnIqJOQEIjiYfUSEhp7099/s7DxHqQyOiYnBiVBQD0BM + nAW+BCtacJgDwjwUHpjExXQvGvt4oFeEB05UNHnQ1+k5eHJAQEDK2pSCvQUb9mxYv3v9+l3r1+1ct2bH + mrl1c+W5ckmqRDJXIpkt6Ta8W+fozi+4vaCW/2+0Y+epvlZrIh4B/QhuIB6oqI9x3tzTZUus67Y4YO0G + rPfEexzs53V8oM/Zwb6oGF8dxsrFUA/Ga6E0j89hBFETt/B3LzK4Ffm7FxuMUSo44k2Q1zawfkTtIN99 + Bu+9Pl77fAG0/zEB34thYZfDw68IcTks7FJY2IWwsPNhYfgrFoQ+PgkPPxsScsTLK8vWdqC1tRoXcdBh + Z+ApkCVYASUO18fMFbZ042AuDAVipyq6RPTA7hv+4F/EE/A0rJ++Qb5lh8sQpYdKSw6WIIoPFBc1FQ2u + GSzLlcnSZNIFUul8IeZKGeIju3WO6PyC4wsOshf6OFkm+9sQysYIV5SFaOp6ONf3IKzdtsW5be/tvive + Y08fz6a+3kcH+qC8g3IxKtGokV4f6Q9DcqG/+7GedqfjXS4O8LIwuBUi/NyKEAaAzuAuMbiXwxTDP8BI + AG6YCjG1g333+Hvv8fXa4+mxG/oQGHg0JORkSMhpAUSgeQEQh4dfjcCWSRavCMFwR0REXGyOSxERiMuR + kVcDAupcXeep1eFEcLqkCngRmhi4QjMfQ8B4YHwCG0YwGoiBFZMHvogH/hbPgW8ZMnFI7dna2jO1Nadr + qk9VV52qqjpZVXG8Irg6WJGvwCSjfLFctkgmS5XJUmTSZAHu6RKbCTYvx7/8kv6lTl3/21/z0ljPl/PD + 5cC6IESxMcy2NsZ5U4xLfU+XhljXrXFu23q574j32NXHc29fLxR5Dg30OTlYDyU52c/tWC+nY3EOZ/u6 + XRoE8xeAANAFfiyANYtmrAF3qb8H8r06MbWDfHb7ee/29twNCYb+BgWBxccRpAmCSgBusJVhDXwjcdZc + 5GtRUTeEj4jrCHwxCsc4iCI6+rXu3W9ERV01GDa6uExXqYJg1LCaQb6BGuBD8w3DbRicwJgr9gPjgSFu + PNDe5w/6CvaS4IE9A+lF6Y2vNG69unXrla1brmxpuNSAQfTKc5VOtU7KtUrFSoViqUKRoZCnM8Tli+Sy + ZJl0hlQySYK5L8kYifVwa8sIyxecX3CQvzDQpWu6r6Qiwr6mu/OmHi51PRjQDbFuDOveHjvjPXf19YKS + NPZw2hxl1xipa4p1Pt7X68Jgv8sJ/leH+r8y1J8B7aAc4ue2QQhzuB9R29+rUe+5zdNju17fFBCA9Q0Q + UzCgCWuIrxBMGSAXwDoy8hUgGx39enT0G9HRt7p35/FGTMzNmBh8fBQ9etzq0ePNnj3f7t79emBgjavr + JK02DCegJSUlwTVj8hrDbRiNxQNzKjibCw8MzGOLiskDgq4P1gPfPW/s2X1z966bu3a9vmvnjZ3br29f + eGqhpl6jWqdSrlIqs5TKTKVyhVKxXCB4qlw2UyabIZNOkkonSCXjjYi/3Pvll9xfkr/4P0Oc5ZlB9sg2 + gXV9TwY0qL2pu2NNlH1lmLY6TFsf5bCtp+vueJ/9/XyPDdCfHuR3fojhUoL/FQFri67/+4KtLM7HeVVr + cDPh9nUr9XKrcHOt8fHZHhDQFBTEXERw8FEhGNAhIZzRIPXJsLBTYWGnBRU+D3GAMhDW3bu/GRPzVo8e + 7/To8S5Fz54U7wiBT96LjX0/Lg7xQVzcRzEx1xAhIZt9fJY6Og5XqXzi4+MhLPCFkG90PDFRiLEgPDBn + j0Es+ogH7ihLnJV48L2DB947sP/d/Sze2b/vrX37bu8bcGyAuk6tKlSpVqtU+SpVnkq1SqXKUSlXKhVp + Cvk8uXymXDZNJpsik00WEJ8olY6X2vSwQVaFoSQ7SbcBDrIMP/XGMF1psLo4ULUxVFsd6VAf49rYy3t7 + L+8d8T674n329PHZ18f3cH+/kwP9zg02XEzwB7UtskIde9vaqK2DPexTm7E2stvHtdDDpdDZqdDDo0Kv + rzMYtgUE7AoMBNYQDYZ1SMgxAWWiM2f0qfDw00KcCQ8/Fxl5ISrqcnT0NYgD+AvCEqCxsR8CTUSvXh8L + cUeIT4T4tFevz3r2vN2z51txce/Exb3Xq9cHsbE3w8N3+Ptne3iMt7MLk0rlMHDQYqSOWD8hLJgPwgOT + K0gR8xryjn187NidY/h49KOjiMMfHD70/iG/w36aTRp1iVpdoFavV6vXqRniq1XKHKViiUKxQKGYq1DM + UgBu+Qy5fJpcOllqPd66i08X7MRCwvniiy927dpN1unFvrY2KwNsa7u71vVwb4j1aIj13BrnxbDu7bPT + iLXv3r76g/38Tgz0OwushxgsCqLc1ka6DHOSyyxdXLRTCGtf1w0ezuudnda7u5f6+FRiGk+ITQbDloCA + 7YGBe4OCDgQHHwoJAdbHQ0MRDOWwMKKzEeiICMxAnYmMJKwvRUdfhSb06PE6EIyNfTcu7kMB2c969/5d + 796f9+59Nz7+bp8+iC/79LmHIPR79/60T59P+/b9tH//3w0c+LuEhM+HD/985MgvBg++FB/fGB29KjBw + mqdnvJ2dl8FgwOBhv379fJFl3d5z6INDhz86fPTjowxuxCfH8m7laQ9pAbSmTKMp1qgL1aoClXK9Ur5a + LsuS2SyysZ5n3W1mt65Tu3aZ1OWlcS+9mPjib0f99sVRL/2v4rfe3kG9eg0bMWLGtGnpY8bMjYzs4yyT + jHbXFkRAQzw2x3lujvPa2strW28fYL0DcPfx3dOXYb2/n/7YAD/IiEVJd/eCaIb1FE+1TSeZvWKIh/M6 + F6d17u5F3t4b9XpwuVKvr0Y0w13v778tMHBXUFCTgPWR0NBjYWEnhADEFKcJZQI6KgpxPirqYnT05ZiY + V3r0eK1nzzdiY9+GRADN3r0/EyC+17fv1337ftuv37f9+387YAA+fjFgwN1Bg74cPPjLhIR7w4bdGzHi + q9Gjvxo79qvx47+aNOnr6dO/njXrm/nzv0lN/SYt7d6CBTdnzTrq7z98bPKk/e8danrv4L539u99u2n3 + 7T273ty189bOHod6vFT10ourX3wx58UXM1m8tPKlTis7dVrWqfOiLp3ndu48y9JyxstdZ3R7eaa1VZKN + dZJUMlNuPUzWtatVUlLGjBnLkpKWz5qVOXdu9vz5uZMmLYyO7mvQKJJ8HepiGdBbegFrb2C9Ld5nR7wv + sN4twN3UV3+kv59FRU/30hiG9bpI11Hu6t/813/Z2HR3cVnp61uOaAaaYe3nV2Mw1BoM4HWdv39DYOD2 + oKA9ISEHQkOPhIUdCw8/ER5+MiLiVEQEUD4dGQmIz1IIQJ+Ljj4fHX0hOvpS9+5XevS4BrhjY9+Ii3sb + shAffyc+/nMBawbxoEHfJSR8N3ToV8OGfTVyJMD9OjHx63Hjvpk48dvJk7+dPv3bpKRvZ8/+Ljn5u0WL + vsvI+G7Fiu9Xrfr9mjW/z8//TKG2Kz1cffLzCyd/d/7k5+dPfXH+1N3zp4XwPWNQb9epqnSqcp2qjIWy + RKss1irWaxTZGvlStTxNJV+okqWoZAtUsvlKhHSe0jpGGhoaB3DnzMmZNy9nwYLVCxeuWbRo3ZIlRcuW + laJgEx7eO9ZRsyzYZUsvbwTDOt4XwbHeHufT2N3XArV5YJ0b4TrEQ2cvl0Dg+vbtK5MZnJzm+PpWUIDU + fn4II9b+/pv8/esCAoD11uDgXSEhTWFhh8LDjwJrAB0ZSSifiYoCxGKUAfT57t0vCHEpJuZKM7tvxsW9 + 1avX+7173+nT5/O+fb/q3/87YD106DejRn2TmPjd+PHfTZr0/ZQp3yclfT937g/JyT+kpv6QlvbDsmV/ + yMr6Q17eH9et+2Nx8Z8qKv48Z87WfqMTTt+9ePrLi2fuXTx779K5ry6dw8d7l1a+k6M5bqve0gw0sN4o + YF2sVa7XKrI0iuVqebpavlgtX6SWp6o54t28JQkJUxYsyEtJWZ2aum7x4oL09OJly8oyMytzcjbl5TWs + WbN1/PhkB7k80cu+LMZja2/vRghIvO/mWJ+6aJ9NkT61Ed51EV4WKBPPD3QKs1fBe6LkiCsDsAUIe7O6 + ddPY2g7z9t4gkNqItcFQbTDU+PvXAmsBaMTmoCBsN8J4NYasj0REYAL4ZFTU6agoBnR0NIhMwVDmQMfE + XBSCwd2jx9WePV/t2fNGXNybvXq927v3R/Hxn/Xt+yUEZMiQ70aM+H7MmN9PmvT7qVN/mD37D8nJf1i0 + 6A/p6X9YseKPq1b9ce3aPxUV/bm8/M81NX/ZuvWvcXFTM6vzzn11+dzXl89/c+WCEOfx+deX+10bpNlv + q26wVdfYqiuFqNAhGKnXEtAaxZLmSDMiLpui6iaXgM6LFm1ISyvMyACLy1asqMrJqc3P37x27bYNG3YV + Fu4tKWnKzq4eMmRiuJ0m2c+lJsq7KpxFZbhXVZhnTTjCw2KUt529Uo6dWLiAYN26dfBGeXl52DqABT02 + NlapjHB1XejnVyEwutJgqALW/v41AQG1SOcCA+uDggD0luDgrRivDgvbFx5+MAJTTlEnoqIwdn0mOpqw + BpEpiM6PohlxaDcQf6Vnz+uxsa8T4vHxH/Xp8zsQfMAAsPv7xEQGd1LSD/PmMaxB5+xsBnRJyZ8rK/9S + X/+X7OxzIT2iD394kqH8tRFlwnr/l4fczntpdtmq6wSgq4RgWNuqSnTKfK0yS6NcoVFkCJEuhAC6tJ8y + IiJ+yZJCsHjp0tLlyyuys2tyc+vXrGksKNhVXNwEy1NRcTQr68j06QcHDTro45Np9ZJ0gK0uP8CtItSj + MswY1QAah0+jxF5SUoKkABuyUWsH4nig8oCvjx8/3sbG3t5+lK9vgcEAoCv9/QF0dUBATWDgpsDAuqAg + hrUANAJ7jXaGhzdFRByKjDwWFXUyOvp09+5nu3c/J0SbcAP6lhxniDdz/B1wvE8fcPweJCUhgRF88uQf + Zs78YcECRm3AvW7dn0pL/zxwYPqcnNSz9y6fbcloAD3r9jzNcTt1o6261lZdLYSANRPrQp1yFYDWKldo + lUspHiFuY5CPGjVLYHF5ZiaIvCk/v2Ht2u1r1uxJT98/bdqhhIQjcXHQzCPQz6CgnXh/Ayi1ephBqpjv + 4VgR6l4Z5l4Rxj5aoFuBB7IAGFI8UDLHo1R4AH080OyAZ1KrI9zdU/z9qwICgDKLwMBaYB0cXBccXB8c + DKyxJRQbQ4E19tMR3Aejoo4JOwrM4TalthnNoSqXoSrNNIeO3xbR/B7RHKBPmcIkZfLk11y8DXWXdp36 + 4vLpu5dPf3n5DEf86yshlyM0TbbqzWZAY0lcr1PmCkAv1yqXiWKpVj5dba2QYd1LTy9PTq6aPr1m9Oja + gQMb4uK2R0TshgsIDt4bHIxPYMDgC7YAZSiq8KYvd3CYpewiGemgA8oUFih04UFtDtTg6SPKxPwjfRE7 + 5aVSWweHoXp9PvJjRFBQrRAM65CQ+pCQhpCQLeB1M9bbw8N3RkTsw6aNyEgmJgLiZ5qp3R7QHHQRzR+B + 3sz0t3v3ZnalT58vIC8eHtmJ82Ye+eTy0U8uH/v08rHPLh//3eUTn18++fnllW+tVhy1l222lVXp5BU6 + eTkLBT6WaeWFWtkqrSxLK1uulWVopOksJEs0Nmka68Uayx4KR8f+4eFFwcElKMLo9RRMQiGewBRLFMlm + UJAx8BUoKv4Wb31395UyWVxPtTrH4MKAJkCpjYTqO/WNxA0O9DhQLMYDDRH09NRqfze3aYGBlUFBNcHB + QJkHgxuHUmBbuUDtrbR9MSxsB3YiRUbuj4o6gs0yLeFuRbXNdbxV3Js1HavoaxERRzT27sUH6w99fOHQ + xxcPs7hkjDuXIk73e7lR93K59uUi7csF2pcLtd0KWLy8Vts1R2uZobFM01imaCwXaLokq0WhesFBYms7 + 1dMz29MzR4g8b+/Vvr4b/PxK/PzKBfEE0IB4e3DwjuDgncJHRCOoHRCAbAMmbaNGM8pPIk/xdLQAxOjR + oTuHBgd1N9DXQOmduhhUfcdHPPBH1IuxYKIXZWfX09s7NTi4VohNISFAmYJRW8DaqCTNcBPBm0DwqKij + 0dE/huBtraXOzvOHzZh06KNzhz46b4yPzx8SouB2jeKAc9catWWx2nKD2nK92nIdiy5rVV1yVZ2XKTun + KTsvVHaeT6Hg8VKC7De/sXJ1XeLmlu7uvtTDY4WXV463d76Pz3o/vzKDoSIgYFNQUCPwhXSEhu4NDd0H + LyB8Ar+7A38lsBtpR6WDwwxbS4kFhxjdIzSNgCaqX2hVoOKOB4rCqLijmk6ld3wFVTT8LfbVKhS2Tk6D + 9PqVBHdICOBuC3EId6MI8d0C4ocEBWcL5pNKihhx/J5qO7eCphoBaNOIO5NguU1luVFpWaC03KC0XK+0 + XMeiy2pFlyxF5zR551R55wXyzvNN47cBErm8t6vr4magMz09V/n4rNHrCyHBgm5sDgnZLvja/UgjhEzi + oOBxD4SF7YUHE6iNbKMK7wAXl/kW0ARiMTiLvgaaGgAU5XZsJEehHWctUZUdH1Eaxh9Rhkc9Hi8AKL9w + 4UKVyg379A2G3GZ2c9BNCE56wuGGpIDjTFJEiD+xiANxR8c5I2dNaRXl6nd2aA66WW5SWZYIQDejbLlW + 2SVX0WWZAPTCVlDuNFn2G5mVnd1UV9c0N7cMd/flHh5ZXl6gM3SjFCSFr8VRYSEh2HS8PzwcECOBOCrE + EQFosBu8xmZvSHmZXr/e1zfPAj06CAK6R+ApaAuIgS9gxXZ91NdRREdlHYVgPPAJvoKvA3eATohDweHB + 1WovV9fRBkNecDCEm+KJEN8lUhWu4/CFrbtvzmjQyt7dp/RIQ6tADzyX2HWH2rJCaVloRudsReclAp1T + WgH6xZ5SK6tQV9dFkA7ohrv7CtBZEOgCyC7WOqyBorzhCLwsIBbiYHg4BASqjVSuKjAQT4agF+j1ay1A + TGgFNAH6gI4RWkGAEvjiyEGU1ansiwf2KeJzlNhRbifEUZkEwUF8/EOsojNmzFCrvV1cRvv5rRLB/XjE + xaqClTMiYq+I5iZSbrp42tlNmbhoTqsob3p3l+6Qh2WdyrK0NTovb5POkJH/dbTWaEY268YyDw/SjbV6 + fZGgzkgdIIa7YGHJxQr47qXdxyigC34X2gITDJGBYwHQaywgF2jQEZGBHSBGCwMQA1wU0XFuBNV56YGt + iii0A3HADY5zuMFuiAlmMwS43Z2d4QJXtITbSPOWUt7WysmEpSXoWD/FTGfpD97FvmHhdZd2t0nnnW3Q + OUfROV3eeVHrdH5poMzS0pfo7OYGOkM3sr288oRlEKgxv4G8AdmZkKBBplGBoMUfNMfXG/BuhiULDMRL + UubvXwygDYb1FlBkwAQpQEcOVAWCBDFgxSG92GqLkzqwWQ4PfIJNitjoDPTxBHCc2I0+HsQErxNeLXw3 + rK6Y0cKpQU5O/by9F7YGtxh0cyk3sSvkESHokBe4ctJ0hrtKNWT+6qWtolzxdiNT51bpnKfosqKZzsmt + 6MYLPjYKRX+Bzmnu7rAcAHolLIePT75ev87PD4thCRAEjhAHwd1SDkG/CP4IYakKCsLfliOasS60wHsf + igywwFAoAxpCwBEQA1bsjsNmROxppgd2JeKPhDjgxgHgeDL+CTp4eB/gdYLsQHwg3NB6eBiUqHAHoJ1d + FI7WCwhY3zbiTF5EjgU/tynTW66iDHcXl+QeQwbsf+/UwY/O8jj00VkhzsWdGdJ1h6pLeWvq3D6dR0h/ + 06UbDBl8Av4LF5cUV9dUN7fFHh7pXl7LvL1z9PrVYCgEQcAaq2J1UFC16FfD5ywErPG3DO6AgI0BAaUW + ICMUAHJBB6CAyKAt7ffEnnHaXosHPqEHhxtPQ9+IxARSA00nJcGbg4QbioQFFlUq9Jwg3zhdz8cnrV24 + 25SXZm9utOf4PRVah5zNGw5+dMY8Vr9RotjvaFmr6FIq77JB3mWdMTqvkXfOlXdeIe+UJuuUKuuULOs0 + n0LaaZ4xfhtoJZFEODpOc3Sc4eQ0E1M+gNvNbaGHxxJPz+Xe3lnwD35+a/39gXWxgHU5yAtYBXy5EeBY + G6kNrNlB3VAA6AAgoyN9QGQ6w5GfDEa3yeNBl7rir/AEHGWHJ4P7eG24kuBtgTcHpgPICEK4CW4k8dAT + TN7a2oa7uY3388vuAOKtuheWE2m1w8fMn3bwo9OtRtiJWMut8i7lsi6Fsi7rZV3WybqsZdF5taxzlqzT + EmmnRdJOCx6By1F+aYzkN9Zd8c0dHKYAaycnYD3bxWWum9sCD4/Fnp5LvbzQD1mFlc1g2CAAvVEAmlAW + A42f3JTaFkAZlIQOkFzQxmWCGMjy+0TooEo6NZ+wBt9JSaDjXEloneTCbQI3TCQqghhKQrJjbx/j7j7F + zKJwUrT5iZtbSmBMdP2VXQc/PG0eC64ttdqntqyRdymWddkgRlnaeZW083Jpp8WSTgslneZLOs0zjRdC + ullbB9nbT3RwmERYOzsnCUCnuLszoMFovR6MXtesHgDanM7in9xIbb0+2wIo05lrXC7MUeZnihHWYmq3 + qiQk3CZwU3qJhAhuErk+2gu46xiI29lFg+M44bAjHMdvaC3TZJSvahVlfNHjSIDlZlmXMlmXgpZ0zpN2 + zpR2SpN0SpV0WtAKyi+Ns/mN1FKtHmxvP8HeHkBPBaOdnWdhhMrdHdIBjV7h40MaDToXQXYFOqPmY6Ib + j4DGL4VfDasUfk0LLsomckEUbvUKTBO4QW2uJHjBuAsUww0xIe3GUglngjwethJVFOSlQByHi0JVtNpA + 6LiX1zx//7VtgY739ai5k9tCediF8V13yy2rBNEQ0zlfoPOydukc2s3KKtDODihPcHCYLEgH6DwHuuHu + vkigc6avby4EWqAz6Qan8yPdwA+PXwG/CH4d/FKYrscRNaj1s7uyxKIslot2Tsc0wZouiYaS4FuRC2wV + bloq4UzICCJLgnyD4Mj+UcZCtwHniGJkQKm0h5S7uIzw9p7v77+Ggw5yhfWKbUs0NtwqVx9wtqyXdSlt + Sec1ss650s4rm1Fulc5jTOg8RaDzTIHOKVgJvbyWC3TOhyM2GDidjUDjh8SPih8YPzZ++J49e6LMiRlw + XnNG5c4Ca5r4oJSO317NVVusJO3AzXMcZJ4wlPDdWC1JT4jgUHAqEMKJo3WJoyHhDhUKtVYbAEvu6DhM + Y++YXb+2LTqHnOhhuU3WpcJsDQSds6WdMiSdFkk6pbQiGhDrF4KgzsEiOkM3QOfZrq7JAp0zBDqv8vMz + LoN+fvleXgvd3CY6OfXFj4cfEuOZeF/C0aJVIq48I4mj4qjxhk6Tpa+DJ73iaa3CTcJtwm6YbloqYQTJ + d1PNhAhO/gQKLkYcpS5UxtFUmzNnjqur64wVM5rea2p6/8D+9w/t/+DIgQ+OHfjg+IEPTx788NSEy0ld + 9yosq2VdSgTRgNkwOg0pozNfA5NbAfrFkda/sbLUaoc2qzOWwelEZ1oG3d3nubhMdXFJtLcfoNNFqVRe + crk6NDQUG0Rw9wg6UKjU85o+IUvg0o4QKu6zy31/NMriRbKtdZLDDdMNb0NGEL6br5ac4FzBxYhDVcBx + ZPajZo06/eVpxMkvTh7/3fGjnxw9fOfwwY8O7v9gf8HNQu1+206bLDuVWHZa/3Kntd06r7XqvMYa0SnX + ulOmTaclNp1SbTql2LR0Gvgji//VW1pZGTQatOt6q9U9VCqsXSFyuUEm85JKHW1sVOiZ6vV6cBazGJi4 + hCaAtuJNIXzfDd9uQ+Dy3QtgDLsXnI5na3Xp6zi1O8huyuApzaESFREc7hsKjtwSkgLEOcehKth6FTs4 + dvur289+dfbsPRZn7p15FF+e6XGph6xJZlNnY7XRqltxt5cLXrZcb2m5zrJzfudO2Z1eynjpxdQXf7vg + t7+d+9vfzm4Zc377Qv8X/vul/8b533Z2dnjT+Pj44NRpzDNiqYApgnxhGgAHLeJdhc41+qi074bvCKFq + vnjTDd+3QPtCaLQey74FifK/jnL77ObOhHw3pTmAG3qC0gohjmTHHHHonV+IX/H+4nNfnUMwrHkIoE+5 + OUV5QqnYoZBvksur5PIKubxcLt8ol5XKZEUy2RqZNEsqXSGVLpVK01lI0iWPIk3SzdANO++wRQyYTp8+ + HasxZAo7uoAvzqCCI8LwBVZpnNiDFjY6q4AY/CVNIM6KkaXmFAeXdoTQvgWLp4tyO3CTM4ER5AUTXqIi + xLmkcMTxU9o72WdWZZ7/5vz5r1mc+/ocCwF0xLr317mecVXuUSoaFIoahaJS8QjoEplsvUyaI2VALzei + TFjzsB5kDU2AzkKaADEK6xgLhhvDvjwcZA+UUT8AyhAKEBkvOUFM221Qx8eDOEttP9AWyOLBN4XQdhDa + tMCAfiJ9eKInmyyVPKuk1RKGh0pUIDgUnEsKIQ7tBgTJ+ckXvr3A4psLDG4KAfQjXx4JuRSiOqhSNiqV + tUpltRJAKyoUinKFvEwuL5SzMdFsmQzN6GUyWYZpSGdJu7l1g+xiCylYDIhxSCC2GWCvGBp1sD18RymI + jCWOeqoELpDF4sF3MdHmJdCWGn6wUgQub1EhjbB4IuB+3JM53CZZJSc4LZgkKRzxJUuWTEubdvG7iyy+ + ZWFEXAAdMfDVgZrjGvVOtapepapRKauUykqlskKp2KhQlCgU6xTyHLkcB1wvl8uXymVLZcZoRhzj5bRl + BkKBB9py+B9xoQOWBIgyJzKGA+hEf0AMfEFbUgMsHli0+RYm8V4bWCkYKr4XBBs+8B79OYBuS0/EZROS + FI442ISpfUw3G+8++O6SEfFm0JNuJ9metdXs0ai3qNW1anWNWlWlUlWqVBUqZZlSWaBU5CkUOQrsVZEv + k7NY2iKk46RWaivIBSgMOYb/hSLDqGEWDpt5se5hlghagc4RenXUsyZ8wVkiLFZs2sKEeg7WcCAL2tIu + G6w0BC5tAcEKhPfozwo0Id4qwXmhCojjl0yYlLDvzX2Xv7+MwA0TxqALJ767lPNhjvt5d+1+raZRgz0p + BLS6igWAVhWrVGtVylylMtu4RUWxTCEObA2SBEhQvIVKAF+wGBDjPEC8urhgBNYCE0XQCjpcHhBDc0Fe + 4EtqQLCKNy/xziqqzXxnDcCFs4KdxQoEVfwFgG6V4Dy9xG/Yf3R/mLlH16YIcHPQ6z6vC7gSoDuk0+7Q + ahuECf4ajaaahbpCrS5Tqzeo2eaUHJUqU4W9QCyWtwhpfynmNwEuljvgCxYDYtIKWAuky5BjugqLGta4 + BAr4AlwsGyAssRWulGAlziIXI2SxqgNZAhfOCnYWaz5U8ZcE2hxxqGGf4X02X9x85fdXECa31OCPuFis + +7Xutidsdbt02q04mlyr3aTV1rDQVGk05RpNkUa9Wq3OVauyVaoVrYRiskLiIIFiQIhhKiAU5N7wNoJB + puO3YdGolQqIIbggL/BFMRLgcimgrUq0QwmwIhfjyGKlAbhYdagLiDUfqvhMAE2Ig0fxQ+Prz9cTyiZB + oA+4McDutJ3tXltdo07XoNPV6XSbdLpaHcO6Qqsp0ajXqtX5avUqtTpLrV5pGrgcQRYiwxWbwBcPCAXq + ahjqhFYQkfmtvRAKYjHaRsCXdJakgGNKe5MIVjGyWGkIXOr/UaPqWQEaKRa4XH+h3uRSKzHco2+Ntjtn + Z7vfVre9BcrsVrwqrbZMi0sINas1mlx2rYcms0WoMxnoiv4KXFWP0WQ8CGJoBYgMg8zvgqSZABq7gETQ + QABJAYeVeta8bd0qsrwLiDUfj2cCaPyqAxIHMMUQXdBm8vmUt6bggmm7A3bsYjzcyEv3eQvXAelwNz3u + PS7U4qJYdnlKjinKBLpqokpmJ4NBhhYTxERkcm90WS8UGXaCrleCZwCLwV+SWoBLOkBsFROWOGuCLK8g + Ue79ywONX3vo5KHY1toOynPemeNy0cXukIAyruOlO6Y5yhU6dhFQG9fx0qVAmgUaub8cw8eAGMPgdKoN + Fl66XoyjDMcGl0aXWEF/6apv4Esle6onizGlzjVxltqqdBMaL2w8uoflx+UgT+Vf4RfAijRmzpimt5ra + QRk31LM7vHHjMS4QM0e5UqfDxfQ4dIWutso2vRiPgFbEKrAxBxBTyYJmaOmiTaQhMHDIlfkFmjQQAKGg + 244JYg5o+7C2lWn/YozG8oJMYUbGjOOfHG8H5UXvLzJFGaJBXMa9VlU6div9OiYarV5MTyirhqpkMhkd + z0SFITqHhW7ZBMpI8OiOXs5loEytaroTQVxJpjzgSWtEvwzQWNCd3Z1T16a2AzH+Cih7XvK0OyLisjnK + uIWXRMPsVnpCWT1ZLXeWwyzzCjKhzC8kFOuy+Nq7p3tv5i8ANFxqUFRQbl1u+ygbFQMo427HRkGXmxdA + I5fLhCt425fmeRqFQYE6Bj8iC4pBKCOxRlUIlSCYZX69MQwcv3KaFjfxXSr/imD+rEDjDYi1qO/IvhVH + K9pHGavfI8VoiTLuHmSKsVGnK3jcApihUUYrUWvmKNPqRzfkofyG2gX8MooVqFGIL+ymCyc6crNgx6H/ + +YBGZoU678SUiftu7Wsf5alvTWUeQ7z6cTMHlAUzxy7fJS6bXQvL7x5U9WG30vN9UKjD0fV4VIcjaTa5 + QZruqnm6okEvxs8ENOoG+iB9RnEGsrv2UU68lYhbpJmT4x7jR6GsHqqWqWTIrcXSDJtBtx+jPI/EBEWi + Vi8UfLqi8TMBDclDsot8ZOPhje1DfPK7kwNfH4hL0Y1ZCTm5tlBu9Z7S5ns01WPUckfjAgigycyJpRnV + ZKR/dMcuakPI/R57RWbHVaLVZ/60jMbbE+5iTuYcHErSPsoNdxtirsfYn7G32y/KSpo9BtNlsWK0a5nV + U9UKDwVKoOIF0ESa4ZpNbo1GyeInEg0jozeWrPgpIjc7efDAnlF9I3Lqs059caL9WHY73eu0h3y/RLZF + Iq21kVbYSMttpGU20lIWkmJrSYG1ZJ21ZJW1zUorm+VWNkutbJZY2aS1ElYTXu7q2jkmJjhxVP8xo/uP + HTNw/NhBkyYMmTxx6PSpw2cljZ47e1zK/ImLFk7NWDJjxdLZOZnz81ctWJOfumFtWuGG9OKCjJLCpaVF + y8qKlz9dWH4SRqN04Kn3nJc977FEBs1hMHARut1RO7s9drbbzOoYlJXw1a9dLmtg5oIU6JtwLvMFEBkg + STNcM6SZbpunSVq6Q+xpXczdlsJYiF+38tKVFBVlmc2RVbkRkY2oKkfkVFXkVFesQtRU5hqjKq+WRf6m + 6vz0tKTY2LD+iX037F53+u5J0/jy5GlRHPr8QN8r8aoTCvkumbxBKq+Vyiul8gqpvFwq38hCViqRFUlk + 6yWyPIk0SyJdKZEul0gzJNJ0iYwi41FIZ9lY+XfrFdd97pwp8+ZOnT9vekpyUurCWUvS5i7NWJC5YlFu + TvraNSuLCnPLy9bWVhdu2bxxx7aqvbvrDjRtPXJox/Fju0+e2HvmVNPZMwfPnz148fzhi+ePXLpw9NLF + o5cvHrt86fiVyyeuIq6cfOXKqWtXT1975fSrr5x59drZ66+ee+3V869dP3/jtQuvv3bx9RuXbt649Mbr + l9+4eeXWzau33rj65q1X3rx17akxGnVbdCti+sdk1WShkdq+IuNvSz4twcl3rYgyrxbxDJtnJW07Oc0i + jTJKidFCbuawAPI8m3ITLICYZeWuGQUNFD9NpPlppSfmvH4KjF6dt3jk8L4efm4zV8zYcWNbK0Tm1G6m + 8+QbE51POcqbpPJGqWyTVFbdTGTO5RKJrFAiWyeR5tpIs2yMXE5nXKYQM1o6z8YqpFt0dNjc2ZPnzgad + pyXPn7FwQVLaojnpS5JXLFuYk52Wn7e8YENWaXF+VcX6+k0ljVvKd++s3ben/tCBxqOHd5zgdD594NzZ + gxfOHXq2GI3KAIqc3v7eM5fP3HZt22NZjCds+3Jbvxv97C/YM6eM3NpMlJnBAJdR+URNjqpFdBG66Ap0 + 8eeaxRpld2ViYiIKRtwyk5nDUsEzQLIZdDW0uKDBy0YdnFf+0SbvRzI6JzN5xLA+Tu4O4+aPqTi+sT0W + i5R61s0kjzNuigMy+TaprE4iq5bIKqSycqlMUGQWZVJZsURWIJGtlkizBS6vsJEus+FENmG0dC7jclRk + 8OxZk+bMngJ1ZtK8YMaiVEjzvGUZKVmZi/Nyl65fu7K4MLdi45oaSHND2XYmzZv279t8+OC2Y0d2gs6n + Tuw9fbrp7On9UOfz5w49E4xGCQb9Y/9Q/9krZ2+9vLUjLMZzYJNBZIcLDkisje5iS8t8hJc9YTCoit9u + 5ZPV8lOYLmMqmbgsTkyomkGTAlQCFduMnzo3aT1h6aDrKFyfMWPaqKjIwKDuAbOzZjZcrjt990RzmLmL + ln5j/GtjmSLvFxTZSGSJrFwi2yiRgcIIGAyIMgzGOoksFwYDomwjXW4jXQouUzxSZ+PnM2ysDC/HxITP + njmJ6Dx/7rQFydMXpsyENC+DzViZuio7fe3qFQUbsjeW5ldXbmioK27cUrFrB5Pmg/u3HD28/diRHSeP + MzrDbJw53XTuzIFfktFwnWjLOzg5oOGUvzn/1O9OdZDFeNqqj1cxa3GupSKLE2uU8MWivL5ZlNvulbAS + 80w1/DLmP8UegyYQicuoGVEDED88SqCUZ9MWP7HNoCpoxzc5/GiBZkWlthi9LGMmkqugAO/AKP9p6ZPL + jpacuntCHO0zuviDwthLPdTHlfI9UvlWWAuJrAqK3ExkxmUWUu6UTUWZc9mU0ZKx1t3cu8bHx8xMmgg6 + CzZjyoL501JTZi5eNDsjff6K5bAZS1bnL92wDjYjr7JiXd2mIrjmndur9uzadKBpi+A0th8/ugt0Pn1y + 7+mT+6DOZ8/s/1kZjbIhjASELzg6eOqiqUX7is7dO9dxCuOZu+/tHnVrFOuMHLeza2ouXFDfWtS6NhIZ + Hb/S5soysr68NhslxnbJGFbHwEyiCZfhMUy4TOV8cBmFZrLMtF1V3J36ebj8qNaRnTkPdYD43pGeHk4B + EX5j5yXmbVl14L0mY4GiJZE5qc0Zvf3TxpHXhkOOma/YLpU1SGQ1ElmliMgCixmRS2ykxTbSDRLpmpbu + 4pEot8Jom35WL6sthyb0nZk0YdbMiZDmuXMmJ8+btjBlBuPyknkrl6dkZy7Oz1u6fl1mSdGqCiED3Fxf + ur2xctfO2qa9kGYkgdtgnI8f3XnqxB7EmVP7WDb4MzAaG+G8A7wTJiakFaRtOrvpsfXiVtm976t9E29P + 1F/R258SipwoJcMgi31Fc773qKla1ly8f5xTZgYjQ4MqPurLaP2J6xiU+5FfpoFPGpUz4bJ5p/Xn5LKR + 0ShKNL2zt73qWruMLv+wbNDVAc4nHeUHpPIdEsbi2pYsbpZjI5GLQGQb6RobidgmZ5jwt8UfJdNtrIJe + Dgk2TJ44UuDyhDmzJs1jXJ66cMGMxang8twVy4jLGetgmYtyysvW1FRtaGAZYAWkudk1MzrDaZw4xtUZ + fuPnYvQT6a/4yWvurMEkHOvsQYtRRG6XxS0UmbpQHSAy9bDRXeV9P9qog9YfmlLULqHcD2OfdPBIq1zm + lbmnuDPqSR2IxWOLxSZmY+cn26e+Ntn/nJ/imEy2RyLbKpHV2chqbJgWkzWmaJZjRmTIMYi83ka6GkS2 + lmRaS1bYSJDvtUtk2GdriLLWckD/2KTp45JmjDNyee7k5PnTUMpYnDqLcXlpSnZWM5cLczaWrq6pQjWj + eOuWjTsaK3fvYtJ86MCWwwfhNIx0BqOhzoLfeCYZnXcnb/Drg70ve9ufZr6YJXjbhdEhOApujUVabJRj + dEaocEEDGLAW7dYujBNcyPpilZh64aJMNz3x7TqoL2NsATU5dLJpyIgfPCI+EuNZ4LJRox/L6Px3cofg + 4uDT7vKjUkbhRom0zgZ9EFmljazcRrZRiDJESxaTryiwka61kebZMBavBJGtJcusJRnWkiU2CCnCmPi1 + +MRmlFU3z67RkcFTpyQmTR9r5PLsifPAZaPHmJWRPo/pctai/NwMoZSRXV4GLq+rqy3aygrNlbt31jTt + qT/QtBl0PnKIjDMzG/DOQjb4bDD67PdnV99ZDTscdDWIVdqOiVTYnMItWfxIjuErULXAVByfC2hjmIhX + 45i7GKiSO8gxKM6dsliUMfhCBoPa2Kgv8zO36DQoyv3Mp7medILrSSX4sc9vodElHxRNuzEl+kKE00kH + +ZFm/tbbSGtspFXNrbyNQjePUViI0uZPwOhSQY4LBTnO53JsLVluLVkKFoujFUbbjLPq5vdycLDfmMQh + 06clzpg2ZibT5fFzZk+aP2fKgmTkfklLFs9emj5v5YqFq7IXr85D7reiuHBV+cbV1UyXwWVY5gpwed+e + uv376g8yOsNpNB47wsoaJ46hUMf8xi/D6NLPSue+Mxf+IeBqABtAPmHH9HefkNHBC7fKX1C4LRaj9lbc + XEemTA+l5DYmPFsQebAKE3I4DoiILN4GTFkfPwiRzpokg4EJI5oVpzO3zI93eer7gh/L3DZ7hvIjEtle + iQwWGB1oIm+liLzN/CUWG0NoTjMu45MSa6MWrxO02GgqmlmcbkJk/sdHjLZJtOqm7xoY4DtqxMBpU0eD + y9DlmUnj5syaICR+U1MWTF+cOnNJ2pzlS5MzVy5clZO2Jn9ZwXoh99uYX1Np5PK2reW7djDL3LQXbcDN + B/dvPnKwUcgDt5E6/8KMboW5VJEwD2FYlgfrg5CjQLEC1pi0uMMspoIy8j25vZxu2jMnMp2bio4fnDLt + QaODEDErjh42JvKpiEGDzOZnbv2km4KflNoWUnC2VdqaUZimLIQyhbW00Fq63lq6hs1aMEeBgBCTo2iT + xSJ2p9lYD+z2sotlWKj/2MQhjMhTRwuiPHY2RHkWMxgL5k9NXTgjbREzGCuXL8jOhMFIX7dmeeGGzNJi + tEuYX26oK9raAF1GAxBcRqGZChponWxFHGV0hjob/cYvzehWyWuuwtQBIQrDTnAh5o6i7baeSbsPyZ4y + XIlzGrCZ0sRa8Hs6OZFRvuDnpvKDECHKHTnZ7ElJ95M+36KF+BKLibnNwQaFiqwlhcKs0GprSY6VJFMI + mGKyEx2hsGA5bCZZdQvv2lXSJS42YsrkkVOnjAKXZ0CUZ4ydNWPc7JkT5s2ZlDx/SmrK9EWpM9MhysuS + s1YszGWinCEYDCR+uVUVa2pr0C4hj1G+i1WZqwUuQ5oZnck4M+/8jDLaXIJpsqKc5XVsGJmrMA3LdsBO + PPIV8wQ5dpJjjx/2nXE5Fp/HDmtBh4XTSdbiA4DF56a2L8rPlC6L3yIWLfhbYmMkL8265VvbrLKyybRi + E28rrCTLrSTLrCQZVpJ0K0maVUtf3Ja7sLaZYWXV8+Wutl1CQvxGjOg3ZRKIPHLalFHTp41OEpwyRHnu + nInJ8yYvTJ62aGFSetrs5UvhlBesyl6Un7dk3ZplgijnlDODgcSvYHN9UeOWsh3b4DGQ/lVDmpv2om+C + JLDh4P4GoazBvPOzx2gSX05eWAjoL/XueGmC7PDj8joTLcYknKqfSu4mx5k52N1HLBZfTs0PGUGyh8E4 + nNDAt7fTSdacyFS+MDk39amcBvWT6nILRkvWW0tgHvKsbXIE5grkZRObNLSZYWWTbhzaZCwWR4tMrwWj + rSd06xbVtaumS1Cgb8KQ3pMnDp8yacTUySOng8hTE2dMF9zFrPHzQOT5UxYumLYoFUSetSxjbubylJys + 1PzctLVrlhasX1lSlFVemltZsXpTNfp+BVvq0cZmXN65vRK6TNK8fy+SwDpwWVBnJtDPKKONzCXzwMUX + 5H1cOtfq6JB6khpzQ3JbOQ4gRe+8VRajjoyeiPjuBn6xAG2/ph3u/GhaMZFpS6W4e/3MirLJe8WC0ZYz + t5m8rY4et8Nom9lWVv1e7urVxdnZLjoyaPSIAZMmDuNEhiLPgCJPHzN75tg5syfMmztxAYicMj0NRF4y + e1mGoMhZC/Ny0tatXrph/fLiwqyykpxKiHLV2k01MMuFWxtKtm0t29EILqOUYbQZjM776g7sgzrDbDz7 + jP5RzOV0xni9qjcTYlzzhGOfOIXpwDJ+wwsdqEUsplsF0BOh00YwRkRHNdA5AuSRyVrw2gUnMlokz075 + 4on03aJV8j6W0dZTunXr1bWrR5cuXTqFhvgNGdxr4rihk8YPnTRh+ORJw6dOHgFrMX3qqBnTR89KGjtn + 1rh5syfOnzt54YKpixZOX7I4KWMJsxZZK5JXZXNFXl5UkFlWgvJFXnXlmtrqdQ0Q5Ybixs3EZUxlVOze + waR5725yzahpYH7uOWJ0G1OarUowjAR2OylDlHItO0cWRxGJUzuiMN0DBSGGL+b3FPF7dOhmddTeMKcs + lmNULWiTOz9HQHwk+/NLZM76DjHaesLLjL9eXSxtOvv6uMX2CBs9sv+EcQkTxidMHJ/A5HjSMLB4+lTG + 4qQZibOSxsyeNW7u7Anz505KSZ6cmjJtySLBIGfMXbl8fnZmSm72otV5S9avzShYj3wPRM6p2Liqqnx1 + bdXa+k0bttQXbt1cBC5vbyQul4PLu3dW7mV0Rq0Z8StitCZVox6rVvVSKXwU6N3ROch0Jif0lySYHyVL + Z0YShfnJcHRyGebsUT5GK4S0GIU3MhWovWHfPckx+Qq0RegogVb3uT+RID6DT27BaOukblbDunaLtoT4 + Wko6u7rahwTr+/aJHjdm0PixgyeMGzxh/JCJExImN1N42hTGYgjxzOlgsaDFcyYkz5uYkjxl0cJpaakz + BHc8e+XyeVkrkemlrs5dvHZ1+vq1S4s2rCgpyiwvBZFzqytW11avrasVRFng8rYt0OXSHY1l4PIu0Hln + 5R7mNKqeb0bDNqgTmPllzFXLHnsOMj+Wk/OX8jqoMHrSRGE6HI4OL+O3QaEVQic/mbCYLiHhN2SYHNjw + DHLzx/1IFg52Gh9v14hwQ98+UYkj+48TNuYZyQv+jgd/h0KCp0waNm3K8GmCl0gChWckwhRjz968OeMF + CjNHsThVcBTpM5cvnQMWZzMWL1ydu2hNfpogx8tLCleWFWdtLMUeL1iLfIHI6xs2wSkXbG2AWS4Gl7c3 + Mi7v2FYGLu/aAacB4/yrYDTqZ3RrJD9hml8fyU/rFZ+DTMee0smcdLghnRxJKswpzIUYvhiVCjpci6wx + v0pH7I75nPLzkuk9Ka8tJowfPHH8EOwtncTEd+iUiYy8UyeDvIL+TgN/Rwn8HTNn1th5c8Ylz5uwYB55 + ialpqdPSF88AhSHEK5bNzVo5PydrQW7OwvzcxWtWp61fk1G4fllxIeR45cYSzF3AV+TVVEKR19TVMFHe + XLdhM0S5obBxC7jM6Exc3rkNTmPjr43RyNmgth0/B5mOPcXEJvEXNTY6fw9NPK7CmK+gAw35hVt0vhY5 + Cn6Vzq+exS2qd9OnjpgxDTFyJk53T0Iilzhn1pi5s8fOI/1ldYlJCxeAv1PSFk1bsnh6+pKkZemzViyd + k8m8xLycrORVoPCq1DV5oPCSDesyCjcsLSpYXlIMFqP2BjnGNlu2r7a2ajWIXF+7rn7TenB5S4Ogy8xj + FG/bWrKdhVGdf52Mhtt9onOQUSNGUQKHPNH5kSTBZCT4EXzioyLFQvxrdRQd0WuL+XNhG8YvmD8hJXli + 6oJJixZOXrywmbxpM5amz1q+dNaKZbMzl8/NBn8zwd+UvFXMS6xlKpy2YW16wXr44mXFBStKicVljMVV + bL84FDlvUzWqyWvqa9fCXWyuY1zeXL9B4HJhI9I/Uud/B0Y/6TnI4qN66QhJOj+S38knVuF/Zwqb1qOX + LpmxLCNpecbMFUtnrVyGLA7iK5AX4pu9IDc7JT934eq81LX5i9atXiyo8BLsOSzasLSkcHlpEXzxyo2l + WRVliBx29kF5bjVOPYAiV+fX1cBdMC4jiMtb6hGoyZE6/5sx+knPQRbrr9hF8A7ev5WX6Ig6G+ejcVRM + Xk5y3qoFOIhlde7CNXnwD6kCeaG/TIKJv0UFy0qLQOEVZezEGpzpgQM9wGLhHA/j8R3GUzuMXK41crlh + E4oYsMz/9oymW3s7fg6yybGn4gNPO/7y/hs+02I9o21awboliML16UUbMoqEc4WEYCzG6UJMiEvoWJqs + io1ZghYbz6FhR9GITqBhHqMGfnlN3X8YbXICzZOeg/yLj84/p+8Gi+KCpQiisEBeFtgg3ny+Eh2uxHxF + R85U+g+j2zxTqa3jpX+tVbRf6g1hwSksYvGPPyXsP4z+yU8J+6WY8rz8vz/yTKW2zr37D6P/w+hfmPr/ + YfTPdbrBL/xC/9v89/9h9H8Y/esi+38Y/R9G/7oY/f8DPTxUq2GibSkAAAAASUVORK5CYII= + + + + 3, 3 + + + 131, 259 + + + StretchImage + + + 12 + + + logoPictureBox + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel + + + 0 + + + Fill + + + 143, 0 + + + 6, 0, 3, 0 + + + 271, 17 + + + 19 + + + Name of product + + + MiddleLeft + + + labelProductName + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel + + + 1 + + + Fill + + + 143, 26 + + + 6, 0, 3, 0 + + + 271, 17 + + + 0 + + + Versión + + + MiddleLeft + + + labelVersion + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel + + + 2 + + + Fill + + + 143, 52 + + + 6, 0, 3, 0 + + + 271, 17 + + + 21 + + + Copyright + + + MiddleLeft + + + labelCopyright + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel + + + 3 + + + Fill + + + 143, 78 + + + 6, 0, 3, 0 + + + 271, 17 + + + 22 + + + Company + + + MiddleLeft + + + labelCompanyName + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel + + + 4 + + + Fill + + + 143, 107 + + + 6, 3, 3, 3 + + + True + + + Both + + + 271, 126 + + + 23 + + + Description + + + textBoxDescription + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel + + + 5 + + + Bottom, Right + + + 339, 239 + + + 75, 23 + + + 24 + + + &Accept + + + okButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel + + + 6 + + + Fill + + + 9, 9 + + + 6 + + + 417, 265 + + + 0 + + + tableLayoutPanel + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="logoPictureBox" Row="0" RowSpan="6" Column="0" ColumnSpan="1" /><Control Name="labelProductName" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelVersion" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelCopyright" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelCompanyName" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="textBoxDescription" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="okButton" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,33,Percent,67" /><Rows Styles="Percent,10,Percent,10,Percent,10,Percent,10,Percent,50,Percent,10" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 435, 283 + + + 9, 9, 9, 9 + + + CenterParent + + + AboutBox + + + AboutBoxForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/AssignDeployed.Designer.cs b/client/administration/UdsAdmin/forms/AssignDeployed.Designer.cs new file mode 100644 index 000000000..e35c523d3 --- /dev/null +++ b/client/administration/UdsAdmin/forms/AssignDeployed.Designer.cs @@ -0,0 +1,146 @@ +namespace UdsAdmin.forms +{ + partial class AssignDeployed + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de Windows Forms + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AssignDeployed)); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.serviceCombo = new System.Windows.Forms.ComboBox(); + this.label1 = new System.Windows.Forms.Label(); + this.userCombo = new System.Windows.Forms.ComboBox(); + this.userLabel = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.authCombo = new System.Windows.Forms.ComboBox(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.accept = new System.Windows.Forms.Button(); + this.cancel = new System.Windows.Forms.Button(); + this.tableLayoutPanel1.SuspendLayout(); + this.tableLayoutPanel2.SuspendLayout(); + this.SuspendLayout(); + // + // tableLayoutPanel1 + // + resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); + this.tableLayoutPanel1.Controls.Add(this.serviceCombo, 1, 2); + this.tableLayoutPanel1.Controls.Add(this.label1, 0, 2); + this.tableLayoutPanel1.Controls.Add(this.userCombo, 1, 1); + this.tableLayoutPanel1.Controls.Add(this.userLabel, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.label2, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.authCombo, 1, 0); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + // + // serviceCombo + // + this.serviceCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.serviceCombo.FormattingEnabled = true; + resources.ApplyResources(this.serviceCombo, "serviceCombo"); + this.serviceCombo.Name = "serviceCombo"; + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // + // userCombo + // + this.userCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.userCombo.FormattingEnabled = true; + resources.ApplyResources(this.userCombo, "userCombo"); + this.userCombo.Name = "userCombo"; + // + // userLabel + // + resources.ApplyResources(this.userLabel, "userLabel"); + this.userLabel.Name = "userLabel"; + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.Name = "label2"; + // + // authCombo + // + this.authCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.authCombo.FormattingEnabled = true; + resources.ApplyResources(this.authCombo, "authCombo"); + this.authCombo.Name = "authCombo"; + this.authCombo.SelectedIndexChanged += new System.EventHandler(this.authCombo_SelectedIndexChanged); + // + // tableLayoutPanel2 + // + resources.ApplyResources(this.tableLayoutPanel2, "tableLayoutPanel2"); + this.tableLayoutPanel2.Controls.Add(this.accept, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.cancel, 2, 0); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + // + // accept + // + resources.ApplyResources(this.accept, "accept"); + this.accept.Name = "accept"; + this.accept.UseVisualStyleBackColor = true; + this.accept.Click += new System.EventHandler(this.accept_Click); + // + // cancel + // + resources.ApplyResources(this.cancel, "cancel"); + this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancel.Name = "cancel"; + this.cancel.UseVisualStyleBackColor = true; + this.cancel.Click += new System.EventHandler(this.cancel_Click); + // + // AssignDeployed + // + this.AcceptButton = this.accept; + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.cancel; + this.Controls.Add(this.tableLayoutPanel1); + this.Controls.Add(this.tableLayoutPanel2); + this.Name = "AssignDeployed"; + this.Load += new System.EventHandler(this.AssignDeployed_Load); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + this.tableLayoutPanel2.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label userLabel; + private System.Windows.Forms.ComboBox userCombo; + private System.Windows.Forms.ComboBox serviceCombo; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.Button accept; + private System.Windows.Forms.Button cancel; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.ComboBox authCombo; + } +} \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/AssignDeployed.cs b/client/administration/UdsAdmin/forms/AssignDeployed.cs new file mode 100644 index 000000000..0e8ac6669 --- /dev/null +++ b/client/administration/UdsAdmin/forms/AssignDeployed.cs @@ -0,0 +1,119 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.forms +{ + public partial class AssignDeployed : Form + { + private xmlrpc.DeployedService _parent; + + public AssignDeployed(xmlrpc.DeployedService parent) + { + _parent = parent; + InitializeComponent(); + Text = Strings.titleAssignService; + } + + private void AssignDeployed_Load(object sender, EventArgs e) + { + xmlrpc.AssignableDeployedService[] services = xmlrpc.UdsAdminService.GetAssignableDeployedServices(_parent.id); + if (services.Length == 0) + { + MessageBox.Show(Strings.error, Strings.services, MessageBoxButtons.OK, MessageBoxIcon.Error); + Close(); + return; + } + + xmlrpc.Authenticator[] auths = xmlrpc.UdsAdminService.GetAuthenticators(); + + if (auths.Length == 0) + { + MessageBox.Show(Strings.error, Strings.authenticators, MessageBoxButtons.OK, MessageBoxIcon.Error); + Close(); + return; + } + + foreach (xmlrpc.Authenticator a in auths) + { + authCombo.Items.Add(a); + } + authCombo.SelectedIndex = 0; + serviceCombo.Items.AddRange(services); + } + + private void accept_Click(object sender, EventArgs e) + { + if (userCombo.SelectedItem == null) + { + gui.UserNotifier.notifyError(Strings.userRequired); + return; + } + + if (serviceCombo.SelectedItem == null) + { + gui.UserNotifier.notifyError(Strings.serviceRequired); + return; + } + + try { + xmlrpc.UdsAdminService.AssignDeployedService(_parent.id, + ((xmlrpc.AssignableDeployedService)serviceCombo.SelectedItem).id, + ((xmlrpc.User)userCombo.SelectedItem).id); + DialogResult = System.Windows.Forms.DialogResult.OK; + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + } + + private void cancel_Click(object sender, EventArgs e) + { + DialogResult = System.Windows.Forms.DialogResult.Cancel; + } + + private void authCombo_SelectedIndexChanged(object sender, EventArgs e) + { + userCombo.Items.Clear(); + xmlrpc.User[] users = xmlrpc.UdsAdminService.GetUsers(((xmlrpc.Authenticator)authCombo.Items[0]).id); + userCombo.Items.AddRange(users); + + } + + } +} diff --git a/client/administration/UdsAdmin/forms/AssignDeployed.de.resx b/client/administration/UdsAdmin/forms/AssignDeployed.de.resx new file mode 100644 index 000000000..3876ef5d8 --- /dev/null +++ b/client/administration/UdsAdmin/forms/AssignDeployed.de.resx @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 75, 13 + + + Benutzername + + + Akzeptieren + + + Abbrechen + + + Assign Service + + + Service + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/AssignDeployed.es.resx b/client/administration/UdsAdmin/forms/AssignDeployed.es.resx new file mode 100644 index 000000000..d0d085def --- /dev/null +++ b/client/administration/UdsAdmin/forms/AssignDeployed.es.resx @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Assign Service + + + Servicio + + + Aceptar + + + Cancelar + + + Nombre de usuario + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/AssignDeployed.fr.resx b/client/administration/UdsAdmin/forms/AssignDeployed.fr.resx new file mode 100644 index 000000000..712b8a84f --- /dev/null +++ b/client/administration/UdsAdmin/forms/AssignDeployed.fr.resx @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Assign Service + + + Service + + + Accepter + + + Annuler + + + Nom d'utilisateur + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/AssignDeployed.resx b/client/administration/UdsAdmin/forms/AssignDeployed.resx new file mode 100644 index 000000000..767656925 --- /dev/null +++ b/client/administration/UdsAdmin/forms/AssignDeployed.resx @@ -0,0 +1,417 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 2 + + + + 91, 59 + + + 240, 21 + + + 4 + + + serviceCombo + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + True + + + 3, 62 + + + + 3, 6, 3, 0 + + + 43, 13 + + + 3 + + + Service + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + 91, 31 + + + 240, 21 + + + 2 + + + userCombo + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + True + + + 3, 34 + + + 3, 6, 3, 0 + + + 60, 13 + + + 1 + + + User Name + + + userLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + True + + + NoControl + + + 3, 6 + + + 3, 6, 3, 0 + + + 70, 13 + + + 1 + + + Authenticator + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + 91, 3 + + + 240, 21 + + + 2 + + + authCombo + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 5 + + + 13, 7 + + + 3 + + + 334, 86 + + + 10 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="serviceCombo" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="userCombo" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="userLabel" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label2" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="authCombo" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,26,49842,Percent,73,50158" /><Rows Styles="Percent,33,Percent,33,Percent,34" /></TableLayoutSettings> + + + 3 + + + Bottom, Left, Right + + + 3, 7 + + + 101, 23 + + + 0 + + + Accept + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Bottom, Left, Right + + + 252, 7 + + + 102, 23 + + + 1 + + + Cancel + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + Bottom + + + 0, 117 + + + 1 + + + 357, 33 + + + 9 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="accept" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cancel" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 357, 150 + + + CenterParent + + + Assign Service + + + AssignDeployed + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/AuthenticatorForm.Designer.cs b/client/administration/UdsAdmin/forms/AuthenticatorForm.Designer.cs new file mode 100644 index 000000000..a04619535 --- /dev/null +++ b/client/administration/UdsAdmin/forms/AuthenticatorForm.Designer.cs @@ -0,0 +1,207 @@ +namespace UdsAdmin.forms +{ + partial class AuthenticatorForm + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de Windows Forms + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AuthenticatorForm)); + this.groupData = new System.Windows.Forms.GroupBox(); + this.dataPanel = new System.Windows.Forms.TableLayoutPanel(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.label3 = new System.Windows.Forms.Label(); + this.comments = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.name = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.priority = new System.Windows.Forms.NumericUpDown(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.accept = new System.Windows.Forms.Button(); + this.cancel = new System.Windows.Forms.Button(); + this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); + this.test = new System.Windows.Forms.Button(); + this.groupData.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.tableLayoutPanel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.priority)).BeginInit(); + this.tableLayoutPanel1.SuspendLayout(); + this.tableLayoutPanel3.SuspendLayout(); + this.SuspendLayout(); + // + // groupData + // + resources.ApplyResources(this.groupData, "groupData"); + this.groupData.Controls.Add(this.dataPanel); + this.groupData.Name = "groupData"; + this.groupData.TabStop = false; + // + // dataPanel + // + resources.ApplyResources(this.dataPanel, "dataPanel"); + this.dataPanel.Name = "dataPanel"; + // + // groupBox1 + // + resources.ApplyResources(this.groupBox1, "groupBox1"); + this.groupBox1.Controls.Add(this.tableLayoutPanel2); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.TabStop = false; + // + // tableLayoutPanel2 + // + resources.ApplyResources(this.tableLayoutPanel2, "tableLayoutPanel2"); + this.tableLayoutPanel2.Controls.Add(this.label3, 0, 2); + this.tableLayoutPanel2.Controls.Add(this.comments, 1, 1); + this.tableLayoutPanel2.Controls.Add(this.label2, 0, 1); + this.tableLayoutPanel2.Controls.Add(this.name, 1, 0); + this.tableLayoutPanel2.Controls.Add(this.label1, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.priority, 1, 2); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + // + // label3 + // + resources.ApplyResources(this.label3, "label3"); + this.label3.Name = "label3"; + // + // comments + // + resources.ApplyResources(this.comments, "comments"); + this.comments.Name = "comments"; + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.Name = "label2"; + // + // name + // + resources.ApplyResources(this.name, "name"); + this.name.Name = "name"; + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // + // priority + // + resources.ApplyResources(this.priority, "priority"); + this.priority.Maximum = new decimal(new int[] { + 10, + 0, + 0, + 0}); + this.priority.Minimum = new decimal(new int[] { + 10, + 0, + 0, + -2147483648}); + this.priority.Name = "priority"; + this.priority.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + // + // tableLayoutPanel1 + // + resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); + this.tableLayoutPanel1.Controls.Add(this.accept, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.cancel, 2, 0); + this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel3, 1, 0); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + // + // accept + // + resources.ApplyResources(this.accept, "accept"); + this.accept.Name = "accept"; + this.accept.UseVisualStyleBackColor = true; + this.accept.Click += new System.EventHandler(this.accept_Click); + // + // cancel + // + resources.ApplyResources(this.cancel, "cancel"); + this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancel.Name = "cancel"; + this.cancel.UseVisualStyleBackColor = true; + // + // tableLayoutPanel3 + // + resources.ApplyResources(this.tableLayoutPanel3, "tableLayoutPanel3"); + this.tableLayoutPanel3.Controls.Add(this.test, 1, 0); + this.tableLayoutPanel3.Name = "tableLayoutPanel3"; + // + // test + // + resources.ApplyResources(this.test, "test"); + this.test.Name = "test"; + this.test.UseVisualStyleBackColor = true; + this.test.Click += new System.EventHandler(this.test_Click); + // + // AuthenticatorForm + // + this.AcceptButton = this.accept; + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.cancel; + this.Controls.Add(this.groupData); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.tableLayoutPanel1); + this.DoubleBuffered = true; + this.Name = "AuthenticatorForm"; + this.Load += new System.EventHandler(this.Authenticator_Load); + this.groupData.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.priority)).EndInit(); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel3.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupData; + private System.Windows.Forms.TableLayoutPanel dataPanel; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.TextBox comments; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox name; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Button accept; + private System.Windows.Forms.Button cancel; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; + private System.Windows.Forms.Button test; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.NumericUpDown priority; + + } +} \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/AuthenticatorForm.cs b/client/administration/UdsAdmin/forms/AuthenticatorForm.cs new file mode 100644 index 000000000..984b142b8 --- /dev/null +++ b/client/administration/UdsAdmin/forms/AuthenticatorForm.cs @@ -0,0 +1,137 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.forms +{ + public partial class AuthenticatorForm : Form + { + string _id; + xmlrpc.GuiField[] _flds; + xmlrpc.GuiFieldValue[] _fldValues; + string _authenticatorName; + string _authenticatorType; + + public AuthenticatorForm(string providerName, string providerType, Icon icon) + { + InitializeComponent(); + _fldValues = null; + _id = null; + _flds = null; + _authenticatorName = providerName; + _authenticatorType = providerType; + Icon = icon; + Text = Strings.titleAuthenticator; + } + + public void setData(string name, string comments, string id, xmlrpc.GuiFieldValue[] data) + { + this.name.Text = name; + this.comments.Text = comments; + this._id = id; + this.priority.Value = Convert.ToInt32(xmlrpc.GuiFieldValue.getData(data, "priority")); + _fldValues = data; + } + + private void Authenticator_Load(object sender, EventArgs e) + { + _flds = xmlrpc.UdsAdminService.GetAuthenticatorGui(_authenticatorType); + Size sz = gui.DinamycFieldsManager.PutFields(dataPanel, _flds, _fldValues); + groupData.Size = new Size(groupData.Size.Width, 32 + sz.Height); + Size wSize = new Size(); + wSize.Width = Size.Width; + wSize.Height = groupData.Location.Y + tableLayoutPanel1.Size.Height + groupData.Size.Height + 48; + Size = MinimumSize = MaximumSize = wSize; + + if (_flds.Length == 0) + groupData.Visible = false; + Text = _authenticatorName; + //this.Location = System.Windows.Forms.Cursor.Position; + } + + private void accept_Click(object sender, EventArgs e) + { + if (name.Text.Trim().Length == 0) + { + gui.UserNotifier.notifyError(Strings.nameRequired); + return; + } + xmlrpc.GuiFieldValue[] data; + try { + data = gui.DinamycFieldsManager.ReadFields(dataPanel, _flds); + } + catch (gui.DinamycFieldsManager.ValidationError err) + { + gui.UserNotifier.notifyValidationException(err); + return; + } + + try { + if (_id == null) + xmlrpc.UdsAdminService.CreateAuthenticator(name.Text, comments.Text, _authenticatorType, Convert.ToInt32(priority.Value), data); + else + { + xmlrpc.UdsAdminService.ModifyAuthenticator(name.Text, comments.Text, Convert.ToInt32(priority.Value), _id, data); + } + DialogResult = System.Windows.Forms.DialogResult.OK; + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + + } + + private void test_Click(object sender, EventArgs e) + { + try + { + xmlrpc.GuiFieldValue[] data = gui.DinamycFieldsManager.ReadFields(dataPanel, _flds); + xmlrpc.ResultTest res = xmlrpc.UdsAdminService.TestAuthenticator(_authenticatorType, data); + gui.UserNotifier.notifyTestResult(res); + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + catch (gui.DinamycFieldsManager.ValidationError ex) + { + gui.UserNotifier.notifyValidationException(ex); + } + } + } +} diff --git a/client/administration/UdsAdmin/forms/AuthenticatorForm.de.resx b/client/administration/UdsAdmin/forms/AuthenticatorForm.de.resx new file mode 100644 index 000000000..c33d1a7e5 --- /dev/null +++ b/client/administration/UdsAdmin/forms/AuthenticatorForm.de.resx @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Authenticator + + + Authentifikator Daten + + + Priorität + + + Kommentare + + + Name + + + Allgemeine Daten + + + Akzeptieren + + + Abbrechen + + + Test + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/AuthenticatorForm.es.resx b/client/administration/UdsAdmin/forms/AuthenticatorForm.es.resx new file mode 100644 index 000000000..331480fd0 --- /dev/null +++ b/client/administration/UdsAdmin/forms/AuthenticatorForm.es.resx @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Datos del autenticador + + + + 65, 13 + + + Comentarios + + + 44, 13 + + + Nombre + + + Datos comunes + + + Aceptar + + + Cancelar + + + Probar + + + Autenticador + + + Prioridad + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/AuthenticatorForm.fr.resx b/client/administration/UdsAdmin/forms/AuthenticatorForm.fr.resx new file mode 100644 index 000000000..0a85bb677 --- /dev/null +++ b/client/administration/UdsAdmin/forms/AuthenticatorForm.fr.resx @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Données authentificateur + + + Données communes + + + + 39, 13 + + + Priorité + + + 73, 13 + + + Commentaires + + + 29, 13 + + + Nom + + + Accepter + + + Annuler + + + Test + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/AuthenticatorForm.resx b/client/administration/UdsAdmin/forms/AuthenticatorForm.resx new file mode 100644 index 000000000..73fe3efc9 --- /dev/null +++ b/client/administration/UdsAdmin/forms/AuthenticatorForm.resx @@ -0,0 +1,561 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Top, Left, Right + + + + 2 + + + Fill + + + + 3, 16 + + + 2 + + + 443, 157 + + + 0 + + + dataPanel + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupData + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls /><Columns Styles="Percent,50,Percent,50" /><Rows Styles="Percent,50,Percent,50" /></TableLayoutSettings> + + + 12, 125 + + + 449, 176 + + + 7 + + + Authenticator data + + + groupData + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + Top, Left, Right + + + 2 + + + Left + + + True + + + NoControl + + + 3, 57 + + + 38, 13 + + + 4 + + + Priority + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + 82, 28 + + + 320, 20 + + + 3 + + + comments + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + Left + + + True + + + 3, 31 + + + 56, 13 + + + 1 + + + Comments + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + 82, 3 + + + 320, 20 + + + 2 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 3 + + + Left + + + True + + + 3, 6 + + + 35, 13 + + + 0 + + + Name + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 4 + + + 82, 53 + + + 63, 20 + + + 5 + + + priority + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 5 + + + 12, 19 + + + 3 + + + 414, 77 + + + 2 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label3" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="comments" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="name" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="priority" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,19,29825,Percent,80,70175" /><Rows Styles="Percent,33,Percent,33,Percent,34" /></TableLayoutSettings> + + + 12, 7 + + + 449, 112 + + + 6 + + + Common Data + + + groupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + 3 + + + Bottom, Left, Right + + + 3, 7 + + + 136, 23 + + + 0 + + + Accept + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Bottom, Left, Right + + + 334, 7 + + + 137, 23 + + + 1 + + + Cancel + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + 3 + + + Fill + + + 39, 3 + + + 103, 21 + + + 0 + + + Test + + + test + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel3 + + + 0 + + + 145, 3 + + + 1 + + + 183, 27 + + + 2 + + + tableLayoutPanel3 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="test" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,20,Percent,60,Percent,20" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + Bottom + + + 0, 307 + + + 1 + + + 474, 33 + + + 5 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="accept" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cancel" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="tableLayoutPanel3" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 474, 340 + + + CenterParent + + + Authenticator + + + AuthenticatorForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/ConfigurationForm.Designer.cs b/client/administration/UdsAdmin/forms/ConfigurationForm.Designer.cs new file mode 100644 index 000000000..e34896699 --- /dev/null +++ b/client/administration/UdsAdmin/forms/ConfigurationForm.Designer.cs @@ -0,0 +1,88 @@ +namespace UdsAdmin.forms +{ + partial class ConfigurationForm + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de Windows Forms + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConfigurationForm)); + this.modTabs = new System.Windows.Forms.TabControl(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.accept = new System.Windows.Forms.Button(); + this.cancel = new System.Windows.Forms.Button(); + this.tableLayoutPanel2.SuspendLayout(); + this.SuspendLayout(); + // + // modTabs + // + resources.ApplyResources(this.modTabs, "modTabs"); + this.modTabs.Name = "modTabs"; + this.modTabs.SelectedIndex = 0; + // + // tableLayoutPanel2 + // + resources.ApplyResources(this.tableLayoutPanel2, "tableLayoutPanel2"); + this.tableLayoutPanel2.Controls.Add(this.accept, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.cancel, 2, 0); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + // + // accept + // + resources.ApplyResources(this.accept, "accept"); + this.accept.Name = "accept"; + this.accept.UseVisualStyleBackColor = true; + this.accept.Click += new System.EventHandler(this.accept_Click); + // + // cancel + // + resources.ApplyResources(this.cancel, "cancel"); + this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancel.Name = "cancel"; + this.cancel.UseVisualStyleBackColor = true; + // + // ConfigurationForm + // + this.AcceptButton = this.accept; + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.cancel; + this.Controls.Add(this.tableLayoutPanel2); + this.Controls.Add(this.modTabs); + this.Name = "ConfigurationForm"; + this.Load += new System.EventHandler(this.ConfigurationForm_Load); + this.tableLayoutPanel2.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TabControl modTabs; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.Button accept; + private System.Windows.Forms.Button cancel; + } +} \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/ConfigurationForm.cs b/client/administration/UdsAdmin/forms/ConfigurationForm.cs new file mode 100644 index 000000000..2648ed890 --- /dev/null +++ b/client/administration/UdsAdmin/forms/ConfigurationForm.cs @@ -0,0 +1,141 @@ +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.forms +{ + public partial class ConfigurationForm : Form + { + List panels = new List(); + + public ConfigurationForm() + { + InitializeComponent(); + Text = Strings.titleConfiguration; + } + + private void ConfigurationForm_Load(object sender, EventArgs e) + { + xmlrpc.Configuration[] configuration = xmlrpc.UdsAdminService.GetConfiguration(); + Dictionary> dict = new Dictionary>(); + // Create the different tabs + foreach (xmlrpc.Configuration cfg in configuration) + { + if (!dict.ContainsKey(cfg.section)) + { + dict.Add(cfg.section, new List()); + } + dict[cfg.section].Add(cfg); + } + + // Now we create the tabs with fields + foreach (KeyValuePair> entry in dict) + { + int rows = entry.Value.Count; + TableLayoutPanel pan = new TableLayoutPanel(); + pan.RowCount = rows; + pan.ColumnCount = 2; + pan.AutoSize = true; + pan.Left = 8; + pan.Top = 8; + pan.Dock = DockStyle.Fill; + pan.AutoScroll = true; + + int row = 0; + foreach (xmlrpc.Configuration cfg in entry.Value) + { + Label lab = new Label(); + lab.Text = cfg.key; + lab.Margin = new System.Windows.Forms.Padding(3, 6, 3, 0); + lab.AutoSize = true; + lab.Dock = DockStyle.Fill; + pan.Controls.Add(lab, 0, row); + TextBox txt = new TextBox(); + txt.Tag = cfg; + txt.Text = cfg.value; + txt.Width = 180; + txt.UseSystemPasswordChar = cfg.crypt; + txt.Dock = DockStyle.Fill; + pan.Controls.Add(txt, 1, row); + row++; + } + + // Set panel column and rows styles + TableLayoutColumnStyleCollection styles = pan.ColumnStyles; + + foreach (ColumnStyle style in styles) + { + style.SizeType = SizeType.AutoSize; + } + + TableLayoutRowStyleCollection stylesR = pan.RowStyles; + foreach (RowStyle style in stylesR) + { + style.SizeType = SizeType.AutoSize; + } + + TabPage page = new TabPage(entry.Key); + page.Controls.Add(pan); + panels.Add(pan); + modTabs.TabPages.Add(page); + } + + } + + private void accept_Click(object sender, EventArgs e) + { + // Locate changed items and submit them to save + List changed = new List(); + foreach (TableLayoutPanel pan in panels ) + { + foreach (Control ctrl in pan.Controls) + { + if (ctrl is TextBox) + { + TextBox txt = (TextBox)ctrl; + xmlrpc.Configuration cfg = (xmlrpc.Configuration)ctrl.Tag; + if( cfg.value != txt.Text ) + changed.Add( new xmlrpc.Configuration(cfg.section, cfg.key, txt.Text, cfg.crypt ) ); + } + } + } + + xmlrpc.UdsAdminService.UpdateConfiguration(changed.ToArray()); + + DialogResult = System.Windows.Forms.DialogResult.OK; + } + } +} diff --git a/client/administration/UdsAdmin/forms/ConfigurationForm.de.resx b/client/administration/UdsAdmin/forms/ConfigurationForm.de.resx new file mode 100644 index 000000000..97d9b06d3 --- /dev/null +++ b/client/administration/UdsAdmin/forms/ConfigurationForm.de.resx @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + modTabs + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Akzeptieren + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Abbrechen + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + UserPreferencesForm + + + UserPreferencesForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/ConfigurationForm.es.resx b/client/administration/UdsAdmin/forms/ConfigurationForm.es.resx new file mode 100644 index 000000000..41809757f --- /dev/null +++ b/client/administration/UdsAdmin/forms/ConfigurationForm.es.resx @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + modTabs + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Aceptar + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Cancelar + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + UserPreferencesForm + + + UserPreferencesForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/ConfigurationForm.fr.resx b/client/administration/UdsAdmin/forms/ConfigurationForm.fr.resx new file mode 100644 index 000000000..568042243 --- /dev/null +++ b/client/administration/UdsAdmin/forms/ConfigurationForm.fr.resx @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + modTabs + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Accepter + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Annuler + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + UserPreferencesForm + + + UserPreferencesForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/ConfigurationForm.resx b/client/administration/UdsAdmin/forms/ConfigurationForm.resx new file mode 100644 index 000000000..98aed7f06 --- /dev/null +++ b/client/administration/UdsAdmin/forms/ConfigurationForm.resx @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Top, Bottom, Left, Right + + + + 12, 12 + + + 368, 319 + + + + 0 + + + modTabs + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + 3 + + + Bottom, Left, Right + + + 3, 7 + + + 111, 23 + + + 0 + + + Accept + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Bottom, Left, Right + + + 276, 7 + + + 113, 23 + + + 1 + + + Cancel + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + Bottom + + + 0, 337 + + + 1 + + + 392, 33 + + + 8 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="accept" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cancel" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 392, 370 + + + 400, 400 + + + CenterParent + + + ConfigurationForm + + + ConfigurationForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/DeployedGroupForm.Designer.cs b/client/administration/UdsAdmin/forms/DeployedGroupForm.Designer.cs new file mode 100644 index 000000000..82fc2598a --- /dev/null +++ b/client/administration/UdsAdmin/forms/DeployedGroupForm.Designer.cs @@ -0,0 +1,127 @@ +namespace UdsAdmin.forms +{ + partial class DeployedGroupForm + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de Windows Forms + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DeployedGroupForm)); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.accept = new System.Windows.Forms.Button(); + this.cancel = new System.Windows.Forms.Button(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.groupLabel = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.groupCombo = new System.Windows.Forms.ComboBox(); + this.authCombo = new System.Windows.Forms.ComboBox(); + this.tableLayoutPanel2.SuspendLayout(); + this.tableLayoutPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // tableLayoutPanel2 + // + resources.ApplyResources(this.tableLayoutPanel2, "tableLayoutPanel2"); + this.tableLayoutPanel2.Controls.Add(this.accept, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.cancel, 2, 0); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + // + // accept + // + resources.ApplyResources(this.accept, "accept"); + this.accept.Name = "accept"; + this.accept.UseVisualStyleBackColor = true; + this.accept.Click += new System.EventHandler(this.accept_Click); + // + // cancel + // + resources.ApplyResources(this.cancel, "cancel"); + this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancel.Name = "cancel"; + this.cancel.UseVisualStyleBackColor = true; + // + // tableLayoutPanel1 + // + resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); + this.tableLayoutPanel1.Controls.Add(this.groupLabel, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.groupCombo, 1, 1); + this.tableLayoutPanel1.Controls.Add(this.authCombo, 1, 0); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + // + // groupLabel + // + resources.ApplyResources(this.groupLabel, "groupLabel"); + this.groupLabel.Name = "groupLabel"; + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // + // groupCombo + // + this.groupCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.groupCombo.FormattingEnabled = true; + resources.ApplyResources(this.groupCombo, "groupCombo"); + this.groupCombo.Name = "groupCombo"; + // + // authCombo + // + this.authCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.authCombo.FormattingEnabled = true; + resources.ApplyResources(this.authCombo, "authCombo"); + this.authCombo.Name = "authCombo"; + this.authCombo.SelectedIndexChanged += new System.EventHandler(this.authCombo_SelectedIndexChanged); + // + // DeployedGroupForm + // + this.AcceptButton = this.accept; + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.cancel; + this.Controls.Add(this.tableLayoutPanel1); + this.Controls.Add(this.tableLayoutPanel2); + this.Name = "DeployedGroupForm"; + this.Load += new System.EventHandler(this.DeployedGroupForm_Load); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.Button accept; + private System.Windows.Forms.Button cancel; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Label groupLabel; + private System.Windows.Forms.ComboBox groupCombo; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.ComboBox authCombo; + } +} \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/DeployedGroupForm.cs b/client/administration/UdsAdmin/forms/DeployedGroupForm.cs new file mode 100644 index 000000000..7492b947b --- /dev/null +++ b/client/administration/UdsAdmin/forms/DeployedGroupForm.cs @@ -0,0 +1,94 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.forms +{ + public partial class DeployedGroupForm : Form + { + private xmlrpc.DeployedService _ds; + + public DeployedGroupForm(xmlrpc.DeployedService ds) + { + _ds = ds; + InitializeComponent(); + Text = Strings.titleAssignNewGroup; + } + + private void DeployedGroupForm_Load(object sender, EventArgs e) + { + xmlrpc.Authenticator[] auths = xmlrpc.UdsAdminService.GetAuthenticators(); + authCombo.Items.AddRange(auths); + + if (auths.Length > 0) + { + authCombo.SelectedIndex = 0; + } + else + { + MessageBox.Show(Strings.error, Strings.authenticators, MessageBoxButtons.OK, MessageBoxIcon.Error); + Close(); + } + + } + + private void accept_Click(object sender, EventArgs e) + { + if (groupCombo.SelectedItem != null) + { + xmlrpc.Group grp = (xmlrpc.Group)groupCombo.SelectedItem; + xmlrpc.UdsAdminService.AssignGroupToDeployedService(_ds.id, grp.id); + DialogResult = System.Windows.Forms.DialogResult.OK; + } + else + gui.UserNotifier.notifyError(Strings.groupRequired); + + } + + private void authCombo_SelectedIndexChanged(object sender, EventArgs e) + { + groupCombo.Items.Clear(); + string id = ((xmlrpc.Authenticator)authCombo.SelectedItem).id; + xmlrpc.Group[] grps = xmlrpc.UdsAdminService.GetAuthenticatorGroups(id); + if (grps.Length > 0) + { + groupCombo.Items.AddRange(grps); + groupCombo.SelectedIndex = 0; + } + } + } +} diff --git a/client/administration/UdsAdmin/forms/DeployedGroupForm.de.resx b/client/administration/UdsAdmin/forms/DeployedGroupForm.de.resx new file mode 100644 index 000000000..ea10f3c8c --- /dev/null +++ b/client/administration/UdsAdmin/forms/DeployedGroupForm.de.resx @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Akzeptieren + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Abbrechen + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Gruppenname + + + groupLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + groupBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + Assign new group + + + DeployedGroupForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/DeployedGroupForm.es.resx b/client/administration/UdsAdmin/forms/DeployedGroupForm.es.resx new file mode 100644 index 000000000..67c6b67f4 --- /dev/null +++ b/client/administration/UdsAdmin/forms/DeployedGroupForm.es.resx @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Aceptar + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Cancelar + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Nombre del grupo + + + groupLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + groupBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + Assign new group + + + DeployedGroupForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/DeployedGroupForm.fr.resx b/client/administration/UdsAdmin/forms/DeployedGroupForm.fr.resx new file mode 100644 index 000000000..b3e4a4ef2 --- /dev/null +++ b/client/administration/UdsAdmin/forms/DeployedGroupForm.fr.resx @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Accepter + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Annuler + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Nom du groupe + + + groupLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + groupBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + Assign new group + + + DeployedGroupForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/DeployedGroupForm.resx b/client/administration/UdsAdmin/forms/DeployedGroupForm.resx new file mode 100644 index 000000000..ff9221600 --- /dev/null +++ b/client/administration/UdsAdmin/forms/DeployedGroupForm.resx @@ -0,0 +1,366 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 3 + + + + Bottom, Left, Right + + + + 3, 7 + + + 101, 23 + + + 0 + + + Accept + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Bottom, Left, Right + + + 253, 7 + + + 103, 23 + + + 1 + + + Cancel + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + Bottom + + + 0, 97 + + + 1 + + + 359, 33 + + + 7 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="accept" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cancel" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + 2 + + + True + + + 3, 37 + + + 3, 6, 3, 0 + + + 67, 13 + + + 1 + + + Group Name + + + groupLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + True + + + NoControl + + + 3, 6 + + + 3, 6, 3, 0 + + + 70, 13 + + + 1 + + + Authenticator + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + 91, 34 + + + 240, 21 + + + 2 + + + groupCombo + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + 91, 3 + + + 240, 21 + + + 2 + + + authCombo + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + 13, 13 + + + 2 + + + 334, 62 + + + 8 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="groupLabel" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="groupCombo" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="authCombo" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,26,49842,Percent,73,50158" /><Rows Styles="Percent,50,Percent,50,Absolute,20" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 359, 130 + + + CenterParent + + + Assign new group + + + DeployedGroupForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/DeployedServiceForm.Designer.cs b/client/administration/UdsAdmin/forms/DeployedServiceForm.Designer.cs new file mode 100644 index 000000000..c328bd81c --- /dev/null +++ b/client/administration/UdsAdmin/forms/DeployedServiceForm.Designer.cs @@ -0,0 +1,325 @@ +namespace UdsAdmin.forms +{ + partial class DeployedServiceForm + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de Windows Forms + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DeployedServiceForm)); + this.tabs = new System.Windows.Forms.TabControl(); + this.Service = new System.Windows.Forms.TabPage(); + this.publishOnSave = new System.Windows.Forms.CheckBox(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.label3 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.osManagerCombo = new System.Windows.Forms.ComboBox(); + this.baseServiceCombo = new System.Windows.Forms.ComboBox(); + this.label9 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.nameBox = new System.Windows.Forms.TextBox(); + this.commentsBox = new System.Windows.Forms.TextBox(); + this.Transports = new System.Windows.Forms.TabPage(); + this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); + this.label4 = new System.Windows.Forms.Label(); + this.allowedTransports = new System.Windows.Forms.CheckedListBox(); + this.Cache = new System.Windows.Forms.TabPage(); + this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); + this.cacheL2ServicesBox = new System.Windows.Forms.NumericUpDown(); + this.cacheL2Label = new System.Windows.Forms.Label(); + this.cacheServicesBox = new System.Windows.Forms.NumericUpDown(); + this.label5 = new System.Windows.Forms.Label(); + this.cacheLabel = new System.Windows.Forms.Label(); + this.initialServicesBox = new System.Windows.Forms.NumericUpDown(); + this.label7 = new System.Windows.Forms.Label(); + this.maxServicesBox = new System.Windows.Forms.NumericUpDown(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.accept = new System.Windows.Forms.Button(); + this.cancel = new System.Windows.Forms.Button(); + this.tabs.SuspendLayout(); + this.Service.SuspendLayout(); + this.tableLayoutPanel2.SuspendLayout(); + this.Transports.SuspendLayout(); + this.tableLayoutPanel3.SuspendLayout(); + this.Cache.SuspendLayout(); + this.tableLayoutPanel4.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.cacheL2ServicesBox)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.cacheServicesBox)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.initialServicesBox)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.maxServicesBox)).BeginInit(); + this.tableLayoutPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // tabs + // + resources.ApplyResources(this.tabs, "tabs"); + this.tabs.Controls.Add(this.Service); + this.tabs.Controls.Add(this.Transports); + this.tabs.Controls.Add(this.Cache); + this.tabs.Name = "tabs"; + this.tabs.SelectedIndex = 0; + // + // Service + // + this.Service.BackColor = System.Drawing.Color.Transparent; + this.Service.Controls.Add(this.publishOnSave); + this.Service.Controls.Add(this.tableLayoutPanel2); + resources.ApplyResources(this.Service, "Service"); + this.Service.Name = "Service"; + this.Service.UseVisualStyleBackColor = true; + // + // publishOnSave + // + resources.ApplyResources(this.publishOnSave, "publishOnSave"); + this.publishOnSave.Name = "publishOnSave"; + this.publishOnSave.UseVisualStyleBackColor = true; + // + // tableLayoutPanel2 + // + resources.ApplyResources(this.tableLayoutPanel2, "tableLayoutPanel2"); + this.tableLayoutPanel2.Controls.Add(this.label3, 0, 3); + this.tableLayoutPanel2.Controls.Add(this.label1, 0, 2); + this.tableLayoutPanel2.Controls.Add(this.osManagerCombo, 1, 3); + this.tableLayoutPanel2.Controls.Add(this.baseServiceCombo, 1, 2); + this.tableLayoutPanel2.Controls.Add(this.label9, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.label8, 0, 1); + this.tableLayoutPanel2.Controls.Add(this.nameBox, 1, 0); + this.tableLayoutPanel2.Controls.Add(this.commentsBox, 1, 1); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + // + // label3 + // + resources.ApplyResources(this.label3, "label3"); + this.label3.Name = "label3"; + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // + // osManagerCombo + // + resources.ApplyResources(this.osManagerCombo, "osManagerCombo"); + this.osManagerCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.osManagerCombo.FormattingEnabled = true; + this.osManagerCombo.Name = "osManagerCombo"; + // + // baseServiceCombo + // + resources.ApplyResources(this.baseServiceCombo, "baseServiceCombo"); + this.baseServiceCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.baseServiceCombo.FormattingEnabled = true; + this.baseServiceCombo.Name = "baseServiceCombo"; + this.baseServiceCombo.SelectionChangeCommitted += new System.EventHandler(this.baseServiceCombo_SelectionChangeCommitted); + // + // label9 + // + resources.ApplyResources(this.label9, "label9"); + this.label9.Name = "label9"; + // + // label8 + // + resources.ApplyResources(this.label8, "label8"); + this.label8.Name = "label8"; + // + // nameBox + // + resources.ApplyResources(this.nameBox, "nameBox"); + this.nameBox.Name = "nameBox"; + // + // commentsBox + // + resources.ApplyResources(this.commentsBox, "commentsBox"); + this.commentsBox.Name = "commentsBox"; + // + // Transports + // + this.Transports.Controls.Add(this.tableLayoutPanel3); + resources.ApplyResources(this.Transports, "Transports"); + this.Transports.Name = "Transports"; + this.Transports.UseVisualStyleBackColor = true; + // + // tableLayoutPanel3 + // + resources.ApplyResources(this.tableLayoutPanel3, "tableLayoutPanel3"); + this.tableLayoutPanel3.Controls.Add(this.label4, 0, 0); + this.tableLayoutPanel3.Controls.Add(this.allowedTransports, 0, 1); + this.tableLayoutPanel3.Name = "tableLayoutPanel3"; + // + // label4 + // + resources.ApplyResources(this.label4, "label4"); + this.label4.Name = "label4"; + // + // allowedTransports + // + resources.ApplyResources(this.allowedTransports, "allowedTransports"); + this.allowedTransports.FormattingEnabled = true; + this.allowedTransports.Name = "allowedTransports"; + // + // Cache + // + this.Cache.Controls.Add(this.tableLayoutPanel4); + resources.ApplyResources(this.Cache, "Cache"); + this.Cache.Name = "Cache"; + this.Cache.UseVisualStyleBackColor = true; + // + // tableLayoutPanel4 + // + resources.ApplyResources(this.tableLayoutPanel4, "tableLayoutPanel4"); + this.tableLayoutPanel4.Controls.Add(this.cacheL2ServicesBox, 1, 2); + this.tableLayoutPanel4.Controls.Add(this.cacheL2Label, 0, 2); + this.tableLayoutPanel4.Controls.Add(this.cacheServicesBox, 1, 1); + this.tableLayoutPanel4.Controls.Add(this.label5, 0, 0); + this.tableLayoutPanel4.Controls.Add(this.cacheLabel, 0, 1); + this.tableLayoutPanel4.Controls.Add(this.initialServicesBox, 1, 0); + this.tableLayoutPanel4.Controls.Add(this.label7, 0, 3); + this.tableLayoutPanel4.Controls.Add(this.maxServicesBox, 1, 3); + this.tableLayoutPanel4.Name = "tableLayoutPanel4"; + // + // cacheL2ServicesBox + // + resources.ApplyResources(this.cacheL2ServicesBox, "cacheL2ServicesBox"); + this.cacheL2ServicesBox.Name = "cacheL2ServicesBox"; + // + // cacheL2Label + // + resources.ApplyResources(this.cacheL2Label, "cacheL2Label"); + this.cacheL2Label.Name = "cacheL2Label"; + // + // cacheServicesBox + // + resources.ApplyResources(this.cacheServicesBox, "cacheServicesBox"); + this.cacheServicesBox.Name = "cacheServicesBox"; + // + // label5 + // + resources.ApplyResources(this.label5, "label5"); + this.label5.Name = "label5"; + // + // cacheLabel + // + resources.ApplyResources(this.cacheLabel, "cacheLabel"); + this.cacheLabel.Name = "cacheLabel"; + // + // initialServicesBox + // + resources.ApplyResources(this.initialServicesBox, "initialServicesBox"); + this.initialServicesBox.Name = "initialServicesBox"; + // + // label7 + // + resources.ApplyResources(this.label7, "label7"); + this.label7.Name = "label7"; + // + // maxServicesBox + // + resources.ApplyResources(this.maxServicesBox, "maxServicesBox"); + this.maxServicesBox.Name = "maxServicesBox"; + // + // tableLayoutPanel1 + // + resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); + this.tableLayoutPanel1.Controls.Add(this.accept, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.cancel, 2, 0); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + // + // accept + // + resources.ApplyResources(this.accept, "accept"); + this.accept.Name = "accept"; + this.accept.UseVisualStyleBackColor = true; + this.accept.Click += new System.EventHandler(this.accept_Click); + // + // cancel + // + resources.ApplyResources(this.cancel, "cancel"); + this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancel.Name = "cancel"; + this.cancel.UseVisualStyleBackColor = true; + // + // DeployedServiceForm + // + this.AcceptButton = this.accept; + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.cancel; + this.Controls.Add(this.tableLayoutPanel1); + this.Controls.Add(this.tabs); + this.Name = "DeployedServiceForm"; + this.Load += new System.EventHandler(this.DeployedServiceForm_Load); + this.tabs.ResumeLayout(false); + this.Service.ResumeLayout(false); + this.Service.PerformLayout(); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel2.PerformLayout(); + this.Transports.ResumeLayout(false); + this.tableLayoutPanel3.ResumeLayout(false); + this.tableLayoutPanel3.PerformLayout(); + this.Cache.ResumeLayout(false); + this.tableLayoutPanel4.ResumeLayout(false); + this.tableLayoutPanel4.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.cacheL2ServicesBox)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.cacheServicesBox)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.initialServicesBox)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.maxServicesBox)).EndInit(); + this.tableLayoutPanel1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TabControl tabs; + private System.Windows.Forms.TabPage Service; + private System.Windows.Forms.TabPage Transports; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Button accept; + private System.Windows.Forms.Button cancel; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.CheckedListBox allowedTransports; + private System.Windows.Forms.TabPage Cache; + private System.Windows.Forms.ComboBox osManagerCombo; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4; + private System.Windows.Forms.NumericUpDown maxServicesBox; + private System.Windows.Forms.NumericUpDown cacheServicesBox; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label cacheLabel; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.NumericUpDown initialServicesBox; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.ComboBox baseServiceCombo; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.TextBox nameBox; + private System.Windows.Forms.TextBox commentsBox; + private System.Windows.Forms.NumericUpDown cacheL2ServicesBox; + private System.Windows.Forms.Label cacheL2Label; + private System.Windows.Forms.CheckBox publishOnSave; + } +} \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/DeployedServiceForm.cs b/client/administration/UdsAdmin/forms/DeployedServiceForm.cs new file mode 100644 index 000000000..fa30cfcbf --- /dev/null +++ b/client/administration/UdsAdmin/forms/DeployedServiceForm.cs @@ -0,0 +1,229 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.forms +{ + public partial class DeployedServiceForm : Form + { + private xmlrpc.DeployedService _dps; + + private xmlrpc.Service[] _services = null; + private xmlrpc.OSManager[] _osManagers = null; + private xmlrpc.Transport[] _transports; + private ToolTip tooltipCache = new ToolTip(); + private ToolTip tooltipCacheL2 = new ToolTip(); + + public DeployedServiceForm() + { + InitializeComponent(); + _dps = new xmlrpc.DeployedService(); + _dps.id = ""; + Text = Strings.titleDeployedService; + } + + public void setData(xmlrpc.DeployedService dps) + { + _dps = dps; + } + + private void DeployedServiceForm_Load(object sender, EventArgs e) + { + _services = xmlrpc.UdsAdminService.GetAllServices(); + _osManagers = xmlrpc.UdsAdminService.GetOSManagers(); + _transports = xmlrpc.UdsAdminService.GetTransports(); + + tooltipCache.SetToolTip(cacheLabel, ""); + tooltipCacheL2.SetToolTip(cacheL2Label, ""); + + Text = Strings.titleDeployedService; + + if (_services.Length == 0) + { + UdsAdmin.gui.UserNotifier.notifyError(Strings.needsServices); + Close(); + return; + } + + if (_osManagers.Length == 0) + { + UdsAdmin.gui.UserNotifier.notifyError(Strings.needsOsManagers); + Close(); + return; + } + + if (_transports.Length == 0 ) + { + UdsAdmin.gui.UserNotifier.notifyError(Strings.needsTransports); + } + + baseServiceCombo.Items.AddRange(_services); + osManagerCombo.Items.AddRange(_osManagers); + allowedTransports.Items.AddRange(_transports); + + // Modifying, update form to modify operation + if (_dps.id != "") + { + Text = Strings.modifying + " " + _dps.name; + + baseServiceCombo.Enabled = false; + osManagerCombo.Enabled = false; + publishOnSave.Enabled = false; + publishOnSave.Checked = false; + foreach (xmlrpc.OSManager osm in _osManagers) + if (osm.id == _dps.idOsManager) + { + osManagerCombo.SelectedItem = osm; + break; + } + foreach (xmlrpc.Service serv in _services) + if (serv.id == _dps.idService) + { + baseServiceCombo.SelectedItem = serv; + ((Control)tabs.TabPages["Cache"]).Enabled = serv.info.usesCache; + cacheL2Label.Enabled = cacheL2ServicesBox.Enabled = serv.info.usesCacheL2; + tooltipCache.SetToolTip(cacheLabel, serv.info.cacheTooltip); + tooltipCacheL2.SetToolTip(cacheL2Label, serv.info.cacheTooltipL2); + break; + } + foreach (xmlrpc.SimpleInfo trans in _dps.transports) + { + for (int i = 0; i < allowedTransports.Items.Count; i++) + { + xmlrpc.Transport tr = (xmlrpc.Transport)allowedTransports.Items[i]; + if (tr.id == trans.id) + allowedTransports.SetItemChecked(i, true); + } + } + nameBox.Text = _dps.name; + commentsBox.Text = _dps.comments; + initialServicesBox.Value = _dps.initialServices; + cacheServicesBox.Value = _dps.cacheL1; + cacheL2ServicesBox.Value = _dps.cacheL2; + maxServicesBox.Value = _dps.maxServices; + } + else + { + publishOnSave.Checked = true; + } + + //this.Location = System.Windows.Forms.Cursor.Position; + } + + private void baseServiceCombo_SelectionChangeCommitted(object sender, EventArgs e) + { + xmlrpc.Service selected = (xmlrpc.Service)baseServiceCombo.SelectedItem; + if (_dps.id == "") + { + osManagerCombo.Enabled = selected.info.needsManager; + } + publishOnSave.Enabled = selected.info.needsPublication; + ((Control)tabs.TabPages["Cache"]).Enabled = selected.info.usesCache; + cacheL2Label.Enabled = cacheL2ServicesBox.Enabled = selected.info.usesCacheL2; + tooltipCache.SetToolTip(cacheLabel, selected.info.cacheTooltip); + tooltipCacheL2.SetToolTip(cacheL2Label, selected.info.cacheTooltipL2); + } + + private void accept_Click(object sender, EventArgs e) + { + if (nameBox.Text.Trim().Length == 0) + { + gui.UserNotifier.notifyError(Strings.nameRequired); + return; + } + + if( baseServiceCombo.SelectedItem == null ) + { + gui.UserNotifier.notifyError(Strings.specifyBaseService); + return; + } + + if( ((xmlrpc.Service)baseServiceCombo.SelectedItem).info.needsManager && osManagerCombo.SelectedItem == null ) + { + gui.UserNotifier.notifyError(Strings.specifyOsManager); + return; + } + + if (initialServicesBox.Value > maxServicesBox.Value) + maxServicesBox.Value = initialServicesBox.Value; + if (cacheServicesBox.Value > maxServicesBox.Value) + maxServicesBox.Value = cacheServicesBox.Value; + + _dps.initialServices = (int)initialServicesBox.Value; + _dps.cacheL1 = (int)cacheServicesBox.Value; + _dps.cacheL2 = (int)cacheL2ServicesBox.Value; + _dps.maxServices = (int)maxServicesBox.Value; + _dps.name = nameBox.Text; + _dps.comments = commentsBox.Text; + _dps.idService = ((xmlrpc.Service)baseServiceCombo.SelectedItem).id; + if (osManagerCombo.SelectedItem != null) + _dps.idOsManager = ((xmlrpc.OSManager)osManagerCombo.SelectedItem).id; + else + _dps.idOsManager = "-1"; + + xmlrpc.SimpleInfo[] transports = new xmlrpc.SimpleInfo[allowedTransports.CheckedItems.Count]; + int n = 0; + foreach( xmlrpc.Transport trns in allowedTransports.CheckedItems ) + transports[n++] = new xmlrpc.SimpleInfo(trns.id, trns.name); + + _dps.transports = transports; + + try + { + if (_dps.id == "") // Create a new deployed Service + { + _dps.state = xmlrpc.Constants.STATE_ACTIVE; + _dps.id = xmlrpc.UdsAdminService.CreateDeployedService(_dps); + if ( publishOnSave.Enabled && publishOnSave.Checked) + xmlrpc.UdsAdminService.PublishDeployedService(_dps); + } + else + { + xmlrpc.UdsAdminService.ModifyDeployedService(_dps); + } + DialogResult = System.Windows.Forms.DialogResult.OK; + } + catch( CookComputing.XmlRpc.XmlRpcFaultException ex ) + { + gui.UserNotifier.notifyRpcException(ex); + } + + } + + + } +} diff --git a/client/administration/UdsAdmin/forms/DeployedServiceForm.de.resx b/client/administration/UdsAdmin/forms/DeployedServiceForm.de.resx new file mode 100644 index 000000000..48bae546a --- /dev/null +++ b/client/administration/UdsAdmin/forms/DeployedServiceForm.de.resx @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Veröffentlichen automatisch auf Speichern + + + OS-Manager + + + Basisdienst + + + Kommentare + + + Zulässige Transporte + + + Transporte + + + Dienstleistungen im L2-Cache zu behalten (Experimental) + + + Erste Services Availables + + + Dienstleistungen im Cache zu behalten + + + Maximale Anzahl von Dienstleistungen + + + Akzeptieren + + + Abbrechen + + + + + AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AABtIBEAbSEQAHIoFQB2KhQAdy0VAHkuFgB3LhsAezAWAHwxFQAyMjIAezIcAH41HQCCNxgAfzYdAIM4 + GwCGOxgAiD4cAIk/GQCJPxsAikEgAIxCHwCHQScAkUYbAItEJgCPRyIARkZGAI5HKwCVTCAAS0tLAJ1T + HgBPT08AkFIwAJ9XIwCTVjUApFsiAJpWNwClXCEAmlg5AJRcPACpYiQAq2MjAKxkIwCXX0AAmVpUALNt + JwCiZlsAqGxOAKZrWACscU4Aw4EsAK52XQDAh0sA0JU+ANGZSQCSkpIAmJiYAJmZmQCdnZ0An5+fAKCg + oACtr64AtbW1ALi4uAC8vLwAvb29ALy/vgC/wsEAw8PDAMTExADCxcQAw8XEAMXFxQDExsUAxMfGAMfH + xwDFyMcAyMjIAMnJyQDKysoAzMzMAMvNzADMzc0Azc3NAM7OzgDPz88Az9DQANDR0QDR0dEA0tLSANPT + 0wDV1dUA1tbWANra2gDb29sA3NzcAN3d3QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAYGBgYGAJYBlgHmAcYGBgYGBgYGA2OTc7Ojg7NmBgYGBgYGBgYE9XQ0NXUkRgYGBgYGBgYExN + T1RUUk5gYGBgYGBgYGBgVFtYWVtTTWBgYGBgYGBgP1peXF1dU2BgYGBgYGBgYGBHXF9ZWUpgYGBgYGBg + YGA5PlZVREA9YGBgYGBgYGBgYGBgPGBgYGBgYGBgYGBQYElgRUtIYEJgQVFgYGBgYGBgYGBgYGBgYGBG + YGBgYCZgYGBgIR9gYGAjKhFgYBASB2BgDRQTBWBgDhgXAxUnJA8BYBgpHQgAYCAoGwpgNSwMYGAwNCIE + YGAzMRYGKzIaYGBgLS4LYGBgLyUCYPqvAADwDwAA+A8AAPAfAAD4DwAA8B8AAPgfAADwHwAA/v8AANRT + AAD/+wAA3nEAAIwwAAAEEAAAjDAAABxxAAA= + + + + Service + + + Cache + + + Name + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/DeployedServiceForm.es.resx b/client/administration/UdsAdmin/forms/DeployedServiceForm.es.resx new file mode 100644 index 000000000..4a3075345 --- /dev/null +++ b/client/administration/UdsAdmin/forms/DeployedServiceForm.es.resx @@ -0,0 +1,551 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + cacheL2Label + + + 6 + + + allowedTransports + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + baseServiceCombo + + + 5 + + + maxServicesBox + + + Service + + + 0 + + + tableLayoutPanel2 + + + 0 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + tableLayoutPanel2 + + + tabs + + + Cache + + + tableLayoutPanel1 + + + osManagerCombo + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel4 + + + 1 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + label1 + + + tabs + + + Transportes + + + Servicios + + + accept + + + Transports + + + Service + + + tabs + + + label7 + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel4 + + + Cancelar + + + tableLayoutPanel1 + + + tableLayoutPanel2 + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Servicios a mantener en la caché + + + tableLayoutPanel4 + + + Comentarios + + + tableLayoutPanel4 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 4 + + + Caché + + + 0 + + + Publicar automáticamente al guardar + + + 2 + + + DeployedServiceForm + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel3 + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 0 + + + Servicios a mantener en la caché L2 (Experimental) + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + label5 + + + tableLayoutPanel2 + + + cacheServicesBox + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 2 + + + label9 + + + publishOnSave + + + 0 + + + 1 + + + 1 + + + Service + + + tableLayoutPanel4 + + + Aceptar + + + tableLayoutPanel2 + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + label4 + + + 0 + + + cacheLabel + + + Nº Maximo de servicios + + + Nombre + + + tableLayoutPanel4 + + + tableLayoutPanel2 + + + tableLayoutPanel4 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + commentsBox + + + System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + Cache + + + cancel + + + + + AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AABtIBEAbSEQAHIoFQB2KhQAdy0VAHkuFgB3LhsAezAWAHwxFQAyMjIAezIcAH41HQCCNxgAfzYdAIM4 + GwCGOxgAiD4cAIk/GQCJPxsAikEgAIxCHwCHQScAkUYbAItEJgCPRyIARkZGAI5HKwCVTCAAS0tLAJ1T + HgBPT08AkFIwAJ9XIwCTVjUApFsiAJpWNwClXCEAmlg5AJRcPACpYiQAq2MjAKxkIwCXX0AAmVpUALNt + JwCiZlsAqGxOAKZrWACscU4Aw4EsAK52XQDAh0sA0JU+ANGZSQCSkpIAmJiYAJmZmQCdnZ0An5+fAKCg + oACtr64AtbW1ALi4uAC8vLwAvb29ALy/vgC/wsEAw8PDAMTExADCxcQAw8XEAMXFxQDExsUAxMfGAMfH + xwDFyMcAyMjIAMnJyQDKysoAzMzMAMvNzADMzc0Azc3NAM7OzgDPz88Az9DQANDR0QDR0dEA0tLSANPT + 0wDV1dUA1tbWANra2gDb29sA3NzcAN3d3QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAYGBgYGAJYBlgHmAcYGBgYGBgYGA2OTc7Ojg7NmBgYGBgYGBgYE9XQ0NXUkRgYGBgYGBgYExN + T1RUUk5gYGBgYGBgYGBgVFtYWVtTTWBgYGBgYGBgP1peXF1dU2BgYGBgYGBgYGBHXF9ZWUpgYGBgYGBg + YGA5PlZVREA9YGBgYGBgYGBgYGBgPGBgYGBgYGBgYGBQYElgRUtIYEJgQVFgYGBgYGBgYGBgYGBgYGBG + YGBgYCZgYGBgIR9gYGAjKhFgYBASB2BgDRQTBWBgDhgXAxUnJA8BYBgpHQgAYCAoGwpgNSwMYGAwNCIE + YGAzMRYGKzIaYGBgLS4LYGBgLyUCYPqvAADwDwAA+A8AAPAfAAD4DwAA8B8AAPgfAADwHwAA/v8AANRT + AAD/+wAA3nEAAIwwAAAEEAAAjDAAABxxAAA= + + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + nameBox + + + Transports + + + New Deployed Service + + + tabs + + + tableLayoutPanel1 + + + label8 + + + tableLayoutPanel3 + + + OS Manager + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 3 + + + cacheL2ServicesBox + + + Servicio Base + + + 1 + + + 2 + + + $this + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 7 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 6 + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 5 + + + 1 + + + tableLayoutPanel2 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 4 + + + 1 + + + 0 + + + tableLayoutPanel4 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 0 + + + 3 + + + tableLayoutPanel4 + + + 1 + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 7 + + + initialServicesBox + + + Servicios Iniciales disponibles + + + tableLayoutPanel3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 0 + + + Transportes permitidos + + + label3 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/DeployedServiceForm.fr.resx b/client/administration/UdsAdmin/forms/DeployedServiceForm.fr.resx new file mode 100644 index 000000000..b75d93ff3 --- /dev/null +++ b/client/administration/UdsAdmin/forms/DeployedServiceForm.fr.resx @@ -0,0 +1,575 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Publier automatiquement d'enregistrer + + + publishOnSave + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Service + + + 0 + + + Gestionnaire de système d'exploitation + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + Service de base + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + osManagerCombo + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 3 + + + authenticatorCombo + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 4 + + + baseServiceCombo + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 5 + + + Nom + + + label9 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 6 + + + Commentaires + + + label8 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 7 + + + nameBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 8 + + + commentsBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 9 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Service + + + 1 + + + Service + + + Service + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabs + + + 0 + + + Transports autorisés + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel3 + + + 0 + + + allowedTransports + + + System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel3 + + + 1 + + + tableLayoutPanel3 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Transports + + + 0 + + + Transports + + + Transports + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabs + + + 1 + + + cacheL2ServicesBox + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel4 + + + 0 + + + Services de garder en mémoire cache L2 (Experimental) + + + cacheL2Label + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel4 + + + 1 + + + cacheServicesBox + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel4 + + + 2 + + + Initial Services disponibles + + + label5 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel4 + + + 3 + + + Services de garder dans le cache + + + cacheLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel4 + + + 4 + + + initialServicesBox + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel4 + + + 5 + + + Nombre maximal de services + + + label7 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel4 + + + 6 + + + maxServicesBox + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel4 + + + 7 + + + tableLayoutPanel4 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cache + + + 0 + + + Cache + + + Cache + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabs + + + 2 + + + tabs + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Accepter + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Annuler + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + + + AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AABtIBEAbSEQAHIoFQB2KhQAdy0VAHkuFgB3LhsAezAWAHwxFQAyMjIAezIcAH41HQCCNxgAfzYdAIM4 + GwCGOxgAiD4cAIk/GQCJPxsAikEgAIxCHwCHQScAkUYbAItEJgCPRyIARkZGAI5HKwCVTCAAS0tLAJ1T + HgBPT08AkFIwAJ9XIwCTVjUApFsiAJpWNwClXCEAmlg5AJRcPACpYiQAq2MjAKxkIwCXX0AAmVpUALNt + JwCiZlsAqGxOAKZrWACscU4Aw4EsAK52XQDAh0sA0JU+ANGZSQCSkpIAmJiYAJmZmQCdnZ0An5+fAKCg + oACtr64AtbW1ALi4uAC8vLwAvb29ALy/vgC/wsEAw8PDAMTExADCxcQAw8XEAMXFxQDExsUAxMfGAMfH + xwDFyMcAyMjIAMnJyQDKysoAzMzMAMvNzADMzc0Azc3NAM7OzgDPz88Az9DQANDR0QDR0dEA0tLSANPT + 0wDV1dUA1tbWANra2gDb29sA3NzcAN3d3QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAYGBgYGAJYBlgHmAcYGBgYGBgYGA2OTc7Ojg7NmBgYGBgYGBgYE9XQ0NXUkRgYGBgYGBgYExN + T1RUUk5gYGBgYGBgYGBgVFtYWVtTTWBgYGBgYGBgP1peXF1dU2BgYGBgYGBgYGBHXF9ZWUpgYGBgYGBg + YGA5PlZVREA9YGBgYGBgYGBgYGBgPGBgYGBgYGBgYGBQYElgRUtIYEJgQVFgYGBgYGBgYGBgYGBgYGBG + YGBgYCZgYGBgIR9gYGAjKhFgYBASB2BgDRQTBWBgDhgXAxUnJA8BYBgpHQgAYCAoGwpgNSwMYGAwNCIE + YGAzMRYGKzIaYGBgLS4LYGBgLyUCYPqvAADwDwAA+A8AAPAfAAD4DwAA8B8AAPgfAADwHwAA/v8AANRT + AAD/+wAA3nEAAIwwAAAEEAAAjDAAABxxAAA= + + + + New Deployed Service + + + DeployedServiceForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/DeployedServiceForm.resx b/client/administration/UdsAdmin/forms/DeployedServiceForm.resx new file mode 100644 index 000000000..f5082d683 --- /dev/null +++ b/client/administration/UdsAdmin/forms/DeployedServiceForm.resx @@ -0,0 +1,1015 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Top, Bottom, Left, Right + + + + True + + + + 3, 144 + + + 165, 17 + + + 2 + + + Publish automatically on save + + + publishOnSave + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Service + + + 0 + + + Top, Left, Right + + + 2 + + + Left + + + True + + + NoControl + + + 3, 106 + + + 67, 13 + + + 3 + + + OS Manager + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Left + + + True + + + 3, 73 + + + 70, 13 + + + 1 + + + Base Service + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + Fill + + + 79, 99 + + + 248, 21 + + + 5 + + + osManagerCombo + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + Fill + + + 79, 67 + + + 248, 21 + + + 3 + + + baseServiceCombo + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 3 + + + Left + + + True + + + NoControl + + + 3, 9 + + + 35, 13 + + + 9 + + + Name + + + label9 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 4 + + + Left + + + True + + + NoControl + + + 3, 41 + + + 56, 13 + + + 10 + + + Comments + + + label8 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 5 + + + Fill + + + 79, 3 + + + 128 + + + 248, 20 + + + 1 + + + nameBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 6 + + + Fill + + + 79, 35 + + + 256 + + + 248, 20 + + + 2 + + + commentsBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 7 + + + 6, 6 + + + 3 + + + 330, 129 + + + 1 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Service + + + 1 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label3" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label1" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="osManagerCombo" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="baseServiceCombo" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label9" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label8" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="nameBox" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="commentsBox" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="Percent,25,Percent,25,Percent,25,Percent,25" /></TableLayoutSettings> + + + 4, 23 + + + 3, 3, 3, 3 + + + 342, 197 + + + 0 + + + Service + + + Service + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabs + + + 0 + + + Top, Bottom, Left, Right + + + 1 + + + Left + + + True + + + 3, 5 + + + 97, 13 + + + 2 + + + Allowed Transports + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel3 + + + 0 + + + Fill + + + 3, 27 + + + 512, 154 + + + 9 + + + allowedTransports + + + System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel3 + + + 1 + + + 7, 7 + + + 2 + + + 518, 184 + + + 0 + + + tableLayoutPanel3 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Transports + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label4" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="allowedTransports" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100,Absolute,20" /><Rows Styles="Absolute,24,Percent,100" /></TableLayoutSettings> + + + 4, 23 + + + 3, 3, 3, 3 + + + 440, 197 + + + 1 + + + Transports + + + Transports + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabs + + + 1 + + + Top, Left, Right + + + 2 + + + Fill + + + 224, 72 + + + 3, 6, 3, 3 + + + 201, 20 + + + 12 + + + cacheL2ServicesBox + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel4 + + + 0 + + + Left + + + True + + + NoControl + + + 3, 76 + + + 215, 13 + + + 3 + + + Services to keep in L2 cache (Experimental) + + + cacheL2Label + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel4 + + + 1 + + + Fill + + + 224, 39 + + + 3, 6, 3, 3 + + + 201, 20 + + + 11 + + + cacheServicesBox + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel4 + + + 2 + + + Left + + + True + + + NoControl + + + 3, 10 + + + 126, 13 + + + 1 + + + Initial Services Availables + + + label5 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel4 + + + 3 + + + Left + + + True + + + NoControl + + + 3, 43 + + + 131, 13 + + + 2 + + + Services to keep in cache + + + cacheLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel4 + + + 4 + + + Fill + + + 224, 6 + + + 3, 6, 3, 3 + + + 201, 20 + + + 10 + + + initialServicesBox + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel4 + + + 5 + + + Left + + + True + + + NoControl + + + 3, 110 + + + 143, 13 + + + 3 + + + Maximum number of services + + + label7 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel4 + + + 6 + + + Fill + + + 224, 105 + + + 3, 6, 3, 3 + + + 201, 20 + + + 12 + + + maxServicesBox + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel4 + + + 7 + + + 6, 6 + + + 4 + + + 428, 135 + + + 2 + + + tableLayoutPanel4 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Cache + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="cacheL2ServicesBox" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="cacheL2Label" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cacheServicesBox" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label5" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cacheLabel" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="initialServicesBox" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label7" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="maxServicesBox" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100" /><Rows Styles="Percent,25,Percent,25,Percent,25,Percent,25" /></TableLayoutSettings> + + + 4, 23 + + + 3, 3, 3, 3 + + + 440, 197 + + + 2 + + + Cache + + + Cache + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabs + + + 2 + + + 12, 12 + + + 448, 224 + + + 6 + + + tabs + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + 3 + + + Bottom, Left, Right + + + 3, 7 + + + 135, 23 + + + 7 + + + Accept + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Bottom, Left, Right + + + 332, 7 + + + 137, 23 + + + 8 + + + Cancel + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + Bottom + + + 0, 242 + + + 1 + + + 472, 33 + + + 6 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="accept" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cancel" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 472, 275 + + + + AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AABtIBEAbSEQAHIoFQB2KhQAdy0VAHkuFgB3LhsAezAWAHwxFQAyMjIAezIcAH41HQCCNxgAfzYdAIM4 + GwCGOxgAiD4cAIk/GQCJPxsAikEgAIxCHwCHQScAkUYbAItEJgCPRyIARkZGAI5HKwCVTCAAS0tLAJ1T + HgBPT08AkFIwAJ9XIwCTVjUApFsiAJpWNwClXCEAmlg5AJRcPACpYiQAq2MjAKxkIwCXX0AAmVpUALNt + JwCiZlsAqGxOAKZrWACscU4Aw4EsAK52XQDAh0sA0JU+ANGZSQCSkpIAmJiYAJmZmQCdnZ0An5+fAKCg + oACtr64AtbW1ALi4uAC8vLwAvb29ALy/vgC/wsEAw8PDAMTExADCxcQAw8XEAMXFxQDExsUAxMfGAMfH + xwDFyMcAyMjIAMnJyQDKysoAzMzMAMvNzADMzc0Azc3NAM7OzgDPz88Az9DQANDR0QDR0dEA0tLSANPT + 0wDV1dUA1tbWANra2gDb29sA3NzcAN3d3QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAYGBgYGAJYBlgHmAcYGBgYGBgYGA2OTc7Ojg7NmBgYGBgYGBgYE9XQ0NXUkRgYGBgYGBgYExN + T1RUUk5gYGBgYGBgYGBgVFtYWVtTTWBgYGBgYGBgP1peXF1dU2BgYGBgYGBgYGBHXF9ZWUpgYGBgYGBg + YGA5PlZVREA9YGBgYGBgYGBgYGBgPGBgYGBgYGBgYGBQYElgRUtIYEJgQVFgYGBgYGBgYGBgYGBgYGBG + YGBgYCZgYGBgIR9gYGAjKhFgYBASB2BgDRQTBWBgDhgXAxUnJA8BYBgpHQgAYCAoGwpgNSwMYGAwNCIE + YGAzMRYGKzIaYGBgLS4LYGBgLyUCYPqvAADwDwAA+A8AAPAfAAD4DwAA8B8AAPgfAADwHwAA/v8AANRT + AAD/+wAA3nEAAIwwAAAEEAAAjDAAABxxAAA= + + + + CenterParent + + + New Deployed Service + + + DeployedServiceForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/DeployedTransportForm.Designer.cs b/client/administration/UdsAdmin/forms/DeployedTransportForm.Designer.cs new file mode 100644 index 000000000..c113b2400 --- /dev/null +++ b/client/administration/UdsAdmin/forms/DeployedTransportForm.Designer.cs @@ -0,0 +1,108 @@ +namespace UdsAdmin.forms +{ + partial class DeployedTransportForm + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de Windows Forms + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DeployedTransportForm)); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.accept = new System.Windows.Forms.Button(); + this.cancel = new System.Windows.Forms.Button(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.label1 = new System.Windows.Forms.Label(); + this.transCombo = new System.Windows.Forms.ComboBox(); + this.tableLayoutPanel2.SuspendLayout(); + this.tableLayoutPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // tableLayoutPanel2 + // + resources.ApplyResources(this.tableLayoutPanel2, "tableLayoutPanel2"); + this.tableLayoutPanel2.Controls.Add(this.accept, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.cancel, 2, 0); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + // + // accept + // + resources.ApplyResources(this.accept, "accept"); + this.accept.Name = "accept"; + this.accept.UseVisualStyleBackColor = true; + this.accept.Click += new System.EventHandler(this.accept_Click); + // + // cancel + // + resources.ApplyResources(this.cancel, "cancel"); + this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancel.Name = "cancel"; + this.cancel.UseVisualStyleBackColor = true; + // + // tableLayoutPanel1 + // + resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); + this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.transCombo, 1, 0); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // + // transCombo + // + this.transCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.transCombo.FormattingEnabled = true; + resources.ApplyResources(this.transCombo, "transCombo"); + this.transCombo.Name = "transCombo"; + // + // DeployedTransportForm + // + this.AcceptButton = this.accept; + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.cancel; + this.Controls.Add(this.tableLayoutPanel1); + this.Controls.Add(this.tableLayoutPanel2); + this.Name = "DeployedTransportForm"; + this.Load += new System.EventHandler(this.DeployedTransportForm_Load); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.Button accept; + private System.Windows.Forms.Button cancel; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.ComboBox transCombo; + } +} \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/DeployedTransportForm.cs b/client/administration/UdsAdmin/forms/DeployedTransportForm.cs new file mode 100644 index 000000000..03f9d6371 --- /dev/null +++ b/client/administration/UdsAdmin/forms/DeployedTransportForm.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.forms +{ + public partial class DeployedTransportForm : Form + { + private xmlrpc.DeployedService _ds; + + public DeployedTransportForm(xmlrpc.DeployedService ds) + { + _ds = ds; + InitializeComponent(); + Text = Strings.titleAssignNewGroup; + } + + private void DeployedTransportForm_Load(object sender, EventArgs e) + { + xmlrpc.Transport[] trans = xmlrpc.UdsAdminService.GetTransports(); + transCombo.Items.AddRange(trans); + + if (trans.Length > 0) + { + transCombo.SelectedIndex = 0; + } + else + { + MessageBox.Show(Strings.error, Strings.transports, MessageBoxButtons.OK, MessageBoxIcon.Error); + Close(); + } + + } + + private void accept_Click(object sender, EventArgs e) + { + if (transCombo.SelectedItem != null) + { + xmlrpc.Transport trans = (xmlrpc.Transport)transCombo.SelectedItem; + xmlrpc.UdsAdminService.AssignTransportToDeployedService(_ds.id, trans.id); + DialogResult = System.Windows.Forms.DialogResult.OK; + } + else + gui.UserNotifier.notifyError(Strings.transportRequired); + + } + + } +} diff --git a/client/administration/UdsAdmin/forms/DeployedTransportForm.de.resx b/client/administration/UdsAdmin/forms/DeployedTransportForm.de.resx new file mode 100644 index 000000000..5e41acdb4 --- /dev/null +++ b/client/administration/UdsAdmin/forms/DeployedTransportForm.de.resx @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Akzeptieren + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Abbrechen + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + groupLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + groupBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + Assign new group + + + DeployedGroupForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Verkehr + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/DeployedTransportForm.es.resx b/client/administration/UdsAdmin/forms/DeployedTransportForm.es.resx new file mode 100644 index 000000000..decb87edc --- /dev/null +++ b/client/administration/UdsAdmin/forms/DeployedTransportForm.es.resx @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Aceptar + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Cancelar + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + groupLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + groupBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + Assign new group + + + DeployedGroupForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Transporte + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/DeployedTransportForm.fr.resx b/client/administration/UdsAdmin/forms/DeployedTransportForm.fr.resx new file mode 100644 index 000000000..66b8fbffe --- /dev/null +++ b/client/administration/UdsAdmin/forms/DeployedTransportForm.fr.resx @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Accepter + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Annuler + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + groupLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + groupBox + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + Assign new group + + + DeployedGroupForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Transport + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/DeployedTransportForm.resx b/client/administration/UdsAdmin/forms/DeployedTransportForm.resx new file mode 100644 index 000000000..4a5bac44f --- /dev/null +++ b/client/administration/UdsAdmin/forms/DeployedTransportForm.resx @@ -0,0 +1,315 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 3 + + + + Bottom, Left, Right + + + + 3, 7 + + + 101, 23 + + + 0 + + + Accept + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Bottom, Left, Right + + + 253, 7 + + + 103, 23 + + + 1 + + + Cancel + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + Bottom + + + 0, 67 + + + 1 + + + 359, 33 + + + 7 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="accept" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cancel" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + 2 + + + True + + + NoControl + + + 3, 6 + + + 3, 6, 3, 0 + + + 52, 13 + + + 1 + + + Transport + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + 91, 3 + + + 240, 21 + + + 2 + + + transCombo + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + 13, 13 + + + 1 + + + 334, 32 + + + 8 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="transCombo" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,26,49842,Percent,73,50158" /><Rows Styles="Percent,50,Absolute,32" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 359, 100 + + + CenterParent + + + Assign new transport + + + DeployedTransportForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/FileDownloader.Designer.cs b/client/administration/UdsAdmin/forms/FileDownloader.Designer.cs new file mode 100644 index 000000000..282e9f4a4 --- /dev/null +++ b/client/administration/UdsAdmin/forms/FileDownloader.Designer.cs @@ -0,0 +1,92 @@ +namespace UdsAdmin.forms +{ + partial class FileDownloader + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de Windows Forms + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FileDownloader)); + this.progress = new System.Windows.Forms.ProgressBar(); + this.info = new System.Windows.Forms.Label(); + this.cancel = new System.Windows.Forms.Button(); + this.bgTask = new System.ComponentModel.BackgroundWorker(); + this.install = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // progress + // + resources.ApplyResources(this.progress, "progress"); + this.progress.Name = "progress"; + this.progress.Style = System.Windows.Forms.ProgressBarStyle.Continuous; + // + // info + // + resources.ApplyResources(this.info, "info"); + this.info.Name = "info"; + // + // cancel + // + resources.ApplyResources(this.cancel, "cancel"); + this.cancel.Name = "cancel"; + this.cancel.UseVisualStyleBackColor = true; + this.cancel.Click += new System.EventHandler(this.cancel_Click); + // + // bgTask + // + this.bgTask.WorkerSupportsCancellation = true; + this.bgTask.DoWork += new System.ComponentModel.DoWorkEventHandler(this.bgTask_DoWork); + // + // install + // + resources.ApplyResources(this.install, "install"); + this.install.Name = "install"; + this.install.UseVisualStyleBackColor = true; + this.install.Click += new System.EventHandler(this.install_Click); + // + // FileDownloader + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.install); + this.Controls.Add(this.cancel); + this.Controls.Add(this.info); + this.Controls.Add(this.progress); + this.Name = "FileDownloader"; + this.Load += new System.EventHandler(this.FileDownloader_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ProgressBar progress; + private System.Windows.Forms.Label info; + private System.Windows.Forms.Button cancel; + private System.ComponentModel.BackgroundWorker bgTask; + private System.Windows.Forms.Button install; + } +} \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/FileDownloader.cs b/client/administration/UdsAdmin/forms/FileDownloader.cs new file mode 100644 index 000000000..b959d40a3 --- /dev/null +++ b/client/administration/UdsAdmin/forms/FileDownloader.cs @@ -0,0 +1,142 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.Net; +using System.Diagnostics; + +namespace UdsAdmin.forms +{ + public partial class FileDownloader : Form + { + private string _url; + private string _outFile; + private const int BUFFER_SIZE = 8192; + delegate void UpdateDialogCallback(int readed, int length, double speed); + + public FileDownloader(string url) + { + _url = url; + _outFile = System.IO.Path.GetTempPath() + "UDSAdminSetup.exe"; + InitializeComponent(); + Text = Strings.titleDownloader; + } + + private void FileDownloader_Load(object sender, EventArgs e) + { + install.Enabled = false; + bgTask.RunWorkerAsync(); + } + + private void UpdateProgress(int readed, int length, double speed) + { + progress.Maximum = length; + progress.Value = readed; + info.Text = String.Format(Strings.downloadInfo, readed / 1024, length / 1024, speed / 1024); + if (readed == length) + { + install.Enabled = true; + cancel.Text = Strings.exit; + } + } + + private void bgTask_DoWork(object sender, DoWorkEventArgs e) + { + HttpWebRequest req; + HttpWebResponse res; + try + { + req = (HttpWebRequest)WebRequest.Create(_url); + res = (HttpWebResponse)req.GetResponse(); + + int length = (int)res.ContentLength; + + System.IO.FileStream of = new System.IO.FileStream(_outFile, System.IO.FileMode.Create); + int nRead = 0; + + Stopwatch timer = new Stopwatch(); + + byte[] buffer = new byte[BUFFER_SIZE]; + UpdateDialogCallback d = new UpdateDialogCallback(UpdateProgress); + + timer.Start(); + while (true) + { + if (bgTask.CancellationPending) + break; + + int bytesReaded = res.GetResponseStream().Read(buffer, 0, BUFFER_SIZE); + + nRead += bytesReaded; + + double speed = 1000.0 * ((double)nRead) / timer.ElapsedMilliseconds; + + this.Invoke(d, new object[] { nRead, length, speed }); + + if (bytesReaded == 0) + break; + + of.Write(buffer, 0, bytesReaded); + + } + timer.Stop(); + + res.GetResponseStream().Close(); + of.Close(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, Strings.error, MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + } + + private void install_Click(object sender, EventArgs e) + { + Process install = new Process(); + install.StartInfo.FileName = _outFile; + install.Start(); + DialogResult = System.Windows.Forms.DialogResult.OK; + } + + private void cancel_Click(object sender, EventArgs e) + { + bgTask.CancelAsync(); + DialogResult = System.Windows.Forms.DialogResult.Cancel; + } + + } +} diff --git a/client/administration/UdsAdmin/forms/FileDownloader.de.resx b/client/administration/UdsAdmin/forms/FileDownloader.de.resx new file mode 100644 index 000000000..f136f85a3 --- /dev/null +++ b/client/administration/UdsAdmin/forms/FileDownloader.de.resx @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 39, 13 + + + Label1 + + + Abbrechen + + + Installieren + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/FileDownloader.es.resx b/client/administration/UdsAdmin/forms/FileDownloader.es.resx new file mode 100644 index 000000000..8acd0b4d2 --- /dev/null +++ b/client/administration/UdsAdmin/forms/FileDownloader.es.resx @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Top, Left, Right + + + + 12, 12 + + + 331, 23 + + + + 0 + + + progress + + + System.Windows.Forms.ProgressBar, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + + + Top, Left, Right + + + True + + + 12, 38 + + + 35, 13 + + + 1 + + + Label1 + + + info + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + Bottom, Right + + + 268, 54 + + + 75, 23 + + + 4 + + + Cancelar + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + 17, 17 + + + 15, 54 + + + 75, 23 + + + 5 + + + Instalar + + + install + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + True + + + 355, 89 + + + Downloader + + + bgTask + + + System.ComponentModel.BackgroundWorker, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + FileDownloader + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/FileDownloader.fr.resx b/client/administration/UdsAdmin/forms/FileDownloader.fr.resx new file mode 100644 index 000000000..d033b96fc --- /dev/null +++ b/client/administration/UdsAdmin/forms/FileDownloader.fr.resx @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Top, Left, Right + + + + 12, 12 + + + 331, 23 + + + + 0 + + + progress + + + System.Windows.Forms.ProgressBar, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + + + Top, Left, Right + + + True + + + 12, 38 + + + 35, 13 + + + 1 + + + Label1 + + + info + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + Bottom, Right + + + 268, 54 + + + 75, 23 + + + 4 + + + Annuler + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + 17, 17 + + + 15, 54 + + + 75, 23 + + + 5 + + + Installer + + + install + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + True + + + 355, 89 + + + Downloader + + + bgTask + + + System.ComponentModel.BackgroundWorker, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + FileDownloader + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/FileDownloader.resx b/client/administration/UdsAdmin/forms/FileDownloader.resx new file mode 100644 index 000000000..a7da8f7a4 --- /dev/null +++ b/client/administration/UdsAdmin/forms/FileDownloader.resx @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Top, Left, Right + + + + 12, 12 + + + 331, 23 + + + + 0 + + + progress + + + System.Windows.Forms.ProgressBar, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + + + Top, Left, Right + + + True + + + 12, 38 + + + 35, 13 + + + 1 + + + label1 + + + info + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + Bottom, Right + + + 268, 54 + + + 75, 23 + + + 4 + + + Cancel + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + 17, 17 + + + 15, 54 + + + 75, 23 + + + 5 + + + Install + + + install + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + True + + + 355, 89 + + + CenterParent + + + Downloader + + + bgTask + + + System.ComponentModel.BackgroundWorker, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + FileDownloader + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/GroupForm.Designer.cs b/client/administration/UdsAdmin/forms/GroupForm.Designer.cs new file mode 100644 index 000000000..6310134d2 --- /dev/null +++ b/client/administration/UdsAdmin/forms/GroupForm.Designer.cs @@ -0,0 +1,175 @@ +namespace UdsAdmin.forms +{ + partial class GroupForm + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de Windows Forms + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GroupForm)); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.label3 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.name = new System.Windows.Forms.TextBox(); + this.comments = new System.Windows.Forms.TextBox(); + this.searchButton = new System.Windows.Forms.Button(); + this.groupLabel = new System.Windows.Forms.Label(); + this.active = new System.Windows.Forms.CheckBox(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.accept = new System.Windows.Forms.Button(); + this.cancel = new System.Windows.Forms.Button(); + this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); + this.check = new System.Windows.Forms.Button(); + this.tableLayoutPanel1.SuspendLayout(); + this.tableLayoutPanel2.SuspendLayout(); + this.tableLayoutPanel3.SuspendLayout(); + this.SuspendLayout(); + // + // tableLayoutPanel1 + // + resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); + this.tableLayoutPanel1.Controls.Add(this.label3, 0, 2); + this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.name, 1, 0); + this.tableLayoutPanel1.Controls.Add(this.comments, 1, 1); + this.tableLayoutPanel1.Controls.Add(this.searchButton, 2, 0); + this.tableLayoutPanel1.Controls.Add(this.groupLabel, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.active, 1, 2); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + // + // label3 + // + resources.ApplyResources(this.label3, "label3"); + this.label3.Name = "label3"; + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.Name = "label2"; + // + // name + // + resources.ApplyResources(this.name, "name"); + this.name.Name = "name"; + // + // comments + // + this.tableLayoutPanel1.SetColumnSpan(this.comments, 2); + resources.ApplyResources(this.comments, "comments"); + this.comments.Name = "comments"; + // + // searchButton + // + this.searchButton.Image = global::UdsAdmin.Images.find16; + resources.ApplyResources(this.searchButton, "searchButton"); + this.searchButton.Name = "searchButton"; + this.searchButton.UseVisualStyleBackColor = true; + this.searchButton.Click += new System.EventHandler(this.searchButton_Click); + // + // groupLabel + // + resources.ApplyResources(this.groupLabel, "groupLabel"); + this.groupLabel.Name = "groupLabel"; + // + // active + // + resources.ApplyResources(this.active, "active"); + this.active.Checked = true; + this.active.CheckState = System.Windows.Forms.CheckState.Checked; + this.tableLayoutPanel1.SetColumnSpan(this.active, 2); + this.active.Name = "active"; + this.active.UseVisualStyleBackColor = true; + this.active.CheckedChanged += new System.EventHandler(this.active_CheckedChanged); + // + // tableLayoutPanel2 + // + resources.ApplyResources(this.tableLayoutPanel2, "tableLayoutPanel2"); + this.tableLayoutPanel2.Controls.Add(this.accept, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.cancel, 2, 0); + this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel3, 1, 0); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + // + // accept + // + resources.ApplyResources(this.accept, "accept"); + this.accept.Name = "accept"; + this.accept.UseVisualStyleBackColor = true; + this.accept.Click += new System.EventHandler(this.accept_Click); + // + // cancel + // + resources.ApplyResources(this.cancel, "cancel"); + this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancel.Name = "cancel"; + this.cancel.UseVisualStyleBackColor = true; + this.cancel.Click += new System.EventHandler(this.cancel_Click); + // + // tableLayoutPanel3 + // + resources.ApplyResources(this.tableLayoutPanel3, "tableLayoutPanel3"); + this.tableLayoutPanel3.Controls.Add(this.check, 1, 0); + this.tableLayoutPanel3.Name = "tableLayoutPanel3"; + // + // check + // + resources.ApplyResources(this.check, "check"); + this.check.Name = "check"; + this.check.UseVisualStyleBackColor = true; + // + // GroupForm + // + this.AcceptButton = this.accept; + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.cancel; + this.Controls.Add(this.tableLayoutPanel2); + this.Controls.Add(this.tableLayoutPanel1); + this.Name = "GroupForm"; + this.Load += new System.EventHandler(this.GroupForm_Load); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel3.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Label groupLabel; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Button searchButton; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.Button accept; + private System.Windows.Forms.Button cancel; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; + private System.Windows.Forms.Button check; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.CheckBox active; + public System.Windows.Forms.TextBox name; + public System.Windows.Forms.TextBox comments; + } +} \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/GroupForm.cs b/client/administration/UdsAdmin/forms/GroupForm.cs new file mode 100644 index 000000000..ea900236b --- /dev/null +++ b/client/administration/UdsAdmin/forms/GroupForm.cs @@ -0,0 +1,109 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.forms +{ + public partial class GroupForm : Form + { + private xmlrpc.Authenticator _auth; + private xmlrpc.AuthenticatorType _authType; + + public GroupForm(xmlrpc.Authenticator auth, xmlrpc.AuthenticatorType authType) + { + _auth = auth; + _authType = authType; + InitializeComponent(); + Text = Strings.titleGroup; + } + + private void GroupForm_Load(object sender, EventArgs e) + { + active.Checked = true; + active.Text = Strings.active; + if (_authType.canSearchGroups) + { + searchButton.Enabled = true; + check.Visible = true; + } + else + { + searchButton.Enabled = false; + check.Visible = false; + } + groupLabel.Text = _authType.groupNameLabel; + //this.Location = System.Windows.Forms.Cursor.Position; + } + + private void searchButton_Click(object sender, EventArgs e) + { + SearchForm form = new SearchForm(SearchForm.Type.groupSearch, _auth, name.Text); + if (form.ShowDialog() == System.Windows.Forms.DialogResult.Yes) + name.Text = form.selection; + } + + private void accept_Click(object sender, EventArgs e) + { + if (name.Text.Trim().Length == 0) + { + gui.UserNotifier.notifyError(Strings.nameRequired); + return; + } + xmlrpc.Group grp = new xmlrpc.Group(); + grp.idParent = _auth.id; grp.id = ""; grp.name = name.Text; grp.comments = comments.Text; grp.active = active.Checked; + try + { + xmlrpc.UdsAdminService.CreateGroup(grp); + DialogResult = System.Windows.Forms.DialogResult.OK; + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + } + + private void active_CheckedChanged(object sender, EventArgs e) + { + active.Text = active.Checked ? Strings.active : Strings.inactive; + } + + private void cancel_Click(object sender, EventArgs e) + { + DialogResult = System.Windows.Forms.DialogResult.Cancel; + } + } +} diff --git a/client/administration/UdsAdmin/forms/GroupForm.de.resx b/client/administration/UdsAdmin/forms/GroupForm.de.resx new file mode 100644 index 000000000..c4266474e --- /dev/null +++ b/client/administration/UdsAdmin/forms/GroupForm.de.resx @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAD///8A////AP///wD///8A////AP///wD+/v8A////AP///wD+//4A////AP///wD///8A////AP// + /wD///8A9PT7AL295/+4uOr/zMzx/+rq+sz///8A////AP///wD///8A////AP///wDj9uf/vejG/6nc + sf+327v/8vjyAF9fv/8oKLb/S0vL/29v2v+NjeT/k5Tk/7287f/6+/4A+v36AKrhtP9p0oT/XNF8/zzC + W/8dqjb/DY8d/0CVRv9eXrz/ICCx/1ZWz/99fd//mpro/3l32P9ITND/////AP///wAdrTr/RsNi/2jY + iP9Jymn/J7FB/weHFv9CkUf/tbXi/2Bgyv8xMb7/Xl7S/3Bw2P9RWtr/VU+4/8yajv/LoYz/OZxA/zK3 + U/9Gv1//LbZJ/wmXHf9Grlf/pc6n//7+/wCpqeD/Y2LR/ywtuf81MLH/j3Gf/8aCYf/ei0D/4YZH/7yQ + S/9ulEH/F4oe/wqRHf82tVD/n9Gj//7+/gD9/f4A////AMzM7f8vMLT/QDy4/3ZVif/VgD3/0n5C/9F+ + QP/RcDP/XXok/yKVLP8UiyL/xOPI/////wD9/f0A/Pz+APz8/gDh4fP/Kyqy/yssvP8IDpz/nEMu/8JW + Fv/AThj/mEwV/wFoDP8Kkx3/D4od/97s3//8/fwA/P38APv7/QD///8AlpbO/xgYoP8RD5L/AgSQ/4g/ + Sv/AVBX/uEEZ/4BgNv8CWQL/BWEG/wRyDf+SuJP/////APv8+wD6+vwA////AH9/vP8hIab/Liyh/42W + 8/+eboH/rTgF/8VqTf/EyLv/a9mI/x54JP8MeRb/eqF9/////wD6+/oA/f39AP///wDU1Nr/enrH/y8w + pv+mpMT/r2la/6s3CP/Wdjf/5NbJ/5C3nf8dfib/Za9x/9PW0/////8A/f3+AP///wD///8A////AO3t + 82bZ2d//8+/v/5spE/+SIQT/t00Y/+qzkv////8A1dXV/+7x7kT///8A////AP///wD///8A////AP7+ + /gD///8A////APHf2/+gMg7/kyUL/5UiA//JfmH///7+AP///wD///8A/v7+AP///wD///8A////AP// + /wD///8A/f3+AP78/AD8+fkAzolo/71fMf+WIQL/3ruy///+/gD8+voA/v7+AP///wD///8A////AP// + /wD///8A////AP///wD//v4A////APr29QDbtq7/58/K/////wD//v4A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD//v4A////AP///wD///8A////AP// + /wD///8A//8AAIfhAAABgAAAAYAAAAAAAACAAQAAwAMAAMADAADAAwAAwAMAAMADAADwLwAA+D8AAPw/ + AAD+fwAA//8AAA== + + + + Staat + + + Kommentare + + + Gruppenname + + + Aktive + + + Akzeptieren + + + Abbrechen + + + Überprüfen Sie Namen + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/GroupForm.es.resx b/client/administration/UdsAdmin/forms/GroupForm.es.resx new file mode 100644 index 000000000..1bb71712b --- /dev/null +++ b/client/administration/UdsAdmin/forms/GroupForm.es.resx @@ -0,0 +1,331 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Estado + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Comentarios + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + comments + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + searchButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + Nombre del grupo + + + groupLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 5 + + + Activo + + + active + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 6 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Aceptar + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Cancelar + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + Nombre del cheque + + + check + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel3 + + + 0 + + + tableLayoutPanel3 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + + + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAD///8A////AP///wD///8A////AP///wD+/v8A////AP///wD+//4A////AP///wD///8A////AP// + /wD///8A9PT7AL295/+4uOr/zMzx/+rq+sz///8A////AP///wD///8A////AP///wDj9uf/vejG/6nc + sf+327v/8vjyAF9fv/8oKLb/S0vL/29v2v+NjeT/k5Tk/7287f/6+/4A+v36AKrhtP9p0oT/XNF8/zzC + W/8dqjb/DY8d/0CVRv9eXrz/ICCx/1ZWz/99fd//mpro/3l32P9ITND/////AP///wAdrTr/RsNi/2jY + iP9Jymn/J7FB/weHFv9CkUf/tbXi/2Bgyv8xMb7/Xl7S/3Bw2P9RWtr/VU+4/8yajv/LoYz/OZxA/zK3 + U/9Gv1//LbZJ/wmXHf9Grlf/pc6n//7+/wCpqeD/Y2LR/ywtuf81MLH/j3Gf/8aCYf/ei0D/4YZH/7yQ + S/9ulEH/F4oe/wqRHf82tVD/n9Gj//7+/gD9/f4A////AMzM7f8vMLT/QDy4/3ZVif/VgD3/0n5C/9F+ + QP/RcDP/XXok/yKVLP8UiyL/xOPI/////wD9/f0A/Pz+APz8/gDh4fP/Kyqy/yssvP8IDpz/nEMu/8JW + Fv/AThj/mEwV/wFoDP8Kkx3/D4od/97s3//8/fwA/P38APv7/QD///8AlpbO/xgYoP8RD5L/AgSQ/4g/ + Sv/AVBX/uEEZ/4BgNv8CWQL/BWEG/wRyDf+SuJP/////APv8+wD6+vwA////AH9/vP8hIab/Liyh/42W + 8/+eboH/rTgF/8VqTf/EyLv/a9mI/x54JP8MeRb/eqF9/////wD6+/oA/f39AP///wDU1Nr/enrH/y8w + pv+mpMT/r2la/6s3CP/Wdjf/5NbJ/5C3nf8dfib/Za9x/9PW0/////8A/f3+AP///wD///8A////AO3t + 82bZ2d//8+/v/5spE/+SIQT/t00Y/+qzkv////8A1dXV/+7x7kT///8A////AP///wD///8A////AP7+ + /gD///8A////APHf2/+gMg7/kyUL/5UiA//JfmH///7+AP///wD///8A/v7+AP///wD///8A////AP// + /wD///8A/f3+AP78/AD8+fkAzolo/71fMf+WIQL/3ruy///+/gD8+voA/v7+AP///wD///8A////AP// + /wD///8A////AP///wD//v4A////APr29QDbtq7/58/K/////wD//v4A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD//v4A////AP///wD///8A////AP// + /wD///8A//8AAIfhAAABgAAAAYAAAAAAAACAAQAAwAMAAMADAADAAwAAwAMAAMADAADwLwAA+D8AAPw/ + AAD+fwAA//8AAA== + + + + Groups + + + GroupForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/GroupForm.fr.resx b/client/administration/UdsAdmin/forms/GroupForm.fr.resx new file mode 100644 index 000000000..fe40ab76d --- /dev/null +++ b/client/administration/UdsAdmin/forms/GroupForm.fr.resx @@ -0,0 +1,331 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + État + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Commentaires + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + comments + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + searchButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + Nom du groupe + + + groupLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 5 + + + Active + + + active + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 6 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Accepter + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Annuler + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + Vérifiez le nom + + + check + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel3 + + + 0 + + + tableLayoutPanel3 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + + + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAD///8A////AP///wD///8A////AP///wD+/v8A////AP///wD+//4A////AP///wD///8A////AP// + /wD///8A9PT7AL295/+4uOr/zMzx/+rq+sz///8A////AP///wD///8A////AP///wDj9uf/vejG/6nc + sf+327v/8vjyAF9fv/8oKLb/S0vL/29v2v+NjeT/k5Tk/7287f/6+/4A+v36AKrhtP9p0oT/XNF8/zzC + W/8dqjb/DY8d/0CVRv9eXrz/ICCx/1ZWz/99fd//mpro/3l32P9ITND/////AP///wAdrTr/RsNi/2jY + iP9Jymn/J7FB/weHFv9CkUf/tbXi/2Bgyv8xMb7/Xl7S/3Bw2P9RWtr/VU+4/8yajv/LoYz/OZxA/zK3 + U/9Gv1//LbZJ/wmXHf9Grlf/pc6n//7+/wCpqeD/Y2LR/ywtuf81MLH/j3Gf/8aCYf/ei0D/4YZH/7yQ + S/9ulEH/F4oe/wqRHf82tVD/n9Gj//7+/gD9/f4A////AMzM7f8vMLT/QDy4/3ZVif/VgD3/0n5C/9F+ + QP/RcDP/XXok/yKVLP8UiyL/xOPI/////wD9/f0A/Pz+APz8/gDh4fP/Kyqy/yssvP8IDpz/nEMu/8JW + Fv/AThj/mEwV/wFoDP8Kkx3/D4od/97s3//8/fwA/P38APv7/QD///8AlpbO/xgYoP8RD5L/AgSQ/4g/ + Sv/AVBX/uEEZ/4BgNv8CWQL/BWEG/wRyDf+SuJP/////APv8+wD6+vwA////AH9/vP8hIab/Liyh/42W + 8/+eboH/rTgF/8VqTf/EyLv/a9mI/x54JP8MeRb/eqF9/////wD6+/oA/f39AP///wDU1Nr/enrH/y8w + pv+mpMT/r2la/6s3CP/Wdjf/5NbJ/5C3nf8dfib/Za9x/9PW0/////8A/f3+AP///wD///8A////AO3t + 82bZ2d//8+/v/5spE/+SIQT/t00Y/+qzkv////8A1dXV/+7x7kT///8A////AP///wD///8A////AP7+ + /gD///8A////APHf2/+gMg7/kyUL/5UiA//JfmH///7+AP///wD///8A/v7+AP///wD///8A////AP// + /wD///8A/f3+AP78/AD8+fkAzolo/71fMf+WIQL/3ruy///+/gD8+voA/v7+AP///wD///8A////AP// + /wD///8A////AP///wD//v4A////APr29QDbtq7/58/K/////wD//v4A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD//v4A////AP///wD///8A////AP// + /wD///8A//8AAIfhAAABgAAAAYAAAAAAAACAAQAAwAMAAMADAADAAwAAwAMAAMADAADwLwAA+D8AAPw/ + AAD+fwAA//8AAA== + + + + Groups + + + GroupForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/GroupForm.resx b/client/administration/UdsAdmin/forms/GroupForm.resx new file mode 100644 index 000000000..3379184d9 --- /dev/null +++ b/client/administration/UdsAdmin/forms/GroupForm.resx @@ -0,0 +1,543 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Top, Left, Right + + + + 3 + + + True + + + + 3, 56 + + + 3, 6, 3, 0 + + + 32, 13 + + + 7 + + + State + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + True + + + 3, 31 + + + 3, 6, 3, 0 + + + 56, 13 + + + 1 + + + Comments + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + Fill + + + 71, 3 + + + 231, 20 + + + 2 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + Fill + + + 71, 28 + + + 299, 20 + + + 3 + + + comments + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + 308, 3 + + + 30, 19 + + + 4 + + + searchButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + True + + + 3, 6 + + + 3, 6, 3, 0 + + + 39, 19 + + + 0 + + + Group Name + + + groupLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 5 + + + Button + + + True + + + Fill + + + 71, 56 + + + 3, 6, 3, 3 + + + 299, 26 + + + 6 + + + Active + + + MiddleCenter + + + active + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 6 + + + 12, 12 + + + 3 + + + 373, 85 + + + 0 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label3" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="name" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="comments" Row="1" RowSpan="1" Column="1" ColumnSpan="2" /><Control Name="searchButton" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="groupLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="active" Row="2" RowSpan="1" Column="1" ColumnSpan="2" /></Controls><Columns Styles="Percent,22,52252,Percent,77,47748,Absolute,67" /><Rows Styles="Percent,30,Percent,30,Percent,40" /></TableLayoutSettings> + + + 3 + + + Bottom, Left, Right + + + 3, 7 + + + 113, 23 + + + 0 + + + Accept + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Bottom, Left, Right + + + 280, 7 + + + 114, 23 + + + 1 + + + Cancel + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + 3 + + + Fill + + + 33, 3 + + + 85, 21 + + + 0 + + + Check name + + + check + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel3 + + + 0 + + + 122, 3 + + + 1 + + + 152, 27 + + + 2 + + + tableLayoutPanel3 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="check" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,20,Percent,60,Percent,20" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + Bottom + + + 0, 131 + + + 1 + + + 397, 33 + + + 6 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="accept" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cancel" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="tableLayoutPanel3" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 397, 164 + + + + AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAD///8A////AP///wD///8A////AP///wD+/v8A////AP///wD+//4A////AP///wD///8A////AP// + /wD///8A9PT7AL295/+4uOr/zMzx/+rq+sz///8A////AP///wD///8A////AP///wDj9uf/vejG/6nc + sf+327v/8vjyAF9fv/8oKLb/S0vL/29v2v+NjeT/k5Tk/7287f/6+/4A+v36AKrhtP9p0oT/XNF8/zzC + W/8dqjb/DY8d/0CVRv9eXrz/ICCx/1ZWz/99fd//mpro/3l32P9ITND/////AP///wAdrTr/RsNi/2jY + iP9Jymn/J7FB/weHFv9CkUf/tbXi/2Bgyv8xMb7/Xl7S/3Bw2P9RWtr/VU+4/8yajv/LoYz/OZxA/zK3 + U/9Gv1//LbZJ/wmXHf9Grlf/pc6n//7+/wCpqeD/Y2LR/ywtuf81MLH/j3Gf/8aCYf/ei0D/4YZH/7yQ + S/9ulEH/F4oe/wqRHf82tVD/n9Gj//7+/gD9/f4A////AMzM7f8vMLT/QDy4/3ZVif/VgD3/0n5C/9F+ + QP/RcDP/XXok/yKVLP8UiyL/xOPI/////wD9/f0A/Pz+APz8/gDh4fP/Kyqy/yssvP8IDpz/nEMu/8JW + Fv/AThj/mEwV/wFoDP8Kkx3/D4od/97s3//8/fwA/P38APv7/QD///8AlpbO/xgYoP8RD5L/AgSQ/4g/ + Sv/AVBX/uEEZ/4BgNv8CWQL/BWEG/wRyDf+SuJP/////APv8+wD6+vwA////AH9/vP8hIab/Liyh/42W + 8/+eboH/rTgF/8VqTf/EyLv/a9mI/x54JP8MeRb/eqF9/////wD6+/oA/f39AP///wDU1Nr/enrH/y8w + pv+mpMT/r2la/6s3CP/Wdjf/5NbJ/5C3nf8dfib/Za9x/9PW0/////8A/f3+AP///wD///8A////AO3t + 82bZ2d//8+/v/5spE/+SIQT/t00Y/+qzkv////8A1dXV/+7x7kT///8A////AP///wD///8A////AP7+ + /gD///8A////APHf2/+gMg7/kyUL/5UiA//JfmH///7+AP///wD///8A/v7+AP///wD///8A////AP// + /wD///8A/f3+AP78/AD8+fkAzolo/71fMf+WIQL/3ruy///+/gD8+voA/v7+AP///wD///8A////AP// + /wD///8A////AP///wD//v4A////APr29QDbtq7/58/K/////wD//v4A////AP///wD///8A////AP// + /wD///8A////AP///wD///8A////AP///wD///8A////AP///wD//v4A////AP///wD///8A////AP// + /wD///8A//8AAIfhAAABgAAAAYAAAAAAAACAAQAAwAMAAMADAADAAwAAwAMAAMADAADwLwAA+D8AAPw/ + AAD+fwAA//8AAA== + + + + CenterParent + + + Groups + + + GroupForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/LoginForm.Designer.cs b/client/administration/UdsAdmin/forms/LoginForm.Designer.cs new file mode 100644 index 000000000..9b414cbb6 --- /dev/null +++ b/client/administration/UdsAdmin/forms/LoginForm.Designer.cs @@ -0,0 +1,157 @@ +namespace UdsAdmin.forms +{ + partial class LoginForm + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de Windows Forms + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LoginForm)); + this.label1 = new System.Windows.Forms.Label(); + this.serverCombo = new System.Windows.Forms.ComboBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.username = new System.Windows.Forms.TextBox(); + this.passwordText = new System.Windows.Forms.TextBox(); + this.connectButton = new System.Windows.Forms.Button(); + this.exitButton = new System.Windows.Forms.Button(); + this.useSSLCheck = new System.Windows.Forms.CheckBox(); + this.extendButton = new System.Windows.Forms.Button(); + this.label4 = new System.Windows.Forms.Label(); + this.authenticator = new System.Windows.Forms.ComboBox(); + this.SuspendLayout(); + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // + // serverCombo + // + this.serverCombo.FormattingEnabled = true; + resources.ApplyResources(this.serverCombo, "serverCombo"); + this.serverCombo.Name = "serverCombo"; + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.Name = "label2"; + // + // label3 + // + resources.ApplyResources(this.label3, "label3"); + this.label3.Name = "label3"; + // + // username + // + resources.ApplyResources(this.username, "username"); + this.username.Name = "username"; + // + // passwordText + // + resources.ApplyResources(this.passwordText, "passwordText"); + this.passwordText.Name = "passwordText"; + this.passwordText.UseSystemPasswordChar = true; + // + // connectButton + // + resources.ApplyResources(this.connectButton, "connectButton"); + this.connectButton.Name = "connectButton"; + this.connectButton.UseVisualStyleBackColor = true; + this.connectButton.Click += new System.EventHandler(this.button1_Click); + // + // exitButton + // + this.exitButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + resources.ApplyResources(this.exitButton, "exitButton"); + this.exitButton.Name = "exitButton"; + this.exitButton.UseVisualStyleBackColor = true; + this.exitButton.Click += new System.EventHandler(this.exit_Click); + // + // useSSLCheck + // + resources.ApplyResources(this.useSSLCheck, "useSSLCheck"); + this.useSSLCheck.Name = "useSSLCheck"; + this.useSSLCheck.UseVisualStyleBackColor = true; + // + // extendButton + // + resources.ApplyResources(this.extendButton, "extendButton"); + this.extendButton.Name = "extendButton"; + this.extendButton.UseVisualStyleBackColor = true; + this.extendButton.Click += new System.EventHandler(this.button2_Click); + // + // label4 + // + resources.ApplyResources(this.label4, "label4"); + this.label4.Name = "label4"; + // + // authenticator + // + this.authenticator.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.authenticator.FormattingEnabled = true; + resources.ApplyResources(this.authenticator, "authenticator"); + this.authenticator.Name = "authenticator"; + // + // LoginForm + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.authenticator); + this.Controls.Add(this.label4); + this.Controls.Add(this.extendButton); + this.Controls.Add(this.useSSLCheck); + this.Controls.Add(this.exitButton); + this.Controls.Add(this.connectButton); + this.Controls.Add(this.passwordText); + this.Controls.Add(this.username); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.serverCombo); + this.Controls.Add(this.label1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Name = "LoginForm"; + this.Load += new System.EventHandler(this.LoginForm_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.ComboBox serverCombo; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox username; + private System.Windows.Forms.TextBox passwordText; + private System.Windows.Forms.Button connectButton; + private System.Windows.Forms.Button exitButton; + private System.Windows.Forms.CheckBox useSSLCheck; + private System.Windows.Forms.Button extendButton; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.ComboBox authenticator; + } +} \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/LoginForm.cs b/client/administration/UdsAdmin/forms/LoginForm.cs new file mode 100644 index 000000000..207ae37ef --- /dev/null +++ b/client/administration/UdsAdmin/forms/LoginForm.cs @@ -0,0 +1,199 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.forms +{ + public partial class LoginForm : Form + { + private const int HEIGHT_REDUCED = 80; + private const int HEIGHT_EXPANDED = 220; + + private string savedAuth = ""; + private string savedUser = ""; + + public LoginForm() + { + InitializeComponent(); + Height = HEIGHT_REDUCED; + Text = Strings.titleLogin; + } + + private void LoginForm_Load(object sender, EventArgs e) + { + LoadFormData(); + AcceptButton = extendButton; + } + + private void exit_Click(object sender, EventArgs e) + { + DialogResult = System.Windows.Forms.DialogResult.Cancel; + } + + private void button1_Click(object sender, EventArgs e) + { + try + { + string auth = ""; + if (authenticator.SelectedItem != null) + auth = ((xmlrpc.SimpleInfo)authenticator.SelectedItem).id; + xmlrpc.UdsAdminService.Login(username.Text, passwordText.Text, auth); + SaveAuthUser(); + DialogResult = System.Windows.Forms.DialogResult.OK; + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + if (ex.FaultCode == xmlrpc.ExceptionExplainer.AUTH_FAILED) + MessageBox.Show(Strings.invalidCredentials, Strings.error, MessageBoxButtons.OK, MessageBoxIcon.Error); + else + gui.UserNotifier.notifyRpcException(ex); + } + catch (exceptions.NewVersionRequiredException ex) + { + if (MessageBox.Show(Strings.newVersionRequired, Strings.downloadQuery, MessageBoxButtons.YesNo, MessageBoxIcon.Hand) == System.Windows.Forms.DialogResult.Yes) + { + string url = "http" + (useSSLCheck.Checked ? "s" : "") + "://" + serverCombo.Text + ex.Url; + (new FileDownloader(url)).ShowDialog(); + } + DialogResult = System.Windows.Forms.DialogResult.Cancel; + } + } + + private void button2_Click(object sender, EventArgs e) + { + if (extendButton.Text == ">>>") + { + try + { + xmlrpc.SimpleInfo[] info = xmlrpc.UdsAdminService.GetAdminAuths(serverCombo.Text, useSSLCheck.Checked); + authenticator.Items.Clear(); + foreach( xmlrpc.SimpleInfo i in info) + { + authenticator.Items.Add(i); + } + if (info.Length > 0) + authenticator.SelectedIndex = 0; + SaveServerData(); + SetAuthUser(); + } + catch (exceptions.CommunicationException) + { + MessageBox.Show(Strings.cantConnect); + return; + } + extendButton.Text = "<<<"; + serverCombo.Enabled = false; + useSSLCheck.Enabled = false; + Height = HEIGHT_EXPANDED; + username.Focus(); + AcceptButton = connectButton; + } + else + { + extendButton.Text = ">>>"; + serverCombo.Enabled = true; + useSSLCheck.Enabled = true; + Height = HEIGHT_REDUCED; + AcceptButton = extendButton; + } + } + + private void SaveServerData() + { + List items = new List(); + bool addNewItem = true; + string value = serverCombo.Text; + foreach (object i in serverCombo.Items) + { + string s = i.ToString(); + items.Add(s); + if (s == value) + addNewItem = false; + } + if (addNewItem) + { + items.Add(value); + serverCombo.Items.Add(value); + } + Application.UserAppDataRegistry.SetValue("server", string.Join(",", items.ToArray())); + Application.UserAppDataRegistry.SetValue("ssl", useSSLCheck.Checked ? "y" : "n"); + } + + private void SetAuthUser() + { + if (savedAuth != "") + { + foreach (xmlrpc.SimpleInfo i in authenticator.Items) + { + if (i.id == savedAuth) + { + authenticator.SelectedItem = i; + break; + } + } + } + if (savedUser != "") + { + username.Text = savedUser; + } + } + + private void SaveAuthUser() + { + savedAuth = ((xmlrpc.SimpleInfo)authenticator.SelectedItem).id; + savedUser = username.Text; + Application.UserAppDataRegistry.SetValue("auth", savedAuth); + Application.UserAppDataRegistry.SetValue("user", savedUser); + } + + private void LoadFormData() + { + string server = (string)Application.UserAppDataRegistry.GetValue("server", ""); + if (server != "") + { + string[] items = server.Split(','); + serverCombo.Items.Clear(); + foreach (string i in items) + serverCombo.Items.Insert(0, i); + } + useSSLCheck.Checked = ((string)Application.UserAppDataRegistry.GetValue("ssl", "n")) == "y"; + savedAuth = (string)Application.UserAppDataRegistry.GetValue("auth", ""); + savedUser = (string)Application.UserAppDataRegistry.GetValue("user", ""); + } + + } +} diff --git a/client/administration/UdsAdmin/forms/LoginForm.de.resx b/client/administration/UdsAdmin/forms/LoginForm.de.resx new file mode 100644 index 000000000..980c8b30e --- /dev/null +++ b/client/administration/UdsAdmin/forms/LoginForm.de.resx @@ -0,0 +1,457 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 12, 18 + + + 116, 18 + + + + 0 + + + Server + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 11 + + + 134, 4 + + + 258, 21 + + + 1 + + + serverCombo + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 10 + + + 12, 91 + + + 116, 18 + + + 2 + + + Benutzername + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 9 + + + 12, 117 + + + 116, 18 + + + 3 + + + Passwort + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 8 + + + 134, 88 + + + 258, 20 + + + 4 + + + username + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 7 + + + 135, 114 + + + 32 + + + 257, 20 + + + 5 + + + passwordText + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 6 + + + 79, 152 + + + 75, 23 + + + 6 + + + Verbinden + + + button1 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 5 + + + 276, 152 + + + 75, 23 + + + 7 + + + Ausfahrt + + + exit + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 4 + + + True + + + 134, 31 + + + 68, 17 + + + 9 + + + Verwendung SSL + + + useSSLCheck + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + + + 362, 27 + + + 30, 23 + + + 10 + + + >>> + + + button2 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + + NoControl + + + 12, 64 + + + 116, 18 + + + 11 + + + Authentifikator + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + 135, 61 + + + 257, 21 + + + 12 + + + authenticator + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 402, 193 + + + + AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AABeBwAAZRAMAGMQDQBkEA0AZxINAGcUDwBrFhAAbRgMAG8YEQBxGxAAbxsTAHAbEwByGxQAdRwSAHUd + EgByHhUAex8TAH8iFAB3IxcAdiMZAIEkFQCGJRUAkiYOAHclGwCLKREAhyoaAKArDwCGKxsAlCwXAI0t + GAB8LCIAqi4MAJQtGACULxUAey8iAIEvIACQMB4AmjEZAIMxIwCJMiAAmTMZAJU0HQCGNCYAozUaAJ81 + HgCVNiAAiDcmAKU4HACpOBsArDsdALo8FQCrPh8AuEIfALNDIQC5RCEAw0UdAJJEMgDCRiAApEUvALlH + IwCURzAAsUksAMZKIgC8TCMAv00nAM5NIgDDTikAvFIrANRSJADUUyUAvVQtAKJVPADTVigAyFctANBZ + KwDXWSkA3VopAM1cLgDUXiwAz14vAOFgLQDkZjEAwGhCAONrNQDEa0QAxm1HAO1xNgClbGMA6XM6ALdz + WQDvfUAA7X5CAO5/QgDvf0IA7oBDAO+ERQDuhEYA74RGAOqGSgDohksA6YZLAOmITQDpiU0A8IlMAOuK + TwDukFQA6pRbAPGVVwCwjosAzZJ0ANuqkADeycYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAcHBwcHA8cFRwUnAicHBwcHBwBxhOWl1eXlxdUyEAbHBwcBpDa2hkZWZlY2dGH3BwcHAsP2pp + YF9hW1hRSzJvcHBwcFVwSUpIRURBOTYWcHBwcFdZKRwrO0AxLygdcHBwcHBwcHAQM01PNRUOcHBwcHBw + cHBwcBEkOhkEcHBwcHBwcHBwcHBwG0I9cHBwcHBwcHBwcHBwLi03VmJwcHBwcHBwcHBwChcUNFBwcHBw + cHBwcHBwcAYFCCU+THBwcHBwcHBwcHAMAQINIDBwcHBwcHBwcHBwKkcjAwsncHBwcHBwcHBwcBJubQkm + cHBwcHBwcHBwcHBwHjgPE3BwcHBwcPqvAADAAQAAwAMAAMABAADoAwAAwAcAAPgPAAD8HwAA/j8AAPwf + AAD4PwAA+B8AAPgfAAD4HwAA+D8AAPw/AAA= + + + + CenterScreen + + + UDS Administration + + + LoginForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/LoginForm.es.resx b/client/administration/UdsAdmin/forms/LoginForm.es.resx new file mode 100644 index 000000000..27af22c5b --- /dev/null +++ b/client/administration/UdsAdmin/forms/LoginForm.es.resx @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Servidor + + + Usuario + + + Contraseña + + + Conectar + + + Salir + + + + 71, 17 + + + Usar SSL + + + Administración de UDS + + + >>> + + + Autenticador + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/LoginForm.fr.resx b/client/administration/UdsAdmin/forms/LoginForm.fr.resx new file mode 100644 index 000000000..7df1d308a --- /dev/null +++ b/client/administration/UdsAdmin/forms/LoginForm.fr.resx @@ -0,0 +1,457 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 12, 18 + + + 116, 18 + + + + 0 + + + Serveur + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 11 + + + 134, 4 + + + 258, 21 + + + 1 + + + serverCombo + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 10 + + + 12, 91 + + + 116, 18 + + + 2 + + + Nom d'utilisateur + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 9 + + + 12, 117 + + + 116, 18 + + + 3 + + + Mot de passe + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 8 + + + 134, 88 + + + 258, 20 + + + 4 + + + username + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 7 + + + 135, 114 + + + 32 + + + 257, 20 + + + 5 + + + passwordText + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 6 + + + 79, 152 + + + 75, 23 + + + 6 + + + Se connecter + + + button1 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 5 + + + 276, 152 + + + 75, 23 + + + 7 + + + Sortie + + + exit + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 4 + + + True + + + 134, 31 + + + 68, 17 + + + 9 + + + Utilisation SSL + + + useSSLCheck + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + + + 362, 27 + + + 30, 23 + + + 10 + + + >>> + + + button2 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + + NoControl + + + 12, 64 + + + 116, 18 + + + 11 + + + Authentificateur + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + 135, 61 + + + 257, 21 + + + 12 + + + authenticator + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 402, 193 + + + + AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AABeBwAAZRAMAGMQDQBkEA0AZxINAGcUDwBrFhAAbRgMAG8YEQBxGxAAbxsTAHAbEwByGxQAdRwSAHUd + EgByHhUAex8TAH8iFAB3IxcAdiMZAIEkFQCGJRUAkiYOAHclGwCLKREAhyoaAKArDwCGKxsAlCwXAI0t + GAB8LCIAqi4MAJQtGACULxUAey8iAIEvIACQMB4AmjEZAIMxIwCJMiAAmTMZAJU0HQCGNCYAozUaAJ81 + HgCVNiAAiDcmAKU4HACpOBsArDsdALo8FQCrPh8AuEIfALNDIQC5RCEAw0UdAJJEMgDCRiAApEUvALlH + IwCURzAAsUksAMZKIgC8TCMAv00nAM5NIgDDTikAvFIrANRSJADUUyUAvVQtAKJVPADTVigAyFctANBZ + KwDXWSkA3VopAM1cLgDUXiwAz14vAOFgLQDkZjEAwGhCAONrNQDEa0QAxm1HAO1xNgClbGMA6XM6ALdz + WQDvfUAA7X5CAO5/QgDvf0IA7oBDAO+ERQDuhEYA74RGAOqGSgDohksA6YZLAOmITQDpiU0A8IlMAOuK + TwDukFQA6pRbAPGVVwCwjosAzZJ0ANuqkADeycYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAcHBwcHA8cFRwUnAicHBwcHBwBxhOWl1eXlxdUyEAbHBwcBpDa2hkZWZlY2dGH3BwcHAsP2pp + YF9hW1hRSzJvcHBwcFVwSUpIRURBOTYWcHBwcFdZKRwrO0AxLygdcHBwcHBwcHAQM01PNRUOcHBwcHBw + cHBwcBEkOhkEcHBwcHBwcHBwcHBwG0I9cHBwcHBwcHBwcHBwLi03VmJwcHBwcHBwcHBwChcUNFBwcHBw + cHBwcHBwcAYFCCU+THBwcHBwcHBwcHAMAQINIDBwcHBwcHBwcHBwKkcjAwsncHBwcHBwcHBwcBJubQkm + cHBwcHBwcHBwcHBwHjgPE3BwcHBwcPqvAADAAQAAwAMAAMABAADoAwAAwAcAAPgPAAD8HwAA/j8AAPwf + AAD4PwAA+B8AAPgfAAD4HwAA+D8AAPw/AAA= + + + + CenterScreen + + + UDS Administration + + + LoginForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/LoginForm.resx b/client/administration/UdsAdmin/forms/LoginForm.resx new file mode 100644 index 000000000..5080e1626 --- /dev/null +++ b/client/administration/UdsAdmin/forms/LoginForm.resx @@ -0,0 +1,457 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 12, 18 + + + 116, 18 + + + + 0 + + + Server + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 11 + + + 134, 4 + + + 258, 21 + + + 1 + + + serverCombo + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 10 + + + 12, 91 + + + 116, 18 + + + 2 + + + Username + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 9 + + + 12, 117 + + + 116, 18 + + + 3 + + + Password + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 8 + + + 134, 88 + + + 258, 20 + + + 4 + + + username + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 7 + + + 135, 114 + + + 32 + + + 257, 20 + + + 5 + + + passwordText + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 6 + + + 79, 152 + + + 75, 23 + + + 6 + + + Connect + + + connectButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 5 + + + 276, 152 + + + 75, 23 + + + 7 + + + Exit + + + exitButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 4 + + + True + + + 134, 31 + + + 68, 17 + + + 9 + + + Use SSL + + + useSSLCheck + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + + + 362, 27 + + + 30, 23 + + + 10 + + + >>> + + + extendButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + + NoControl + + + 12, 64 + + + 116, 18 + + + 11 + + + Authenticator + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + 135, 61 + + + 257, 21 + + + 12 + + + authenticator + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 402, 193 + + + + AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AABeBwAAZRAMAGMQDQBkEA0AZxINAGcUDwBrFhAAbRgMAG8YEQBxGxAAbxsTAHAbEwByGxQAdRwSAHUd + EgByHhUAex8TAH8iFAB3IxcAdiMZAIEkFQCGJRUAkiYOAHclGwCLKREAhyoaAKArDwCGKxsAlCwXAI0t + GAB8LCIAqi4MAJQtGACULxUAey8iAIEvIACQMB4AmjEZAIMxIwCJMiAAmTMZAJU0HQCGNCYAozUaAJ81 + HgCVNiAAiDcmAKU4HACpOBsArDsdALo8FQCrPh8AuEIfALNDIQC5RCEAw0UdAJJEMgDCRiAApEUvALlH + IwCURzAAsUksAMZKIgC8TCMAv00nAM5NIgDDTikAvFIrANRSJADUUyUAvVQtAKJVPADTVigAyFctANBZ + KwDXWSkA3VopAM1cLgDUXiwAz14vAOFgLQDkZjEAwGhCAONrNQDEa0QAxm1HAO1xNgClbGMA6XM6ALdz + WQDvfUAA7X5CAO5/QgDvf0IA7oBDAO+ERQDuhEYA74RGAOqGSgDohksA6YZLAOmITQDpiU0A8IlMAOuK + TwDukFQA6pRbAPGVVwCwjosAzZJ0ANuqkADeycYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAcHBwcHA8cFRwUnAicHBwcHBwBxhOWl1eXlxdUyEAbHBwcBpDa2hkZWZlY2dGH3BwcHAsP2pp + YF9hW1hRSzJvcHBwcFVwSUpIRURBOTYWcHBwcFdZKRwrO0AxLygdcHBwcHBwcHAQM01PNRUOcHBwcHBw + cHBwcBEkOhkEcHBwcHBwcHBwcHBwG0I9cHBwcHBwcHBwcHBwLi03VmJwcHBwcHBwcHBwChcUNFBwcHBw + cHBwcHBwcAYFCCU+THBwcHBwcHBwcHAMAQINIDBwcHBwcHBwcHBwKkcjAwsncHBwcHBwcHBwcBJubQkm + cHBwcHBwcHBwcHBwHjgPE3BwcHBwcPqvAADAAQAAwAMAAMABAADoAwAAwAcAAPgPAAD8HwAA/j8AAPwf + AAD4PwAA+B8AAPgfAAD4HwAA+D8AAPw/AAA= + + + + CenterScreen + + + UDS Administration + + + LoginForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/MainForm.Designer.cs b/client/administration/UdsAdmin/forms/MainForm.Designer.cs new file mode 100644 index 000000000..269f5461a --- /dev/null +++ b/client/administration/UdsAdmin/forms/MainForm.Designer.cs @@ -0,0 +1,278 @@ +namespace UdsAdmin.forms +{ + partial class MainForm + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de Windows Forms + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.treeActions = new System.Windows.Forms.TreeView(); + this.statusStrip1 = new System.Windows.Forms.StatusStrip(); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolsToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.languageToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.englishToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.spanishToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.frenchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.germanToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.configurationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.aboutToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.serviceProviderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.newServiceProviderMenu = new System.Windows.Forms.ToolStripMenuItem(); + this.testToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.languageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.spanishToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.englishToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStrip1 = new System.Windows.Forms.ToolStrip(); + this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.menuStrip1.SuspendLayout(); + this.toolStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // splitContainer1 + // + resources.ApplyResources(this.splitContainer1, "splitContainer1"); + this.splitContainer1.Name = "splitContainer1"; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.treeActions); + // + // treeActions + // + resources.ApplyResources(this.treeActions, "treeActions"); + this.treeActions.HideSelection = false; + this.treeActions.MinimumSize = new System.Drawing.Size(200, 4); + this.treeActions.Name = "treeActions"; + this.treeActions.ShowNodeToolTips = true; + this.treeActions.BeforeExpand += new System.Windows.Forms.TreeViewCancelEventHandler(this.treeActions_BeforeExpand); + this.treeActions.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeActions_AfterSelect); + this.treeActions.KeyUp += new System.Windows.Forms.KeyEventHandler(this.treeActions_KeyUp); + this.treeActions.MouseDown += new System.Windows.Forms.MouseEventHandler(this.treeActions_MouseDown); + // + // statusStrip1 + // + resources.ApplyResources(this.statusStrip1, "statusStrip1"); + this.statusStrip1.Name = "statusStrip1"; + // + // menuStrip1 + // + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem, + this.toolsToolStripMenuItem1}); + resources.ApplyResources(this.menuStrip1, "menuStrip1"); + this.menuStrip1.Name = "menuStrip1"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.exitToolStripMenuItem}); + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + resources.ApplyResources(this.fileToolStripMenuItem, "fileToolStripMenuItem"); + // + // exitToolStripMenuItem + // + this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; + resources.ApplyResources(this.exitToolStripMenuItem, "exitToolStripMenuItem"); + this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); + // + // toolsToolStripMenuItem1 + // + this.toolsToolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.languageToolStripMenuItem1, + this.configurationToolStripMenuItem, + this.aboutToolStripMenuItem1}); + this.toolsToolStripMenuItem1.Name = "toolsToolStripMenuItem1"; + resources.ApplyResources(this.toolsToolStripMenuItem1, "toolsToolStripMenuItem1"); + // + // languageToolStripMenuItem1 + // + this.languageToolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.englishToolStripMenuItem1, + this.spanishToolStripMenuItem1, + this.frenchToolStripMenuItem, + this.germanToolStripMenuItem}); + this.languageToolStripMenuItem1.Name = "languageToolStripMenuItem1"; + resources.ApplyResources(this.languageToolStripMenuItem1, "languageToolStripMenuItem1"); + // + // englishToolStripMenuItem1 + // + this.englishToolStripMenuItem1.Name = "englishToolStripMenuItem1"; + resources.ApplyResources(this.englishToolStripMenuItem1, "englishToolStripMenuItem1"); + this.englishToolStripMenuItem1.Click += new System.EventHandler(this.englishToolStripMenuItem_Click); + // + // spanishToolStripMenuItem1 + // + this.spanishToolStripMenuItem1.Name = "spanishToolStripMenuItem1"; + resources.ApplyResources(this.spanishToolStripMenuItem1, "spanishToolStripMenuItem1"); + this.spanishToolStripMenuItem1.Click += new System.EventHandler(this.spanishToolStripMenuItem_Click); + // + // frenchToolStripMenuItem + // + this.frenchToolStripMenuItem.Name = "frenchToolStripMenuItem"; + resources.ApplyResources(this.frenchToolStripMenuItem, "frenchToolStripMenuItem"); + this.frenchToolStripMenuItem.Click += new System.EventHandler(this.frenchToolStripMenuItem_Click); + // + // germanToolStripMenuItem + // + this.germanToolStripMenuItem.Name = "germanToolStripMenuItem"; + resources.ApplyResources(this.germanToolStripMenuItem, "germanToolStripMenuItem"); + this.germanToolStripMenuItem.Click += new System.EventHandler(this.germanToolStripMenuItem_Click); + // + // configurationToolStripMenuItem + // + this.configurationToolStripMenuItem.Name = "configurationToolStripMenuItem"; + resources.ApplyResources(this.configurationToolStripMenuItem, "configurationToolStripMenuItem"); + this.configurationToolStripMenuItem.Click += new System.EventHandler(this.configurationToolStripMenuItem_Click); + // + // aboutToolStripMenuItem1 + // + this.aboutToolStripMenuItem1.Name = "aboutToolStripMenuItem1"; + resources.ApplyResources(this.aboutToolStripMenuItem1, "aboutToolStripMenuItem1"); + // + // serviceProviderToolStripMenuItem + // + this.serviceProviderToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.newServiceProviderMenu, + this.testToolStripMenuItem}); + this.serviceProviderToolStripMenuItem.Name = "serviceProviderToolStripMenuItem"; + resources.ApplyResources(this.serviceProviderToolStripMenuItem, "serviceProviderToolStripMenuItem"); + // + // newServiceProviderMenu + // + this.newServiceProviderMenu.Name = "newServiceProviderMenu"; + resources.ApplyResources(this.newServiceProviderMenu, "newServiceProviderMenu"); + // + // testToolStripMenuItem + // + this.testToolStripMenuItem.Name = "testToolStripMenuItem"; + resources.ApplyResources(this.testToolStripMenuItem, "testToolStripMenuItem"); + // + // toolsToolStripMenuItem + // + this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem"; + resources.ApplyResources(this.toolsToolStripMenuItem, "toolsToolStripMenuItem"); + // + // languageToolStripMenuItem + // + this.languageToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.spanishToolStripMenuItem, + this.englishToolStripMenuItem}); + this.languageToolStripMenuItem.Name = "languageToolStripMenuItem"; + resources.ApplyResources(this.languageToolStripMenuItem, "languageToolStripMenuItem"); + // + // spanishToolStripMenuItem + // + this.spanishToolStripMenuItem.Name = "spanishToolStripMenuItem"; + resources.ApplyResources(this.spanishToolStripMenuItem, "spanishToolStripMenuItem"); + this.spanishToolStripMenuItem.Click += new System.EventHandler(this.spanishToolStripMenuItem_Click); + // + // englishToolStripMenuItem + // + this.englishToolStripMenuItem.Name = "englishToolStripMenuItem"; + resources.ApplyResources(this.englishToolStripMenuItem, "englishToolStripMenuItem"); + this.englishToolStripMenuItem.Click += new System.EventHandler(this.englishToolStripMenuItem_Click); + // + // aboutToolStripMenuItem + // + this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; + resources.ApplyResources(this.aboutToolStripMenuItem, "aboutToolStripMenuItem"); + // + // toolStrip1 + // + this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripButton1}); + resources.ApplyResources(this.toolStrip1, "toolStrip1"); + this.toolStrip1.Name = "toolStrip1"; + // + // toolStripButton1 + // + this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton1.Image = global::UdsAdmin.Images.cache16; + resources.ApplyResources(this.toolStripButton1, "toolStripButton1"); + this.toolStripButton1.Name = "toolStripButton1"; + this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click); + // + // MainForm + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.splitContainer1); + this.Controls.Add(this.toolStrip1); + this.Controls.Add(this.statusStrip1); + this.Controls.Add(this.menuStrip1); + this.MainMenuStrip = this.menuStrip1; + this.Name = "MainForm"; + this.WindowState = System.Windows.Forms.FormWindowState.Maximized; + this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.MainForm_FormClosed); + this.Load += new System.EventHandler(this.MainForm_Load); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.ResumeLayout(false); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.toolStrip1.ResumeLayout(false); + this.toolStrip1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.StatusStrip statusStrip1; + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem serviceProviderToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem newServiceProviderMenu; + private System.Windows.Forms.ToolStrip toolStrip1; + private System.Windows.Forms.SplitContainer splitContainer1; + private System.Windows.Forms.TreeView treeActions; + private System.Windows.Forms.ToolStripMenuItem toolsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem languageToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem spanishToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem englishToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem testToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem toolsToolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem languageToolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem englishToolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem spanishToolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem frenchToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem germanToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem1; + private System.Windows.Forms.ToolStripButton toolStripButton1; + private System.Windows.Forms.ToolStripMenuItem configurationToolStripMenuItem; + + } +} \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/MainForm.cs b/client/administration/UdsAdmin/forms/MainForm.cs new file mode 100644 index 000000000..7e0fd6e68 --- /dev/null +++ b/client/administration/UdsAdmin/forms/MainForm.cs @@ -0,0 +1,677 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.Globalization; +using System.Threading; + +namespace UdsAdmin.forms +{ + public partial class MainForm : Form + { + public xmlrpc.ServiceProviderType[] _serviceProvidersTypes = null; + public xmlrpc.AuthenticatorType[] _authenticatorsTypes = null; + public xmlrpc.OSManagerType[] _osManagersTypes = null; + public xmlrpc.TransportType[] _transportTypes = null; + + public MainForm form = null; + + private Icon getIcon( xmlrpc.BaseType[] bas, string type) + { + Icon icon = null; + foreach (xmlrpc.BaseType bt in bas) + { + if (bt.type == type) + { + icon = gui.Helpers.IconFromBase64(bt.icon); + break; + } + } + return icon; + } + + public MainForm() + { + InitializeComponent(); + form = this; + Text = Strings.titleMain; + } + + private void MainForm_Load(object sender, EventArgs e) + { + // Adjust split position + splitContainer1.SplitterDistance = 200; + + // Saves the providers known by this server + _serviceProvidersTypes = xmlrpc.UdsAdminService.GetServiceProvidersTypes(); + _authenticatorsTypes = xmlrpc.UdsAdminService.GetAuthenticatorsTypes(); + _osManagersTypes = xmlrpc.UdsAdminService.GetOSManagersTypes(); + _transportTypes = xmlrpc.UdsAdminService.GetTransportsTypes(); + + // Initialize the base images for the action tree + gui.ActionTree.InitializeImageList(treeActions); + // Fill the types of servers for service providers, authenticators + gui.ActionTree.addTypesImages(treeActions, _serviceProvidersTypes, _authenticatorsTypes, _osManagersTypes, _transportTypes); + + // Menus for top level items + ContextMenuStrip servicesProvidersContextMenu = new System.Windows.Forms.ContextMenuStrip(); + ContextMenuStrip authenticatorsContextMenu = new System.Windows.Forms.ContextMenuStrip(); + ContextMenuStrip osManagersContextMenu = new System.Windows.Forms.ContextMenuStrip(); + ContextMenuStrip transportsContextMenu = new System.Windows.Forms.ContextMenuStrip(); + ContextMenuStrip deployedServiceContextMenu = new System.Windows.Forms.ContextMenuStrip(); + ContextMenuStrip networkContexMenu = new System.Windows.Forms.ContextMenuStrip(); + + // Contextual menu for Services Providers + ToolStripMenuItem newService = new ToolStripMenuItem(Strings.newItem); + gui.MenusManager.InitProvidersMenu(newService, newServiceProviderMenu_Click, _serviceProvidersTypes); + servicesProvidersContextMenu.Items.Add(newService); + + // Contextual menu for authenticators + ToolStripMenuItem newAuth = new ToolStripMenuItem(Strings.newItem); + gui.MenusManager.InitAuthenticatorsMenu(newAuth, newAuthenticatorMenu_Click, _authenticatorsTypes); + authenticatorsContextMenu.Items.Add(newAuth); + + // Contextual menu for os managers + ToolStripMenuItem newOSManager = new ToolStripMenuItem(Strings.newItem); + gui.MenusManager.InitOSManagersMenu(newOSManager, newOSManagerMenu_Click, _osManagersTypes); + osManagersContextMenu.Items.Add(newOSManager); + + // Contextual menu for transports + ToolStripMenuItem newTransport = new ToolStripMenuItem(Strings.newItem); + gui.MenusManager.InitTransportsMenu(newTransport, newTransportMenu_Click, _transportTypes); + transportsContextMenu.Items.Add(newTransport); + + // Contextual menu for Deployed Services + ToolStripMenuItem newDeployed = new ToolStripMenuItem(Strings.newItem); + gui.MenusManager.InitDeployedServicesMenu(newDeployed, newDeployed_Click); + deployedServiceContextMenu.Items.Add(newDeployed); + + // Contextual menu for Networks + ToolStripMenuItem newNetwork = new ToolStripMenuItem(Strings.newItem); + newNetwork.Click += newNetwork_Click; + networkContexMenu.Items.Add(newNetwork); + + // Generate main tree + treeActions.Nodes.Add(gui.ActionTree.SERVICES_PROVIDERS, Strings.serviceProviders, + gui.ActionTree.SERVICES_PROVIDERS + gui.ActionTree.DIMMED_OUT, gui.ActionTree.SERVICES_PROVIDERS); + treeActions.Nodes.Add(gui.ActionTree.AUTHENTICATORS, Strings.authenticators, + gui.ActionTree.AUTHENTICATORS + gui.ActionTree.DIMMED_OUT, gui.ActionTree.AUTHENTICATORS); + treeActions.Nodes.Add(gui.ActionTree.OS_MANAGERS, Strings.osManagers, + gui.ActionTree.OS_MANAGERS + gui.ActionTree.DIMMED_OUT, gui.ActionTree.OS_MANAGERS); + + treeActions.Nodes.Add(gui.ActionTree.CONNECTIVITY, Strings.connectivity, + gui.ActionTree.CONNECTIVITY + gui.ActionTree.DIMMED_OUT, gui.ActionTree.CONNECTIVITY); + treeActions.Nodes[gui.ActionTree.CONNECTIVITY].Nodes.Add(gui.ActionTree.TRANSPORTS, Strings.transports, + gui.ActionTree.TRANSPORTS + gui.ActionTree.DIMMED_OUT, gui.ActionTree.TRANSPORTS); + treeActions.Nodes[gui.ActionTree.CONNECTIVITY].Nodes.Add(gui.ActionTree.NETWORKS, Strings.networks, + gui.ActionTree.NETWORKS + gui.ActionTree.DIMMED_OUT, gui.ActionTree.NETWORKS); + + treeActions.Nodes.Add(gui.ActionTree.DEPLOYED_SERVICES, Strings.deployedServices, + gui.ActionTree.DEPLOYED_SERVICES + gui.ActionTree.DIMMED_OUT, gui.ActionTree.DEPLOYED_SERVICES); + + // Add context menus + treeActions.Nodes[gui.ActionTree.SERVICES_PROVIDERS].ContextMenuStrip = servicesProvidersContextMenu; + treeActions.Nodes[gui.ActionTree.AUTHENTICATORS].ContextMenuStrip = authenticatorsContextMenu; + treeActions.Nodes[gui.ActionTree.OS_MANAGERS].ContextMenuStrip = osManagersContextMenu; + + treeActions.Nodes[gui.ActionTree.CONNECTIVITY].Nodes[gui.ActionTree.TRANSPORTS].ContextMenuStrip = transportsContextMenu; + treeActions.Nodes[gui.ActionTree.CONNECTIVITY].Nodes[gui.ActionTree.NETWORKS].ContextMenuStrip = networkContexMenu; + + treeActions.Nodes[gui.ActionTree.DEPLOYED_SERVICES].ContextMenuStrip = deployedServiceContextMenu; + + updateServicesProvidersTree(); + updateAuthenticatorsTree(); + updateOSManagersTree(); + updateTransportsTree(); + updateDeployedServicesTree(); + } + + private void changeLangTo(string lang) + { + if (MessageBox.Show(Strings.changeLanguage, Strings.language, MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) + { + UdsAdmin.Properties.Settings.Default.Locale = lang; + //CultureInfo culture = new CultureInfo(UdsAdmin.Properties.Settings.Default.Locale); + //Thread.CurrentThread.CurrentCulture = culture; + //Thread.CurrentThread.CurrentUICulture = culture; + + //UdsAdmin.Properties.Settings.Default.Save(); done at Program.cs + } + } + + private void englishToolStripMenuItem_Click(object sender, EventArgs e) + { + changeLangTo("en-US"); + } + + private void spanishToolStripMenuItem_Click(object sender, EventArgs e) + { + changeLangTo("es-ES"); + } + + private void frenchToolStripMenuItem_Click(object sender, EventArgs e) + { + changeLangTo("fr-FR"); + } + + private void germanToolStripMenuItem_Click(object sender, EventArgs e) + { + changeLangTo("de-DE"); + } + + private void treeActions_AfterSelect(object sender, TreeViewEventArgs e) + { + if (treeActions.SelectedNode == null) + return; + try + { + gui.ActionTree.showAssociatedPanel(splitContainer1.Panel2, treeActions, this); + } + catch (Exception) + { + // Nothing done right now + } + + } + + private void newServiceProviderMenu_Click(object sender, EventArgs e) + { + ToolStripMenuItem s = (ToolStripMenuItem)sender; + ServiceProviderForm dlg = new ServiceProviderForm(s.Text, s.Name, getIcon(_serviceProvidersTypes, s.Name)); + dlg.ShowDialog(); + updateServicesProvidersTree(); + } + + private void newAuthenticatorMenu_Click(object sender, EventArgs e) + { + ToolStripMenuItem s = (ToolStripMenuItem)sender; + AuthenticatorForm dlg = new AuthenticatorForm(s.Text, s.Name, getIcon(_authenticatorsTypes, s.Name)); + dlg.ShowDialog(); + updateAuthenticatorsTree(); + } + + private void newOSManagerMenu_Click(object sender, EventArgs e) + { + ToolStripMenuItem s = (ToolStripMenuItem)sender; + OSManagerForm dlg = new OSManagerForm(s.Text, s.Name, getIcon(_osManagersTypes, s.Name)); + dlg.ShowDialog(); + updateOSManagersTree(); + } + + private void newTransportMenu_Click(object sender, EventArgs e) + { + ToolStripMenuItem s = (ToolStripMenuItem)sender; + TransportForm dlg = new TransportForm(s.Text, s.Name, getIcon(_transportTypes, s.Name)); + dlg.ShowDialog(); + updateTransportsTree(); + } + + private void newDeployed_Click(object sender, EventArgs e) + { + ToolStripMenuItem s = (ToolStripMenuItem)sender; + DeployedServiceForm dlg = new DeployedServiceForm(); + DialogResult res = dlg.ShowDialog(); + updateDeployedServicesTree(); + } + + private void treeActions_BeforeExpand(object sender, TreeViewCancelEventArgs e) + { + // We can do a constant refresh here, but i think better not, F5 must be enought + /*if (e.Node.Name == gui.ActionTree.SERVICES_PROVIDERS) + updateServicesProvidersTree();*/ + switch( e.Node.Name ) + { + case gui.ActionTree.SERVICE_PROVIDER: + xmlrpc.ServiceProvider sp = (xmlrpc.ServiceProvider)e.Node.Tag; + updateServicesTree(sp.id); + break; + } + } + + private void serviceProviderContextMenu_Click(object sender, EventArgs e) + { + ToolStripMenuItem s = (ToolStripMenuItem)sender; + + switch (s.Name) + { + case gui.ActionTree.NEW_ACTION: + { + // Selects the corresponding "Services" node + if( treeActions.SelectedNode.Name == gui.ActionTree.SERVICE_PROVIDER ) + treeActions.SelectedNode = treeActions.SelectedNode.Nodes[gui.ActionTree.SERVICES]; + treeActions.SelectedNode.Expand(); + xmlrpc.ServiceType st = (xmlrpc.ServiceType)s.Tag; + xmlrpc.ServiceProvider sp = (xmlrpc.ServiceProvider)treeActions.SelectedNode.Parent.Tag; + + ServiceForm dlg = new ServiceForm(sp.id, st.name, st.type, gui.Helpers.IconFromBase64(st.icon)); + if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) + updateServicesTree(sp.id); + break; + } + case gui.ActionTree.MODIFY_ACTION: + { + xmlrpc.ServiceProvider sp = (xmlrpc.ServiceProvider)treeActions.SelectedNode.Tag; + ServiceProviderForm dlg = new ServiceProviderForm(sp.typeName, sp.type, getIcon(_serviceProvidersTypes, sp.type)); + dlg.setData(sp.name, sp.comments, sp.id, xmlrpc.UdsAdminService.GetServiceProvider(sp.id)); + if( dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK ) + updateServicesProvidersTree(); + break; + } + case gui.ActionTree.DELETE_ACTION: + { + try + { + if (MessageBox.Show(Strings.removeQuestion, Strings.serviceProviders, MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) + { + xmlrpc.ServiceProvider sp = (xmlrpc.ServiceProvider)treeActions.SelectedNode.Tag; + xmlrpc.UdsAdminService.RemoveServiceProvider(sp.id); + updateServicesProvidersTree(); + } + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + + break; + } + case gui.ActionTree.CHECK_ACTION: + { + xmlrpc.ServiceProvider sp = (xmlrpc.ServiceProvider)treeActions.SelectedNode.Tag; + MessageBox.Show(xmlrpc.UdsAdminService.CheckServiceProvider(sp.id)); + break; + } + } + } + + private void AuthenticatorContextMenu_Click(object sender, EventArgs e) + { + ToolStripMenuItem s = (ToolStripMenuItem)sender; + switch (s.Name) + { + case gui.ActionTree.MODIFY_ACTION: + { + xmlrpc.Authenticator auth = (xmlrpc.Authenticator)treeActions.SelectedNode.Tag; + AuthenticatorForm dlg = new AuthenticatorForm(auth.typeName, auth.type, getIcon(_authenticatorsTypes, auth.type)); + dlg.setData(auth.name, auth.comments, auth.id, xmlrpc.UdsAdminService.GetAuthenticator(auth.id)); + if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) + updateAuthenticatorsTree(); + break; + } + case gui.ActionTree.DELETE_ACTION: + { + xmlrpc.Authenticator auth = (xmlrpc.Authenticator)treeActions.SelectedNode.Tag; + xmlrpc.UdsAdminService.RemoveAuthenticator(auth.id); + updateAuthenticatorsTree(); + break; + } + case gui.ActionTree.CHECK_ACTION: + { + xmlrpc.Authenticator auth = (xmlrpc.Authenticator)treeActions.SelectedNode.Tag; + MessageBox.Show(xmlrpc.UdsAdminService.CheckAuthenticator(auth.id)); + break; + } + } + } + + + private void serviceContextMenu_Click(object sender, EventArgs e) + { + ToolStripMenuItem s = (ToolStripMenuItem)sender; + + switch (s.Name) + { + case gui.ActionTree.MODIFY_ACTION: + { + xmlrpc.ServiceProvider sp = (xmlrpc.ServiceProvider)treeActions.SelectedNode.Parent.Parent.Tag; + xmlrpc.Service se = (xmlrpc.Service)treeActions.SelectedNode.Tag; + xmlrpc.ServiceType st = (xmlrpc.ServiceType)s.Tag; + ServiceForm dlg = new ServiceForm(sp.id, se.typeName, se.type, gui.Helpers.IconFromBase64(st.icon)); + dlg.setData(se.name, se.comments, se.id, xmlrpc.UdsAdminService.GetService(se.id)); + if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) + updateServicesTree(sp.id); + break; + } + case gui.ActionTree.DELETE_ACTION: + { + try + { + if (MessageBox.Show(Strings.removeQuestion, Strings.services, MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) + { + xmlrpc.Service ser = (xmlrpc.Service)treeActions.SelectedNode.Tag; + xmlrpc.UdsAdminService.RemoveService(ser.id); + updateServicesTree(ser.idParent); + } + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + break; + } + } + } + + private void osManagerContextMenu_Click(object sender, EventArgs e) + { + ToolStripMenuItem s = (ToolStripMenuItem)sender; + switch (s.Name) + { + case gui.ActionTree.MODIFY_ACTION: + { + xmlrpc.OSManager osm = (xmlrpc.OSManager)treeActions.SelectedNode.Tag; + OSManagerForm dlg = new OSManagerForm(osm.typeName, osm.type, getIcon(_osManagersTypes,osm.type)); + dlg.setData(osm.name, osm.comments, osm.id, xmlrpc.UdsAdminService.GetOSManager(osm.id)); + if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) + updateOSManagersTree(); + break; + } + case gui.ActionTree.DELETE_ACTION: + { + xmlrpc.OSManager osm = (xmlrpc.OSManager)treeActions.SelectedNode.Tag; + if (MessageBox.Show(Strings.removeQuestion, Strings.osManager, MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) + { + try + { + xmlrpc.UdsAdminService.RemoveOSManager(osm.id); + updateOSManagersTree(); + } + catch( CookComputing.XmlRpc.XmlRpcFaultException ex ) + { + gui.UserNotifier.notifyRpcException(ex); + } + } + break; + } + case gui.ActionTree.CHECK_ACTION: + { + xmlrpc.OSManager osm = (xmlrpc.OSManager)treeActions.SelectedNode.Tag; + MessageBox.Show(xmlrpc.UdsAdminService.CheckOSManager(osm.id)); + break; + } + } + } + + private void transportContextMenu_Click(object sender, EventArgs e) + { + ToolStripMenuItem s = (ToolStripMenuItem)sender; + switch (s.Name) + { + case gui.ActionTree.MODIFY_ACTION: + { + xmlrpc.Transport trans = (xmlrpc.Transport)treeActions.SelectedNode.Tag; + TransportForm dlg = new TransportForm(trans.typeName, trans.type, getIcon(_transportTypes, trans.type)); + dlg.setData(trans.name, trans.comments, trans.id, xmlrpc.UdsAdminService.GetTransport(trans.id)); + if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) + updateTransportsTree(); + break; + } + case gui.ActionTree.DELETE_ACTION: + { + xmlrpc.Transport trans = (xmlrpc.Transport)treeActions.SelectedNode.Tag; + xmlrpc.UdsAdminService.RemoveTransport(trans.id); + updateTransportsTree(); + break; + } + } + } + + private void deployedContextMenu_Click(object sender, EventArgs e) + { + ToolStripMenuItem s = (ToolStripMenuItem)sender; + switch (s.Name) + { + case gui.ActionTree.MODIFY_ACTION: + { + xmlrpc.DeployedService dps = (xmlrpc.DeployedService)treeActions.SelectedNode.Tag; + dps = xmlrpc.UdsAdminService.GetDeployedService(dps.id); + DeployedServiceForm dlg = new DeployedServiceForm(); + dlg.setData(dps); + if( dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK ) + updateDeployedServicesTree(); + break; + } + case gui.ActionTree.DELETE_ACTION: + { + xmlrpc.DeployedService dps = (xmlrpc.DeployedService)treeActions.SelectedNode.Tag; + if (MessageBox.Show(Strings.removeQuestion, Strings.deployedService, MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) + { + xmlrpc.UdsAdminService.RemoveDeployedService(dps.id); + updateDeployedServicesTree(); + } + break; + } + case gui.ActionTree.PUBLISH_ACTION: + { + // This can be trigered from 2 different places + if (treeActions.SelectedNode.Name == gui.ActionTree.DEPLOYED_SERVICE) + treeActions.SelectedNode = treeActions.SelectedNode.Nodes[gui.ActionTree.PUBLICATIONS]; + xmlrpc.DeployedService dps = (xmlrpc.DeployedService)treeActions.SelectedNode.Parent.Tag; + if (MessageBox.Show(Strings.publishQuestion, Strings.publish, MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) + try + { + xmlrpc.UdsAdminService.PublishDeployedService(dps); + treeActions_AfterSelect(null, null); + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + + break; + } + } + } + + private void UserGroupsMenu_Click(object sender, EventArgs e) + { + bool user = treeActions.SelectedNode.Name == gui.ActionTree.USERS; + xmlrpc.Authenticator auth = (xmlrpc.Authenticator)(treeActions.SelectedNode.Parent.Tag); + xmlrpc.AuthenticatorType type = gui.ActionTree.authType(auth, _authenticatorsTypes); + ToolStripMenuItem s = (ToolStripMenuItem)sender; + switch (s.Name) + { + case gui.ActionTree.NEW_ACTION: + { + if (user) + { + if (type.canCreateUsers == false) + { + gui.UserNotifier.notifyError(Strings.cantCreateUsers); + return; + } + forms.UserForm dlg = new UserForm(auth, type, new xmlrpc.User()); + if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) + { + treeActions_AfterSelect(null, null); + } + } + else + { + forms.GroupForm dlg = new GroupForm(auth, type); + if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) + treeActions_AfterSelect(null, null); + } + break; + } + } + + } + + private void newNetwork_Click(object sender, EventArgs e) + { + forms.NetworkForm dlg = new NetworkForm(); + if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) + treeActions_AfterSelect(null, null); + } + + + private void treeActions_MouseDown(object sender, MouseEventArgs e) + { + // We force the selected item to be the one at witch we right-clicked + if (e.Button == MouseButtons.Right) + { + treeActions.SelectedNode = treeActions.GetNodeAt(e.X, e.Y); + } + } + + private void treeActions_KeyUp(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.F5) + { + TreeNode node = treeActions.SelectedNode; + switch (node.Name) + { + case gui.ActionTree.SERVICES_PROVIDERS: + updateServicesProvidersTree(); + break; + case gui.ActionTree.SERVICE_PROVIDER: + { + xmlrpc.ServiceProvider sp = (xmlrpc.ServiceProvider)node.Tag; + updateServicesTree(sp.id); + } + break; + case gui.ActionTree.AUTHENTICATORS: + updateAuthenticatorsTree(); + break; + case gui.ActionTree.AUTHENTICATOR: + // TODO: Make this update the auth tree + break; + case gui.ActionTree.OS_MANAGERS: + case gui.ActionTree.OS_MANAGER: + updateOSManagersTree(); + break; + case gui.ActionTree.TRANSPORTS: + case gui.ActionTree.TRANSPORT: + updateTransportsTree(); + break; + case gui.ActionTree.NETWORKS: + updateTransportsTree(); + break; + case gui.ActionTree.DEPLOYED_SERVICES: + case gui.ActionTree.DEPLOYED_SERVICE: + updateDeployedServicesTree(); + break; + case gui.ActionTree.PUBLICATIONS: + case gui.ActionTree.ASSIGNED_SERVICES: + case gui.ActionTree.CACHE: + case gui.ActionTree.USERS: + case gui.ActionTree.GROUPS: + treeActions_AfterSelect(null, null); + break; + + } + + } + } + + // Test form + private void testToolStripMenuItem1_Click(object sender, EventArgs e) + { + } + + + // Helper methods, Tree updaters + private void updateServicesProvidersTree() + { + gui.ActionTree.FillServicesProviders(treeActions.Nodes[gui.ActionTree.SERVICES_PROVIDERS], serviceProviderContextMenu_Click); + treeActions_AfterSelect(null, null); + } + + private void updateServicesTree(string idServiceProvider) + { + TreeNode nodeBase = treeActions.Nodes[gui.ActionTree.SERVICES_PROVIDERS]; + foreach (TreeNode node in nodeBase.Nodes) + { + if (node.Name == gui.ActionTree.SERVICE_PROVIDER) + { + xmlrpc.ServiceProvider sp = (xmlrpc.ServiceProvider)node.Tag; + if (sp.id == idServiceProvider) + gui.ActionTree.FillServices(node, serviceContextMenu_Click); + } + } + treeActions_AfterSelect(null, null); + } + + private void updateAuthenticatorsTree() + { + gui.ActionTree.FillAuthenticators(treeActions.Nodes[gui.ActionTree.AUTHENTICATORS], _authenticatorsTypes, + AuthenticatorContextMenu_Click, UserGroupsMenu_Click); + treeActions_AfterSelect(null, null); + } + + private void updateOSManagersTree() + { + gui.ActionTree.FillOSManagers(treeActions.Nodes[gui.ActionTree.OS_MANAGERS], osManagerContextMenu_Click); + treeActions_AfterSelect(null, null); + } + + private void updateTransportsTree() + { + gui.ActionTree.FillTransports(treeActions.Nodes[gui.ActionTree.CONNECTIVITY].Nodes[gui.ActionTree.TRANSPORTS], + transportContextMenu_Click); + treeActions_AfterSelect(null, null); + } + + private void updateDeployedServicesTree() + { + gui.ActionTree.FillDeployedServices(treeActions.Nodes[gui.ActionTree.DEPLOYED_SERVICES], deployedContextMenu_Click); + treeActions_AfterSelect(this, null); + } + + private void MainForm_FormClosed(object sender, FormClosedEventArgs e) + { + xmlrpc.UdsAdminService.Logout(); + } + + private void exitToolStripMenuItem_Click(object sender, EventArgs e) + { + Close(); + } + + private void toolStripButton1_Click(object sender, EventArgs e) + { + xmlrpc.UdsAdminService.FlushCache(); + MessageBox.Show(Strings.cacheFlushed, Strings.cache, MessageBoxButtons.OK); + } + + private void configurationToolStripMenuItem_Click(object sender, EventArgs e) + { + new ConfigurationForm().ShowDialog(); + } + + } +} diff --git a/client/administration/UdsAdmin/forms/MainForm.de.resx b/client/administration/UdsAdmin/forms/MainForm.de.resx new file mode 100644 index 000000000..7972aad73 --- /dev/null +++ b/client/administration/UdsAdmin/forms/MainForm.de.resx @@ -0,0 +1,287 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5UcmVlTm9kZQkAAAAEVGV4dAROYW1lCUlzQ2hlY2tlZApJbWFnZUluZGV4 + CEltYWdlS2V5ElNlbGVjdGVkSW1hZ2VJbmRleBBTZWxlY3RlZEltYWdlS2V5CkNoaWxkQ291bnQIVXNl + ckRhdGEBAQAAAQABAAEBCAgIAgAAAAYDAAAAE1NlcnZpY2VzIFByb3ZpZGVycyAGBAAAABFTZXJ2aWNl + c1Byb3ZpZGVycwD/////BgUAAAAA/////wkFAAAAAAAAAAkFAAAACw== + + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5UcmVlTm9kZQkAAAAEVGV4dAROYW1lCUlzQ2hlY2tlZApJbWFnZUluZGV4 + CEltYWdlS2V5ElNlbGVjdGVkSW1hZ2VJbmRleBBTZWxlY3RlZEltYWdlS2V5CkNoaWxkQ291bnQIVXNl + ckRhdGEBAQAAAQABAAEBCAgIAgAAAAYDAAAADkF1dGhlbnRpY2F0b3JzBgQAAAAOQXV0aGVudGljYXRv + cnMA/////wYFAAAAAP////8JBQAAAAAAAAAJBQAAAAs= + + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5UcmVlTm9kZQgAAAAEVGV4dAROYW1lCUlzQ2hlY2tlZApJbWFnZUluZGV4 + CEltYWdlS2V5ElNlbGVjdGVkSW1hZ2VJbmRleBBTZWxlY3RlZEltYWdlS2V5CkNoaWxkQ291bnQBAQAA + AQABAAEICAgCAAAABgMAAAALT1MgTWFuYWdlcnMGBAAAAApPU01hbmFnZXJzAP////8GBQAAAAD///// + CQUAAAAAAAAACw== + + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5UcmVlTm9kZQoAAAAEVGV4dAROYW1lCUlzQ2hlY2tlZApJbWFnZUluZGV4 + CEltYWdlS2V5ElNlbGVjdGVkSW1hZ2VJbmRleBBTZWxlY3RlZEltYWdlS2V5CkNoaWxkQ291bnQJY2hp + bGRyZW4wCWNoaWxkcmVuMQEBAAABAAEABAQBCAgIHVN5c3RlbS5XaW5kb3dzLkZvcm1zLlRyZWVOb2Rl + AgAAAB1TeXN0ZW0uV2luZG93cy5Gb3Jtcy5UcmVlTm9kZQIAAAACAAAABgMAAAAMQ29ubmVjdGl2aXR5 + BgQAAAAMQ29ubmVjdGl2aXR5AP////8GBQAAAAD/////CQUAAAACAAAACQYAAAAJBwAAAAUGAAAAHVN5 + c3RlbS5XaW5kb3dzLkZvcm1zLlRyZWVOb2RlCAAAAARUZXh0BE5hbWUJSXNDaGVja2VkCkltYWdlSW5k + ZXgISW1hZ2VLZXkSU2VsZWN0ZWRJbWFnZUluZGV4EFNlbGVjdGVkSW1hZ2VLZXkKQ2hpbGRDb3VudAEB + AAABAAEAAQgICAIAAAAGCAAAAApUcmFuc3BvcnRzBgkAAAAKVHJhbnNwb3J0cwD/////CQUAAAD///// + CQUAAAAAAAAABQcAAAAdU3lzdGVtLldpbmRvd3MuRm9ybXMuVHJlZU5vZGUIAAAABFRleHQETmFtZQlJ + c0NoZWNrZWQKSW1hZ2VJbmRleAhJbWFnZUtleRJTZWxlY3RlZEltYWdlSW5kZXgQU2VsZWN0ZWRJbWFn + ZUtleQpDaGlsZENvdW50AQEAAAEAAQABCAgIAgAAAAYLAAAACE5ldHdvcmtzBgwAAAAITmV0d29ya3MA + /////wkFAAAA/////wkFAAAAAAAAAAs= + + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5UcmVlTm9kZQkAAAAEVGV4dAROYW1lCUlzQ2hlY2tlZApJbWFnZUluZGV4 + CEltYWdlS2V5ElNlbGVjdGVkSW1hZ2VJbmRleBBTZWxlY3RlZEltYWdlS2V5CkNoaWxkQ291bnQIVXNl + ckRhdGEBAQAAAQABAAEBCAgIAgAAAAYDAAAAEURlcGxveWVkIFNlcnZpY2VzBgQAAAAQRGVwbG95ZWRT + ZXJ2aWNlcwD/////BgUAAAAA/////wkFAAAAAAAAAAkFAAAACw== + + + + + 136, 20 + + + Anbieter von Diensten + + + 96, 22 + + + Neu + + + 96, 22 + + + Test + + + 77, 20 + + + Werkzeuge + + + 116, 22 + + + Sprache + + + 135, 22 + + + Englisch + + + 135, 22 + + + Spanisch + + + 135, 22 + + + Französisch + + + 135, 22 + + + Deutsch + + + Service-Provider + + + 96, 22 + + + Neu + + + 96, 22 + + + Sprache + + + 121, 22 + + + Spanisch + + + 121, 22 + + + Englisch + + + Über + + + statusStrip1 + + + Ausfahrt + + + Datei + + + Über + + + topMenu + + + toolStrip1 + + + Cache leeren + + + Löscht den Cache + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/MainForm.es.resx b/client/administration/UdsAdmin/forms/MainForm.es.resx new file mode 100644 index 000000000..e249e498f --- /dev/null +++ b/client/administration/UdsAdmin/forms/MainForm.es.resx @@ -0,0 +1,247 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5UcmVlTm9kZQkAAAAEVGV4dAROYW1lCUlzQ2hlY2tlZApJbWFnZUluZGV4 + CEltYWdlS2V5ElNlbGVjdGVkSW1hZ2VJbmRleBBTZWxlY3RlZEltYWdlS2V5CkNoaWxkQ291bnQIVXNl + ckRhdGEBAQAAAQABAAEBCAgIAgAAAAYDAAAAGFByb3ZlZWRvcmVzIGRlIHNlcnZpY2lvcwYEAAAAEVNl + cnZpY2VzUHJvdmlkZXJzAP////8GBQAAAAD/////CQUAAAAAAAAACQUAAAAL + + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5UcmVlTm9kZQkAAAAEVGV4dAROYW1lCUlzQ2hlY2tlZApJbWFnZUluZGV4 + CEltYWdlS2V5ElNlbGVjdGVkSW1hZ2VJbmRleBBTZWxlY3RlZEltYWdlS2V5CkNoaWxkQ291bnQIVXNl + ckRhdGEBAQAAAQABAAEBCAgIAgAAAAYDAAAADkF1dGVudGljYWRvcmVzBgQAAAAOQXV0aGVudGljYXRv + cnMA/////wYFAAAAAP////8JBQAAAAAAAAAJBQAAAAs= + + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5UcmVlTm9kZQgAAAAEVGV4dAROYW1lCUlzQ2hlY2tlZApJbWFnZUluZGV4 + CEltYWdlS2V5ElNlbGVjdGVkSW1hZ2VJbmRleBBTZWxlY3RlZEltYWdlS2V5CkNoaWxkQ291bnQBAQAA + AQABAAEICAgCAAAABgMAAAAQR2VzdG9yZXMgZGUgUy5PLgYEAAAACk9TTWFuYWdlcnMA/////wYFAAAA + AP////8JBQAAAAAAAAAL + + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5UcmVlTm9kZQoAAAAEVGV4dAROYW1lCUlzQ2hlY2tlZApJbWFnZUluZGV4 + CEltYWdlS2V5ElNlbGVjdGVkSW1hZ2VJbmRleBBTZWxlY3RlZEltYWdlS2V5CkNoaWxkQ291bnQJY2hp + bGRyZW4wCWNoaWxkcmVuMQEBAAABAAEABAQBCAgIHVN5c3RlbS5XaW5kb3dzLkZvcm1zLlRyZWVOb2Rl + AgAAAB1TeXN0ZW0uV2luZG93cy5Gb3Jtcy5UcmVlTm9kZQIAAAACAAAABgMAAAAMQ29uZWN0aXZpZGFk + BgQAAAAMQ29ubmVjdGl2aXR5AP////8GBQAAAAD/////CQUAAAACAAAACQYAAAAJBwAAAAUGAAAAHVN5 + c3RlbS5XaW5kb3dzLkZvcm1zLlRyZWVOb2RlCAAAAARUZXh0BE5hbWUJSXNDaGVja2VkCkltYWdlSW5k + ZXgISW1hZ2VLZXkSU2VsZWN0ZWRJbWFnZUluZGV4EFNlbGVjdGVkSW1hZ2VLZXkKQ2hpbGRDb3VudAEB + AAABAAEAAQgICAIAAAAGCAAAAAtUcmFuc3BvcnRlcwYJAAAAClRyYW5zcG9ydHMA/////wkFAAAA//// + /wkFAAAAAAAAAAUHAAAAHVN5c3RlbS5XaW5kb3dzLkZvcm1zLlRyZWVOb2RlCAAAAARUZXh0BE5hbWUJ + SXNDaGVja2VkCkltYWdlSW5kZXgISW1hZ2VLZXkSU2VsZWN0ZWRJbWFnZUluZGV4EFNlbGVjdGVkSW1h + Z2VLZXkKQ2hpbGRDb3VudAEBAAABAAEAAQgICAIAAAAGCwAAAAVSZWRlcwYMAAAACE5ldHdvcmtzAP// + //8JBQAAAP////8JBQAAAAAAAAAL + + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5UcmVlTm9kZQkAAAAEVGV4dAROYW1lCUlzQ2hlY2tlZApJbWFnZUluZGV4 + CEltYWdlS2V5ElNlbGVjdGVkSW1hZ2VJbmRleBBTZWxlY3RlZEltYWdlS2V5CkNoaWxkQ291bnQIVXNl + ckRhdGEBAQAAAQABAAEBCAgIAgAAAAYDAAAAFVNlcnZpY2lvcyBEZXNwbGVnYWRvcwYEAAAAEERlcGxv + eWVkU2VydmljZXMA/////wYFAAAAAP////8JBQAAAAAAAAAJBQAAAAs= + + + + Acerca de + + + Inglés + + + Inglés + + + Español + + + Español + + + statusStrip1 + + + Idioma + + + Idioma + + + Proveedor de servicios + + + Nuevo + + + Proveedores de servicios + + + Nuevo + + + topMenu + + + Herramientas + + + toolStrip1 + + + prueba + + + Francés + + + Alemán + + + Salir + + + Archivo + + + Acerca de + + + Vaciar la caché + + + Borra la caché + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/MainForm.fr.resx b/client/administration/UdsAdmin/forms/MainForm.fr.resx new file mode 100644 index 000000000..aa88e1a42 --- /dev/null +++ b/client/administration/UdsAdmin/forms/MainForm.fr.resx @@ -0,0 +1,247 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5UcmVlTm9kZQkAAAAEVGV4dAROYW1lCUlzQ2hlY2tlZApJbWFnZUluZGV4 + CEltYWdlS2V5ElNlbGVjdGVkSW1hZ2VJbmRleBBTZWxlY3RlZEltYWdlS2V5CkNoaWxkQ291bnQIVXNl + ckRhdGEBAQAAAQABAAEBCAgIAgAAAAYDAAAAElNlcnZpY2VzIFByb3ZpZGVycwYEAAAAEVNlcnZpY2Vz + UHJvdmlkZXJzAP////8GBQAAAAD/////CQUAAAAAAAAACQUAAAAL + + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5UcmVlTm9kZQkAAAAEVGV4dAROYW1lCUlzQ2hlY2tlZApJbWFnZUluZGV4 + CEltYWdlS2V5ElNlbGVjdGVkSW1hZ2VJbmRleBBTZWxlY3RlZEltYWdlS2V5CkNoaWxkQ291bnQIVXNl + ckRhdGEBAQAAAQABAAEBCAgIAgAAAAYDAAAADkF1dGhlbnRpY2F0b3JzBgQAAAAOQXV0aGVudGljYXRv + cnMA/////wYFAAAAAP////8JBQAAAAAAAAAJBQAAAAs= + + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5UcmVlTm9kZQgAAAAEVGV4dAROYW1lCUlzQ2hlY2tlZApJbWFnZUluZGV4 + CEltYWdlS2V5ElNlbGVjdGVkSW1hZ2VJbmRleBBTZWxlY3RlZEltYWdlS2V5CkNoaWxkQ291bnQBAQAA + AQABAAEICAgCAAAABgMAAAALT1MgTWFuYWdlcnMGBAAAAApPU01hbmFnZXJzAP////8GBQAAAAD///// + CQUAAAAAAAAACw== + + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5UcmVlTm9kZQoAAAAEVGV4dAROYW1lCUlzQ2hlY2tlZApJbWFnZUluZGV4 + CEltYWdlS2V5ElNlbGVjdGVkSW1hZ2VJbmRleBBTZWxlY3RlZEltYWdlS2V5CkNoaWxkQ291bnQJY2hp + bGRyZW4wCWNoaWxkcmVuMQEBAAABAAEABAQBCAgIHVN5c3RlbS5XaW5kb3dzLkZvcm1zLlRyZWVOb2Rl + AgAAAB1TeXN0ZW0uV2luZG93cy5Gb3Jtcy5UcmVlTm9kZQIAAAACAAAABgMAAAAMQ29ubmVjdGl2aXR5 + BgQAAAAMQ29ubmVjdGl2aXR5AP////8GBQAAAAD/////CQUAAAACAAAACQYAAAAJBwAAAAUGAAAAHVN5 + c3RlbS5XaW5kb3dzLkZvcm1zLlRyZWVOb2RlCAAAAARUZXh0BE5hbWUJSXNDaGVja2VkCkltYWdlSW5k + ZXgISW1hZ2VLZXkSU2VsZWN0ZWRJbWFnZUluZGV4EFNlbGVjdGVkSW1hZ2VLZXkKQ2hpbGRDb3VudAEB + AAABAAEAAQgICAIAAAAGCAAAAApUcmFuc3BvcnRzBgkAAAAKVHJhbnNwb3J0cwD/////CQUAAAD///// + CQUAAAAAAAAABQcAAAAdU3lzdGVtLldpbmRvd3MuRm9ybXMuVHJlZU5vZGUIAAAABFRleHQETmFtZQlJ + c0NoZWNrZWQKSW1hZ2VJbmRleAhJbWFnZUtleRJTZWxlY3RlZEltYWdlSW5kZXgQU2VsZWN0ZWRJbWFn + ZUtleQpDaGlsZENvdW50AQEAAAEAAQABCAgIAgAAAAYLAAAACE5ldHdvcmtzBgwAAAAITmV0d29ya3MA + /////wkFAAAA/////wkFAAAAAAAAAAs= + + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAAB1TeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5UcmVlTm9kZQkAAAAEVGV4dAROYW1lCUlzQ2hlY2tlZApJbWFnZUluZGV4 + CEltYWdlS2V5ElNlbGVjdGVkSW1hZ2VJbmRleBBTZWxlY3RlZEltYWdlS2V5CkNoaWxkQ291bnQIVXNl + ckRhdGEBAQAAAQABAAEBCAgIAgAAAAYDAAAAEURlcGxveWVkIFNlcnZpY2VzBgQAAAAQRGVwbG95ZWRT + ZXJ2aWNlcwD/////BgUAAAAA/////wkFAAAAAAAAAAkFAAAACw== + + + + Sujet + + + Anglais + + + Anglais + + + Espagnol + + + Espagnol + + + statusStrip1 + + + Langue + + + Langue + + + Fournisseur de services + + + Nouveau + + + Fournisseurs de services + + + Nouveau + + + topMenu + + + Outils + + + toolStrip1 + + + test + + + Français + + + Allemand + + + Sortie + + + Fichier + + + Sujet + + + Vider le Cache + + + Efface le cache + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/MainForm.resx b/client/administration/UdsAdmin/forms/MainForm.resx new file mode 100644 index 000000000..29d70c845 --- /dev/null +++ b/client/administration/UdsAdmin/forms/MainForm.resx @@ -0,0 +1,531 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Fill + + + + 0, 50 + + + Fill + + + 0, 0 + + + 200, 376 + + + + 0 + + + treeActions + + + System.Windows.Forms.TreeView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer1.Panel1 + + + 0 + + + splitContainer1.Panel1 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer1 + + + 0 + + + 32 + + + splitContainer1.Panel2 + + + System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + splitContainer1 + + + 1 + + + 32 + + + 610, 376 + + + 146 + + + 3 + + + splitContainer1 + + + System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + 17, 17 + + + 0, 426 + + + 610, 22 + + + 0 + + + statusStrip1 + + + statusStrip1 + + + System.Windows.Forms.StatusStrip, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + 133, 17 + + + 102, 22 + + + Exit + + + 42, 21 + + + File + + + 127, 22 + + + English + + + 127, 22 + + + Spanish + + + 127, 22 + + + French + + + 127, 22 + + + German + + + 165, 22 + + + Language + + + 165, 22 + + + Configuration + + + 165, 22 + + + About + + + 52, 21 + + + Tools + + + 0, 0 + + + 610, 25 + + + 1 + + + topMenu + + + menuStrip1 + + + System.Windows.Forms.MenuStrip, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 3 + + + 106, 22 + + + New + + + 106, 22 + + + 103, 20 + + + Service Provider + + + 32, 19 + + + 126, 22 + + + Spanish + + + 126, 22 + + + English + + + 126, 22 + + + Language + + + 126, 22 + + + About + + + 248, 17 + + + Magenta + + + 23, 22 + + + Flush Cache + + + Clears the cache + + + 0, 25 + + + 610, 25 + + + 2 + + + toolStrip1 + + + toolStrip1 + + + System.Windows.Forms.ToolStrip, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + True + + + 6, 13 + + + 610, 448 + + + UDS Administration + + + fileToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + exitToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + toolsToolStripMenuItem1 + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + languageToolStripMenuItem1 + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + englishToolStripMenuItem1 + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + spanishToolStripMenuItem1 + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + frenchToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + germanToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + configurationToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + aboutToolStripMenuItem1 + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + serviceProviderToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + newServiceProviderMenu + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + testToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + toolsToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + languageToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + spanishToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + englishToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + aboutToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + toolStripButton1 + + + System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + MainForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/NetworkForm.Designer.cs b/client/administration/UdsAdmin/forms/NetworkForm.Designer.cs new file mode 100644 index 000000000..0b58d77a2 --- /dev/null +++ b/client/administration/UdsAdmin/forms/NetworkForm.Designer.cs @@ -0,0 +1,138 @@ +namespace UdsAdmin.forms +{ + partial class NetworkForm + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de Windows Forms + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NetworkForm)); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.accept = new System.Windows.Forms.Button(); + this.cancel = new System.Windows.Forms.Button(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.label3 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.groupLabel = new System.Windows.Forms.Label(); + this.name = new System.Windows.Forms.TextBox(); + this.netStart = new System.Windows.Forms.TextBox(); + this.netEnd = new System.Windows.Forms.TextBox(); + this.tableLayoutPanel2.SuspendLayout(); + this.tableLayoutPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // tableLayoutPanel2 + // + resources.ApplyResources(this.tableLayoutPanel2, "tableLayoutPanel2"); + this.tableLayoutPanel2.Controls.Add(this.accept, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.cancel, 2, 0); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + // + // accept + // + resources.ApplyResources(this.accept, "accept"); + this.accept.Name = "accept"; + this.accept.UseVisualStyleBackColor = true; + this.accept.Click += new System.EventHandler(this.accept_Click); + // + // cancel + // + resources.ApplyResources(this.cancel, "cancel"); + this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancel.Name = "cancel"; + this.cancel.UseVisualStyleBackColor = true; + // + // tableLayoutPanel1 + // + resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); + this.tableLayoutPanel1.Controls.Add(this.label3, 0, 2); + this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.groupLabel, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.name, 1, 0); + this.tableLayoutPanel1.Controls.Add(this.netStart, 1, 1); + this.tableLayoutPanel1.Controls.Add(this.netEnd, 1, 2); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + // + // label3 + // + resources.ApplyResources(this.label3, "label3"); + this.label3.Name = "label3"; + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.Name = "label2"; + // + // groupLabel + // + resources.ApplyResources(this.groupLabel, "groupLabel"); + this.groupLabel.Name = "groupLabel"; + // + // name + // + resources.ApplyResources(this.name, "name"); + this.name.Name = "name"; + // + // netStart + // + resources.ApplyResources(this.netStart, "netStart"); + this.netStart.Name = "netStart"; + // + // netEnd + // + resources.ApplyResources(this.netEnd, "netEnd"); + this.netEnd.Name = "netEnd"; + // + // NetworkForm + // + this.AcceptButton = this.accept; + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.cancel; + this.Controls.Add(this.tableLayoutPanel1); + this.Controls.Add(this.tableLayoutPanel2); + this.Name = "NetworkForm"; + this.Load += new System.EventHandler(this.NetworkForm_Load); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.Button accept; + private System.Windows.Forms.Button cancel; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label groupLabel; + private System.Windows.Forms.TextBox name; + private System.Windows.Forms.TextBox netStart; + private System.Windows.Forms.TextBox netEnd; + } +} \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/NetworkForm.cs b/client/administration/UdsAdmin/forms/NetworkForm.cs new file mode 100644 index 000000000..f664ea3d7 --- /dev/null +++ b/client/administration/UdsAdmin/forms/NetworkForm.cs @@ -0,0 +1,124 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.forms +{ + public partial class NetworkForm : Form + { + private xmlrpc.Network _net; + + public NetworkForm(xmlrpc.Network net = null) + { + InitializeComponent(); + + if (net != null) + _net = net; + else + _net = new xmlrpc.Network(); + + netStart.KeyPress += HandleKeyPress; + netEnd.KeyPress += HandleKeyPress; + + Text = Strings.titleNetwork; + } + + private void NetworkForm_Load(object sender, EventArgs e) + { + if (_net == null) + { + name.Text = _net.name; + netStart.Text = _net.netStart; + netEnd.Text = _net.netEnd; + } + } + + private void accept_Click(object sender, EventArgs e) + { + if (name.Text.Trim().Length == 0) + { + gui.UserNotifier.notifyError(Strings.nameRequired); + return; + } + System.Net.IPAddress ip; + System.Net.IPAddress ip2; + if (System.Net.IPAddress.TryParse(netStart.Text, out ip) == false) + { + MessageBox.Show(Strings.invalidIpAddress, Strings.netStart, MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + if (System.Net.IPAddress.TryParse(netEnd.Text, out ip2) == false) + { + MessageBox.Show(Strings.invalidIpAddress, Strings.netEnd, MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + if (ip.Address > ip2.Address) + { + MessageBox.Show(Strings.netRangeError, Strings.netStart + "/" + Strings.netEnd, MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + _net.name = name.Text; + _net.netStart = netStart.Text; + _net.netEnd = netEnd.Text; + try { + if (_net.id == "") + { + xmlrpc.UdsAdminService.CreateNetwork(_net); + } + else + { + xmlrpc.UdsAdminService.ModifyNetwork(_net); + } + DialogResult = System.Windows.Forms.DialogResult.OK; + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + + } + + private void HandleKeyPress(object sender, KeyPressEventArgs e) + { + if (!(char.IsDigit(e.KeyChar) || char.IsControl(e.KeyChar)) && e.KeyChar != '.') + e.Handled = true; + } + + } +} diff --git a/client/administration/UdsAdmin/forms/NetworkForm.de.resx b/client/administration/UdsAdmin/forms/NetworkForm.de.resx new file mode 100644 index 000000000..eb0ad66b9 --- /dev/null +++ b/client/administration/UdsAdmin/forms/NetworkForm.de.resx @@ -0,0 +1,417 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 3 + + + + Bottom, Left, Right + + + + 3, 7 + + + 121, 23 + + + 3 + + + Akzeptieren + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Bottom, Left, Right + + + 300, 7 + + + 123, 23 + + + 4 + + + Abbrechen + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + Bottom + + + 0, 117 + + + 1 + + + 426, 33 + + + 9 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="accept" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cancel" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + Top, Left, Right + + + 2 + + + True + + + 3, 62 + + + 3, 6, 3, 0 + + + 69, 13 + + + 7 + + + Netzwerk-Ende + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + True + + + 3, 34 + + + 3, 6, 3, 0 + + + 72, 13 + + + 1 + + + Netzwerk-Start + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + True + + + 3, 6 + + + 3, 6, 3, 0 + + + 113, 13 + + + 0 + + + Netzwerk-Bereich Name + + + groupLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + Fill + + + 147, 3 + + + 252, 20 + + + 0 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + 147, 31 + + + 119, 20 + + + 1 + + + netStart + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + 147, 59 + + + 119, 20 + + + 2 + + + netEnd + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 5 + + + 12, 12 + + + 3 + + + 402, 85 + + + 10 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label3" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="groupLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="name" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="netStart" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="netEnd" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,35,95506,Percent,64,04494" /><Rows Styles="Percent,33,Percent,33,Percent,34" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 426, 150 + + + Network + + + NetworkForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/NetworkForm.es.resx b/client/administration/UdsAdmin/forms/NetworkForm.es.resx new file mode 100644 index 000000000..097926fd0 --- /dev/null +++ b/client/administration/UdsAdmin/forms/NetworkForm.es.resx @@ -0,0 +1,417 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 3 + + + + Bottom, Left, Right + + + + 3, 7 + + + 121, 23 + + + 3 + + + Aceptar + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Bottom, Left, Right + + + 300, 7 + + + 123, 23 + + + 4 + + + Cancelar + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + Bottom + + + 0, 117 + + + 1 + + + 426, 33 + + + 9 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="accept" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cancel" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + Top, Left, Right + + + 2 + + + True + + + 3, 62 + + + 3, 6, 3, 0 + + + 69, 13 + + + 7 + + + Final de red + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + True + + + 3, 34 + + + 3, 6, 3, 0 + + + 72, 13 + + + 1 + + + Inicio de red + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + True + + + 3, 6 + + + 3, 6, 3, 0 + + + 113, 13 + + + 0 + + + Nombre de rango de red + + + groupLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + Fill + + + 147, 3 + + + 252, 20 + + + 0 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + 147, 31 + + + 119, 20 + + + 1 + + + netStart + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + 147, 59 + + + 119, 20 + + + 2 + + + netEnd + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 5 + + + 12, 12 + + + 3 + + + 402, 85 + + + 10 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label3" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="groupLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="name" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="netStart" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="netEnd" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,35,95506,Percent,64,04494" /><Rows Styles="Percent,33,Percent,33,Percent,34" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 426, 150 + + + Network + + + NetworkForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/NetworkForm.fr.resx b/client/administration/UdsAdmin/forms/NetworkForm.fr.resx new file mode 100644 index 000000000..f24c7df88 --- /dev/null +++ b/client/administration/UdsAdmin/forms/NetworkForm.fr.resx @@ -0,0 +1,417 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 3 + + + + Bottom, Left, Right + + + + 3, 7 + + + 121, 23 + + + 3 + + + Accepter + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Bottom, Left, Right + + + 300, 7 + + + 123, 23 + + + 4 + + + Annuler + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + Bottom + + + 0, 117 + + + 1 + + + 426, 33 + + + 9 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="accept" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cancel" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + Top, Left, Right + + + 2 + + + True + + + 3, 62 + + + 3, 6, 3, 0 + + + 69, 13 + + + 7 + + + Fin de réseau + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + True + + + 3, 34 + + + 3, 6, 3, 0 + + + 72, 13 + + + 1 + + + Début du réseau + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + True + + + 3, 6 + + + 3, 6, 3, 0 + + + 113, 13 + + + 0 + + + Nom de la plage réseau + + + groupLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + Fill + + + 147, 3 + + + 252, 20 + + + 0 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + 147, 31 + + + 119, 20 + + + 1 + + + netStart + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + 147, 59 + + + 119, 20 + + + 2 + + + netEnd + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 5 + + + 12, 12 + + + 3 + + + 402, 85 + + + 10 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label3" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="groupLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="name" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="netStart" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="netEnd" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,35,95506,Percent,64,04494" /><Rows Styles="Percent,33,Percent,33,Percent,34" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 426, 150 + + + Network + + + NetworkForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/NetworkForm.resx b/client/administration/UdsAdmin/forms/NetworkForm.resx new file mode 100644 index 000000000..564185acc --- /dev/null +++ b/client/administration/UdsAdmin/forms/NetworkForm.resx @@ -0,0 +1,420 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 3 + + + + Bottom, Left, Right + + + + 3, 7 + + + 121, 23 + + + 3 + + + Accept + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Bottom, Left, Right + + + 300, 7 + + + 123, 23 + + + 4 + + + Cancel + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + Bottom + + + 0, 117 + + + 1 + + + 426, 33 + + + 9 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="accept" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cancel" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + Top, Left, Right + + + 2 + + + True + + + 3, 62 + + + 3, 6, 3, 0 + + + 69, 13 + + + 7 + + + Network End + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + True + + + 3, 34 + + + 3, 6, 3, 0 + + + 72, 13 + + + 1 + + + Network Start + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + True + + + 3, 6 + + + 3, 6, 3, 0 + + + 113, 13 + + + 0 + + + Network Range Name + + + groupLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + Fill + + + 147, 3 + + + 252, 20 + + + 0 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + 147, 31 + + + 119, 20 + + + 1 + + + netStart + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + 147, 59 + + + 119, 20 + + + 2 + + + netEnd + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 5 + + + 12, 12 + + + 3 + + + 402, 85 + + + 10 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label3" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="groupLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="name" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="netStart" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="netEnd" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,35,95506,Percent,64,04494" /><Rows Styles="Percent,33,Percent,33,Percent,34" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 426, 150 + + + CenterParent + + + Network + + + NetworkForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/OSManagerForm.Designer.cs b/client/administration/UdsAdmin/forms/OSManagerForm.Designer.cs new file mode 100644 index 000000000..40c57ba1f --- /dev/null +++ b/client/administration/UdsAdmin/forms/OSManagerForm.Designer.cs @@ -0,0 +1,174 @@ +namespace UdsAdmin.forms +{ + partial class OSManagerForm + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de Windows Forms + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OSManagerForm)); + this.groupData = new System.Windows.Forms.GroupBox(); + this.dataPanel = new System.Windows.Forms.TableLayoutPanel(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.comments = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.name = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.accept = new System.Windows.Forms.Button(); + this.cancel = new System.Windows.Forms.Button(); + this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); + this.test = new System.Windows.Forms.Button(); + this.groupData.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.tableLayoutPanel2.SuspendLayout(); + this.tableLayoutPanel1.SuspendLayout(); + this.tableLayoutPanel3.SuspendLayout(); + this.SuspendLayout(); + // + // groupData + // + resources.ApplyResources(this.groupData, "groupData"); + this.groupData.Controls.Add(this.dataPanel); + this.groupData.Name = "groupData"; + this.groupData.TabStop = false; + // + // dataPanel + // + resources.ApplyResources(this.dataPanel, "dataPanel"); + this.dataPanel.Name = "dataPanel"; + // + // groupBox1 + // + resources.ApplyResources(this.groupBox1, "groupBox1"); + this.groupBox1.Controls.Add(this.tableLayoutPanel2); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.TabStop = false; + // + // tableLayoutPanel2 + // + resources.ApplyResources(this.tableLayoutPanel2, "tableLayoutPanel2"); + this.tableLayoutPanel2.Controls.Add(this.comments, 1, 1); + this.tableLayoutPanel2.Controls.Add(this.label2, 0, 1); + this.tableLayoutPanel2.Controls.Add(this.name, 1, 0); + this.tableLayoutPanel2.Controls.Add(this.label1, 0, 0); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + // + // comments + // + resources.ApplyResources(this.comments, "comments"); + this.comments.Name = "comments"; + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.Name = "label2"; + // + // name + // + resources.ApplyResources(this.name, "name"); + this.name.Name = "name"; + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // + // tableLayoutPanel1 + // + resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); + this.tableLayoutPanel1.Controls.Add(this.accept, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.cancel, 2, 0); + this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel3, 1, 0); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + // + // accept + // + resources.ApplyResources(this.accept, "accept"); + this.accept.Name = "accept"; + this.accept.UseVisualStyleBackColor = true; + this.accept.Click += new System.EventHandler(this.accept_Click); + // + // cancel + // + resources.ApplyResources(this.cancel, "cancel"); + this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancel.Name = "cancel"; + this.cancel.UseVisualStyleBackColor = true; + // + // tableLayoutPanel3 + // + resources.ApplyResources(this.tableLayoutPanel3, "tableLayoutPanel3"); + this.tableLayoutPanel3.Controls.Add(this.test, 1, 0); + this.tableLayoutPanel3.Name = "tableLayoutPanel3"; + // + // test + // + resources.ApplyResources(this.test, "test"); + this.test.Name = "test"; + this.test.UseVisualStyleBackColor = true; + this.test.Click += new System.EventHandler(this.test_Click); + // + // OSManagerForm + // + this.AcceptButton = this.accept; + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.cancel; + this.Controls.Add(this.groupData); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.tableLayoutPanel1); + this.DoubleBuffered = true; + this.Name = "OSManagerForm"; + this.Load += new System.EventHandler(this.OsManager_Load); + this.groupData.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel2.PerformLayout(); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel3.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupData; + private System.Windows.Forms.TableLayoutPanel dataPanel; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.TextBox comments; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox name; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Button accept; + private System.Windows.Forms.Button cancel; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; + private System.Windows.Forms.Button test; + + } +} \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/OSManagerForm.cs b/client/administration/UdsAdmin/forms/OSManagerForm.cs new file mode 100644 index 000000000..30827ffc8 --- /dev/null +++ b/client/administration/UdsAdmin/forms/OSManagerForm.cs @@ -0,0 +1,137 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.forms +{ + public partial class OSManagerForm : Form + { + string _id; + xmlrpc.GuiField[] _flds; + xmlrpc.GuiFieldValue[] _fldValues; + string _osManagerName; + string _osManagerType; + + public OSManagerForm(string osManagerName, string osManagerType, Icon icon) + { + InitializeComponent(); + _fldValues = null; + _id = null; + _flds = null; + _osManagerName = osManagerName; + _osManagerType = osManagerType; + Icon = icon; + Text = Strings.titleOsManager; + } + + public void setData(string name, string comments, string id, xmlrpc.GuiFieldValue[] data) + { + this.name.Text = name; + this.comments.Text = comments; + this._id = id; + _fldValues = data; + } + + private void OsManager_Load(object sender, EventArgs e) + { + _flds = xmlrpc.UdsAdminService.GetOSManagerGui(_osManagerType); + if (_flds == null) + { + Close(); + return; + } + Size sz = gui.DinamycFieldsManager.PutFields(dataPanel, _flds, _fldValues); + groupData.Size = new Size(groupData.Size.Width, 32 + sz.Height); + Size wSize = new Size(); + wSize.Width = Size.Width; + wSize.Height = groupData.Location.Y + tableLayoutPanel1.Size.Height + groupData.Size.Height + 48; + Size = MinimumSize = MaximumSize = wSize; + + if (_flds.Length == 0) + groupData.Visible = false; + + Text = _osManagerName; + } + + private void accept_Click(object sender, EventArgs e) + { + if (name.Text.Trim().Length == 0) + { + gui.UserNotifier.notifyError(Strings.nameRequired); + return; + } + xmlrpc.GuiFieldValue[] data; + try + { + data = gui.DinamycFieldsManager.ReadFields(dataPanel, _flds); + } + catch (gui.DinamycFieldsManager.ValidationError err) + { + gui.UserNotifier.notifyValidationException(err); + return; + } + if (_id == null) + try { + xmlrpc.UdsAdminService.CreateOSManager(name.Text, comments.Text, _osManagerType, data); + DialogResult = System.Windows.Forms.DialogResult.OK; + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + else + { + try { + xmlrpc.UdsAdminService.ModifyOSManager(name.Text, comments.Text, _id, data); + DialogResult = System.Windows.Forms.DialogResult.OK; + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + + } + } + + private void test_Click(object sender, EventArgs e) + { + xmlrpc.GuiFieldValue[] data = gui.DinamycFieldsManager.ReadFields(dataPanel, _flds); + xmlrpc.ResultTest res = xmlrpc.UdsAdminService.TestOsManager(_osManagerType, data); + gui.UserNotifier.notifyTestResult(res); + } + } +} diff --git a/client/administration/UdsAdmin/forms/OSManagerForm.de.resx b/client/administration/UdsAdmin/forms/OSManagerForm.de.resx new file mode 100644 index 000000000..cc683ba8c --- /dev/null +++ b/client/administration/UdsAdmin/forms/OSManagerForm.de.resx @@ -0,0 +1,306 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + dataPanel + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupData + + + 0 + + + Service-Anbieterdaten + + + groupData + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + comments + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Kommentare + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + Name + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 3 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + Allgemeine Daten + + + groupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Akzeptieren + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Abbrechen + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + Test + + + test + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel3 + + + 0 + + + tableLayoutPanel3 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + ServiceProvider + + + OSManagerForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/OSManagerForm.es.resx b/client/administration/UdsAdmin/forms/OSManagerForm.es.resx new file mode 100644 index 000000000..15af18ebe --- /dev/null +++ b/client/administration/UdsAdmin/forms/OSManagerForm.es.resx @@ -0,0 +1,306 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + dataPanel + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupData + + + 0 + + + Datos del proveedor de servicio + + + groupData + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + comments + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Comentarios + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + Nombre + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 3 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + Datos comunes + + + groupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Aceptar + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Cancelar + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + Prueba + + + test + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel3 + + + 0 + + + tableLayoutPanel3 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + ServiceProvider + + + OSManagerForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/OSManagerForm.fr.resx b/client/administration/UdsAdmin/forms/OSManagerForm.fr.resx new file mode 100644 index 000000000..136a329be --- /dev/null +++ b/client/administration/UdsAdmin/forms/OSManagerForm.fr.resx @@ -0,0 +1,306 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + dataPanel + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupData + + + 0 + + + Données de fournisseur de service + + + groupData + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + comments + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Commentaires + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + Nom + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 3 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + Données communes + + + groupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Accepter + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Annuler + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + Test + + + test + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel3 + + + 0 + + + tableLayoutPanel3 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + ServiceProvider + + + OSManagerForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/OSManagerForm.resx b/client/administration/UdsAdmin/forms/OSManagerForm.resx new file mode 100644 index 000000000..c0bff3265 --- /dev/null +++ b/client/administration/UdsAdmin/forms/OSManagerForm.resx @@ -0,0 +1,507 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Top, Left, Right + + + + 2 + + + Fill + + + + 3, 16 + + + 2 + + + 439, 120 + + + 0 + + + dataPanel + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupData + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls /><Columns Styles="Percent,50,Percent,50" /><Rows Styles="Percent,50,Percent,50" /></TableLayoutSettings> + + + 13, 105 + + + 445, 139 + + + 7 + + + Service Provider Data + + + groupData + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + Top, Left, Right + + + 2 + + + 82, 36 + + + 320, 20 + + + 3 + + + comments + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Left + + + True + + + 3, 43 + + + 56, 13 + + + 1 + + + Comments + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + 82, 3 + + + 320, 20 + + + 2 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + Left + + + True + + + 3, 10 + + + 35, 13 + + + 0 + + + Name + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 3 + + + 12, 19 + + + 2 + + + 414, 67 + + + 2 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="comments" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="name" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,19,29825,Percent,80,70175" /><Rows Styles="Percent,50,Percent,50" /></TableLayoutSettings> + + + 13, 7 + + + 445, 92 + + + 6 + + + Common Data + + + groupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + 3 + + + Bottom, Left, Right + + + 3, 7 + + + 135, 23 + + + 0 + + + Accept + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Bottom, Left, Right + + + 332, 7 + + + 135, 23 + + + 1 + + + Cancel + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + 3 + + + Fill + + + 39, 3 + + + 103, 21 + + + 0 + + + Test + + + test + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel3 + + + 0 + + + 144, 3 + + + 1 + + + 182, 27 + + + 2 + + + tableLayoutPanel3 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="test" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,20,Percent,60,Percent,20" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + Bottom + + + 0, 270 + + + 1 + + + 470, 33 + + + 5 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="accept" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cancel" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="tableLayoutPanel3" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 470, 303 + + + CenterParent + + + Os Manager + + + OSManagerForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/SearchForm.Designer.cs b/client/administration/UdsAdmin/forms/SearchForm.Designer.cs new file mode 100644 index 000000000..12a201491 --- /dev/null +++ b/client/administration/UdsAdmin/forms/SearchForm.Designer.cs @@ -0,0 +1,146 @@ +namespace UdsAdmin.forms +{ + partial class SearchForm + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de Windows Forms + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SearchForm)); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.close = new System.Windows.Forms.Button(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.searchLabel = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.searchText = new System.Windows.Forms.TextBox(); + this.searchButton = new System.Windows.Forms.Button(); + this.resultsList = new System.Windows.Forms.ListView(); + this.id = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.name = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.tableLayoutPanel2.SuspendLayout(); + this.tableLayoutPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // tableLayoutPanel2 + // + resources.ApplyResources(this.tableLayoutPanel2, "tableLayoutPanel2"); + this.tableLayoutPanel2.Controls.Add(this.close, 2, 0); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + // + // close + // + resources.ApplyResources(this.close, "close"); + this.close.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.close.Name = "close"; + this.close.UseVisualStyleBackColor = true; + this.close.Click += new System.EventHandler(this.cancel_Click); + // + // tableLayoutPanel1 + // + resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); + this.tableLayoutPanel1.Controls.Add(this.searchLabel, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.label1, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.searchText, 1, 0); + this.tableLayoutPanel1.Controls.Add(this.searchButton, 2, 0); + this.tableLayoutPanel1.Controls.Add(this.resultsList, 1, 1); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + // + // searchLabel + // + resources.ApplyResources(this.searchLabel, "searchLabel"); + this.searchLabel.Name = "searchLabel"; + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // + // searchText + // + resources.ApplyResources(this.searchText, "searchText"); + this.searchText.Name = "searchText"; + // + // searchButton + // + resources.ApplyResources(this.searchButton, "searchButton"); + this.searchButton.Name = "searchButton"; + this.searchButton.UseVisualStyleBackColor = true; + this.searchButton.Click += new System.EventHandler(this.searchButton_Click); + // + // resultsList + // + this.resultsList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.id, + this.name}); + this.tableLayoutPanel1.SetColumnSpan(this.resultsList, 2); + resources.ApplyResources(this.resultsList, "resultsList"); + this.resultsList.FullRowSelect = true; + this.resultsList.Name = "resultsList"; + this.resultsList.UseCompatibleStateImageBehavior = false; + this.resultsList.View = System.Windows.Forms.View.Details; + this.resultsList.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.resultsList_ColumnClick); + this.resultsList.DoubleClick += new System.EventHandler(this.resultsList_DoubleClick); + // + // id + // + resources.ApplyResources(this.id, "id"); + // + // name + // + resources.ApplyResources(this.name, "name"); + // + // SearchForm + // + this.AcceptButton = this.searchButton; + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.close; + this.Controls.Add(this.tableLayoutPanel2); + this.Controls.Add(this.tableLayoutPanel1); + this.Name = "SearchForm"; + this.Load += new System.EventHandler(this.SearchForm_Load); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.Button close; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Label searchLabel; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox searchText; + private System.Windows.Forms.Button searchButton; + private System.Windows.Forms.ListView resultsList; + private System.Windows.Forms.ColumnHeader id; + private System.Windows.Forms.ColumnHeader name; + + + } +} \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/SearchForm.cs b/client/administration/UdsAdmin/forms/SearchForm.cs new file mode 100644 index 000000000..3e4010562 --- /dev/null +++ b/client/administration/UdsAdmin/forms/SearchForm.cs @@ -0,0 +1,113 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.forms +{ + public partial class SearchForm : Form + { + public enum Type { userSearch, groupSearch }; + + private Type _type; + private string _authId; + gui.ListViewSorter _listSorter; + + public SearchForm(Type type, xmlrpc.Authenticator auth, string defText = null) + { + InitializeComponent(); + _type = type; + _authId = auth.id; + if (defText != null) + searchText.Text = defText; + + resultsList.ListViewItemSorter = _listSorter = new gui.ListViewSorter(resultsList); + } + + private void SearchForm_Load(object sender, EventArgs e) + { + if (_type == Type.userSearch) + { + Text = Strings.searchUser; + searchLabel.Text = Strings.user; + } + else + { + Text = Strings.searchGroup; + searchLabel.Text = Strings.group; + } + } + + public string selection + { + get { return resultsList.SelectedItems[0].SubItems[0].Text; } + } + + private void cancel_Click(object sender, EventArgs e) + { + DialogResult = System.Windows.Forms.DialogResult.No; + } + + private void searchButton_Click(object sender, EventArgs e) + { + string srch = searchText.Text.Trim(); + try + { + xmlrpc.SimpleInfo[] res = xmlrpc.UdsAdminService.SearchAuthenticator(_authId, _type == Type.userSearch, srch); + resultsList.Items.Clear(); + foreach (xmlrpc.SimpleInfo r in res) + { + ListViewItem itm = new ListViewItem(new string[]{r.id, r.name}); + resultsList.Items.Add(itm); + } + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + } + + private void resultsList_ColumnClick(object sender, ColumnClickEventArgs e) + { + _listSorter.ColumnClick(sender, e); + } + + private void resultsList_DoubleClick(object sender, EventArgs e) + { + DialogResult = System.Windows.Forms.DialogResult.Yes; + } + } +} diff --git a/client/administration/UdsAdmin/forms/SearchForm.de.resx b/client/administration/UdsAdmin/forms/SearchForm.de.resx new file mode 100644 index 000000000..c630dcc9b --- /dev/null +++ b/client/administration/UdsAdmin/forms/SearchForm.de.resx @@ -0,0 +1,399 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 3 + + + + Bottom, Left, Right + + + NoControl + + + + 293, 7 + + + 119, 23 + + + 9 + + + Schließen + + + close + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Bottom + + + 0, 234 + + + 1 + + + 415, 33 + + + 7 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="close" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + Top, Bottom, Left, Right + + + 3 + + + True + + + NoControl + + + 3, 6 + + + 3, 6, 3, 0 + + + 63, 13 + + + 1 + + + Suchbegriff + + + searchLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + True + + + NoControl + + + 3, 35 + + + 3, 6, 3, 0 + + + 42, 13 + + + 2 + + + Ergebnisse + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + 109, 3 + + + 178, 20 + + + 3 + + + searchText + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + 331, 3 + + + 64, 21 + + + 4 + + + Suche + + + searchButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + Id + + + 85 + + + Name + + + 175 + + + Fill + + + 109, 32 + + + 300, 190 + + + 5 + + + resultsList + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + 0, 3 + + + 2 + + + 412, 225 + + + 0 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="searchLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label1" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="searchText" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="searchButton" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="resultsList" Row="1" RowSpan="1" Column="1" ColumnSpan="2" /></Controls><Columns Styles="Percent,25,81699,Percent,53,92157,Percent,20" /><Rows Styles="Percent,12,88889,Percent,87,11111,Absolute,20" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 415, 267 + + + CenterParent + + + SearchForm + + + id + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + SearchForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/SearchForm.es.resx b/client/administration/UdsAdmin/forms/SearchForm.es.resx new file mode 100644 index 000000000..a55458e47 --- /dev/null +++ b/client/administration/UdsAdmin/forms/SearchForm.es.resx @@ -0,0 +1,399 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 3 + + + + Bottom, Left, Right + + + NoControl + + + + 293, 7 + + + 119, 23 + + + 9 + + + Cerrar + + + close + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Bottom + + + 0, 234 + + + 1 + + + 415, 33 + + + 7 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="close" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + Top, Bottom, Left, Right + + + 3 + + + True + + + NoControl + + + 3, 6 + + + 3, 6, 3, 0 + + + 63, 13 + + + 1 + + + Elemento de búsqueda + + + searchLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + True + + + NoControl + + + 3, 35 + + + 3, 6, 3, 0 + + + 42, 13 + + + 2 + + + Resultados + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + 109, 3 + + + 178, 20 + + + 3 + + + searchText + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + 331, 3 + + + 64, 21 + + + 4 + + + Búsqueda + + + searchButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + Id + + + 85 + + + Nombre + + + 175 + + + Fill + + + 109, 32 + + + 300, 190 + + + 5 + + + resultsList + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + 0, 3 + + + 2 + + + 412, 225 + + + 0 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="searchLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label1" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="searchText" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="searchButton" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="resultsList" Row="1" RowSpan="1" Column="1" ColumnSpan="2" /></Controls><Columns Styles="Percent,25,81699,Percent,53,92157,Percent,20" /><Rows Styles="Percent,12,88889,Percent,87,11111,Absolute,20" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 415, 267 + + + CenterParent + + + SearchForm + + + id + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + SearchForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/SearchForm.fr.resx b/client/administration/UdsAdmin/forms/SearchForm.fr.resx new file mode 100644 index 000000000..221b32631 --- /dev/null +++ b/client/administration/UdsAdmin/forms/SearchForm.fr.resx @@ -0,0 +1,399 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 3 + + + + Bottom, Left, Right + + + NoControl + + + + 293, 7 + + + 119, 23 + + + 9 + + + Fermer + + + close + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Bottom + + + 0, 234 + + + 1 + + + 415, 33 + + + 7 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="close" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + Top, Bottom, Left, Right + + + 3 + + + True + + + NoControl + + + 3, 6 + + + 3, 6, 3, 0 + + + 63, 13 + + + 1 + + + Élément de recherche + + + searchLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + True + + + NoControl + + + 3, 35 + + + 3, 6, 3, 0 + + + 42, 13 + + + 2 + + + Résultats + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + 109, 3 + + + 178, 20 + + + 3 + + + searchText + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + 331, 3 + + + 64, 21 + + + 4 + + + Recherche + + + searchButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + Id + + + 85 + + + Nom + + + 175 + + + Fill + + + 109, 32 + + + 300, 190 + + + 5 + + + resultsList + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + 0, 3 + + + 2 + + + 412, 225 + + + 0 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="searchLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label1" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="searchText" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="searchButton" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="resultsList" Row="1" RowSpan="1" Column="1" ColumnSpan="2" /></Controls><Columns Styles="Percent,25,81699,Percent,53,92157,Percent,20" /><Rows Styles="Percent,12,88889,Percent,87,11111,Absolute,20" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 415, 267 + + + CenterParent + + + SearchForm + + + id + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + SearchForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/SearchForm.resx b/client/administration/UdsAdmin/forms/SearchForm.resx new file mode 100644 index 000000000..3b91f4728 --- /dev/null +++ b/client/administration/UdsAdmin/forms/SearchForm.resx @@ -0,0 +1,399 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 3 + + + + Bottom, Left, Right + + + NoControl + + + + 293, 7 + + + 119, 23 + + + 9 + + + Close + + + close + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Bottom + + + 0, 234 + + + 1 + + + 415, 33 + + + 7 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="close" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + Top, Bottom, Left, Right + + + 3 + + + True + + + NoControl + + + 3, 6 + + + 3, 6, 3, 0 + + + 63, 13 + + + 1 + + + Search item + + + searchLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + True + + + NoControl + + + 3, 35 + + + 3, 6, 3, 0 + + + 42, 13 + + + 2 + + + Results + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + 109, 3 + + + 178, 20 + + + 3 + + + searchText + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + 331, 3 + + + 64, 21 + + + 4 + + + Search + + + searchButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + Id + + + 85 + + + Name + + + 175 + + + Fill + + + 109, 32 + + + 300, 190 + + + 5 + + + resultsList + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + 0, 3 + + + 2 + + + 412, 225 + + + 0 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="searchLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label1" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="searchText" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="searchButton" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="resultsList" Row="1" RowSpan="1" Column="1" ColumnSpan="2" /></Controls><Columns Styles="Percent,25,81699,Percent,53,92157,Percent,20" /><Rows Styles="Percent,12,88889,Percent,87,11111,Absolute,20" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 415, 267 + + + CenterParent + + + SearchForm + + + id + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + name + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + SearchForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/ServiceForm.Designer.cs b/client/administration/UdsAdmin/forms/ServiceForm.Designer.cs new file mode 100644 index 000000000..13fed3928 --- /dev/null +++ b/client/administration/UdsAdmin/forms/ServiceForm.Designer.cs @@ -0,0 +1,154 @@ +namespace UdsAdmin.forms +{ + partial class ServiceForm + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de Windows Forms + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ServiceForm)); + this.groupData = new System.Windows.Forms.GroupBox(); + this.dataPanel = new System.Windows.Forms.TableLayoutPanel(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.comments = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.name = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.accept = new System.Windows.Forms.Button(); + this.cancel = new System.Windows.Forms.Button(); + this.groupData.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.tableLayoutPanel2.SuspendLayout(); + this.tableLayoutPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // groupData + // + resources.ApplyResources(this.groupData, "groupData"); + this.groupData.Controls.Add(this.dataPanel); + this.groupData.Name = "groupData"; + this.groupData.TabStop = false; + // + // dataPanel + // + resources.ApplyResources(this.dataPanel, "dataPanel"); + this.dataPanel.Name = "dataPanel"; + // + // groupBox1 + // + resources.ApplyResources(this.groupBox1, "groupBox1"); + this.groupBox1.Controls.Add(this.tableLayoutPanel2); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.TabStop = false; + // + // tableLayoutPanel2 + // + resources.ApplyResources(this.tableLayoutPanel2, "tableLayoutPanel2"); + this.tableLayoutPanel2.Controls.Add(this.comments, 1, 1); + this.tableLayoutPanel2.Controls.Add(this.label2, 0, 1); + this.tableLayoutPanel2.Controls.Add(this.name, 1, 0); + this.tableLayoutPanel2.Controls.Add(this.label1, 0, 0); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + // + // comments + // + resources.ApplyResources(this.comments, "comments"); + this.comments.Name = "comments"; + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.Name = "label2"; + // + // name + // + resources.ApplyResources(this.name, "name"); + this.name.Name = "name"; + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // + // tableLayoutPanel1 + // + resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); + this.tableLayoutPanel1.Controls.Add(this.accept, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.cancel, 2, 0); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + // + // accept + // + resources.ApplyResources(this.accept, "accept"); + this.accept.Name = "accept"; + this.accept.UseVisualStyleBackColor = true; + this.accept.Click += new System.EventHandler(this.accept_Click); + // + // cancel + // + resources.ApplyResources(this.cancel, "cancel"); + this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancel.Name = "cancel"; + this.cancel.UseVisualStyleBackColor = true; + // + // ServiceForm + // + this.AcceptButton = this.accept; + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.cancel; + this.Controls.Add(this.groupData); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.tableLayoutPanel1); + this.DoubleBuffered = true; + this.Name = "ServiceForm"; + this.Load += new System.EventHandler(this.Service_Load); + this.groupData.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel2.PerformLayout(); + this.tableLayoutPanel1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupData; + private System.Windows.Forms.TableLayoutPanel dataPanel; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.TextBox comments; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox name; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Button accept; + private System.Windows.Forms.Button cancel; + + } +} \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/ServiceForm.cs b/client/administration/UdsAdmin/forms/ServiceForm.cs new file mode 100644 index 000000000..2bb33ea38 --- /dev/null +++ b/client/administration/UdsAdmin/forms/ServiceForm.cs @@ -0,0 +1,127 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.forms +{ + public partial class ServiceForm : Form + { + string _id; + string _idParent; + xmlrpc.GuiField[] _flds; + xmlrpc.GuiFieldValue[] _fldValues; + string _serviceName; + string _serviceType; + + public ServiceForm(string idParent, string serviceName, string serviceType, Icon icon) + { + InitializeComponent(); + _id = null; + _idParent = idParent; + _serviceName = serviceName; + _serviceType = serviceType; + _flds = null; + _fldValues = null; + Icon = icon; + Text = Strings.titleService; + } + + public void setData(string name, string comments, string id, xmlrpc.GuiFieldValue[] data) + { + this.name.Text = name; + this.comments.Text = comments; + this._id = id; + _fldValues = data; + } + + private void Service_Load(object sender, EventArgs e) + { + _flds = xmlrpc.UdsAdminService.GetServiceGui(_idParent, _serviceType); + if (_flds == null) + { + Close(); + return; + } + Size sz = gui.DinamycFieldsManager.PutFields(dataPanel, _flds, _fldValues); + groupData.Size = new Size(groupData.Size.Width, 32 + sz.Height); + Size wSize = new Size(); + wSize.Width = Size.Width; + wSize.Height = groupData.Location.Y + tableLayoutPanel1.Size.Height + groupData.Size.Height + 48; + Size = MinimumSize = wSize; + wSize.Width = Screen.GetWorkingArea(this).Width; + MaximumSize = wSize; + if (_flds.Length == 0) + groupData.Visible = false; + Text = _serviceName; + //this.Location = System.Windows.Forms.Cursor.Position; + } + + private void accept_Click(object sender, EventArgs e) + { + if (name.Text.Trim().Length == 0) + { + gui.UserNotifier.notifyError(Strings.nameRequired); + return; + } + xmlrpc.GuiFieldValue[] data; + try { + data = gui.DinamycFieldsManager.ReadFields(dataPanel, _flds); + } + catch (gui.DinamycFieldsManager.ValidationError err) + { + gui.UserNotifier.notifyValidationException(err); + return; + } + + try { + if (_id == null) + { + xmlrpc.UdsAdminService.CreateService(_idParent, name.Text, comments.Text, _serviceType, data); + } + else + { + xmlrpc.UdsAdminService.ModifyService(name.Text, comments.Text, _id, data); + } + DialogResult = System.Windows.Forms.DialogResult.OK; + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + } + } +} diff --git a/client/administration/UdsAdmin/forms/ServiceForm.de.resx b/client/administration/UdsAdmin/forms/ServiceForm.de.resx new file mode 100644 index 000000000..7929850eb --- /dev/null +++ b/client/administration/UdsAdmin/forms/ServiceForm.de.resx @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + dataPanel + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupData + + + 0 + + + Service-Daten + + + groupData + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + comments + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Kommentare + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + Name + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 3 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + Allgemeine Daten + + + groupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Akzeptieren + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Abbrechen + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + ServiceProvider + + + ServiceForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/ServiceForm.es.resx b/client/administration/UdsAdmin/forms/ServiceForm.es.resx new file mode 100644 index 000000000..c75eba7d2 --- /dev/null +++ b/client/administration/UdsAdmin/forms/ServiceForm.es.resx @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + dataPanel + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupData + + + 0 + + + Datos del servicio + + + groupData + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + comments + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Comentarios + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + Nombre + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 3 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + Datos comunes + + + groupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Aceptar + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Cancelar + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + ServiceProvider + + + ServiceForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/ServiceForm.fr.resx b/client/administration/UdsAdmin/forms/ServiceForm.fr.resx new file mode 100644 index 000000000..3af469a50 --- /dev/null +++ b/client/administration/UdsAdmin/forms/ServiceForm.fr.resx @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + dataPanel + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupData + + + 0 + + + Données de service + + + groupData + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + comments + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Commentaires + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + Nom + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 3 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + Données communes + + + groupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Accepter + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Annuler + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + ServiceProvider + + + ServiceForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/ServiceForm.resx b/client/administration/UdsAdmin/forms/ServiceForm.resx new file mode 100644 index 000000000..f36c15993 --- /dev/null +++ b/client/administration/UdsAdmin/forms/ServiceForm.resx @@ -0,0 +1,450 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Top, Left, Right + + + + 2 + + + Fill + + + + 3, 16 + + + 2 + + + 465, 140 + + + 0 + + + dataPanel + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupData + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls /><Columns Styles="Percent,50,Percent,50" /><Rows Styles="Percent,50,Percent,50" /></TableLayoutSettings> + + + 13, 105 + + + 471, 159 + + + 7 + + + Service Data + + + groupData + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + Top, Left, Right + + + 2 + + + 90, 36 + + + 348, 20 + + + 3 + + + comments + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Left + + + True + + + 3, 43 + + + 56, 13 + + + 1 + + + Comments + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + 90, 3 + + + 348, 20 + + + 2 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + Left + + + True + + + 3, 10 + + + 35, 13 + + + 0 + + + Name + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 3 + + + 12, 19 + + + 2 + + + 453, 67 + + + 2 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="comments" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="name" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,19,29825,Percent,80,70175" /><Rows Styles="Percent,50,Percent,50" /></TableLayoutSettings> + + + 13, 7 + + + 471, 92 + + + 6 + + + Common Data + + + groupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + 3 + + + Bottom, Left, Right + + + 3, 7 + + + 142, 23 + + + 0 + + + Accept + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Bottom, Left, Right + + + 349, 7 + + + 144, 23 + + + 1 + + + Cancel + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + Bottom + + + 0, 270 + + + 1 + + + 496, 33 + + + 5 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="accept" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cancel" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 496, 303 + + + CenterParent + + + Service + + + ServiceForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/ServiceProviderForm.Designer.cs b/client/administration/UdsAdmin/forms/ServiceProviderForm.Designer.cs new file mode 100644 index 000000000..55d00cf2b --- /dev/null +++ b/client/administration/UdsAdmin/forms/ServiceProviderForm.Designer.cs @@ -0,0 +1,174 @@ +namespace UdsAdmin.forms +{ + partial class ServiceProviderForm + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de Windows Forms + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ServiceProviderForm)); + this.groupData = new System.Windows.Forms.GroupBox(); + this.dataPanel = new System.Windows.Forms.TableLayoutPanel(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.comments = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.name = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.accept = new System.Windows.Forms.Button(); + this.cancel = new System.Windows.Forms.Button(); + this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); + this.test = new System.Windows.Forms.Button(); + this.groupData.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.tableLayoutPanel2.SuspendLayout(); + this.tableLayoutPanel1.SuspendLayout(); + this.tableLayoutPanel3.SuspendLayout(); + this.SuspendLayout(); + // + // groupData + // + resources.ApplyResources(this.groupData, "groupData"); + this.groupData.Controls.Add(this.dataPanel); + this.groupData.Name = "groupData"; + this.groupData.TabStop = false; + // + // dataPanel + // + resources.ApplyResources(this.dataPanel, "dataPanel"); + this.dataPanel.Name = "dataPanel"; + // + // groupBox1 + // + resources.ApplyResources(this.groupBox1, "groupBox1"); + this.groupBox1.Controls.Add(this.tableLayoutPanel2); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.TabStop = false; + // + // tableLayoutPanel2 + // + resources.ApplyResources(this.tableLayoutPanel2, "tableLayoutPanel2"); + this.tableLayoutPanel2.Controls.Add(this.comments, 1, 1); + this.tableLayoutPanel2.Controls.Add(this.label2, 0, 1); + this.tableLayoutPanel2.Controls.Add(this.name, 1, 0); + this.tableLayoutPanel2.Controls.Add(this.label1, 0, 0); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + // + // comments + // + resources.ApplyResources(this.comments, "comments"); + this.comments.Name = "comments"; + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.Name = "label2"; + // + // name + // + resources.ApplyResources(this.name, "name"); + this.name.Name = "name"; + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // + // tableLayoutPanel1 + // + resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); + this.tableLayoutPanel1.Controls.Add(this.accept, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.cancel, 2, 0); + this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel3, 1, 0); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + // + // accept + // + resources.ApplyResources(this.accept, "accept"); + this.accept.Name = "accept"; + this.accept.UseVisualStyleBackColor = true; + this.accept.Click += new System.EventHandler(this.accept_Click); + // + // cancel + // + resources.ApplyResources(this.cancel, "cancel"); + this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancel.Name = "cancel"; + this.cancel.UseVisualStyleBackColor = true; + // + // tableLayoutPanel3 + // + resources.ApplyResources(this.tableLayoutPanel3, "tableLayoutPanel3"); + this.tableLayoutPanel3.Controls.Add(this.test, 1, 0); + this.tableLayoutPanel3.Name = "tableLayoutPanel3"; + // + // test + // + resources.ApplyResources(this.test, "test"); + this.test.Name = "test"; + this.test.UseVisualStyleBackColor = true; + this.test.Click += new System.EventHandler(this.test_Click); + // + // ServiceProviderForm + // + this.AcceptButton = this.accept; + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.cancel; + this.Controls.Add(this.groupData); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.tableLayoutPanel1); + this.DoubleBuffered = true; + this.Name = "ServiceProviderForm"; + this.Load += new System.EventHandler(this.ServiceProvider_Load); + this.groupData.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel2.PerformLayout(); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel3.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupData; + private System.Windows.Forms.TableLayoutPanel dataPanel; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.TextBox comments; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox name; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Button accept; + private System.Windows.Forms.Button cancel; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; + private System.Windows.Forms.Button test; + + } +} \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/ServiceProviderForm.cs b/client/administration/UdsAdmin/forms/ServiceProviderForm.cs new file mode 100644 index 000000000..9d0c15b95 --- /dev/null +++ b/client/administration/UdsAdmin/forms/ServiceProviderForm.cs @@ -0,0 +1,126 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.forms +{ + public partial class ServiceProviderForm : Form + { + string _id; + xmlrpc.GuiField[] _flds; + xmlrpc.GuiFieldValue[] _fldValues; + string _providerName; + string _providerType; + + public ServiceProviderForm(string providerName, string providerType, Icon icon) + { + InitializeComponent(); + _fldValues = null; + _id = null; + _flds = null; + _providerName = providerName; + _providerType = providerType; + Icon = icon; + Text = Strings.titleServiceProvider; + } + + public void setData(string name, string comments, string id, xmlrpc.GuiFieldValue[] data) + { + this.name.Text = name; + this.comments.Text = comments; + this._id = id; + _fldValues = data; + } + + private void ServiceProvider_Load(object sender, EventArgs e) + { + _flds = xmlrpc.UdsAdminService.GetServiceProviderGui(_providerType); + if (_flds == null) + { + Close(); + return; + } + Size sz = gui.DinamycFieldsManager.PutFields(dataPanel, _flds, _fldValues); + groupData.Size = new Size(groupData.Size.Width, 32 + sz.Height); + Size wSize = new Size(); + wSize.Width = Size.Width; + wSize.Height = groupData.Location.Y + tableLayoutPanel1.Size.Height + groupData.Size.Height + 48; + Size = MinimumSize = MaximumSize = wSize; + if (_flds.Length == 0) + groupData.Visible = false; + Text = _providerName; + //this.Location = System.Windows.Forms.Cursor.Position; + } + + private void accept_Click(object sender, EventArgs e) + { + if (name.Text.Trim().Length == 0) + { + gui.UserNotifier.notifyError(Strings.nameRequired); + return; + } + xmlrpc.GuiFieldValue[] data; + try { + data = gui.DinamycFieldsManager.ReadFields(dataPanel, _flds); + } + catch (gui.DinamycFieldsManager.ValidationError err) + { + gui.UserNotifier.notifyValidationException(err); + return; + } + + try { + if (_id == null) + xmlrpc.UdsAdminService.CreateServiceProvider(name.Text, comments.Text, _providerType, data); + else + xmlrpc.UdsAdminService.ModifyServiceProvider(name.Text, comments.Text, _id, data); + DialogResult = System.Windows.Forms.DialogResult.OK; + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + } + + private void test_Click(object sender, EventArgs e) + { + xmlrpc.GuiFieldValue[] data = gui.DinamycFieldsManager.ReadFields(dataPanel, _flds); + xmlrpc.ResultTest res = xmlrpc.UdsAdminService.testServiceProvider(_providerType, data); + gui.UserNotifier.notifyTestResult(res); + } + } +} diff --git a/client/administration/UdsAdmin/forms/ServiceProviderForm.de.resx b/client/administration/UdsAdmin/forms/ServiceProviderForm.de.resx new file mode 100644 index 000000000..2ee0eabfa --- /dev/null +++ b/client/administration/UdsAdmin/forms/ServiceProviderForm.de.resx @@ -0,0 +1,504 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Top, Left, Right + + + + 2 + + + + 12, 19 + + + 2 + + + 200, 100 + + + 0 + + + dataPanel + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupData + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls /><Columns Styles="Percent,50,Percent,50" /><Rows Styles="Percent,50,Percent,50" /></TableLayoutSettings> + + + 13, 105 + + + 473, 139 + + + 7 + + + Service-Anbieterdaten + + + groupData + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + Top, Left, Right + + + 2 + + + 82, 36 + + + 320, 20 + + + 3 + + + comments + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Left + + + True + + + 3, 43 + + + 56, 13 + + + 1 + + + Kommentare + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + 82, 3 + + + 320, 20 + + + 2 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + Left + + + True + + + 3, 10 + + + 35, 13 + + + 0 + + + Name + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 3 + + + 12, 19 + + + 2 + + + 414, 67 + + + 2 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="comments" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="name" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,19,29825,Percent,80,70175" /><Rows Styles="Percent,50,Percent,50" /></TableLayoutSettings> + + + 13, 7 + + + 473, 92 + + + 6 + + + Allgemeine Daten + + + groupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + 3 + + + Bottom, Left, Right + + + 3, 7 + + + 143, 23 + + + 0 + + + Akzeptieren + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Bottom, Left, Right + + + 351, 7 + + + 144, 23 + + + 1 + + + Abbrechen + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + 3 + + + Fill + + + 39, 3 + + + 103, 21 + + + 0 + + + Test + + + test + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel3 + + + 0 + + + 152, 3 + + + 1 + + + 182, 27 + + + 2 + + + tableLayoutPanel3 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="test" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,20,Percent,60,Percent,20" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + Bottom + + + 0, 273 + + + 1 + + + 498, 33 + + + 5 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="accept" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cancel" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="tableLayoutPanel3" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 498, 306 + + + Manual + + + ServiceProvider + + + ServiceProviderForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/ServiceProviderForm.es.resx b/client/administration/UdsAdmin/forms/ServiceProviderForm.es.resx new file mode 100644 index 000000000..bd5306cc0 --- /dev/null +++ b/client/administration/UdsAdmin/forms/ServiceProviderForm.es.resx @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Datos del proveedor de servicios + + + Datos Comunes + + + + 65, 13 + + + Comentarios + + + 44, 13 + + + Nombre + + + Aceptar + + + Cancelar + + + Probar + + + Proveedor de servicios + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/ServiceProviderForm.fr.resx b/client/administration/UdsAdmin/forms/ServiceProviderForm.fr.resx new file mode 100644 index 000000000..c43b7f5b4 --- /dev/null +++ b/client/administration/UdsAdmin/forms/ServiceProviderForm.fr.resx @@ -0,0 +1,504 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Top, Left, Right + + + + 2 + + + + 12, 19 + + + 2 + + + 200, 100 + + + 0 + + + dataPanel + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupData + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls /><Columns Styles="Percent,50,Percent,50" /><Rows Styles="Percent,50,Percent,50" /></TableLayoutSettings> + + + 13, 105 + + + 473, 139 + + + 7 + + + Données de fournisseur de service + + + groupData + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + Top, Left, Right + + + 2 + + + 82, 36 + + + 320, 20 + + + 3 + + + comments + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Left + + + True + + + 3, 43 + + + 56, 13 + + + 1 + + + Commentaires + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + 82, 3 + + + 320, 20 + + + 2 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + Left + + + True + + + 3, 10 + + + 35, 13 + + + 0 + + + Nom + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 3 + + + 12, 19 + + + 2 + + + 414, 67 + + + 2 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="comments" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="name" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,19,29825,Percent,80,70175" /><Rows Styles="Percent,50,Percent,50" /></TableLayoutSettings> + + + 13, 7 + + + 473, 92 + + + 6 + + + Données communes + + + groupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + 3 + + + Bottom, Left, Right + + + 3, 7 + + + 143, 23 + + + 0 + + + Accepter + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Bottom, Left, Right + + + 351, 7 + + + 144, 23 + + + 1 + + + Annuler + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + 3 + + + Fill + + + 39, 3 + + + 103, 21 + + + 0 + + + Test + + + test + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel3 + + + 0 + + + 152, 3 + + + 1 + + + 182, 27 + + + 2 + + + tableLayoutPanel3 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="test" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,20,Percent,60,Percent,20" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + Bottom + + + 0, 273 + + + 1 + + + 498, 33 + + + 5 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="accept" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cancel" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="tableLayoutPanel3" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 498, 306 + + + Manual + + + ServiceProvider + + + ServiceProviderForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/ServiceProviderForm.resx b/client/administration/UdsAdmin/forms/ServiceProviderForm.resx new file mode 100644 index 000000000..1a0fa34d2 --- /dev/null +++ b/client/administration/UdsAdmin/forms/ServiceProviderForm.resx @@ -0,0 +1,507 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Top, Left, Right + + + + 2 + + + Fill + + + + 3, 16 + + + 2 + + + 467, 120 + + + 0 + + + dataPanel + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupData + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls /><Columns Styles="Percent,50,Percent,50" /><Rows Styles="Percent,50,Percent,50" /></TableLayoutSettings> + + + 13, 105 + + + 473, 139 + + + 7 + + + Service Provider Data + + + groupData + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + Top, Left, Right + + + 2 + + + 82, 36 + + + 320, 20 + + + 3 + + + comments + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Left + + + True + + + 3, 43 + + + 56, 13 + + + 1 + + + Comments + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + 82, 3 + + + 320, 20 + + + 2 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + Left + + + True + + + 3, 10 + + + 35, 13 + + + 0 + + + Name + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 3 + + + 12, 19 + + + 2 + + + 414, 67 + + + 2 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="comments" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="name" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,19,29825,Percent,80,70175" /><Rows Styles="Percent,50,Percent,50" /></TableLayoutSettings> + + + 13, 7 + + + 473, 92 + + + 6 + + + Common Data + + + groupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + 3 + + + Bottom, Left, Right + + + 3, 7 + + + 143, 23 + + + 0 + + + Accept + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Bottom, Left, Right + + + 351, 7 + + + 144, 23 + + + 1 + + + Cancel + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + 3 + + + Fill + + + 39, 3 + + + 103, 21 + + + 0 + + + Test + + + test + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel3 + + + 0 + + + 152, 3 + + + 1 + + + 182, 27 + + + 2 + + + tableLayoutPanel3 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="test" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,20,Percent,60,Percent,20" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + Bottom + + + 0, 273 + + + 1 + + + 498, 33 + + + 5 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 2 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="accept" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cancel" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="tableLayoutPanel3" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 498, 306 + + + CenterParent + + + ServiceProvider + + + ServiceProviderForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/TransportForm.Designer.cs b/client/administration/UdsAdmin/forms/TransportForm.Designer.cs new file mode 100644 index 000000000..3eee1b940 --- /dev/null +++ b/client/administration/UdsAdmin/forms/TransportForm.Designer.cs @@ -0,0 +1,251 @@ +namespace UdsAdmin.forms +{ + partial class TransportForm + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de Windows Forms + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TransportForm)); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.accept = new System.Windows.Forms.Button(); + this.cancel = new System.Windows.Forms.Button(); + this.tabs = new System.Windows.Forms.TabControl(); + this.commonPage = new System.Windows.Forms.TabPage(); + this.groupData = new System.Windows.Forms.GroupBox(); + this.dataPanel = new System.Windows.Forms.TableLayoutPanel(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.label3 = new System.Windows.Forms.Label(); + this.comments = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.name = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.priority = new System.Windows.Forms.NumericUpDown(); + this.networks = new System.Windows.Forms.TabPage(); + this.positiveNets = new System.Windows.Forms.CheckBox(); + this.label4 = new System.Windows.Forms.Label(); + this.nets = new System.Windows.Forms.CheckedListBox(); + this.tableLayoutPanel1.SuspendLayout(); + this.tabs.SuspendLayout(); + this.commonPage.SuspendLayout(); + this.groupData.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.tableLayoutPanel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.priority)).BeginInit(); + this.networks.SuspendLayout(); + this.SuspendLayout(); + // + // tableLayoutPanel1 + // + resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); + this.tableLayoutPanel1.Controls.Add(this.accept, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.cancel, 2, 0); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + // + // accept + // + resources.ApplyResources(this.accept, "accept"); + this.accept.Name = "accept"; + this.accept.UseVisualStyleBackColor = true; + this.accept.Click += new System.EventHandler(this.accept_Click); + // + // cancel + // + resources.ApplyResources(this.cancel, "cancel"); + this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancel.Name = "cancel"; + this.cancel.UseVisualStyleBackColor = true; + // + // tabs + // + resources.ApplyResources(this.tabs, "tabs"); + this.tabs.Controls.Add(this.commonPage); + this.tabs.Controls.Add(this.networks); + this.tabs.Name = "tabs"; + this.tabs.SelectedIndex = 0; + // + // commonPage + // + this.commonPage.Controls.Add(this.groupData); + this.commonPage.Controls.Add(this.groupBox1); + resources.ApplyResources(this.commonPage, "commonPage"); + this.commonPage.Name = "commonPage"; + this.commonPage.UseVisualStyleBackColor = true; + // + // groupData + // + resources.ApplyResources(this.groupData, "groupData"); + this.groupData.Controls.Add(this.dataPanel); + this.groupData.Name = "groupData"; + this.groupData.TabStop = false; + // + // dataPanel + // + resources.ApplyResources(this.dataPanel, "dataPanel"); + this.dataPanel.Name = "dataPanel"; + // + // groupBox1 + // + resources.ApplyResources(this.groupBox1, "groupBox1"); + this.groupBox1.Controls.Add(this.tableLayoutPanel2); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.TabStop = false; + // + // tableLayoutPanel2 + // + resources.ApplyResources(this.tableLayoutPanel2, "tableLayoutPanel2"); + this.tableLayoutPanel2.Controls.Add(this.label3, 0, 2); + this.tableLayoutPanel2.Controls.Add(this.comments, 1, 1); + this.tableLayoutPanel2.Controls.Add(this.label2, 0, 1); + this.tableLayoutPanel2.Controls.Add(this.name, 1, 0); + this.tableLayoutPanel2.Controls.Add(this.label1, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.priority, 1, 2); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + // + // label3 + // + resources.ApplyResources(this.label3, "label3"); + this.label3.Name = "label3"; + // + // comments + // + resources.ApplyResources(this.comments, "comments"); + this.comments.Name = "comments"; + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.Name = "label2"; + // + // name + // + resources.ApplyResources(this.name, "name"); + this.name.Name = "name"; + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // + // priority + // + resources.ApplyResources(this.priority, "priority"); + this.priority.Maximum = new decimal(new int[] { + 10, + 0, + 0, + 0}); + this.priority.Minimum = new decimal(new int[] { + 10, + 0, + 0, + -2147483648}); + this.priority.Name = "priority"; + this.priority.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + // + // networks + // + this.networks.Controls.Add(this.positiveNets); + this.networks.Controls.Add(this.label4); + this.networks.Controls.Add(this.nets); + resources.ApplyResources(this.networks, "networks"); + this.networks.Name = "networks"; + this.networks.UseVisualStyleBackColor = true; + // + // positiveNets + // + resources.ApplyResources(this.positiveNets, "positiveNets"); + this.positiveNets.AutoEllipsis = true; + this.positiveNets.Checked = true; + this.positiveNets.CheckState = System.Windows.Forms.CheckState.Checked; + this.positiveNets.Name = "positiveNets"; + this.positiveNets.UseVisualStyleBackColor = true; + this.positiveNets.CheckedChanged += new System.EventHandler(this.positiveNets_CheckedChanged); + // + // label4 + // + resources.ApplyResources(this.label4, "label4"); + this.label4.Name = "label4"; + // + // nets + // + resources.ApplyResources(this.nets, "nets"); + this.nets.FormattingEnabled = true; + this.nets.Name = "nets"; + // + // TransportForm + // + this.AcceptButton = this.accept; + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.cancel; + this.Controls.Add(this.tabs); + this.Controls.Add(this.tableLayoutPanel1); + this.DoubleBuffered = true; + this.Name = "TransportForm"; + this.Load += new System.EventHandler(this.Transport_Load); + this.tableLayoutPanel1.ResumeLayout(false); + this.tabs.ResumeLayout(false); + this.commonPage.ResumeLayout(false); + this.groupData.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.priority)).EndInit(); + this.networks.ResumeLayout(false); + this.networks.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Button accept; + private System.Windows.Forms.Button cancel; + private System.Windows.Forms.TabControl tabs; + private System.Windows.Forms.TabPage commonPage; + private System.Windows.Forms.GroupBox groupData; + private System.Windows.Forms.TableLayoutPanel dataPanel; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox comments; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox name; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.NumericUpDown priority; + private System.Windows.Forms.TabPage networks; + private System.Windows.Forms.CheckedListBox nets; + private System.Windows.Forms.CheckBox positiveNets; + private System.Windows.Forms.Label label4; + + } +} \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/TransportForm.cs b/client/administration/UdsAdmin/forms/TransportForm.cs new file mode 100644 index 000000000..1a5fa5669 --- /dev/null +++ b/client/administration/UdsAdmin/forms/TransportForm.cs @@ -0,0 +1,158 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.forms +{ + public partial class TransportForm : Form + { + string _id; + xmlrpc.GuiField[] _flds; + xmlrpc.GuiFieldValue[] _fldValues; + string _transportName; + string _transportType; + + public TransportForm(string TransportName, string transportType, Icon icon) + { + InitializeComponent(); + _fldValues = null; + _id = null; + _flds = null; + _transportName = TransportName; + _transportType = transportType; + Icon = icon; + // Read networks + nets.Items.AddRange(xmlrpc.UdsAdminService.GetNetworks()); + Text = Strings.titleTransport; + } + + public void setData(string name, string comments, string id, xmlrpc.GuiFieldValue[] data) + { + this.name.Text = name; + this.comments.Text = comments; + this.priority.Value = Convert.ToInt32(xmlrpc.GuiFieldValue.getData(data, "priority")); + this.positiveNets.Checked = xmlrpc.GuiFieldValue.getData(data, "positiveNet") == xmlrpc.Constants.TRUE; + this._id = id; + _fldValues = data; + // Fill networks + foreach( string netId in xmlrpc.UdsAdminService.GetNetworksForTransport(id)) + { + for( int i = 0; i < nets.Items.Count; i++ ) + { + xmlrpc.Network net = (xmlrpc.Network)nets.Items[i]; + if (net.id == netId) + nets.SetItemChecked(i, true); + } + } + } + + private void Transport_Load(object sender, EventArgs e) + { + _flds = xmlrpc.UdsAdminService.GetTransportGui(_transportType); + if (_flds == null) + { + Close(); + return; + } + Size sz = gui.DinamycFieldsManager.PutFields(dataPanel, _flds, _fldValues); + groupData.Size = new Size(groupData.Size.Width, 32 + sz.Height); + Size wSize = new Size(); + wSize.Width = Size.Width + 64; + wSize.Height = groupData.Location.Y + tableLayoutPanel1.Size.Height + groupData.Size.Height + 96; + Size = MinimumSize = MaximumSize = wSize; + if (_flds.Length == 0) + groupData.Visible = false; + Text = _transportName; + //this.Location = System.Windows.Forms.Cursor.Position; + + // Networks + positiveNets_CheckedChanged(null, null); + } + + private void accept_Click(object sender, EventArgs e) + { + if (name.Text.Trim().Length == 0) + { + gui.UserNotifier.notifyError(Strings.nameRequired); + return; + } + xmlrpc.GuiFieldValue[] data; + try { + data = gui.DinamycFieldsManager.ReadFields(dataPanel, _flds); + } + catch (gui.DinamycFieldsManager.ValidationError err) + { + gui.UserNotifier.notifyValidationException(err); + return; + } + try { + if (_id == null) + _id = xmlrpc.UdsAdminService.CreateTransport(name.Text, comments.Text, Convert.ToInt32(priority.Value), positiveNets.Checked, _transportType, data); + else + xmlrpc.UdsAdminService.ModifyTransport(name.Text, comments.Text, Convert.ToInt32(priority.Value), positiveNets.Checked, _id, data); + List ids = new List(); + foreach (xmlrpc.Network net in nets.CheckedItems) + ids.Add(net.id); + xmlrpc.UdsAdminService.SetNetworksForTransport(_id, ids.ToArray() ); + + DialogResult = System.Windows.Forms.DialogResult.OK; + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + + } + + private void positiveNets_CheckedChanged(object sender, EventArgs e) + { + if (positiveNets.Checked == true) + { + positiveNets.Text = Strings.positiveNetCheck; + positiveNets.BackColor = gui.Colors.ActiveBackColor; + positiveNets.ForeColor = gui.Colors.ActiveForeColor; + } + else + { + positiveNets.Text = Strings.negativeNetCheck; + positiveNets.BackColor = gui.Colors.InactiveBackColor; + positiveNets.ForeColor = gui.Colors.InactiveForeColor; + } + } + + } +} diff --git a/client/administration/UdsAdmin/forms/TransportForm.de.resx b/client/administration/UdsAdmin/forms/TransportForm.de.resx new file mode 100644 index 000000000..54f29b232 --- /dev/null +++ b/client/administration/UdsAdmin/forms/TransportForm.de.resx @@ -0,0 +1,672 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 3 + + + + Bottom, Left, Right + + + + 3, 7 + + + 143, 23 + + + 0 + + + Akzeptieren + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Bottom, Left, Right + + + 350, 7 + + + 144, 23 + + + 1 + + + Abbrechen + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + Bottom + + + 0, 331 + + + 1 + + + 497, 33 + + + 5 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="accept" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cancel" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + Top, Bottom, Left, Right + + + Top, Left, Right + + + 2 + + + 12, 19 + + + 2 + + + 200, 100 + + + 0 + + + dataPanel + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupData + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls /><Columns Styles="Percent,50,Percent,50" /><Rows Styles="Percent,50,Percent,50" /></TableLayoutSettings> + + + 5, 132 + + + 453, 139 + + + 9 + + + Transportdaten + + + groupData + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + commonPage + + + 0 + + + Top, Left, Right + + + 2 + + + Left + + + True + + + NoControl + + + 3, 57 + + + 38, 13 + + + 4 + + + Priorität + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + 82, 28 + + + 320, 20 + + + 3 + + + comments + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + Left + + + True + + + NoControl + + + 3, 31 + + + 56, 13 + + + 1 + + + Kommentare + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + 82, 3 + + + 320, 20 + + + 2 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 3 + + + Left + + + True + + + NoControl + + + 3, 6 + + + 35, 13 + + + 0 + + + Name + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 4 + + + 82, 53 + + + 63, 20 + + + 5 + + + priority + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 5 + + + 11, 19 + + + 3 + + + 414, 77 + + + 3 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label3" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="comments" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="name" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="priority" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,19,29825,Percent,80,70175" /><Rows Styles="Percent,33,Percent,33,Percent,34" /></TableLayoutSettings> + + + 6, 6 + + + 452, 120 + + + 8 + + + Allgemeine Daten + + + groupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + commonPage + + + 1 + + + 4, 22 + + + 3, 3, 3, 3 + + + 464, 286 + + + 0 + + + Verkehr + + + commonPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabs + + + 0 + + + Bottom, Left, Right + + + Button + + + 7, 242 + + + 451, 23 + + + 2 + + + checkBox1 + + + MiddleCenter + + + positiveNets + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + networks + + + 0 + + + Bottom, Left + + + True + + + 7, 268 + + + 244, 13 + + + 1 + + + Hinweis: Keine Netze ausgewählt bedeutet alle Netzwerke + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + networks + + + 1 + + + Top, Bottom, Left, Right + + + 7, 7 + + + 451, 229 + + + 0 + + + nets + + + System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + networks + + + 2 + + + 4, 22 + + + 3, 3, 3, 3 + + + 464, 286 + + + 1 + + + Damit verbundenen Netzwerke + + + networks + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabs + + + 1 + + + 13, 13 + + + 472, 312 + + + 1 + + + tabs + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 497, 364 + + + Manual + + + Transport + + + TransportForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/TransportForm.es.resx b/client/administration/UdsAdmin/forms/TransportForm.es.resx new file mode 100644 index 000000000..64eafd06c --- /dev/null +++ b/client/administration/UdsAdmin/forms/TransportForm.es.resx @@ -0,0 +1,672 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 3 + + + + Bottom, Left, Right + + + + 3, 7 + + + 143, 23 + + + 0 + + + Aceptar + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Bottom, Left, Right + + + 350, 7 + + + 144, 23 + + + 1 + + + Cancelar + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + Bottom + + + 0, 331 + + + 1 + + + 497, 33 + + + 5 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="accept" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cancel" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + Top, Bottom, Left, Right + + + Top, Left, Right + + + 2 + + + 12, 19 + + + 2 + + + 200, 100 + + + 0 + + + dataPanel + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupData + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls /><Columns Styles="Percent,50,Percent,50" /><Rows Styles="Percent,50,Percent,50" /></TableLayoutSettings> + + + 5, 132 + + + 453, 139 + + + 9 + + + Datos de transporte + + + groupData + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + commonPage + + + 0 + + + Top, Left, Right + + + 2 + + + Left + + + True + + + NoControl + + + 3, 57 + + + 38, 13 + + + 4 + + + Prioridad + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + 82, 28 + + + 320, 20 + + + 3 + + + comments + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + Left + + + True + + + NoControl + + + 3, 31 + + + 56, 13 + + + 1 + + + Comentarios + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + 82, 3 + + + 320, 20 + + + 2 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 3 + + + Left + + + True + + + NoControl + + + 3, 6 + + + 35, 13 + + + 0 + + + Nombre + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 4 + + + 82, 53 + + + 63, 20 + + + 5 + + + priority + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 5 + + + 11, 19 + + + 3 + + + 414, 77 + + + 3 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label3" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="comments" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="name" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="priority" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,19,29825,Percent,80,70175" /><Rows Styles="Percent,33,Percent,33,Percent,34" /></TableLayoutSettings> + + + 6, 6 + + + 452, 120 + + + 8 + + + Datos comunes + + + groupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + commonPage + + + 1 + + + 4, 22 + + + 3, 3, 3, 3 + + + 464, 286 + + + 0 + + + Transporte + + + commonPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabs + + + 0 + + + Bottom, Left, Right + + + Button + + + 7, 242 + + + 451, 23 + + + 2 + + + checkBox1 + + + MiddleCenter + + + positiveNets + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + networks + + + 0 + + + Bottom, Left + + + True + + + 7, 268 + + + 244, 13 + + + 1 + + + Nota: Ninguno seleccionadas de redes significa todas las redes + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + networks + + + 1 + + + Top, Bottom, Left, Right + + + 7, 7 + + + 451, 229 + + + 0 + + + nets + + + System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + networks + + + 2 + + + 4, 22 + + + 3, 3, 3, 3 + + + 464, 286 + + + 1 + + + Redes asociadas + + + networks + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabs + + + 1 + + + 13, 13 + + + 472, 312 + + + 1 + + + tabs + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 497, 364 + + + Manual + + + Transport + + + TransportForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/TransportForm.fr.resx b/client/administration/UdsAdmin/forms/TransportForm.fr.resx new file mode 100644 index 000000000..d7ff8ca7e --- /dev/null +++ b/client/administration/UdsAdmin/forms/TransportForm.fr.resx @@ -0,0 +1,672 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 3 + + + + Bottom, Left, Right + + + + 3, 7 + + + 143, 23 + + + 0 + + + Accepter + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Bottom, Left, Right + + + 350, 7 + + + 144, 23 + + + 1 + + + Annuler + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + Bottom + + + 0, 331 + + + 1 + + + 497, 33 + + + 5 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="accept" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cancel" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + Top, Bottom, Left, Right + + + Top, Left, Right + + + 2 + + + 12, 19 + + + 2 + + + 200, 100 + + + 0 + + + dataPanel + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupData + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls /><Columns Styles="Percent,50,Percent,50" /><Rows Styles="Percent,50,Percent,50" /></TableLayoutSettings> + + + 5, 132 + + + 453, 139 + + + 9 + + + Données de transport + + + groupData + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + commonPage + + + 0 + + + Top, Left, Right + + + 2 + + + Left + + + True + + + NoControl + + + 3, 57 + + + 38, 13 + + + 4 + + + Priorité + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + 82, 28 + + + 320, 20 + + + 3 + + + comments + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + Left + + + True + + + NoControl + + + 3, 31 + + + 56, 13 + + + 1 + + + Commentaires + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + 82, 3 + + + 320, 20 + + + 2 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 3 + + + Left + + + True + + + NoControl + + + 3, 6 + + + 35, 13 + + + 0 + + + Nom + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 4 + + + 82, 53 + + + 63, 20 + + + 5 + + + priority + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 5 + + + 11, 19 + + + 3 + + + 414, 77 + + + 3 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label3" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="comments" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="name" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="priority" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,19,29825,Percent,80,70175" /><Rows Styles="Percent,33,Percent,33,Percent,34" /></TableLayoutSettings> + + + 6, 6 + + + 452, 120 + + + 8 + + + Données communes + + + groupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + commonPage + + + 1 + + + 4, 22 + + + 3, 3, 3, 3 + + + 464, 286 + + + 0 + + + Transport + + + commonPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabs + + + 0 + + + Bottom, Left, Right + + + Button + + + 7, 242 + + + 451, 23 + + + 2 + + + checkBox1 + + + MiddleCenter + + + positiveNets + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + networks + + + 0 + + + Bottom, Left + + + True + + + 7, 268 + + + 244, 13 + + + 1 + + + Note : Aucun réseaux sélectionnés signifie tous les réseaux + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + networks + + + 1 + + + Top, Bottom, Left, Right + + + 7, 7 + + + 451, 229 + + + 0 + + + nets + + + System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + networks + + + 2 + + + 4, 22 + + + 3, 3, 3, 3 + + + 464, 286 + + + 1 + + + Réseaux associés + + + networks + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabs + + + 1 + + + 13, 13 + + + 472, 312 + + + 1 + + + tabs + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 497, 364 + + + Manual + + + Transport + + + TransportForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/TransportForm.resx b/client/administration/UdsAdmin/forms/TransportForm.resx new file mode 100644 index 000000000..7af6b84da --- /dev/null +++ b/client/administration/UdsAdmin/forms/TransportForm.resx @@ -0,0 +1,861 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 3 + + + + Bottom, Left, Right + + + + 3, 7 + + + 135, 23 + + + 0 + + + Accept + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Bottom, Left, Right + + + 332, 7 + + + 135, 23 + + + 1 + + + Cancel + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + Bottom + + + 0, 331 + + + 1 + + + 470, 33 + + + 5 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="accept" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cancel" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + Top, Bottom, Left, Right + + + commonPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabs + + + 0 + + + networks + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabs + + + 1 + + + 13, 13 + + + 445, 312 + + + 1 + + + tabs + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + groupData + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + commonPage + + + 0 + + + groupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + commonPage + + + 1 + + + 4, 23 + + + 3, 3, 3, 3 + + + 437, 285 + + + 0 + + + Transport + + + commonPage + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabs + + + 0 + + + Top, Left, Right + + + dataPanel + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupData + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls /><Columns Styles="Percent,50,Percent,50" /><Rows Styles="Percent,50,Percent,50" /></TableLayoutSettings> + + + 5, 132 + + + 426, 139 + + + 9 + + + Transport Data + + + groupData + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + commonPage + + + 0 + + + 2 + + + Fill + + + 3, 16 + + + 2 + + + 420, 120 + + + 0 + + + dataPanel + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupData + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls /><Columns Styles="Percent,50,Percent,50" /><Rows Styles="Percent,50,Percent,50" /></TableLayoutSettings> + + + Top, Left, Right + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label3" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="comments" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="name" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="priority" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,19,29825,Percent,80,70175" /><Rows Styles="Percent,33,Percent,33,Percent,34" /></TableLayoutSettings> + + + 6, 6 + + + 425, 120 + + + 8 + + + Common Data + + + groupBox1 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + commonPage + + + 1 + + + 2 + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + comments + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 3 + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 4 + + + priority + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 5 + + + 11, 19 + + + 3 + + + 414, 77 + + + 3 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label3" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="comments" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="name" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="priority" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,19,29825,Percent,80,70175" /><Rows Styles="Percent,33,Percent,33,Percent,34" /></TableLayoutSettings> + + + Left + + + True + + + NoControl + + + 3, 57 + + + 38, 13 + + + 4 + + + Priority + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + 82, 28 + + + 320, 20 + + + 3 + + + comments + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + Left + + + True + + + NoControl + + + 3, 31 + + + 56, 13 + + + 1 + + + Comments + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + 82, 3 + + + 320, 20 + + + 2 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 3 + + + Left + + + True + + + NoControl + + + 3, 6 + + + 35, 13 + + + 0 + + + Name + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 4 + + + 82, 53 + + + 63, 20 + + + 5 + + + priority + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 5 + + + positiveNets + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + networks + + + 0 + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + networks + + + 1 + + + nets + + + System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + networks + + + 2 + + + 4, 23 + + + 3, 3, 3, 3 + + + 437, 285 + + + 1 + + + Associated Networks + + + networks + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabs + + + 1 + + + Bottom, Left, Right + + + Button + + + 7, 242 + + + 451, 23 + + + 2 + + + checkBox1 + + + MiddleCenter + + + positiveNets + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + networks + + + 0 + + + Bottom, Left + + + True + + + 7, 268 + + + 244, 13 + + + 1 + + + Note: None networks selected means all networks + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + networks + + + 1 + + + Top, Bottom, Left, Right + + + 7, 7 + + + 451, 229 + + + 0 + + + nets + + + System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + networks + + + 2 + + + True + + + 6, 13 + + + 470, 364 + + + CenterParent + + + Transport + + + TransportForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/UserForm.Designer.cs b/client/administration/UdsAdmin/forms/UserForm.Designer.cs new file mode 100644 index 000000000..9b60d48fe --- /dev/null +++ b/client/administration/UdsAdmin/forms/UserForm.Designer.cs @@ -0,0 +1,284 @@ +namespace UdsAdmin.forms +{ + partial class UserForm + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de Windows Forms + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UserForm)); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.accept = new System.Windows.Forms.Button(); + this.cancel = new System.Windows.Forms.Button(); + this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); + this.check = new System.Windows.Forms.Button(); + this.tabs = new System.Windows.Forms.TabControl(); + this.user = new System.Windows.Forms.TabPage(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.realName = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.name = new System.Windows.Forms.TextBox(); + this.comments = new System.Windows.Forms.TextBox(); + this.searchButton = new System.Windows.Forms.Button(); + this.userNameLabel = new System.Windows.Forms.Label(); + this.state = new System.Windows.Forms.ComboBox(); + this.passwordLabel = new System.Windows.Forms.Label(); + this.staffMemberLabel = new System.Windows.Forms.Label(); + this.adminLabel = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.password = new System.Windows.Forms.TextBox(); + this.staffMember = new System.Windows.Forms.CheckBox(); + this.admin = new System.Windows.Forms.CheckBox(); + this.group = new System.Windows.Forms.TabPage(); + this.groupsList = new System.Windows.Forms.CheckedListBox(); + this.tableLayoutPanel2.SuspendLayout(); + this.tableLayoutPanel3.SuspendLayout(); + this.tabs.SuspendLayout(); + this.user.SuspendLayout(); + this.tableLayoutPanel1.SuspendLayout(); + this.group.SuspendLayout(); + this.SuspendLayout(); + // + // tableLayoutPanel2 + // + resources.ApplyResources(this.tableLayoutPanel2, "tableLayoutPanel2"); + this.tableLayoutPanel2.Controls.Add(this.accept, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.cancel, 2, 0); + this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel3, 1, 0); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + // + // accept + // + resources.ApplyResources(this.accept, "accept"); + this.accept.Name = "accept"; + this.accept.UseVisualStyleBackColor = true; + this.accept.Click += new System.EventHandler(this.accept_Click); + // + // cancel + // + resources.ApplyResources(this.cancel, "cancel"); + this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancel.Name = "cancel"; + this.cancel.UseVisualStyleBackColor = true; + this.cancel.Click += new System.EventHandler(this.cancel_Click); + // + // tableLayoutPanel3 + // + resources.ApplyResources(this.tableLayoutPanel3, "tableLayoutPanel3"); + this.tableLayoutPanel3.Controls.Add(this.check, 1, 0); + this.tableLayoutPanel3.Name = "tableLayoutPanel3"; + // + // check + // + resources.ApplyResources(this.check, "check"); + this.check.Name = "check"; + this.check.UseVisualStyleBackColor = true; + // + // tabs + // + resources.ApplyResources(this.tabs, "tabs"); + this.tabs.Controls.Add(this.user); + this.tabs.Controls.Add(this.group); + this.tabs.Name = "tabs"; + this.tabs.SelectedIndex = 0; + // + // user + // + this.user.Controls.Add(this.tableLayoutPanel1); + resources.ApplyResources(this.user, "user"); + this.user.Name = "user"; + this.user.UseVisualStyleBackColor = true; + // + // tableLayoutPanel1 + // + resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); + this.tableLayoutPanel1.Controls.Add(this.realName, 1, 1); + this.tableLayoutPanel1.Controls.Add(this.label4, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.label2, 0, 2); + this.tableLayoutPanel1.Controls.Add(this.name, 1, 0); + this.tableLayoutPanel1.Controls.Add(this.comments, 1, 2); + this.tableLayoutPanel1.Controls.Add(this.searchButton, 2, 0); + this.tableLayoutPanel1.Controls.Add(this.userNameLabel, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.state, 1, 3); + this.tableLayoutPanel1.Controls.Add(this.passwordLabel, 0, 6); + this.tableLayoutPanel1.Controls.Add(this.staffMemberLabel, 0, 4); + this.tableLayoutPanel1.Controls.Add(this.adminLabel, 0, 5); + this.tableLayoutPanel1.Controls.Add(this.label5, 0, 3); + this.tableLayoutPanel1.Controls.Add(this.password, 1, 6); + this.tableLayoutPanel1.Controls.Add(this.staffMember, 1, 4); + this.tableLayoutPanel1.Controls.Add(this.admin, 1, 5); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + // + // realName + // + this.tableLayoutPanel1.SetColumnSpan(this.realName, 2); + resources.ApplyResources(this.realName, "realName"); + this.realName.Name = "realName"; + // + // label4 + // + resources.ApplyResources(this.label4, "label4"); + this.label4.Name = "label4"; + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.Name = "label2"; + // + // name + // + resources.ApplyResources(this.name, "name"); + this.name.Name = "name"; + // + // comments + // + this.tableLayoutPanel1.SetColumnSpan(this.comments, 2); + resources.ApplyResources(this.comments, "comments"); + this.comments.Name = "comments"; + // + // searchButton + // + this.searchButton.Image = global::UdsAdmin.Images.find16; + resources.ApplyResources(this.searchButton, "searchButton"); + this.searchButton.Name = "searchButton"; + this.searchButton.UseVisualStyleBackColor = true; + this.searchButton.Click += new System.EventHandler(this.searchButton_Click_1); + // + // userNameLabel + // + resources.ApplyResources(this.userNameLabel, "userNameLabel"); + this.userNameLabel.Name = "userNameLabel"; + // + // state + // + this.tableLayoutPanel1.SetColumnSpan(this.state, 2); + resources.ApplyResources(this.state, "state"); + this.state.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.state.FormattingEnabled = true; + this.state.Name = "state"; + // + // passwordLabel + // + resources.ApplyResources(this.passwordLabel, "passwordLabel"); + this.passwordLabel.Name = "passwordLabel"; + // + // staffMemberLabel + // + resources.ApplyResources(this.staffMemberLabel, "staffMemberLabel"); + this.staffMemberLabel.Name = "staffMemberLabel"; + // + // adminLabel + // + resources.ApplyResources(this.adminLabel, "adminLabel"); + this.adminLabel.Name = "adminLabel"; + // + // label5 + // + resources.ApplyResources(this.label5, "label5"); + this.label5.Name = "label5"; + // + // password + // + this.tableLayoutPanel1.SetColumnSpan(this.password, 2); + resources.ApplyResources(this.password, "password"); + this.password.Name = "password"; + this.password.UseSystemPasswordChar = true; + // + // staffMember + // + resources.ApplyResources(this.staffMember, "staffMember"); + this.staffMember.Name = "staffMember"; + this.staffMember.UseVisualStyleBackColor = true; + // + // admin + // + resources.ApplyResources(this.admin, "admin"); + this.admin.Name = "admin"; + this.admin.UseVisualStyleBackColor = true; + // + // group + // + this.group.Controls.Add(this.groupsList); + resources.ApplyResources(this.group, "group"); + this.group.Name = "group"; + this.group.UseVisualStyleBackColor = true; + // + // groupsList + // + this.groupsList.FormattingEnabled = true; + resources.ApplyResources(this.groupsList, "groupsList"); + this.groupsList.Name = "groupsList"; + // + // UserForm + // + this.AcceptButton = this.accept; + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.cancel; + this.Controls.Add(this.tabs); + this.Controls.Add(this.tableLayoutPanel2); + this.Name = "UserForm"; + this.Load += new System.EventHandler(this.UserForm_Load); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel3.ResumeLayout(false); + this.tabs.ResumeLayout(false); + this.user.ResumeLayout(false); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + this.group.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.Button accept; + private System.Windows.Forms.Button cancel; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; + private System.Windows.Forms.Button check; + private System.Windows.Forms.TabControl tabs; + private System.Windows.Forms.TabPage user; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Label staffMemberLabel; + private System.Windows.Forms.Label label2; + public System.Windows.Forms.TextBox name; + public System.Windows.Forms.TextBox comments; + private System.Windows.Forms.Button searchButton; + private System.Windows.Forms.TabPage group; + private System.Windows.Forms.CheckedListBox groupsList; + public System.Windows.Forms.TextBox realName; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.ComboBox state; + public System.Windows.Forms.TextBox password; + private System.Windows.Forms.Label passwordLabel; + private System.Windows.Forms.Label adminLabel; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.CheckBox staffMember; + private System.Windows.Forms.CheckBox admin; + private System.Windows.Forms.Label userNameLabel; + } +} \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/UserForm.cs b/client/administration/UdsAdmin/forms/UserForm.cs new file mode 100644 index 000000000..d24b8d762 --- /dev/null +++ b/client/administration/UdsAdmin/forms/UserForm.cs @@ -0,0 +1,192 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.forms +{ + public partial class UserForm : Form + { + private xmlrpc.Authenticator _auth; + private xmlrpc.AuthenticatorType _authType; + private xmlrpc.User _user; + private string[] states = new string[] { xmlrpc.Constants.STATE_ACTIVE, xmlrpc.Constants.STATE_INACTIVE, xmlrpc.Constants.STATE_BLOCKED }; + + public UserForm(xmlrpc.Authenticator auth, xmlrpc.AuthenticatorType authType, xmlrpc.User user) + { + _auth = auth; + _authType = authType; + _user = user; + + InitializeComponent(); + Text = Strings.user; + } + + private void UserForm_Load(object sender, EventArgs e) + { + state.Items.AddRange(new string[] { Strings.active, Strings.inactive, Strings.blocked }); + state.SelectedIndex = 0; + + if (_authType.canSearchUsers) + { + searchButton.Enabled = true; + check.Visible = true; + } + else + { + searchButton.Enabled = false; + check.Visible = false; + } + + if (_authType.needsPassword) + { + password.Visible = passwordLabel.Visible = true; + } + else + { + password.Visible = passwordLabel.Visible = false; + } + + userNameLabel.Text = _authType.userNameLabel; + passwordLabel.Text = _authType.passwordLabel; + + + xmlrpc.Group[] groups = new xmlrpc.Group[0]; + if (_user.id != null) + { + groups = _user.groups; // xmlrpc.UdsAdminService.GetUserGroups(_user.id); + name.Text = _user.name; realName.Text = _user.realName; + comments.Text = _user.comments; password.Text = _user.password; + name.ReadOnly = true; + searchButton.Enabled = false; + for( int i = 0; i < states.Length; i++ ) + if( states[i] == _user.state ) + { + state.SelectedIndex = i; + break; + } + _user.comments = comments.Text; + + } + + if (_authType.isExternalSource ) + { + groupsList.Enabled = false; + if (_user.id != null) + foreach (xmlrpc.Group grp in groups) + groupsList.Items.Add(grp, true); + } + else + { + (tabs.TabPages["group"] as Control).Enabled = true; + try + { + xmlrpc.Group[] grps = xmlrpc.UdsAdminService.GetAuthenticatorGroups(_auth.id); + foreach (xmlrpc.Group grp in grps) + { + bool active = groups.Length > 0 && Array.Find(groups, g => g.id == grp.id).active; + groupsList.Items.Add(grp, active); + } + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + } + + staffMember.Enabled = staffMemberLabel.Enabled = admin.Enabled = adminLabel.Enabled = xmlrpc.UdsAdminService.isAdmin; + staffMember.Checked = _user.staffMember; + admin.Checked = _user.isAdmin; + + //this.Location = System.Windows.Forms.Cursor.Position; + } + + private void accept_Click(object sender, EventArgs e) + { + if (name.Text.Trim().Length == 0) + { + gui.UserNotifier.notifyError(Strings.nameRequired); + return; + } + try + { + if (_authType.isExternalSource == false) + { + _user.groups = new xmlrpc.Group[groupsList.CheckedItems.Count]; + int n = 0; + foreach (xmlrpc.Group grp in groupsList.CheckedItems) + { + _user.groups[n++] = grp; + } + } + _user.idParent = _auth.id; _user.name = name.Text; _user.realName = realName.Text; + _user.comments = comments.Text; _user.state = states[state.SelectedIndex]; + _user.password = password.Text; + // If the user is not admin, server will ignore these parameters + _user.isAdmin = admin.Checked; + _user.staffMember = staffMember.Checked; + if (_user.id == null || _user.id == "") + { + // New user + _user.id = ""; + _user.oldPassword = ""; + xmlrpc.UdsAdminService.CreateUser(_user); + } + else + { + xmlrpc.UdsAdminService.ModifyUser(_user); + } + DialogResult = System.Windows.Forms.DialogResult.OK; + } + catch (CookComputing.XmlRpc.XmlRpcFaultException ex) + { + gui.UserNotifier.notifyRpcException(ex); + } + } + + private void cancel_Click(object sender, EventArgs e) + { + DialogResult = System.Windows.Forms.DialogResult.Cancel; + } + + private void searchButton_Click_1(object sender, EventArgs e) + { + SearchForm form = new SearchForm(SearchForm.Type.userSearch, _auth, name.Text); + if (form.ShowDialog() == System.Windows.Forms.DialogResult.Yes) + name.Text = form.selection; + } + } +} diff --git a/client/administration/UdsAdmin/forms/UserForm.de.resx b/client/administration/UdsAdmin/forms/UserForm.de.resx new file mode 100644 index 000000000..815e72afd --- /dev/null +++ b/client/administration/UdsAdmin/forms/UserForm.de.resx @@ -0,0 +1,494 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Akzeptieren + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Abbrechen + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + Überprüfen Sie Namen + + + check + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel3 + + + 0 + + + tableLayoutPanel3 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + realName + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Richtiger Name + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + Kommentare + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + comments + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + searchButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 5 + + + Benutzername + + + userNameLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 6 + + + state + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 7 + + + Passwort + + + passwordLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 8 + + + Mitarbeiter + + + staffMemberLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 9 + + + Admin + + + adminLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 10 + + + Staat + + + label5 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 11 + + + password + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 12 + + + staffMember + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 13 + + + admin + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 14 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + user + + + 0 + + + Benutzer + + + user + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabs + + + 0 + + + groupsList + + + System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + group + + + 0 + + + Gruppen + + + group + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabs + + + 1 + + + tabs + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + + + AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AABeBwAAZRAMAGMQDQBkEA0AZxINAGcUDwBrFhAAbRgMAG8YEQBxGxAAbxsTAHAbEwByGxQAdRwSAHUd + EgByHhUAex8TAH8iFAB3IxcAdiMZAIEkFQCGJRUAkiYOAHclGwCLKREAhyoaAKArDwCGKxsAlCwXAI0t + GAB8LCIAqi4MAJQtGACULxUAey8iAIEvIACQMB4AmjEZAIMxIwCJMiAAmTMZAJU0HQCGNCYAozUaAJ81 + HgCVNiAAiDcmAKU4HACpOBsArDsdALo8FQCrPh8AuEIfALNDIQC5RCEAw0UdAJJEMgDCRiAApEUvALlH + IwCURzAAsUksAMZKIgC8TCMAv00nAM5NIgDDTikAvFIrANRSJADUUyUAvVQtAKJVPADTVigAyFctANBZ + KwDXWSkA3VopAM1cLgDUXiwAz14vAOFgLQDkZjEAwGhCAONrNQDEa0QAxm1HAO1xNgClbGMA6XM6ALdz + WQDvfUAA7X5CAO5/QgDvf0IA7oBDAO+ERQDuhEYA74RGAOqGSgDohksA6YZLAOmITQDpiU0A8IlMAOuK + TwDukFQA6pRbAPGVVwCwjosAzZJ0ANuqkADeycYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAcHBwcHA8cFRwUnAicHBwcHBwBxhOWl1eXlxdUyEAbHBwcBpDa2hkZWZlY2dGH3BwcHAsP2pp + YF9hW1hRSzJvcHBwcFVwSUpIRURBOTYWcHBwcFdZKRwrO0AxLygdcHBwcHBwcHAQM01PNRUOcHBwcHBw + cHBwcBEkOhkEcHBwcHBwcHBwcHBwG0I9cHBwcHBwcHBwcHBwLi03VmJwcHBwcHBwcHBwChcUNFBwcHBw + cHBwcHBwcAYFCCU+THBwcHBwcHBwcHAMAQINIDBwcHBwcHBwcHBwKkcjAwsncHBwcHBwcHBwcBJubQkm + cHBwcHBwcHBwcHBwHjgPE3BwcHBwcPqvAADAAQAAwAMAAMABAADoAwAAwAcAAPgPAAD8HwAA/j8AAPwf + AAD4PwAA+B8AAPgfAAD4HwAA+D8AAPw/AAA= + + + + Users + + + UserForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/UserForm.es.resx b/client/administration/UdsAdmin/forms/UserForm.es.resx new file mode 100644 index 000000000..2a549bf28 --- /dev/null +++ b/client/administration/UdsAdmin/forms/UserForm.es.resx @@ -0,0 +1,494 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Aceptar + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Cancelar + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + Nombre del cheque + + + check + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel3 + + + 0 + + + tableLayoutPanel3 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + realName + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Nombre real + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + Comentarios + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + comments + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + searchButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 5 + + + Nombre de usuario + + + userNameLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 6 + + + state + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 7 + + + Contraseña + + + passwordLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 8 + + + Personal + + + staffMemberLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 9 + + + Admin + + + adminLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 10 + + + Estado + + + label5 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 11 + + + password + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 12 + + + staffMember + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 13 + + + admin + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 14 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + user + + + 0 + + + Usuario + + + user + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabs + + + 0 + + + groupsList + + + System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + group + + + 0 + + + Grupos + + + group + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabs + + + 1 + + + tabs + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + + + AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AABeBwAAZRAMAGMQDQBkEA0AZxINAGcUDwBrFhAAbRgMAG8YEQBxGxAAbxsTAHAbEwByGxQAdRwSAHUd + EgByHhUAex8TAH8iFAB3IxcAdiMZAIEkFQCGJRUAkiYOAHclGwCLKREAhyoaAKArDwCGKxsAlCwXAI0t + GAB8LCIAqi4MAJQtGACULxUAey8iAIEvIACQMB4AmjEZAIMxIwCJMiAAmTMZAJU0HQCGNCYAozUaAJ81 + HgCVNiAAiDcmAKU4HACpOBsArDsdALo8FQCrPh8AuEIfALNDIQC5RCEAw0UdAJJEMgDCRiAApEUvALlH + IwCURzAAsUksAMZKIgC8TCMAv00nAM5NIgDDTikAvFIrANRSJADUUyUAvVQtAKJVPADTVigAyFctANBZ + KwDXWSkA3VopAM1cLgDUXiwAz14vAOFgLQDkZjEAwGhCAONrNQDEa0QAxm1HAO1xNgClbGMA6XM6ALdz + WQDvfUAA7X5CAO5/QgDvf0IA7oBDAO+ERQDuhEYA74RGAOqGSgDohksA6YZLAOmITQDpiU0A8IlMAOuK + TwDukFQA6pRbAPGVVwCwjosAzZJ0ANuqkADeycYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAcHBwcHA8cFRwUnAicHBwcHBwBxhOWl1eXlxdUyEAbHBwcBpDa2hkZWZlY2dGH3BwcHAsP2pp + YF9hW1hRSzJvcHBwcFVwSUpIRURBOTYWcHBwcFdZKRwrO0AxLygdcHBwcHBwcHAQM01PNRUOcHBwcHBw + cHBwcBEkOhkEcHBwcHBwcHBwcHBwG0I9cHBwcHBwcHBwcHBwLi03VmJwcHBwcHBwcHBwChcUNFBwcHBw + cHBwcHBwcAYFCCU+THBwcHBwcHBwcHAMAQINIDBwcHBwcHBwcHBwKkcjAwsncHBwcHBwcHBwcBJubQkm + cHBwcHBwcHBwcHBwHjgPE3BwcHBwcPqvAADAAQAAwAMAAMABAADoAwAAwAcAAPgPAAD8HwAA/j8AAPwf + AAD4PwAA+B8AAPgfAAD4HwAA+D8AAPw/AAA= + + + + Users + + + UserForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/UserForm.fr.resx b/client/administration/UdsAdmin/forms/UserForm.fr.resx new file mode 100644 index 000000000..68e33b885 --- /dev/null +++ b/client/administration/UdsAdmin/forms/UserForm.fr.resx @@ -0,0 +1,494 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Accepter + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Annuler + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + Vérifiez le nom + + + check + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel3 + + + 0 + + + tableLayoutPanel3 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + realName + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + De son vrai nom + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + Commentaires + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + comments + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + searchButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 5 + + + Nom d'utilisateur + + + userNameLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 6 + + + state + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 7 + + + Mot de passe + + + passwordLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 8 + + + Personnel + + + staffMemberLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 9 + + + Admin + + + adminLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 10 + + + État + + + label5 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 11 + + + password + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 12 + + + staffMember + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 13 + + + admin + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 14 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + user + + + 0 + + + Utilisateur + + + user + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabs + + + 0 + + + groupsList + + + System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + group + + + 0 + + + Groupes + + + group + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabs + + + 1 + + + tabs + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + + + AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AABeBwAAZRAMAGMQDQBkEA0AZxINAGcUDwBrFhAAbRgMAG8YEQBxGxAAbxsTAHAbEwByGxQAdRwSAHUd + EgByHhUAex8TAH8iFAB3IxcAdiMZAIEkFQCGJRUAkiYOAHclGwCLKREAhyoaAKArDwCGKxsAlCwXAI0t + GAB8LCIAqi4MAJQtGACULxUAey8iAIEvIACQMB4AmjEZAIMxIwCJMiAAmTMZAJU0HQCGNCYAozUaAJ81 + HgCVNiAAiDcmAKU4HACpOBsArDsdALo8FQCrPh8AuEIfALNDIQC5RCEAw0UdAJJEMgDCRiAApEUvALlH + IwCURzAAsUksAMZKIgC8TCMAv00nAM5NIgDDTikAvFIrANRSJADUUyUAvVQtAKJVPADTVigAyFctANBZ + KwDXWSkA3VopAM1cLgDUXiwAz14vAOFgLQDkZjEAwGhCAONrNQDEa0QAxm1HAO1xNgClbGMA6XM6ALdz + WQDvfUAA7X5CAO5/QgDvf0IA7oBDAO+ERQDuhEYA74RGAOqGSgDohksA6YZLAOmITQDpiU0A8IlMAOuK + TwDukFQA6pRbAPGVVwCwjosAzZJ0ANuqkADeycYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAcHBwcHA8cFRwUnAicHBwcHBwBxhOWl1eXlxdUyEAbHBwcBpDa2hkZWZlY2dGH3BwcHAsP2pp + YF9hW1hRSzJvcHBwcFVwSUpIRURBOTYWcHBwcFdZKRwrO0AxLygdcHBwcHBwcHAQM01PNRUOcHBwcHBw + cHBwcBEkOhkEcHBwcHBwcHBwcHBwG0I9cHBwcHBwcHBwcHBwLi03VmJwcHBwcHBwcHBwChcUNFBwcHBw + cHBwcHBwcAYFCCU+THBwcHBwcHBwcHAMAQINIDBwcHBwcHBwcHBwKkcjAwsncHBwcHBwcHBwcBJubQkm + cHBwcHBwcHBwcHBwHjgPE3BwcHBwcPqvAADAAQAAwAMAAMABAADoAwAAwAcAAPgPAAD8HwAA/j8AAPwf + AAD4PwAA+B8AAPgfAAD4HwAA+D8AAPw/AAA= + + + + Users + + + UserForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/UserForm.resx b/client/administration/UdsAdmin/forms/UserForm.resx new file mode 100644 index 000000000..77354cee2 --- /dev/null +++ b/client/administration/UdsAdmin/forms/UserForm.resx @@ -0,0 +1,859 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 3 + + + + Bottom, Left, Right + + + + 3, 7 + + + 119, 23 + + + 8 + + + Accept + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Bottom, Left, Right + + + 295, 7 + + + 120, 23 + + + 9 + + + Cancel + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + 3 + + + Fill + + + 33, 3 + + + 85, 21 + + + 7 + + + Check name + + + check + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel3 + + + 0 + + + 128, 3 + + + 1 + + + 152, 27 + + + 2 + + + tableLayoutPanel3 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 2 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="check" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,20,Percent,60,Percent,20" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + Bottom + + + 0, 260 + + + 1 + + + 418, 33 + + + 6 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="accept" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cancel" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="tableLayoutPanel3" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + Top, Left, Right + + + Top, Left, Right + + + 3 + + + Fill + + + 91, 32 + + + 279, 20 + + + 3 + + + realName + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + True + + + 3, 35 + + + 3, 6, 3, 0 + + + 60, 13 + + + 8 + + + Real Name + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + True + + + 3, 64 + + + 3, 6, 3, 0 + + + 56, 13 + + + 1 + + + Comments + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + Fill + + + 91, 3 + + + 227, 20 + + + 1 + + + name + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + Fill + + + 91, 61 + + + 279, 20 + + + 4 + + + comments + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + NoControl + + + 324, 3 + + + 30, 20 + + + 2 + + + searchButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 5 + + + True + + + NoControl + + + 3, 6 + + + 3, 6, 3, 0 + + + 60, 13 + + + 0 + + + User Name + + + userNameLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 6 + + + Fill + + + 91, 88 + + + 279, 21 + + + 5 + + + state + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 7 + + + True + + + 3, 172 + + + 3, 6, 3, 0 + + + 53, 13 + + + 11 + + + Password + + + passwordLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 8 + + + True + + + 3, 118 + + + 3, 6, 3, 0 + + + 70, 13 + + + 7 + + + Staff Member + + + staffMemberLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 9 + + + True + + + 3, 145 + + + 3, 6, 3, 0 + + + 36, 13 + + + 12 + + + Admin + + + adminLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 10 + + + True + + + 3, 91 + + + 3, 6, 3, 0 + + + 32, 13 + + + 13 + + + State + + + label5 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 11 + + + Fill + + + 91, 169 + + + 279, 20 + + + 6 + + + password + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 12 + + + True + + + Fill + + + 91, 115 + + + 227, 21 + + + 14 + + + staffMember + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 13 + + + True + + + Fill + + + 91, 142 + + + 227, 21 + + + 15 + + + admin + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 14 + + + 6, 6 + + + 7 + + + 373, 195 + + + 1 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + user + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="realName" Row="1" RowSpan="1" Column="1" ColumnSpan="2" /><Control Name="label4" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label2" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="name" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="comments" Row="2" RowSpan="1" Column="1" ColumnSpan="2" /><Control Name="searchButton" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="userNameLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="state" Row="3" RowSpan="1" Column="1" ColumnSpan="2" /><Control Name="passwordLabel" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="staffMemberLabel" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="adminLabel" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label5" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="password" Row="6" RowSpan="1" Column="1" ColumnSpan="2" /><Control Name="staffMember" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="admin" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,27,54098,Percent,72,45902,Absolute,51" /><Rows Styles="Percent,15,Percent,15,Percent,14,Percent,14,Percent,14,Percent,14,Percent,14,Absolute,20" /></TableLayoutSettings> + + + 4, 23 + + + 3, 3, 3, 3 + + + 385, 210 + + + 0 + + + User + + + user + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabs + + + 0 + + + 7, 7 + + + 372, 184 + + + 0 + + + groupsList + + + System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + group + + + 0 + + + 4, 23 + + + 3, 3, 3, 3 + + + 385, 210 + + + 1 + + + Groups + + + group + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabs + + + 1 + + + 13, 13 + + + 393, 237 + + + 10 + + + tabs + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + True + + + 6, 13 + + + 418, 293 + + + + AAABAAEAEBAAAAEACABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AABeBwAAZRAMAGMQDQBkEA0AZxINAGcUDwBrFhAAbRgMAG8YEQBxGxAAbxsTAHAbEwByGxQAdRwSAHUd + EgByHhUAex8TAH8iFAB3IxcAdiMZAIEkFQCGJRUAkiYOAHclGwCLKREAhyoaAKArDwCGKxsAlCwXAI0t + GAB8LCIAqi4MAJQtGACULxUAey8iAIEvIACQMB4AmjEZAIMxIwCJMiAAmTMZAJU0HQCGNCYAozUaAJ81 + HgCVNiAAiDcmAKU4HACpOBsArDsdALo8FQCrPh8AuEIfALNDIQC5RCEAw0UdAJJEMgDCRiAApEUvALlH + IwCURzAAsUksAMZKIgC8TCMAv00nAM5NIgDDTikAvFIrANRSJADUUyUAvVQtAKJVPADTVigAyFctANBZ + KwDXWSkA3VopAM1cLgDUXiwAz14vAOFgLQDkZjEAwGhCAONrNQDEa0QAxm1HAO1xNgClbGMA6XM6ALdz + WQDvfUAA7X5CAO5/QgDvf0IA7oBDAO+ERQDuhEYA74RGAOqGSgDohksA6YZLAOmITQDpiU0A8IlMAOuK + TwDukFQA6pRbAPGVVwCwjosAzZJ0ANuqkADeycYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAcHBwcHA8cFRwUnAicHBwcHBwBxhOWl1eXlxdUyEAbHBwcBpDa2hkZWZlY2dGH3BwcHAsP2pp + YF9hW1hRSzJvcHBwcFVwSUpIRURBOTYWcHBwcFdZKRwrO0AxLygdcHBwcHBwcHAQM01PNRUOcHBwcHBw + cHBwcBEkOhkEcHBwcHBwcHBwcHBwG0I9cHBwcHBwcHBwcHBwLi03VmJwcHBwcHBwcHBwChcUNFBwcHBw + cHBwcHBwcAYFCCU+THBwcHBwcHBwcHAMAQINIDBwcHBwcHBwcHBwKkcjAwsncHBwcHBwcHBwcBJubQkm + cHBwcHBwcHBwcHBwHjgPE3BwcHBwcPqvAADAAQAAwAMAAMABAADoAwAAwAcAAPgPAAD8HwAA/j8AAPwf + AAD4PwAA+B8AAPgfAAD4HwAA+D8AAPw/AAA= + + + + CenterParent + + + Users + + + UserForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/UserPreferencesForm.Designer.cs b/client/administration/UdsAdmin/forms/UserPreferencesForm.Designer.cs new file mode 100644 index 000000000..afb542219 --- /dev/null +++ b/client/administration/UdsAdmin/forms/UserPreferencesForm.Designer.cs @@ -0,0 +1,88 @@ +namespace UdsAdmin.forms +{ + partial class UserPreferencesForm + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de Windows Forms + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UserPreferencesForm)); + this.modTabs = new System.Windows.Forms.TabControl(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.accept = new System.Windows.Forms.Button(); + this.cancel = new System.Windows.Forms.Button(); + this.tableLayoutPanel2.SuspendLayout(); + this.SuspendLayout(); + // + // modTabs + // + resources.ApplyResources(this.modTabs, "modTabs"); + this.modTabs.Name = "modTabs"; + this.modTabs.SelectedIndex = 0; + // + // tableLayoutPanel2 + // + resources.ApplyResources(this.tableLayoutPanel2, "tableLayoutPanel2"); + this.tableLayoutPanel2.Controls.Add(this.accept, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.cancel, 2, 0); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + // + // accept + // + resources.ApplyResources(this.accept, "accept"); + this.accept.Name = "accept"; + this.accept.UseVisualStyleBackColor = true; + this.accept.Click += new System.EventHandler(this.accept_Click); + // + // cancel + // + resources.ApplyResources(this.cancel, "cancel"); + this.cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancel.Name = "cancel"; + this.cancel.UseVisualStyleBackColor = true; + // + // UserPreferencesForm + // + this.AcceptButton = this.accept; + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.cancel; + this.Controls.Add(this.tableLayoutPanel2); + this.Controls.Add(this.modTabs); + this.Name = "UserPreferencesForm"; + this.Load += new System.EventHandler(this.UserPreferencesForm_Load); + this.tableLayoutPanel2.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TabControl modTabs; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.Button accept; + private System.Windows.Forms.Button cancel; + } +} \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/UserPreferencesForm.cs b/client/administration/UdsAdmin/forms/UserPreferencesForm.cs new file mode 100644 index 000000000..2d66f922c --- /dev/null +++ b/client/administration/UdsAdmin/forms/UserPreferencesForm.cs @@ -0,0 +1,108 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.forms +{ + public partial class UserPreferencesForm : Form + { + private struct PageData + { + public xmlrpc.GuiField[] fields; + public TableLayoutPanel panel; + + public PageData(xmlrpc.GuiField[] flds, TableLayoutPanel tbl) + { + fields = flds; + panel = tbl; + } + } + + private string _userId; + private List _data = new List(); + + public UserPreferencesForm(string userId) + { + _userId = userId; + InitializeComponent(); + Text = Strings.titleUserPreferences; + } + + private void UserPreferencesForm_Load(object sender, EventArgs e) + { + xmlrpc.PrefGroup[] prefs = xmlrpc.UdsAdminService.GetPrefsForUser(_userId); + Size max = new Size(0, 0); + foreach (xmlrpc.PrefGroup p in prefs) + { + TabPage page = new TabPage(p.moduleLabel); + TableLayoutPanel table = new TableLayoutPanel(); + page.Controls.Add(table); + modTabs.TabPages.Add(page); + _data.Add(new PageData(p.prefs, table)); + + Size sz = gui.DinamycFieldsManager.PutFields(table, p.prefs, null); + if (max.Width < sz.Width) + max.Width = sz.Width; + if (max.Height < sz.Height) + max.Height = sz.Height; + } + max.Height += 120; + max.Width += 56; + Size = max; + } + + private void accept_Click(object sender, EventArgs e) + { + List data = new List(); + try + { + foreach( PageData p in _data ) + { + xmlrpc.GuiFieldValue[] partial = gui.DinamycFieldsManager.ReadFields(p.panel, p.fields); + data.AddRange(partial); + } + xmlrpc.UdsAdminService.SetPrefsForUser(_userId, data.ToArray()); + DialogResult = System.Windows.Forms.DialogResult.OK; + } + catch (gui.DinamycFieldsManager.ValidationError err) + { + gui.UserNotifier.notifyValidationException(err); + return; + } + } + } +} diff --git a/client/administration/UdsAdmin/forms/UserPreferencesForm.de.resx b/client/administration/UdsAdmin/forms/UserPreferencesForm.de.resx new file mode 100644 index 000000000..97d9b06d3 --- /dev/null +++ b/client/administration/UdsAdmin/forms/UserPreferencesForm.de.resx @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + modTabs + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Akzeptieren + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Abbrechen + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + UserPreferencesForm + + + UserPreferencesForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/UserPreferencesForm.es.resx b/client/administration/UdsAdmin/forms/UserPreferencesForm.es.resx new file mode 100644 index 000000000..41809757f --- /dev/null +++ b/client/administration/UdsAdmin/forms/UserPreferencesForm.es.resx @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + modTabs + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Aceptar + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Cancelar + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + UserPreferencesForm + + + UserPreferencesForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/UserPreferencesForm.fr.resx b/client/administration/UdsAdmin/forms/UserPreferencesForm.fr.resx new file mode 100644 index 000000000..568042243 --- /dev/null +++ b/client/administration/UdsAdmin/forms/UserPreferencesForm.fr.resx @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + modTabs + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Accepter + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Annuler + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + UserPreferencesForm + + + UserPreferencesForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/forms/UserPreferencesForm.resx b/client/administration/UdsAdmin/forms/UserPreferencesForm.resx new file mode 100644 index 000000000..1e15c992b --- /dev/null +++ b/client/administration/UdsAdmin/forms/UserPreferencesForm.resx @@ -0,0 +1,255 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Top, Bottom, Left, Right + + + + 12, 12 + + + 344, 218 + + + + 0 + + + modTabs + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + 3 + + + Bottom, Left, Right + + + 3, 7 + + + 104, 23 + + + 0 + + + Accept + + + accept + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 0 + + + Bottom, Left, Right + + + 260, 7 + + + 105, 23 + + + 1 + + + Cancel + + + cancel + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 + + + 1 + + + Bottom + + + 0, 236 + + + 1 + + + 368, 33 + + + 8 + + + tableLayoutPanel2 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="accept" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cancel" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,30,Percent,40,Percent,30" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + True + + + 6, 13 + + + 368, 269 + + + CenterParent + + + UserPreferencesForm + + + UserPreferencesForm + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/client/administration/UdsAdmin/gui/ActionTree.cs b/client/administration/UdsAdmin/gui/ActionTree.cs new file mode 100644 index 000000000..0cccdde25 --- /dev/null +++ b/client/administration/UdsAdmin/gui/ActionTree.cs @@ -0,0 +1,577 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.Drawing; + +namespace UdsAdmin.gui +{ + class ActionTree + { + // Plurar forms must be same literals as designated in actionTree in MainForm + public const string SERVICES_PROVIDERS = "ServicesProviders"; + public const string SERVICE_PROVIDER = "ServiceProvider"; + public const string DEPLOYED_SERVICES = "DeployedServices"; + public const string DEPLOYED_SERVICE = "DeployedService"; + public const string AUTHENTICATORS = "Authenticators"; + public const string AUTHENTICATOR = "Authenticator"; + public const string OS_MANAGERS = "OSManagers"; + public const string OS_MANAGER = "OSManager"; + public const string CONNECTIVITY = "Connectivity"; + public const string TRANSPORTS = "Transports"; + public const string TRANSPORT = "Transport"; + public const string NETWORKS = "Networks"; + public const string SERVICES = "Services"; + public const string SERVICE = "Service"; + public const string USERS = "Users"; + public const string GROUPS = "Groups"; + public const string ALLOWED_GROUPS = "AllowGroups"; + public const string ASSIGNED_SERVICES = "AssignService"; + public const string ASSIGNED_TRANSPORTS = "AssignedTransports"; + public const string PUBLICATIONS = "Deployments"; + public const string CACHE = "Cache"; + + + public const string DIMMED_OUT = "_2"; + + public const float UNSELECTED_OPACITY = 0.8f; + + public const string NEW_ACTION = "new"; + public const string MODIFY_ACTION = "modify"; + public const string DELETE_ACTION = "delete"; + public const string CHECK_ACTION = "test"; + public const string PUBLISH_ACTION = "publish"; + + private static Dictionary stCache = new Dictionary(); + + static public void FillServicesProviders(TreeNode node, EventHandler action) + { + ImageList lst = node.TreeView.ImageList; + node.Nodes.Clear(); + xmlrpc.ServiceProvider[] providers = xmlrpc.UdsAdminService.GetServiceProviders(); + foreach (xmlrpc.ServiceProvider prov in providers) + { + // We check if already knows about this type + if (!stCache.ContainsKey(prov.type)) + stCache.Add(prov.type, xmlrpc.UdsAdminService.GetOffersFromServiceProvider(prov.type)); + + xmlrpc.ServiceType[] offers = stCache[prov.type]; + + // Add Icons of service types to image list if they don't already exists + foreach (xmlrpc.ServiceType st in offers) + { + if (!lst.Images.ContainsKey(st.type)) + { + lst.Images.Add(st.type + DIMMED_OUT, Helpers.SetImageOpacity(Helpers.ImageFromBase64(st.icon), UNSELECTED_OPACITY)); + lst.Images.Add(st.type, Helpers.ImageFromBase64(st.icon)); + } + } + + // Menu for right-click on service provider + ContextMenuStrip menu = MenusManager.ServicesMenu(action, offers, true); + + TreeNode sp = new TreeNode(prov.name); + sp.Name = SERVICE_PROVIDER; + sp.Tag = prov; // We keep provider at tag, so we can easyly modify/delete or add new services for that provider + sp.ToolTipText = prov.typeName + ".\n" + prov.comments; + sp.ImageKey = prov.type + DIMMED_OUT; + sp.SelectedImageKey = prov.type; + sp.ContextMenuStrip = menu; + + // Meno for right-click on "Services" inside service provider + ContextMenuStrip menu2 = MenusManager.ServicesMenu(action, offers, false); + + TreeNode spChild = new TreeNode(Strings.services); + spChild.Name = SERVICES; + spChild.ToolTipText = ""; + spChild.ImageKey = SERVICES + DIMMED_OUT; + spChild.SelectedImageKey = SERVICES; + spChild.ContextMenuStrip = menu2; + sp.Nodes.Add(spChild); + + // Add to tree + node.Nodes.Add(sp); + } + } + + static public void FillServices(TreeNode node, EventHandler action) + { + TreeNode servicesTree = node.Nodes[SERVICES]; + xmlrpc.ServiceProvider sp = (xmlrpc.ServiceProvider)node.Tag; + xmlrpc.Service[] services = xmlrpc.UdsAdminService.GetServices(sp.id); + + servicesTree.Nodes.Clear(); + foreach (xmlrpc.Service s in services) + { + TreeNode se = new TreeNode(s.name); + se.Name = SERVICE; + se.Tag = s; + se.ToolTipText = s.typeName + ".\n" + s.comments; + se.ImageKey = s.type + DIMMED_OUT; + se.SelectedImageKey = s.type; + xmlrpc.ServiceType[] offers = stCache[sp.type]; + xmlrpc.ServiceType type = new xmlrpc.ServiceType(); + foreach( xmlrpc.ServiceType st in offers ) + { + if( st.type == s.type ) + { + type = st; + break; + } + } + se.ContextMenuStrip = MenusManager.ServiceMenu(action, s, type); + + servicesTree.Nodes.Add(se); + } + } + + static public void FillAuthenticators(TreeNode node, xmlrpc.AuthenticatorType[] authsTypes, EventHandler actionOnAuthClick, EventHandler actionOnUsersGroupsClick) + { + ImageList lst = node.TreeView.ImageList; + node.Nodes.Clear(); + xmlrpc.Authenticator[] auths = xmlrpc.UdsAdminService.GetAuthenticators(); + + ContextMenuStrip newMenu = MenusManager.TreeUsersGroupsMenu(actionOnUsersGroupsClick); + + foreach (xmlrpc.Authenticator auth in auths) + { + // Menu for right-click on service provider + ContextMenuStrip menu = MenusManager.AuthMenu(actionOnAuthClick); + + // authenticator type + xmlrpc.AuthenticatorType authType = gui.ActionTree.authType(auth, authsTypes); + + TreeNode a = new TreeNode(auth.name); + a.Name = AUTHENTICATOR; + a.Tag = auth; // We keep provider at tag, so we can easyly modify/delete or add new services for that provider + a.ToolTipText = auth.typeName + ".\n" + auth.comments; + a.ImageKey = auth.type + DIMMED_OUT; + a.SelectedImageKey = auth.type; + a.ContextMenuStrip = menu; + + TreeNode users = new TreeNode(Strings.users); + users.Name = USERS; + users.ToolTipText = Strings.manageUsers; + users.ImageKey = USERS + DIMMED_OUT; + users.SelectedImageKey = USERS; + if( authType.canCreateUsers ) + users.ContextMenuStrip = newMenu; + + // Udpate users for this authenticator + + a.Nodes.Add(users); + + TreeNode groups = new TreeNode(Strings.groups); + groups.Name = GROUPS; + groups.ToolTipText = Strings.manageGroups; + groups.ImageKey = GROUPS + DIMMED_OUT; + groups.SelectedImageKey = GROUPS; + groups.ContextMenuStrip = newMenu; + a.Nodes.Add(groups); + + + // Add to tree + node.Nodes.Add(a); + } + } + + static public void FillOSManagers(TreeNode node, EventHandler action) + { + xmlrpc.OSManager[] osManagers = xmlrpc.UdsAdminService.GetOSManagers(); + + node.Nodes.Clear(); + foreach (xmlrpc.OSManager osm in osManagers) + { + TreeNode se = new TreeNode(osm.name); + se.Name = OS_MANAGER; + se.Tag = osm; + se.ToolTipText = osm.typeName + ".\n" + osm.comments; + se.ImageKey = osm.type + DIMMED_OUT; + se.SelectedImageKey = osm.type; + se.ContextMenuStrip = MenusManager.OSManagerMenu(action, osm); + + node.Nodes.Add(se); + } + } + + static public void FillTransports(TreeNode transNode, EventHandler actionTransports) + { + xmlrpc.Transport[] transports = xmlrpc.UdsAdminService.GetTransports(); + + + transNode.Nodes.Clear(); + foreach (xmlrpc.Transport trans in transports) + { + TreeNode se = new TreeNode(trans.name); + se.Name = TRANSPORT; + se.Tag = trans; + se.ToolTipText = trans.typeName + ".\n" + trans.comments; + se.ImageKey = trans.type + DIMMED_OUT; + se.SelectedImageKey = trans.type; + se.ContextMenuStrip = MenusManager.TransportMenu(actionTransports, trans); + + transNode.Nodes.Add(se); + } + + + } + + static public void FillDeployedServices(TreeNode node, EventHandler action) + { + xmlrpc.DeployedService[] depServices = xmlrpc.UdsAdminService.GetDeployedServices(); + + node.Nodes.Clear(); + foreach (xmlrpc.DeployedService ds in depServices) + { + TreeNode se = new TreeNode(ds.name); + se.Name = DEPLOYED_SERVICE; + se.Tag = ds; + se.ToolTipText = ds.comments; + se.ImageKey = DEPLOYED_SERVICE + DIMMED_OUT; + se.SelectedImageKey = DEPLOYED_SERVICE; + se.ContextMenuStrip = MenusManager.DeployedServiceMenu(action, ds); + + // Add constant child nodes, that are Allowed Groups, Deployments (this only if needed), Assigned Services & Cache (also if needed) + TreeNode a = new TreeNode(Strings.assignedServices); + a.Name = ASSIGNED_SERVICES; a.Tag = ds; a.ToolTipText = Strings.assignedServicesToolTip; + a.ImageKey = ASSIGNED_SERVICES + DIMMED_OUT; a.SelectedImageKey = ASSIGNED_SERVICES; + se.Nodes.Add(a); + + if (ds.info.usesCache) + { + a = new TreeNode(Strings.cache); + a.Name = CACHE; a.Tag = ds; a.ToolTipText = Strings.cacheServicesToolTip; + a.ImageKey = CACHE + DIMMED_OUT; a.SelectedImageKey = CACHE; + se.Nodes.Add(a); + } + + if (ds.info.mustAssignManually == false) + { + a = new TreeNode(Strings.allowedGroups); + a.Name = ALLOWED_GROUPS; a.Tag = ds; a.ToolTipText = Strings.allowedGroupsToolTip; + a.ImageKey = GROUPS + DIMMED_OUT; a.SelectedImageKey = GROUPS; + se.Nodes.Add(a); + } + + // Transports are always associated with deployed services + a = new TreeNode(Strings.transports); + a.Name = ASSIGNED_TRANSPORTS; a.Tag = ds; a.ToolTipText = ""; + a.ImageKey = TRANSPORTS + DIMMED_OUT; a.SelectedImageKey = TRANSPORTS; + se.Nodes.Add(a); + + if (ds.info.needsPublication) + { + a = new TreeNode(Strings.publications); + a.Name = PUBLICATIONS; a.Tag = ds; a.ToolTipText = Strings.publicationsToolTip; + a.ImageKey = PUBLICATIONS + DIMMED_OUT; a.SelectedImageKey = PUBLICATIONS; + // Now the menu for publication + a.ContextMenuStrip = MenusManager.PublicationMenu(action); + se.Nodes.Add(a); + } + + node.Nodes.Add(se); + } + } + + static public void InitializeImageList(TreeView tree) + { + tree.ImageList = new ImageList(); + + tree.ImageList.Images.Add(SERVICES_PROVIDERS, Images.serviceProviders16); + tree.ImageList.Images.Add(SERVICES_PROVIDERS + DIMMED_OUT, Helpers.SetImageOpacity(Images.serviceProviders16, UNSELECTED_OPACITY)); + + tree.ImageList.Images.Add(DEPLOYED_SERVICES, Images.deployedServices16); + tree.ImageList.Images.Add(DEPLOYED_SERVICES + DIMMED_OUT, Helpers.SetImageOpacity(Images.deployedServices16, UNSELECTED_OPACITY)); + + tree.ImageList.Images.Add(AUTHENTICATORS, Images.authenticators16); + tree.ImageList.Images.Add(AUTHENTICATORS + DIMMED_OUT, Helpers.SetImageOpacity(Images.authenticators16, UNSELECTED_OPACITY)); + + tree.ImageList.Images.Add(OS_MANAGERS, Images.osmanagers16); + tree.ImageList.Images.Add(OS_MANAGERS + DIMMED_OUT, Helpers.SetImageOpacity(Images.osmanagers16, UNSELECTED_OPACITY)); + + tree.ImageList.Images.Add(TRANSPORTS, Images.transports16); + tree.ImageList.Images.Add(TRANSPORTS + DIMMED_OUT, Helpers.SetImageOpacity(Images.transports16, UNSELECTED_OPACITY)); + + tree.ImageList.Images.Add(SERVICES, Images.services16); + tree.ImageList.Images.Add(SERVICES + DIMMED_OUT, Helpers.SetImageOpacity(Images.services16, UNSELECTED_OPACITY)); + + tree.ImageList.Images.Add(DEPLOYED_SERVICE, Images.deployedService16); + tree.ImageList.Images.Add(DEPLOYED_SERVICE + DIMMED_OUT, Helpers.SetImageOpacity(Images.deployedService16, UNSELECTED_OPACITY)); + + tree.ImageList.Images.Add(ASSIGNED_SERVICES, Images.assignedServices16); + tree.ImageList.Images.Add(ASSIGNED_SERVICES + DIMMED_OUT, Helpers.SetImageOpacity(Images.assignedServices16, UNSELECTED_OPACITY)); + + tree.ImageList.Images.Add(CACHE, Images.cache16); + tree.ImageList.Images.Add(CACHE + DIMMED_OUT, Helpers.SetImageOpacity(Images.cache16, UNSELECTED_OPACITY)); + + tree.ImageList.Images.Add(PUBLICATIONS, Images.publications16); + tree.ImageList.Images.Add(PUBLICATIONS + DIMMED_OUT, Helpers.SetImageOpacity(Images.publications16, UNSELECTED_OPACITY)); + + tree.ImageList.Images.Add(USERS, Images.users16); + tree.ImageList.Images.Add(USERS + DIMMED_OUT, Helpers.SetImageOpacity(Images.users16, UNSELECTED_OPACITY)); + + tree.ImageList.Images.Add(GROUPS, Images.groups16); + tree.ImageList.Images.Add(GROUPS + DIMMED_OUT, Helpers.SetImageOpacity(Images.groups16, UNSELECTED_OPACITY)); + + tree.ImageList.Images.Add(NETWORKS, Images.networks16); + tree.ImageList.Images.Add(NETWORKS + DIMMED_OUT, Helpers.SetImageOpacity(Images.networks16, UNSELECTED_OPACITY)); + + tree.ImageList.Images.Add(CONNECTIVITY, Images.connectivity16); + tree.ImageList.Images.Add(CONNECTIVITY + DIMMED_OUT, Helpers.SetImageOpacity(Images.connectivity16, UNSELECTED_OPACITY)); + } + + static public void addTypesImages(TreeView tree, xmlrpc.ServiceProviderType[] providersTypes, + xmlrpc.AuthenticatorType[] authsTypes, xmlrpc.OSManagerType[] osManagerTypes, xmlrpc.TransportType[] transportTypes) + { + ImageList lst = tree.ImageList; + foreach (xmlrpc.ServiceProviderType spt in providersTypes) + { + lst.Images.Add(spt.type, Helpers.ImageFromBase64(spt.icon)); + lst.Images.Add(spt.type + DIMMED_OUT, Helpers.SetImageOpacity(Helpers.ImageFromBase64(spt.icon), UNSELECTED_OPACITY)); + } + foreach (xmlrpc.AuthenticatorType at in authsTypes) + { + lst.Images.Add(at.type, Helpers.ImageFromBase64(at.icon)); + lst.Images.Add(at.type + DIMMED_OUT, Helpers.SetImageOpacity(Helpers.ImageFromBase64(at.icon), UNSELECTED_OPACITY)); + } + foreach (xmlrpc.OSManagerType osm in osManagerTypes) + { + lst.Images.Add(osm.type, Helpers.ImageFromBase64(osm.icon)); + lst.Images.Add(osm.type + DIMMED_OUT, Helpers.SetImageOpacity(Helpers.ImageFromBase64(osm.icon), UNSELECTED_OPACITY)); + } + foreach (xmlrpc.TransportType trans in transportTypes) + { + lst.Images.Add(trans.type, Helpers.ImageFromBase64(trans.icon)); + lst.Images.Add(trans.type + DIMMED_OUT, Helpers.SetImageOpacity(Helpers.ImageFromBase64(trans.icon), UNSELECTED_OPACITY)); + } + + } + + static private string getKey(TreeNode node) + { + switch (node.Name) + { + case USERS: + { + xmlrpc.Authenticator auth = (xmlrpc.Authenticator)(node.Parent.Tag); + return USERS + auth.id; + } + case GROUPS: + { + xmlrpc.Authenticator auth = (xmlrpc.Authenticator)(node.Parent.Tag); + return GROUPS + auth.id; + } + case SERVICES: + { + xmlrpc.ServiceProvider prov = (xmlrpc.ServiceProvider)(node.Parent.Tag); + return SERVICE_PROVIDER + prov.id; + } + case SERVICE: + { + xmlrpc.Service serv = (xmlrpc.Service)node.Tag; + return SERVICE + serv.id; + } + case SERVICE_PROVIDER: + { + xmlrpc.ServiceProvider prov = (xmlrpc.ServiceProvider)(node.Tag); + return SERVICE_PROVIDER + prov.id; + } + case DEPLOYED_SERVICE: + { + xmlrpc.DeployedService ds = (xmlrpc.DeployedService)(node.Tag); + return DEPLOYED_SERVICE + ds.id; + } + case CACHE: + { + xmlrpc.DeployedService ds = (xmlrpc.DeployedService)(node.Tag); + return CACHE + ds.id; + } + case ASSIGNED_SERVICES: + { + xmlrpc.DeployedService ds = (xmlrpc.DeployedService)(node.Tag); + return ASSIGNED_SERVICES + ds.id; + } + case ASSIGNED_TRANSPORTS: + { + xmlrpc.DeployedService ds = (xmlrpc.DeployedService)(node.Tag); + return ASSIGNED_TRANSPORTS + ds.id; + } + case PUBLICATIONS: + { + xmlrpc.DeployedService ds = (xmlrpc.DeployedService)(node.Tag); + return PUBLICATIONS + ds.id; + } + case ALLOWED_GROUPS: + { + xmlrpc.DeployedService ds = (xmlrpc.DeployedService)(node.Tag); + return ALLOWED_GROUPS + ds.id; + } + + default: + return node.Name; + } + } + + static public xmlrpc.AuthenticatorType authType(xmlrpc.Authenticator auth, xmlrpc.AuthenticatorType[] types) + { + xmlrpc.AuthenticatorType type = new xmlrpc.AuthenticatorType(); + foreach (xmlrpc.AuthenticatorType a in types) + { + if (a.type == auth.type) + { + type = a; + break; + } + } + return type; + } + + static public void showAssociatedPanel(SplitterPanel panel, TreeView view, forms.MainForm mainForm) + { + TreeNode selected = view.SelectedNode; + + // Hides all visible controls + foreach (Control ctrl in panel.Controls) + ctrl.Hide(); + + string key = getKey(selected); + if (panel.Controls.ContainsKey(key)) + panel.Controls[key].Show(); + else // Don't exists, creates a new panel associated with the tree view and initializes it + { + Control ctrl; + switch( selected.Name ) + { + case USERS: + { + xmlrpc.Authenticator auth = (xmlrpc.Authenticator)(selected.Parent.Tag); + xmlrpc.AuthenticatorType type = authType(auth, mainForm._authenticatorsTypes); + ctrl = new controls.panel.UsersPanel(auth, type); + break; + } + case GROUPS: + { + xmlrpc.Authenticator auth = (xmlrpc.Authenticator)(selected.Parent.Tag); + xmlrpc.AuthenticatorType type = authType(auth, mainForm._authenticatorsTypes); + ctrl = new controls.panel.GroupsPanel(auth, type); + break; + } + case TRANSPORTS: + { + ctrl = new controls.panel.TransportsPanel(); + break; + } + case OS_MANAGERS: + { + ctrl = new controls.panel.OsManagersPanel(); + break; + } + case AUTHENTICATORS: + { + ctrl = new controls.panel.AuthsPanel(); + break; + } + case SERVICES_PROVIDERS: + { + ctrl = new controls.panel.ServiceProvidersPanel(); + break; + } + case SERVICE_PROVIDER: + { + ctrl = new controls.panel.ServicesPanel(((xmlrpc.ServiceProvider)selected.Tag)); + break; + } + case SERVICES: + { + ctrl = new controls.panel.ServicesPanel(((xmlrpc.ServiceProvider)selected.Parent.Tag)); + break; + } + case DEPLOYED_SERVICE: + { + xmlrpc.DeployedService ds = (xmlrpc.DeployedService)(selected.Tag); + ctrl = new controls.panel.DeployedServicePanel(ds); + break; + } + case DEPLOYED_SERVICES: + { + ctrl = new controls.panel.DeployedServicesPanel(); + break; + } + case CACHE: + { + xmlrpc.DeployedService ds = (xmlrpc.DeployedService)(selected.Tag); + ctrl = new controls.panel.DeployedPanel(ds, true); + break; + } + case ASSIGNED_SERVICES: + { + xmlrpc.DeployedService ds = (xmlrpc.DeployedService)(selected.Tag); + ctrl = new controls.panel.DeployedPanel(ds, false); + break; + } + case ASSIGNED_TRANSPORTS: + { + xmlrpc.DeployedService ds = (xmlrpc.DeployedService)(selected.Tag); + ctrl = new controls.panel.TransportsPanel(ds); + break; + } + case PUBLICATIONS: + { + xmlrpc.DeployedService ds = (xmlrpc.DeployedService)(selected.Tag); + ctrl = new controls.panel.PublicationsPanel(ds); + break; + } + case ALLOWED_GROUPS: + { + xmlrpc.DeployedService ds = (xmlrpc.DeployedService)(selected.Tag); + ctrl = new controls.panel.DeployedGroupsPanel(ds); + break; + } + case NETWORKS: + { + ctrl = new controls.panel.NetworksPanel(); + break; + } + default: + ctrl = new controls.panel.PanelEmpty(""); + break; + + } + ctrl.Name = key; + ctrl.Dock = DockStyle.Fill; + panel.Controls.Add(ctrl); + } + } + + } +} diff --git a/client/administration/UdsAdmin/gui/Colors.cs b/client/administration/UdsAdmin/gui/Colors.cs new file mode 100644 index 000000000..d9d885f86 --- /dev/null +++ b/client/administration/UdsAdmin/gui/Colors.cs @@ -0,0 +1,78 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Drawing; + +namespace UdsAdmin.gui +{ + public class Colors + { + public static Color BlackColor = Color.Black; + public static Color ActiveColor = Color.Black; + public static Color InactiveColor = Color.Orange; + public static Color RemovingColor = Color.DarkGray; + public static Color RemovedColor = Color.Gray; + public static Color BlockedColor = Color.Red; + public static Color RunningColor = Color.Green; + public static Color ErrorColor = Color.Red; + public static Color InactiveBackColor = Color.Red; + public static Color InactiveForeColor = Color.Yellow; + public static Color ActiveBackColor = Color.Green; + public static Color ActiveForeColor = Color.White; + + public static Color getColorForState(string state) + { + switch (state) + { + case xmlrpc.Constants.STATE_USABLE: + case xmlrpc.Constants.STATE_ACTIVE: + return ActiveColor; + case xmlrpc.Constants.STATE_ERROR: + return ErrorColor; + case xmlrpc.Constants.STATE_PREPARING: + return RunningColor; + case xmlrpc.Constants.STATE_INACTIVE: + return InactiveColor; + case xmlrpc.Constants.STATE_REMOVABLE: + case xmlrpc.Constants.STATE_REMOVING: + case xmlrpc.Constants.STATE_CANCELING: + return RemovingColor; + case xmlrpc.Constants.STATE_REMOVED: + case xmlrpc.Constants.STATE_CANCELED: + return RemovedColor; + default: + return BlackColor; + } + } + } +} diff --git a/client/administration/UdsAdmin/gui/DinamycFieldsManager.cs b/client/administration/UdsAdmin/gui/DinamycFieldsManager.cs new file mode 100644 index 000000000..188a5430e --- /dev/null +++ b/client/administration/UdsAdmin/gui/DinamycFieldsManager.cs @@ -0,0 +1,661 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.Drawing; + +namespace UdsAdmin.gui +{ + public class DinamycFieldsManager + { + const int DEF_FLD_HEIGHT = 22; + const int DEF_FLD_WIDTH = 12; + + public class ValidationError : Exception + { + private string _msg; + + public ValidationError(string err) : base() + { + _msg = err; + } + + public ValidationError(xmlrpc.GuiField fld) : base() + { + _msg = string.Format(Strings.fieldRequired, fld.gui.label); + } + + public override string Message + { + get + { + return _msg; + } + } + + } + + // I'll try to explain what i want to do with this struture here :-): + // First, we need a translation table so we can easyly know how every single type behabiors. + // This behabiors must include: + // - Generate the control itself, with default data if provided (Textbox, Combobox, ...) + // - Read data from controls (Text from textbox, selected item id from comboboc, selected itemS idS from listbox, ...) + // - Refill controls with data (used for callback invocation, on return it must refill som items) + // - Select values of controls, without refilling data (for "modify" operations, so we can recover the previous state) + // - Calculate the size of the control (so we can adjust the Panel acordly) + // With all of this, we use the next items in every case: + // - PutFields, First, it calculates the size of all cells, done via "sizeCalculator". + // Then, it creates the controls with the specified value/values (value for text controls, values for choices and multichoices) + // This is done via "ctrlGenerator" method + // When all controls r created, it starts, in order, to set values indicated, invoking callbacks if needed + // (this way, if we need to recover the state of something, we can use same callbacks that we used at creation + // to allow modify). This is done via the "dataSelector". + // - Callbacks, It uses the information provided on the callback to; + // * Invoke the remote procedure with indicated parameters (even hidden fields :-)) + // * Receive data from callback and, using "dataWriter", refill the specified fields received on response. + // Choice and Multichoice uses the "values" field, and text ones uses the "value" field + // - ReadFields. It simply reads the previously created controls, fills the pairs "name" "value" in case of single select value controls + // (text, choice) and the keys "name" "values" in case of multiselection controls (multichoice), returning this list. + + struct FldTypeData { + public Func ctrlGenerator; + public Func dataExtractor; + public Action dataWriter; + public Action dataSelector; + public Func sizeCalculator; + + public FldTypeData(Func generator, + Func dataExtractor, + Action dataWriter, + Action dataSelector, + Func sizeCalculator, Size size) + { + this.ctrlGenerator = generator; + this.dataExtractor = dataExtractor; + this.dataWriter = dataWriter; + this.dataSelector = dataSelector; + this.sizeCalculator = sizeCalculator; + } + + public FldTypeData(Func generator, + Func dataExtractor, + Action dataWriter, + Action dataSelector, + Func sizeCalculator) + { + this.ctrlGenerator = generator; + this.dataExtractor = dataExtractor; + this.dataWriter = dataWriter; + this.dataSelector = dataSelector; + this.sizeCalculator = sizeCalculator; + } + + public FldTypeData(Func generator, + Func dataExtractor, + Action dataWriter, + Action dataSelector) + { + this.ctrlGenerator = generator; + this.dataExtractor = dataExtractor; + this.dataWriter = dataWriter; + this.dataSelector = dataSelector; + this.sizeCalculator = DefaultSizeCalculator; + } + + public Size size() + { + return new Size(DEF_FLD_WIDTH, DEF_FLD_HEIGHT); + } + + }; + + + private static Dictionary ctrlTypeInfo = + new Dictionary() + { + { xmlrpc.Constants.TEXT_TYPE, new FldTypeData(CreateTextBox, TextDataExtractor, TextDataWriter, TextSelector) }, + { xmlrpc.Constants.PASSWORD_TYPE, new FldTypeData(CreatePasswordBox, TextDataExtractor, TextDataWriter, TextSelector) }, + { xmlrpc.Constants.NUMERIC_TYPE, new FldTypeData(CreateNumericBox, NumericDataExtractor, TextDataWriter, TextSelector) }, + { xmlrpc.Constants.HIDDEN_TYPE, new FldTypeData(null, TextDataExtractor, TextDataWriter, TextSelector) }, + { xmlrpc.Constants.CHOICE_TYPE, new FldTypeData(CreateChoiceBox, ChoiceDataExtractor, ChoiceDataWriter, ChoiceSelector) }, + { xmlrpc.Constants.MULTI_CHOICE_TYPE, new FldTypeData(CreateMultiChoiceBox, MultiChoiceExtractor, MultichoiceDataWriter, MultiChoiceSelector, MultiChoiceSizeCalculator) }, + { xmlrpc.Constants.EDITABLE_LIST, new FldTypeData(CreateEditList, EditListExtractor, EditListDataWriter, EditListSelector, BtnSizeCalculator) }, + { xmlrpc.Constants.CHECKBOX_TYPE, new FldTypeData(CreateCheckBox, CheckBoxExtractor, CheckBoxDataWriter, CheckBoxSelector, CheckBoxSizeCalculator) }, + }; + + // Put fields on the specified tablelayoutpanel so they can be edited + public static Size PutFields(TableLayoutPanel panel, xmlrpc.GuiField[] fields, xmlrpc.GuiFieldValue[] values) + { + // Controls generator + // Size getters + + // We count the fields, except for hiddend fields, so we know the number of rows + int numRows = fields.Count(fld => (fld.gui.type != xmlrpc.Constants.HIDDEN_TYPE)); + panel.SuspendLayout(); + panel.Controls.Clear(); + panel.RowCount = numRows; + panel.ColumnCount = 2; + + panel.AutoSize = true; + + // Sort the array by fielrd order + Array.Sort(fields, delegate( xmlrpc.GuiField f1, xmlrpc.GuiField f2 ) { + return f1.gui.order.CompareTo(f2.gui.order); + }); + + List ordererValues = new List(); + Dictionary dict = new Dictionary(); + + if (values != null) + foreach (xmlrpc.GuiFieldValue v in values) + dict.Add(v.name, v); + + int row = 0; + foreach (xmlrpc.GuiField fld in fields) + { + if (fld.gui.type != xmlrpc.Constants.HIDDEN_TYPE) // Hiden fields are textbox that don't appears and don't add rows.. + { + ToolTip tt = new ToolTip(); + // Creates the label + Label label = new Label(); + label.AutoSize = true; + label.Margin = new Padding(3, 6, 3, 6); + label.Text = fld.gui.label; + label.TextAlign = ContentAlignment.MiddleLeft; + tt.SetToolTip(label, fld.gui.tooltip); + panel.Controls.Add(label, 0, row); + //panel.SetCellPosition(label, new TableLayoutPanelCellPosition(0, row)); + Control ctrl = ctrlTypeInfo[fld.gui.type].ctrlGenerator(fld, panel); + ctrl.Dock = DockStyle.Fill; + if (dict.ContainsKey(fld.name)) + { + // We have it in order + ordererValues.Add(dict[fld.name]); + } + if (fld.gui.rdonly == true && values != null) + { + label.Enabled = false; + ctrl.Enabled = false; + } + panel.Controls.Add(ctrl, 1, row); + // panel.SetCellPosition(ctrl, new TableLayoutPanelCellPosition(1, row)); + row++; + } + else + { + TextBox hidden = new TextBox(); + if (fld.value != "") + hidden.Text = fld.value; + else + hidden.Text = fld.gui.defvalue; + hidden.Name = fld.name; hidden.Tag = fld; hidden.Visible = false; + panel.Controls.Add(hidden, 0, 0); + } + } + + // Set panel column and rows styles + TableLayoutColumnStyleCollection styles = panel.ColumnStyles; + + foreach (ColumnStyle style in styles) + { + style.SizeType = SizeType.AutoSize; + } + + TableLayoutRowStyleCollection stylesR = panel.RowStyles; + foreach (RowStyle style in stylesR) + { + style.SizeType = SizeType.AutoSize; + } + + panel.ResumeLayout(); + + // Now stores the values of fields if needed (we do it now cause we need all controls to be created BEFORE this + // because the events of change fields will be launched + // Generate a dict with the desired values + foreach (xmlrpc.GuiFieldValue v in ordererValues) + { + Control[] ctrl = panel.Controls.Find(v.name, true); + if (ctrl.Length > 0) + { + xmlrpc.GuiField field = (xmlrpc.GuiField)ctrl[0].Tag; + ctrlTypeInfo[field.gui.type].dataSelector(ctrl[0], v); + } + } + + + return panel.PreferredSize; + } + + + public static xmlrpc.GuiFieldValue[] ReadFields(TableLayoutPanel panel, xmlrpc.GuiField[] flds) + { + + Dictionary ctrlsDict = new Dictionary(); + foreach (Control ctrl in panel.Controls) + { + if (ctrl.Name == "") // Skip labels... + continue; + ctrlsDict.Add(ctrl.Name, ctrl); + } + // Extract data from controls and put it on + xmlrpc.GuiFieldValue[] res = new xmlrpc.GuiFieldValue[flds.Count()]; + int cnt = 0; + foreach (xmlrpc.GuiField fld in flds) + { + res[cnt++] = ctrlTypeInfo[fld.gui.type].dataExtractor(ctrlsDict[fld.name], fld, true); + } + return res; + } + + + // Controls creator helpers + private static Control CreateTextBox(xmlrpc.GuiField fld, Control container) + { + TextBox text = new TextBox(); + text.Name = fld.name; + text.Tag = fld; + Size sz = ctrlTypeInfo[fld.gui.type].sizeCalculator(fld); + text.Width = sz.Width; + text.Height = sz.Height; + text.MaxLength = fld.gui.length; + if (fld.value != "") + text.Text = fld.value; + else + text.Text = fld.gui.defvalue; + return text; + } + + private static Control CreatePasswordBox(xmlrpc.GuiField fld, Control container) + { + TextBox text = new TextBox(); + text.Name = fld.name; + text.Tag = fld; + Size sz = ctrlTypeInfo[fld.gui.type].sizeCalculator(fld); + text.Width = sz.Width; + text.Height = sz.Height; + text.MaxLength = fld.gui.length; + if (fld.value != "") + text.Text = fld.value; + else + text.Text = fld.gui.defvalue; + text.UseSystemPasswordChar = true; + return text; + } + + private static decimal ToDecimal(string value) + { + try + { + return Convert.ToDecimal(value); + } + catch (Exception) + { + return 0; + } + } + + private static Control CreateNumericBox(xmlrpc.GuiField fld, Control container) + { + NumericUpDown num = new NumericUpDown(); + num.Name = fld.name; + num.Tag = fld; + Size sz = ctrlTypeInfo[fld.gui.type].sizeCalculator(fld); + num.Width = sz.Width + 20; + num.Height = sz.Height; + num.Minimum = 0; + double length = fld.gui.length < 8 ? fld.gui.length : 8; + num.Maximum = (decimal)Math.Pow(10, length)-1; + if (fld.value != "") + num.Value = ToDecimal(fld.value); + else + { + num.Value = ToDecimal(fld.gui.defvalue); + } + return num; + } + + private static Control CreateChoiceBox(xmlrpc.GuiField fld, Control container) + { + ComboBox box = new ComboBox(); + box.Name = fld.name; + box.Tag = fld; + box.DropDownStyle = ComboBoxStyle.DropDownList; + Size sz = ctrlTypeInfo[fld.gui.type].sizeCalculator(fld); + box.Width = sz.Width; + box.Height = sz.Height; + foreach (xmlrpc.Choice ch in fld.gui.values) + { + box.Items.Add(ch); + if (ch.id == fld.gui.defvalue) + box.SelectedItem = ch; + } + + if (fld.gui.fills.callbackName != null) + { + // We create a delegate to support the callback for this combo box + box.SelectedIndexChanged += delegate(object sender, EventArgs args) + { + xmlrpc.GuiFieldValue[] data = new xmlrpc.GuiFieldValue[fld.gui.fills.parameters.Length]; + int pos = 0; + foreach (string parameter in fld.gui.fills.parameters) + { + Control[] ctrlParameter = container.Controls.Find(parameter, true); + if (ctrlParameter.Length > 0) + { + xmlrpc.GuiField field = (xmlrpc.GuiField)ctrlParameter[0].Tag; + data[pos++] = ctrlTypeInfo[field.gui.type].dataExtractor(ctrlParameter[0], field, false); + } + } + xmlrpc.GuiFieldValue[] newData = xmlrpc.UdsAdminService.InvokeChooseCallback(fld.gui.fills.callbackName, data); + foreach (xmlrpc.GuiFieldValue val in newData) + { + Control[] ctrlResult = container.Controls.Find(val.name, true); + if (ctrlResult.Length > 0) + { + xmlrpc.GuiField field = (xmlrpc.GuiField)ctrlResult[0].Tag; + ctrlTypeInfo[field.gui.type].dataWriter(ctrlResult[0], val); + } + } + }; + } + // With the event active, we change the selected item (if there is a callback, it should launc now) + return box; + } + + // Multichoice creator + private static Control CreateMultiChoiceBox(xmlrpc.GuiField fld, Control container) + { + ListBox box = new ListBox(); + box.Name = fld.name; + box.Tag = fld; + box.SelectionMode = SelectionMode.MultiExtended; + Size sz = ctrlTypeInfo[fld.gui.type].sizeCalculator(fld); + box.Width = sz.Width; + box.Height = sz.Height; + foreach (xmlrpc.Choice ch in fld.gui.values) + { + box.Items.Add(ch); + if (fld.gui.defvalue == ch.id) + box.SelectedItem = ch; + } + + return box; + } + + private static Control CreateEditList(xmlrpc.GuiField fld, Control container) + { + controls.ListEditor lst = new controls.ListEditor(); + lst.Name = fld.name; + lst.Tag = fld; + lst.Text = fld.gui.label; + Size sz = ctrlTypeInfo[fld.gui.type].sizeCalculator(fld); + lst.Width = sz.Width; + List vals = new List(); + foreach (xmlrpc.Choice ch in fld.gui.values) + vals.Add(ch.id); + lst.Items = vals; + + return lst; + } + + private static Control CreateCheckBox(xmlrpc.GuiField fld, Control container) + { + CheckBox check = new CheckBox(); + check.Name = fld.name; + check.Tag = fld; + Size sz = ctrlTypeInfo[fld.gui.type].sizeCalculator(fld); + check.Width = sz.Width; + check.Height = sz.Height; + string value = (fld.value != "") ? fld.value : fld.gui.defvalue; + + if (value != xmlrpc.Constants.TRUE) + check.Checked = false; + else + check.Checked = true; + return check; + } + + // Controls size calculators + private static Size DefaultSizeCalculator(xmlrpc.GuiField fld) + { + Size sz = ctrlTypeInfo[fld.gui.type].size(); + sz.Width *= fld.gui.length; + if (sz.Width > UdsAdmin.Properties.Settings.Default.MaxControlWidth) + sz.Width = UdsAdmin.Properties.Settings.Default.MaxControlWidth; + + return sz; + } + + // Button size calculators + private static Size BtnSizeCalculator(xmlrpc.GuiField fld) + { + Size sz = ctrlTypeInfo[fld.gui.type].size(); + sz.Height += 8; + sz.Width *= fld.gui.length; + if (sz.Width > UdsAdmin.Properties.Settings.Default.MaxControlWidth) + sz.Width = UdsAdmin.Properties.Settings.Default.MaxControlWidth; + + return sz; + } + + // Listbox size calculator + private static Size MultiChoiceSizeCalculator(xmlrpc.GuiField fld) + { + Size sz = ctrlTypeInfo[fld.gui.type].size(); + sz.Width *= fld.gui.length; + if (sz.Width > UdsAdmin.Properties.Settings.Default.MaxControlWidth) + sz.Width = UdsAdmin.Properties.Settings.Default.MaxControlWidth; + int rows = 2; + if (fld.gui.rows != -1) + rows = fld.gui.rows; + sz.Height *= rows; + return sz; + } + + private static Size CheckBoxSizeCalculator(xmlrpc.GuiField fld) + { + Size sz = ctrlTypeInfo[fld.gui.type].size() + new Size(4, 4); + if (sz.Width > UdsAdmin.Properties.Settings.Default.MaxControlWidth) + sz.Width = UdsAdmin.Properties.Settings.Default.MaxControlWidth; + + return sz; + } + + // Control extractors helpers + private static xmlrpc.GuiFieldValue TextDataExtractor(Control ctrl, xmlrpc.GuiField fld, bool validate) + { + TextBox txt = (TextBox)ctrl; + string val = txt.Text.Trim(); + if (validate && fld.gui.required && val.Length == 0) + throw new ValidationError(fld); + return new xmlrpc.GuiFieldValue(fld.name, val); + } + + private static xmlrpc.GuiFieldValue NumericDataExtractor(Control ctrl, xmlrpc.GuiField fld, bool validate) + { + NumericUpDown num = (NumericUpDown)ctrl; + string val = ((int)(num.Value)).ToString(); + if( validate && fld.gui.required && val == "0" ) + throw new ValidationError(fld); + return new xmlrpc.GuiFieldValue(fld.name, val); + } + + private static xmlrpc.GuiFieldValue ChoiceDataExtractor(Control ctrl, xmlrpc.GuiField fld, bool validate) + { + ComboBox box = (ComboBox)ctrl; + string val = ""; + if( box.SelectedItem != null ) + val = ((xmlrpc.Choice)box.SelectedItem).id; + if( validate && fld.gui.required && val.Length == 0 ) + throw new ValidationError(fld); + return new xmlrpc.GuiFieldValue(fld.name, val); + } + + private static xmlrpc.GuiFieldValue MultiChoiceExtractor(Control ctrl, xmlrpc.GuiField fld, bool validate) + { + ListBox box = (ListBox)ctrl; + xmlrpc.Choice[] selected = new xmlrpc.Choice[box.SelectedItems.Count]; + for (int i = 0; i < box.SelectedItems.Count; i++) + selected[i] = (xmlrpc.Choice)box.SelectedItems[i]; + if (validate && fld.gui.required && selected.Length == 0) + throw new ValidationError(fld); + return new xmlrpc.GuiFieldValue(fld.name, selected); + } + + private static xmlrpc.GuiFieldValue EditListExtractor(Control ctrl, xmlrpc.GuiField fld, bool validate) + { + controls.ListEditor lst = (controls.ListEditor)ctrl; + List vals = lst.Items; + xmlrpc.Choice[] selected = new xmlrpc.Choice[vals.Count]; + for (int i = 0; i < vals.Count; i++) + selected[i] = new xmlrpc.Choice(vals[i], ""); // Returned values goes inside ids (the significant part of choices, text are used to display data to user) + if ( validate && fld.gui.required && selected.Length == 0) + throw new ValidationError(fld); + return new xmlrpc.GuiFieldValue(fld.name, selected); + } + + private static xmlrpc.GuiFieldValue CheckBoxExtractor(Control ctrl, xmlrpc.GuiField fld, bool validate) + { + CheckBox chk = (CheckBox)ctrl; + return new xmlrpc.GuiFieldValue(fld.name, chk.Checked ? xmlrpc.Constants.TRUE : xmlrpc.Constants.FALSE); + } + + // Control writers helpers + private static void TextDataWriter(Control ctrl, xmlrpc.GuiFieldValue value) + { + ctrl.Text = value.value; + } + + // Control writers helpers + private static void NumericDataWriter(Control ctrl, xmlrpc.GuiFieldValue value) + { + NumericUpDown num = (NumericUpDown)ctrl; + num.Value = ToDecimal(value.value); + } + + private static void ChoiceDataWriter(Control ctrl, xmlrpc.GuiFieldValue value) + { + ComboBox box = (ComboBox)ctrl; + box.Items.Clear(); + foreach (xmlrpc.Choice ch in value.values) + { + box.Items.Add(ch); + } + if (box.Items.Count > 0) + box.SelectedIndex = 0; + else + box.SelectedIndex = -1; + } + + private static void MultichoiceDataWriter(Control ctrl, xmlrpc.GuiFieldValue value) + { + ListBox box = (ListBox)ctrl; + box.Items.Clear(); + foreach (xmlrpc.Choice ch in value.values) + { + box.Items.Add(ch); + } + } + + private static void EditListDataWriter(Control ctrl, xmlrpc.GuiFieldValue value) + { + controls.ListEditor lst = (controls.ListEditor)ctrl; + List vals = new List(); + foreach (xmlrpc.Choice ch in value.values) + vals.Add(ch.text); + lst.Items = vals; + } + + private static void CheckBoxDataWriter(Control ctrl, xmlrpc.GuiFieldValue value) + { + CheckBox chk = (CheckBox)ctrl; + if (value.value != xmlrpc.Constants.TRUE) + chk.Checked = false; + else + chk.Checked = true; + } + + // Controls "Selectors" (that is, select the items without overwriting it + private static void TextSelector(Control ctrl, xmlrpc.GuiFieldValue value) + { + ctrl.Text = value.value; + } + + private static void NumericSelector(Control ctrl, xmlrpc.GuiFieldValue value) + { + NumericUpDown num = (NumericUpDown)ctrl; + num.Value = ToDecimal(value.value); + } + + private static void ChoiceSelector(Control ctrl, xmlrpc.GuiFieldValue value) + { + ComboBox box = (ComboBox)ctrl; + foreach( xmlrpc.Choice ch in box.Items ) + { + if (ch.id == value.value) + box.SelectedItem = ch; + } + } + + private static void MultiChoiceSelector(Control ctrl, xmlrpc.GuiFieldValue value) + { + ListBox box = (ListBox)ctrl; + box.BeginUpdate(); + box.ClearSelected(); + foreach (xmlrpc.Choice val in value.values) + box.SelectedItems.Add(val); + box.EndUpdate(); + } + + private static void EditListSelector(Control ctrl, xmlrpc.GuiFieldValue value) + { + // All items are "Selected" in editlist, i mean, we fill the list with this items + controls.ListEditor lst = (controls.ListEditor)ctrl; + List vals = new List(); + foreach (xmlrpc.Choice ch in value.values) + vals.Add(ch.id); + lst.Items = vals; + + } + + private static void CheckBoxSelector(Control ctrl, xmlrpc.GuiFieldValue value) + { + CheckBox chk = (CheckBox)ctrl; + if (value.value != xmlrpc.Constants.TRUE) + chk.Checked = false; + else + chk.Checked = true; + } + + } +} diff --git a/client/administration/UdsAdmin/gui/Helpers.cs b/client/administration/UdsAdmin/gui/Helpers.cs new file mode 100644 index 000000000..8e964db67 --- /dev/null +++ b/client/administration/UdsAdmin/gui/Helpers.cs @@ -0,0 +1,102 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.Drawing; +using System.Drawing.Imaging; + + +namespace UdsAdmin.gui +{ + class Helpers + { + /// + /// Method to convert an string in base64 to an image + /// + /// String with base64 data + /// Image produced from the string provided + public static Bitmap ImageFromBase64(string base64) + { + byte[] raw = Convert.FromBase64String(base64); + System.ComponentModel.TypeConverter tc = System.ComponentModel.TypeDescriptor.GetConverter(typeof(Bitmap)); + + return (Bitmap)tc.ConvertFrom(raw); + } + + public static Icon IconFromBase64(string base64) + { + return Icon.FromHandle(gui.Helpers.ImageFromBase64(base64).GetHicon()); + } + + /// + /// method for changing the opacity of an image + /// + /// image to set opacity on + /// percentage of opacity + /// new Image with the opacity + public static Image SetImageOpacity(Image image, float opacity) + { + try + { + //create a Bitmap the size of the image provided + Bitmap bmp = new Bitmap(image.Width, image.Height); + + //create a graphics object from the image + using (Graphics gfx = Graphics.FromImage(bmp)) + { + + //create a color matrix object + ColorMatrix matrix = new ColorMatrix(); + + //set the opacity + matrix.Matrix33 = opacity; + + //create image attributes + ImageAttributes attributes = new ImageAttributes(); + + //set the color(opacity) of the image + attributes.SetColorMatrix(matrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap); + + //now draw the image + gfx.DrawImage(image, new Rectangle(0, 0, bmp.Width, bmp.Height), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, attributes); + } + return bmp; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + return null; + } + } + } +} diff --git a/client/administration/UdsAdmin/gui/ListViewSorter.cs b/client/administration/UdsAdmin/gui/ListViewSorter.cs new file mode 100644 index 000000000..4f81e51a3 --- /dev/null +++ b/client/administration/UdsAdmin/gui/ListViewSorter.cs @@ -0,0 +1,162 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.Collections; + +namespace UdsAdmin.gui +{ + class ListViewSorter : IComparer + { + private const string ASC = " (asc)"; + private const string DES = " (des)"; + private int _colToSort; + private ImageList sortOrderImages; + SortOrder _order; + IComparer _strComparer; + ListView _list; + ICollection _dateColumns; + + public ListViewSorter(ListView lst, ICollection dateColumns = null ) + { + _colToSort = 0; + _order = SortOrder.None; + _strComparer = new CaseInsensitiveComparer(); + _list = lst; + + _dateColumns = dateColumns; + + + sortOrderImages = new ImageList(); + sortOrderImages.ColorDepth = ColorDepth.Depth24Bit; + sortOrderImages.Images.Add("up", Images.uparrow16); + sortOrderImages.Images.Add("down", Images.downarrow16); + sortOrderImages.Images.Add("empty", Images.empty16); + + lst.SmallImageList = sortOrderImages; + foreach (ColumnHeader h in lst.Columns) + { + h.TextAlign = HorizontalAlignment.Left; + h.ImageKey = "empty"; + h.Width = TextRenderer.MeasureText(h.Text, lst.Parent.Font).Width + 40; + } + } + + + public int Compare(object x, object y) + { + int compareResult; + string listviewX, listviewY; + + // Cast the objects to be compared to ListViewItem objects + listviewX = ((ListViewItem)x).SubItems[_colToSort].Text; + listviewY = ((ListViewItem)y).SubItems[_colToSort].Text; + + // Compare the two items + if( _dateColumns != null && _dateColumns.Contains(_colToSort ) ) + compareResult = DateTime.Compare(DateTime.Parse(listviewX), DateTime.Parse(listviewY)); + else + compareResult = _strComparer.Compare(listviewX, listviewY); + + // Calculate correct return value based on object comparison + if (_order == SortOrder.Ascending) + { + // Ascending sort is selected, return normal result of compare operation + return compareResult; + } + else if (_order == SortOrder.Descending) + { + // Descending sort is selected, return negative result of compare operation + return (-compareResult); + } + else + { + // Return '0' to indicate they are equal + return 0; + } + } + + private void updateColumnHeaderText(int column, string order) + { + ColumnHeader h = _list.Columns[column]; + string txt = h.Text; + // Try to remove " (asc)" or " (des)" + /*if (txt.Contains(ASC)) + txt = txt.Substring(0, txt.Length - ASC.Length); + else if (txt.Contains(DES)) + txt = txt.Substring(0, txt.Length - DES.Length); + txt += order; + h.Text = txt;*/ + if (order == ASC) + h.ImageKey = "down"; + else if (order == DES) + h.ImageKey = "up"; + else + h.ImageKey = "empty"; + } + + private void updateColumHeaders() + { + for (int i = 0; i < _list.Columns.Count; i++) + if (i == _colToSort) + updateColumnHeaderText(i, _order == SortOrder.Ascending ? ASC : DES); + else + updateColumnHeaderText(i, ""); + } + + public void ColumnClick(object sender, ColumnClickEventArgs e) + { + // Determine if clicked column is already the column that is being sorted. + if (e.Column == _colToSort) + { + // Reverse the current sort direction for this column. + if (_order == SortOrder.Ascending) + { + _order = SortOrder.Descending; + } + else + { + _order = SortOrder.Ascending; + } + } + else + { + // Set the column number that is to be sorted; default to ascending. + _colToSort = e.Column; + _order = SortOrder.Ascending; + } + updateColumHeaders(); + _list.Sort(); + } + } +} diff --git a/client/administration/UdsAdmin/gui/MenusManager.cs b/client/administration/UdsAdmin/gui/MenusManager.cs new file mode 100644 index 000000000..d609d7bdf --- /dev/null +++ b/client/administration/UdsAdmin/gui/MenusManager.cs @@ -0,0 +1,239 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.gui +{ + public class MenusManager + { + public static void InitProvidersMenu(ToolStripMenuItem menu, EventHandler action, xmlrpc.ServiceProviderType[] providersTypes) + { + menu.DropDownItems.Clear(); + menu.Text = Strings.newItem; + List lst = new List(providersTypes); + lst.Sort(new xmlrpc.ServiceProviderTypeSorterByName()); + foreach (xmlrpc.ServiceProviderType pt in lst) + { + ToolStripItem m = new ToolStripMenuItem(pt.name); + m.Name = pt.type; + m.ToolTipText = pt.description; + m.Image = gui.Helpers.ImageFromBase64(pt.icon); + m.Click += action; + + menu.DropDownItems.Add(m); + } + } + + public static ContextMenuStrip ServicesMenu(EventHandler action, xmlrpc.ServiceType[] servicesTypes, bool withModifyDelete) + { + ContextMenuStrip menu = new ContextMenuStrip(); + ToolStripMenuItem newA = new ToolStripMenuItem(); newA.Name = "" ; + + newA.DropDownItems.Clear(); + newA.Text = Strings.newItem; + + List lst = new List(servicesTypes); + lst.Sort(new xmlrpc.ServiceTypeSorterByName()); + + foreach (xmlrpc.ServiceType st in lst) + { + ToolStripItem m = new ToolStripMenuItem(st.name); + m.Name = ActionTree.NEW_ACTION; + m.Tag = st; + m.ToolTipText = st.description; + m.Image = gui.Helpers.ImageFromBase64(st.icon); + m.Click += action; + + newA.DropDownItems.Add(m); + } + + if (withModifyDelete) + { + ToolStripMenuItem modify = new ToolStripMenuItem(Strings.modifyItem); modify.Name = ActionTree.MODIFY_ACTION; modify.Click += action; + ToolStripMenuItem delete = new ToolStripMenuItem(Strings.deleteItem); delete.Name = ActionTree.DELETE_ACTION; delete.Click += action; + ToolStripMenuItem check = new ToolStripMenuItem(Strings.checkServiceProvider); check.Name = ActionTree.CHECK_ACTION; check.Click += action; + if( servicesTypes.Length > 0 ) + menu.Items.AddRange(new ToolStripItem[] { newA, modify, delete, check }); + else + menu.Items.AddRange(new ToolStripItem[] { modify, delete, check }); + } + else + menu.Items.Add(newA); + return menu; + } + + public static ContextMenuStrip ServiceMenu(EventHandler action, xmlrpc.Service service, xmlrpc.ServiceType type) + { + ContextMenuStrip menu = new ContextMenuStrip(); + ToolStripMenuItem modify = new ToolStripMenuItem(Strings.modifyItem); modify.Name = ActionTree.MODIFY_ACTION; modify.Click += action; modify.Tag = type; + ToolStripMenuItem delete = new ToolStripMenuItem(Strings.deleteItem); delete.Name = ActionTree.DELETE_ACTION; delete.Click += action; + menu.Items.AddRange(new ToolStripItem[] { modify, delete }); + return menu; + } + + public static void InitAuthenticatorsMenu(ToolStripMenuItem menu, EventHandler action, xmlrpc.AuthenticatorType[] authsTypes) + { + menu.DropDownItems.Clear(); + menu.Text = Strings.newItem; + List lst = new List(authsTypes); + lst.Sort(new xmlrpc.AuthenticatorTypeSorterByName()); + + foreach (xmlrpc.AuthenticatorType authType in lst) + { + ToolStripItem m = new ToolStripMenuItem(authType.name); + m.Name = authType.type; + m.ToolTipText = authType.description; + m.Image = gui.Helpers.ImageFromBase64(authType.icon); + m.Click += action; + + menu.DropDownItems.Add(m); + } + } + + public static ContextMenuStrip AuthMenu(EventHandler action) + { + ContextMenuStrip menu = new ContextMenuStrip(); + ToolStripMenuItem modify = new ToolStripMenuItem(Strings.modifyItem); modify.Name = ActionTree.MODIFY_ACTION; modify.Click += action; + ToolStripMenuItem delete = new ToolStripMenuItem(Strings.deleteItem); delete.Name = ActionTree.DELETE_ACTION; delete.Click += action; + ToolStripMenuItem check = new ToolStripMenuItem(Strings.checkAuthenticator); check.Name = ActionTree.CHECK_ACTION; check.Click += action; + menu.Items.AddRange(new ToolStripItem[] { modify, delete, check }); + return menu; + } + + public static void InitOSManagersMenu(ToolStripMenuItem menu, EventHandler action, xmlrpc.OSManagerType[] osmTypes) + { + menu.DropDownItems.Clear(); + menu.Text = Strings.newItem; + List lst = new List(osmTypes); + lst.Sort(new xmlrpc.OSManagerTypeSorterByName()); + + foreach (xmlrpc.OSManagerType osmType in lst) + { + ToolStripItem m = new ToolStripMenuItem(osmType.name); + m.Name = osmType.type; + m.ToolTipText = osmType.description; + m.Image = gui.Helpers.ImageFromBase64(osmType.icon); + m.Click += action; + + menu.DropDownItems.Add(m); + } + } + + public static ContextMenuStrip OSManagerMenu(EventHandler action, xmlrpc.OSManager osm) + { + ContextMenuStrip menu = new ContextMenuStrip(); + ToolStripMenuItem modify = new ToolStripMenuItem(Strings.modifyItem); modify.Name = ActionTree.MODIFY_ACTION; modify.Click += action; + ToolStripMenuItem delete = new ToolStripMenuItem(Strings.deleteItem); delete.Name = ActionTree.DELETE_ACTION; delete.Click += action; + ToolStripMenuItem check = new ToolStripMenuItem(Strings.checkOSManager); check.Name = ActionTree.CHECK_ACTION; check.Click += action; + menu.Items.AddRange(new ToolStripItem[] { modify, delete, check }); + return menu; + } + + public static void InitTransportsMenu(ToolStripMenuItem menu, EventHandler action, xmlrpc.TransportType[] transTypes) + { + menu.DropDownItems.Clear(); + menu.Text = Strings.newItem; + List lst = new List(transTypes); + lst.Sort(new xmlrpc.TransportTypeSorterByName()); + + foreach (xmlrpc.TransportType tType in lst) + { + ToolStripItem m = new ToolStripMenuItem(tType.name); + m.Name = tType.type; + m.ToolTipText = tType.description; + m.Image = gui.Helpers.ImageFromBase64(tType.icon); + m.Click += action; + + menu.DropDownItems.Add(m); + } + } + + public static ContextMenuStrip TransportMenu(EventHandler action, xmlrpc.Transport trans) + { + ContextMenuStrip menu = new ContextMenuStrip(); + ToolStripMenuItem modify = new ToolStripMenuItem(Strings.modifyItem); modify.Name = ActionTree.MODIFY_ACTION; modify.Click += action; + ToolStripMenuItem delete = new ToolStripMenuItem(Strings.deleteItem); delete.Name = ActionTree.DELETE_ACTION; delete.Click += action; + menu.Items.AddRange(new ToolStripItem[] { modify, delete }); + return menu; + } + + public static ContextMenuStrip NetworksMenu(EventHandler action) + { + ContextMenuStrip menu = new ContextMenuStrip(); + ToolStripMenuItem newNetwork = new ToolStripMenuItem(Strings.newItem); + newNetwork.Click += action; + menu.Items.Add(newNetwork); + return menu; + } + + + public static void InitDeployedServicesMenu(ToolStripMenuItem menu, EventHandler action) + { + menu.Text = Strings.newItem; + menu.Click += action; + } + + public static ContextMenuStrip DeployedServiceMenu(EventHandler action, xmlrpc.DeployedService dps) + { + ContextMenuStrip menu = new ContextMenuStrip(); + ToolStripMenuItem modify = new ToolStripMenuItem(Strings.modifyItem); modify.Name = ActionTree.MODIFY_ACTION; modify.Click += action; + ToolStripMenuItem delete = new ToolStripMenuItem(Strings.deleteItem); delete.Name = ActionTree.DELETE_ACTION; delete.Click += action; + menu.Items.AddRange(new ToolStripItem[] { modify, delete}); + if (dps.info.needsPublication) + { + ToolStripSeparator sep = new ToolStripSeparator(); + ToolStripMenuItem publish = new ToolStripMenuItem(Strings.publish); publish.Name = ActionTree.PUBLISH_ACTION; publish.Click += action; + menu.Items.AddRange(new ToolStripItem[] {sep, publish }); + } + return menu; + } + + public static ContextMenuStrip TreeUsersGroupsMenu(EventHandler action) + { + ContextMenuStrip menu = new ContextMenuStrip(); + ToolStripMenuItem newU = new ToolStripMenuItem(Strings.newItem); newU.Name = ActionTree.NEW_ACTION; newU.Click += action; + menu.Items.Add(newU); + return menu; + } + + + public static ContextMenuStrip PublicationMenu(EventHandler action) + { + ContextMenuStrip menu = new ContextMenuStrip(); + ToolStripMenuItem publish = new ToolStripMenuItem(Strings.publish); publish.Name = ActionTree.PUBLISH_ACTION; publish.Click += action; + menu.Items.Add(publish); + return menu; + } + } +} diff --git a/client/administration/UdsAdmin/gui/UserNotifier.cs b/client/administration/UdsAdmin/gui/UserNotifier.cs new file mode 100644 index 000000000..b91982fc1 --- /dev/null +++ b/client/administration/UdsAdmin/gui/UserNotifier.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace UdsAdmin.gui +{ + public class UserNotifier + { + public static void notifyRpcException(CookComputing.XmlRpc.XmlRpcFaultException e) + { + new xmlrpc.ExceptionExplainer(e).showError(); + } + + public static void notifyValidationException(gui.DinamycFieldsManager.ValidationError err) + { + notifyError(err.Message); + } + + public static void notifyError(string msg) + { + MessageBox.Show(msg, Strings.error, MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + public static void notifyTestResult(xmlrpc.ResultTest res) + { + if (res.ok) + MessageBox.Show(res.message, Strings.resultTestOk, MessageBoxButtons.OK, MessageBoxIcon.Information); + else + MessageBox.Show(res.message, Strings.resultTestError, MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } +} diff --git a/client/administration/UdsAdmin/obj/x86/Debug/UdsAdmin.TrustInfo.xml b/client/administration/UdsAdmin/obj/x86/Debug/UdsAdmin.TrustInfo.xml new file mode 100644 index 000000000..7923810b6 --- /dev/null +++ b/client/administration/UdsAdmin/obj/x86/Debug/UdsAdmin.TrustInfo.xml @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/client/administration/UdsAdmin/xmlrpc/Constants.cs b/client/administration/UdsAdmin/xmlrpc/Constants.cs new file mode 100644 index 000000000..eea986c7d --- /dev/null +++ b/client/administration/UdsAdmin/xmlrpc/Constants.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UdsAdmin.xmlrpc +{ + public class Constants + { + public const string TEXT_TYPE = "text"; + public const string NUMERIC_TYPE = "numeric"; + public const string PASSWORD_TYPE = "password"; + public const string HIDDEN_TYPE = "hidden"; + public const string CHOICE_TYPE = "choice"; + public const string MULTI_CHOICE_TYPE = "multichoice"; + public const string EDITABLE_LIST = "editlist"; + public const string CHECKBOX_TYPE = "checkbox"; + + public const string TRUE = "true"; + public const string FALSE = "false"; + + public const string STATE_ACTIVE = "A"; + public const string STATE_INACTIVE = "I"; + public const string STATE_BLOCKED = "B"; + public const string STATE_LAUNCHING = "L"; + public const string STATE_PREPARING = "P"; + public const string STATE_USABLE = "U"; + public const string STATE_REMOVABLE = "R"; + public const string STATE_REMOVING = "M"; + public const string STATE_REMOVED = "S"; + public const string STATE_ERROR = "E"; + public const string STATE_CANCELED = "C"; + public const string STATE_CANCELING = "K"; + } +} diff --git a/client/administration/UdsAdmin/xmlrpc/ExceptionExplainer.cs b/client/administration/UdsAdmin/xmlrpc/ExceptionExplainer.cs new file mode 100644 index 000000000..5c8a08863 --- /dev/null +++ b/client/administration/UdsAdmin/xmlrpc/ExceptionExplainer.cs @@ -0,0 +1,115 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UdsAdmin.xmlrpc +{ + public class ExceptionExplainer + { + public const int AUTH_CLASS = 0x1000; + public const int DATA_CLASS = 0x2000; + public const int ACTION_CLASS = 0x3000; + + public const int FAIL = 0x0100; + + public const int AUTH_FAILED = AUTH_CLASS | FAIL | 0x0001; + public const int DUPLICATE_FAIL = DATA_CLASS | FAIL | 0x0001; + public const int INSERT_FAIL = DATA_CLASS | FAIL | 0x0002; + public const int DELETE_FAIL = DATA_CLASS | FAIL | 0x0003; + public const int FIND_FAIL = DATA_CLASS | FAIL | 0x0004; + public const int VALIDATION_FAIL = DATA_CLASS | FAIL | 0x0005; + public const int PARAMETERS_FAIL = DATA_CLASS | FAIL | 0x0006; + public const int MODIFY_FAIL = DATA_CLASS | FAIL | 0x0007; + + public const int PUBLISH_FAIL = ACTION_CLASS | FAIL | 0x0001; + public const int CANCEL_FAIL = ACTION_CLASS | FAIL | 0x0001; + + + private int _code; + private string _text; + private bool _fatal; + + public ExceptionExplainer(CookComputing.XmlRpc.XmlRpcFaultException e) + { + _code = e.FaultCode; _text = e.FaultString; + _fatal = false; + } + + public string explain() + { + string res = ""; + switch (_code) + { + case DUPLICATE_FAIL: + res = Strings.duplicatedItem + ": " + _text; + break; + case DELETE_FAIL: + res = Strings.deletionFailed + ": " + _text; + break; + case MODIFY_FAIL: + res = Strings.modificationFailed + ": " + _text; + break; + case INSERT_FAIL: + res = _text; + break; + case FIND_FAIL: + res = Strings.findFailed + ":" + _text; + break; + case VALIDATION_FAIL: + res = Strings.validationFailed + ":" + _text; + break; + case AUTH_FAILED: + _fatal = true; + res = Strings.authFailed + ":" + _text; + break; + case PUBLISH_FAIL: + res = Strings.publicationFailed + ": " + _text; + break; + case PARAMETERS_FAIL: + default: + res = _text; + break; + } + if (_fatal) + res += "\n" + Strings.appWillTerminate; + return res; + } + + public void showError() + { + System.Windows.Forms.MessageBox.Show(explain(), Strings.error, System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); + if (_fatal) + System.Windows.Forms.Application.Exit(); + } + } +} diff --git a/client/administration/UdsAdmin/xmlrpc/IUDSAdmin.cs b/client/administration/UdsAdmin/xmlrpc/IUDSAdmin.cs new file mode 100644 index 000000000..660f8cf48 --- /dev/null +++ b/client/administration/UdsAdmin/xmlrpc/IUDSAdmin.cs @@ -0,0 +1,338 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using CookComputing.XmlRpc; + +namespace UdsAdmin.xmlrpc +{ + public interface IUDSAdmin : IXmlRpcProxy + { + // Login, return credentials if logged in or empty if can't log in + [XmlRpcMethod("login")] + LoginData Login(string username, string password, string idAuth, string locale); + + [XmlRpcMethod("getAdminAuths")] + SimpleInfo[] GetAdminAuths(string locale); + + [XmlRpcMethod("logout")] + bool Logout(string credentials); + + // Service provider related methods + [XmlRpcMethod("getServiceProvidersTypes")] + ServiceProviderType[] GetServiceProvidersTypes(string credentials); + + [XmlRpcMethod("getServiceProviders")] + ServiceProvider[] GetServiceProviders(string credentials); + + [XmlRpcMethod("getServiceProviderGui")] + GuiField[] GetServiceProviderGui(string credentials, string type); + + [XmlRpcMethod("getServiceProvider")] + GuiFieldValue[] GetServiceProvider(string credentials, string id); + + [XmlRpcMethod("createServiceProvider")] + bool CreateServiceProvider(string credentials, string type, GuiFieldValue[] data); + + [XmlRpcMethod("modifyServiceProvider")] + bool ModifyServiceProvider(string credentials, string id, GuiFieldValue[] data); + + [XmlRpcMethod("removeServiceProvider")] + bool RemoveServiceProvider(string credentials, string id); + + [XmlRpcMethod("getOffersFromServiceProvider")] + ServiceType[] GetOffersFromServiceProvider(string credentials, string type); + + [XmlRpcMethod("testServiceProvider")] + ResultTest TestServiceProvider(string credentials, string type, GuiFieldValue[] data); + + [XmlRpcMethod("checkServiceProvider")] + string CheckServiceProvider(string credentials, string id); + + // Services related methods + [XmlRpcMethod("getServices")] + Service[] GetServices(string credentials, string idParent); + + [XmlRpcMethod("getAllServices")] + Service[] GetAllServices(string credentials); + + [XmlRpcMethod("getServiceGui")] + GuiField[] GetServiceGui(string credentials, string idParent, string type); + + [XmlRpcMethod("getService")] + GuiFieldValue[] GetService(string credentials, string id); + + [XmlRpcMethod("createService")] + bool CreateService(string credentials, string idParent, string type, GuiFieldValue[] data); + + [XmlRpcMethod("modifyService")] + bool ModifyService(string credentials, string id, GuiFieldValue[] data); + + [XmlRpcMethod("removeService")] + bool RemoveService(string credentials, string id); + + // Authenticators + [XmlRpcMethod("getAuthenticatorsTypes")] + AuthenticatorType[] GetAuthenticatorsTypes(string credentials); + + [XmlRpcMethod("getAuthenticatorType")] + AuthenticatorType GetAuthenticatorType(string credentials, string id); + + [XmlRpcMethod("getAuthenticators")] + Authenticator[] GetAuthenticators(string credentials); + + [XmlRpcMethod("getAuthenticatorGui")] + GuiField[] GetAuthenticatorGui(string credentials, string type); + + [XmlRpcMethod("getAuthenticator")] + GuiFieldValue[] GetAuthenticator(string credentials, string id); + + [XmlRpcMethod("getAuthenticatorGroups")] + Group[] GetAuthenticatorGroups(string credentials, string id); + + [XmlRpcMethod("createAuthenticator")] + bool CreateAuthenticator(string credentials, string type, GuiFieldValue[] data); + + [XmlRpcMethod("modifyAuthenticator")] + bool ModifyAuthenticator(string credentials, string id, GuiFieldValue[] data); + + [XmlRpcMethod("removeAuthenticator")] + bool RemoveAuthenticator(string credentials, string id); + + [XmlRpcMethod("testAuthenticator")] + ResultTest TestAuthenticator(string credentials, string type, GuiFieldValue[] data); + + [XmlRpcMethod("checkAuthenticator")] + string CheckAuthenticator(string credentials, string id); + + [XmlRpcMethod("searchAuthenticator")] + SimpleInfo[] SearchAuthenticator(string credentials, string id, bool srchUser, string srchString); + + // Authenticators, groups part + [XmlRpcMethod("getGroups")] + Group[] GetGroups(string credentials, string idParent); + + [XmlRpcMethod("getGroup")] + Group GetGroup(string credentials, string id); + + [XmlRpcMethod("createGroup")] + bool CreateGroup(string credentials, Group group); + + [XmlRpcMethod("changeGroupsState")] + bool ChangeGroupsState(string credentials, string[] ids, bool newState); + + [XmlRpcMethod("removeGroups")] + bool RemoveGroups(string credentials, string[] ids); + + // Authenticators, users part + [XmlRpcMethod("getUsers")] + User[] GetUsers(string credentials, string idParent); + + [XmlRpcMethod("getUser")] + User GetUser(string credentials, string id); + + [XmlRpcMethod("getUserGroups")] + Group[] GetUserGroups(string credentials, string id); + + [XmlRpcMethod("changeUsersState")] + bool ChangeUsersState(string credentials, string[] ids, string newState); + + [XmlRpcMethod("removeUsers")] + bool RemoveUsers(string credentials, string[] ids); + + [XmlRpcMethod("createUser")] + bool CreateUser(string credentials, User user); + + [XmlRpcMethod("modifyUser")] + bool ModifyUser(string credentials, User user); + + [XmlRpcMethod("getPrefsForUser")] + PrefGroup[] GetPrefsForUser(string credentials, string id); + + [XmlRpcMethod("setPrefsForUser")] + bool SetPrefsForUser(string credentials, string id, GuiFieldValue[] data); + + // OS Managers related methods + [XmlRpcMethod("getOSManagersTypes")] + OSManagerType[] GetOSManagersTypes(string credentials); + + [XmlRpcMethod("getOSManagers")] + OSManager[] GetOSManagers(string credentials); + + [XmlRpcMethod("getOSManagerGui")] + GuiField[] GetOSManagerGui(string credentials, string type); + + [XmlRpcMethod("getOSManager")] + GuiFieldValue[] GetOSManager(string credentials, string id); + + [XmlRpcMethod("createOSManager")] + bool CreateOSManager(string credentials, string type, GuiFieldValue[] data); + + [XmlRpcMethod("modifyOSManager")] + bool ModifyOSManager(string credentials, string id, GuiFieldValue[] data); + + [XmlRpcMethod("removeOSManager")] + bool RemoveOSManager(string credentials, string id); + + [XmlRpcMethod("testOsManager")] + ResultTest TestOsManager(string credentials, string type, GuiFieldValue[] data); + + [XmlRpcMethod("checkOSManager")] + string CheckOSManager(string credentials, string id); + + // Transports related methods + [XmlRpcMethod("getTransportsTypes")] + TransportType[] GetTransportsTypes(string credentials); + + [XmlRpcMethod("getTransports")] + Transport[] GetTransports(string credentials); + + [XmlRpcMethod("getTransportGui")] + GuiField[] GetTransportGui(string credentials, string type); + + [XmlRpcMethod("getTransport")] + GuiFieldValue[] GetTransport(string credentials, string id); + + [XmlRpcMethod("createTransport")] + string CreateTransport(string credentials, string type, GuiFieldValue[] data); + + [XmlRpcMethod("modifyTransport")] + bool ModifyTransport(string credentials, string id, GuiFieldValue[] data); + + [XmlRpcMethod("removeTransport")] + bool RemoveTransport(string credentials, string id); + + [XmlRpcMethod("checkTransport")] + string CheckTransport(string credentials, string id); + + // Networks related (transports networks) + [XmlRpcMethod("getNetworks")] + Network[] GetNetworks(string credentials); + + [XmlRpcMethod("getNetworksForTransport")] + string[] getNetworksForTransport(string credentials, string id); + + [XmlRpcMethod("setNetworksForTransport")] + bool setNetworksForTransport(string credentials, string id, string[] networks); + + [XmlRpcMethod("getNetwork")] + Network GetNetwork(string credentials, string id); + + [XmlRpcMethod("createNetwork")] + bool CreateNetwork(string credentials, Network network); + + [XmlRpcMethod("modifyNetwork")] + bool ModifyNetwork(string credentials, Network network); + + [XmlRpcMethod("removeNetworks")] + bool RemoveNetworks(string credentials, string[] ids); + + + // Deployed Services related + [XmlRpcMethod("getDeployedServices")] + DeployedService[] GetDeployedServices(string credentials, bool all); + + [XmlRpcMethod("getDeployedService")] + DeployedService GetDeployedService(string credentials, string id); + + [XmlRpcMethod("removeDeployedService")] + bool RemoveDeployedService(string credentials, string id); + + [XmlRpcMethod("createDeployedService")] + string CreateDeployedService(string credentials, DeployedService deployedService); + + [XmlRpcMethod("modifyDeployedService")] + bool ModifyDeployedService(string credentials, DeployedService deployedService); + + [XmlRpcMethod("getGroupsAssignedToDeployedService")] + Group[] GetGroupsAssignedToDeployedService(string credentials, string deployedServiceId); + + [XmlRpcMethod("assignGroupToDeployedService")] + bool AssignGroupToDeployedService(string credentials, string deployedServiceId, string groupId); + + [XmlRpcMethod("removeGroupsFromDeployedService")] + bool RemoveGroupsFromDeployedService(string credentials, string deployedService, string[] groupIds); + + [XmlRpcMethod("getTransportsAssignedToDeployedService")] + Transport[] GetTransportsAssignedToDeployedService(string credentials, string idDeployedService); + + [XmlRpcMethod("assignTransportToDeployedService")] + bool AssignTransportToDeployedService(string credentials, string deployedServiceId, string transportId); + + [XmlRpcMethod("removeTransportFromDeployedService")] + bool RemoveTransportFromDeployedService(string credentials, string deployedService, string[] transportIds); + + [XmlRpcMethod("getPublications")] + DeployedServicePublication[] GetPublications(string credentials, string idParent); + + [XmlRpcMethod("publishDeployedService")] + bool PublishDeployedService(string credentials, string idParent); + + [XmlRpcMethod("cancelPublication")] + bool CancelPublication(string credentials, string id); + + [XmlRpcMethod("getCachedDeployedServices")] + CachedDeployedService[] GetCachedDeployedServices(string credentials, string idParent); + + [XmlRpcMethod("getAssignedDeployedServices")] + AssignedDeployedService[] GetAssignedDeployedServices(string credentials, string idParent); + + [XmlRpcMethod("getAssignableDeployedServices")] + AssignableDeployedService[] GetAssignableDeployedServices(string credentials, string idParent); + + [XmlRpcMethod("removeUserService")] + bool RemoveUserService(string credentials, string[] ids); + + [XmlRpcMethod("assignDeployedService")] + bool AssignDeployedService(string credentials, string idParent, string idDeployedUserService, string idUser); + + [XmlRpcMethod("getUserDeployedServiceError")] + string GetUserDeployedServiceError(string credentials, string id); + + // Utilities and related stuff + [XmlRpcMethod("flushCache")] + bool FlushCache(string credentials); + + [XmlRpcMethod("getConfiguration")] + Configuration[] GetConfiguration(string credentials); + + [XmlRpcMethod("updateConfiguration")] + bool UpdateConfiguration(string credentials, Configuration[] configuration); + + // Callbacks invoker + [XmlRpcMethod("chooseCallback")] + GuiFieldValue[] InvokeChooseCallback(string credentials, string name, GuiFieldValue[] parameters); + + + } + +} diff --git a/client/administration/UdsAdmin/xmlrpc/UDSAdminService.cs b/client/administration/UdsAdmin/xmlrpc/UDSAdminService.cs new file mode 100644 index 000000000..295746abf --- /dev/null +++ b/client/administration/UdsAdmin/xmlrpc/UDSAdminService.cs @@ -0,0 +1,727 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using System.Windows.Forms; +using System.Reflection; + +using CookComputing.XmlRpc; + +namespace UdsAdmin.xmlrpc +{ + public class UdsAdminService + { + //public enum RemoteType { ServiceProvider = 0, Service = 1, Authenticator = 2 }; + private static IUDSAdmin s = null; + private static string server = ""; + private static string credentials = ""; + public static bool isAdmin = false; + + private static void insertNameCommentsPriorityNet(string name, string comments, int priority, bool positiveNet, ref GuiFieldValue[] data) + { + int len = data.Length; + Array.Resize(ref data, len + 4); + data[len] = new GuiFieldValue("name", name); + data[len + 1] = new GuiFieldValue("comments", comments); + data[len + 2] = new GuiFieldValue("priority", priority.ToString()); + data[len + 3] = new GuiFieldValue("positiveNet", positiveNet ? xmlrpc.Constants.TRUE : xmlrpc.Constants.FALSE); + } + + private static void insertNameCommentsPriority(string name, string comments, int priority, ref GuiFieldValue[] data) + { + int len = data.Length; + Array.Resize(ref data, len + 3); + data[len] = new GuiFieldValue("name", name); + data[len + 1] = new GuiFieldValue("comments", comments); + data[len + 2] = new GuiFieldValue("priority", priority.ToString()); + } + + private static void insertNameComments(string name, string comments, ref GuiFieldValue[] data) + { + int len = data.Length; + Array.Resize(ref data, len + 2); + data[len] = new GuiFieldValue("name", name); + data[len + 1] = new GuiFieldValue("comments", comments); + } + + public static void Initialize(string url) + { + System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; }; + s = XmlRpcProxyGen.Create(); + s.Timeout = UdsAdmin.Properties.Settings.Default.TimeOut; + s.Url = url; + s.KeepAlive = false; + s.EnableCompression = true; // Accepts gzip and compress data + } + + // Service provider related methods + public static ServiceProviderType[] GetServiceProvidersTypes() + { + try + { + return s.GetServiceProvidersTypes(credentials); + } + catch (Exception e) + { + MessageBox.Show(e.Message); + } + return null; + } + + public static ServiceProvider[] GetServiceProviders() + { + return s.GetServiceProviders(credentials); + } + + public static GuiField[] GetServiceProviderGui(string type) + { + try { + return s.GetServiceProviderGui(credentials, type); + } + catch (Exception e) + { + MessageBox.Show(e.Message, "Exception invoking getServiceProviderGui!!!"); + return null; + } + + } + + public static GuiFieldValue[] GetServiceProvider(string id) + { + return s.GetServiceProvider(credentials, id); + } + + + public static bool CreateServiceProvider(string name, string comments, string type, GuiFieldValue[] data) + { + insertNameComments(name, comments, ref data); + + return s.CreateServiceProvider(credentials, type, data); + } + + public static bool ModifyServiceProvider(string name, string comments, string id, GuiFieldValue[] data) + { + insertNameComments(name, comments, ref data); + + return s.ModifyServiceProvider(credentials, id, data); + } + + public static bool RemoveServiceProvider(string id) + { + return s.RemoveServiceProvider(credentials, id); + } + + public static ServiceType[] GetOffersFromServiceProvider(string type) + { + return s.GetOffersFromServiceProvider(credentials, type); + } + + public static ResultTest testServiceProvider(string type, GuiFieldValue[] data) + { + return s.TestServiceProvider(credentials, type, data); + } + + public static string CheckServiceProvider(string id) + { + return s.CheckServiceProvider(credentials, id); + } + + // Services related methods + public static Service[] GetServices(string idParent) + { + return s.GetServices(credentials,idParent); + } + + public static Service[] GetAllServices() + { + return s.GetAllServices(credentials); + } + + public static GuiField[] GetServiceGui(string idParent, string type) + { + try + { + return s.GetServiceGui(credentials, idParent, type); + } + catch (Exception e) + { + MessageBox.Show(e.Message, "Exception invoking getServiceGui!!!"); + return null; + } + } + + public static GuiFieldValue[] GetService(string id) + { + return s.GetService(credentials, id); + } + + public static bool CreateService(string idParent, string name, string comments, string type, GuiFieldValue[] data) + { + insertNameComments(name, comments, ref data); + + return s.CreateService(credentials, idParent, type, data); + } + + public static bool ModifyService(string name, string comments, string id, GuiFieldValue[] data) + { + insertNameComments(name, comments, ref data); + + return s.ModifyService(credentials, id, data); + } + + public static bool RemoveService(string id) + { + return s.RemoveService(credentials, id); + } + + + // Login related + + public static SimpleInfo[] GetAdminAuths(string host, bool https) + { + server = https ? "https" : "http"; + server += "://" + host; + string url = server + "/xmlrpc"; + try + { + Initialize(url); + return s.GetAdminAuths(UdsAdmin.Properties.Settings.Default.Locale); + } + catch (Exception e) + { + throw new exceptions.CommunicationException("Can't connect to server " + e.Message); + } + } + + public static void Login(string username, string password, string idAuth) + { + LoginData login = s.Login(username, password, idAuth, UdsAdmin.Properties.Settings.Default.Locale); + credentials = login.credentials; + if (credentials == "") + throw new exceptions.AuthenticationException("Invalid username os password"); + Version v = Assembly.GetExecutingAssembly().GetName().Version; + string executingVersion = v.Major.ToString() + "." + + v.Minor.ToString() + "." + v.Build.ToString(); + if( executingVersion != login.versionRequired ) + throw new exceptions.NewVersionRequiredException("New version required", login.url); + isAdmin = login.isAdmin; + return; + + } + + public static void Logout() + { + if (s != null) + try + { + s.Logout(credentials); + credentials = ""; + s = null; + } + catch (Exception) + { + // If credentials are not valid, or we can't reach server, we are exiting so we don't care :-) + } + } + + // Authenticators + public static AuthenticatorType[] GetAuthenticatorsTypes() + { + try + { + return s.GetAuthenticatorsTypes(credentials); + } + catch (Exception e) + { + MessageBox.Show(e.Message); + } + return null; + } + + public static AuthenticatorType GetAuthenticatorType(string id) + { + return s.GetAuthenticatorType(credentials, id); + } + + public static Authenticator[] GetAuthenticators() + { + return s.GetAuthenticators(credentials); + } + + public static GuiField[] GetAuthenticatorGui(string type) + { + try + { + return s.GetAuthenticatorGui(credentials, type); + } + catch (Exception e) + { + MessageBox.Show(e.Message, "Exception invoking getAuthenticatorGui!!!"); + return null; + } + + } + + public static GuiFieldValue[] GetAuthenticator(string id) + { + return s.GetAuthenticator(credentials, id); + } + + public static Group[] GetAuthenticatorGroups(string id) + { + return s.GetAuthenticatorGroups(credentials, id); + } + + public static bool CreateAuthenticator(string name, string comments, string type, int priority, GuiFieldValue[] data) + { + insertNameCommentsPriority(name, comments, priority, ref data); + + return s.CreateAuthenticator(credentials, type, data); + } + + public static bool ModifyAuthenticator(string name, string comments, int priority, string id, GuiFieldValue[] data) + { + insertNameCommentsPriority(name, comments, priority, ref data); + + return s.ModifyAuthenticator(credentials, id, data); + } + + public static bool RemoveAuthenticator(string id) + { + return s.RemoveAuthenticator(credentials, id); + } + + public static ResultTest TestAuthenticator(string type, GuiFieldValue[] data) + { + return s.TestAuthenticator(credentials, type, data); + } + + public static string CheckAuthenticator(string id) + { + return s.CheckAuthenticator(credentials, id); + } + + public static SimpleInfo[] SearchAuthenticator(string id, bool searchUser, string srchString) + { + return s.SearchAuthenticator(credentials, id, searchUser, srchString); + } + + // Authenticators, groups related methods + public static Group[] GetGroups(string idParent) + { + return s.GetGroups(credentials, idParent); + } + + + public static Group GetGroup(string id) + { + return s.GetGroup(credentials, id); + } + + public static bool CreateGroup(Group grp) + { + return s.CreateGroup(credentials, grp); + } + + public static bool ChangeGroupsState(string[] ids, bool newState) + { + return s.ChangeGroupsState(credentials, ids, newState); + } + + public static bool RemoveGroups(string[] ids) + { + return s.RemoveGroups(credentials, ids); + } + + // Authenticators, users related methods + public static User[] GetUsers(string idParent) + { + return s.GetUsers(credentials, idParent); + } + + public static User GetUser(string id) + { + return s.GetUser(credentials, id); + } + + public static Group[] GetUserGroups(string id) + { + try + { + return s.GetUserGroups(credentials, id); + } + catch (System.Net.WebException e) + { + MessageBox.Show(e.Message, "Exception invoking getUserGroups!!!"); + return null; + } + + } + + public static bool ChangeUsersState(string[] ids, string newState) + { + return s.ChangeUsersState(credentials, ids, newState); + } + + public static bool RemoveUsers(string[] ids) + { + return s.RemoveUsers(credentials, ids); + } + + public static bool CreateUser(User usr) + { + return s.CreateUser(credentials, usr); + } + + + public static bool ModifyUser(User user) + { + return s.ModifyUser(credentials, user); + } + + public static PrefGroup[] GetPrefsForUser(string id) + { + return s.GetPrefsForUser(credentials, id); + } + + + public static bool SetPrefsForUser(string id, GuiFieldValue[] data) + { + return s.SetPrefsForUser(credentials, id, data); + } + + // OS Manager Related methods + public static OSManagerType[] GetOSManagersTypes() + { + try + { + return s.GetOSManagersTypes(credentials); + } + catch (Exception e) + { + MessageBox.Show(e.Message); + } + return null; + } + + public static OSManager[] GetOSManagers() + { + return s.GetOSManagers(credentials); + } + + public static GuiField[] GetOSManagerGui(string type) + { + try + { + return s.GetOSManagerGui(credentials, type); + } + catch (Exception e) + { + MessageBox.Show(e.Message, "Exception invoking GetOSManagerGui!!!"); + return null; + } + + } + + public static GuiFieldValue[] GetOSManager(string id) + { + return s.GetOSManager(credentials, id); + } + + + public static bool CreateOSManager(string name, string comments, string type, GuiFieldValue[] data) + { + insertNameComments(name, comments, ref data); + + return s.CreateOSManager(credentials, type, data); + } + + public static bool ModifyOSManager(string name, string comments, string id, GuiFieldValue[] data) + { + insertNameComments(name, comments, ref data); + + return s.ModifyOSManager(credentials, id, data); + } + + public static bool RemoveOSManager(string id) + { + return s.RemoveOSManager(credentials, id); + } + + public static ResultTest TestOsManager(string type, GuiFieldValue[] data) + { + return s.TestOsManager(credentials, type, data); + } + + public static string CheckOSManager(string id) + { + return s.CheckOSManager(credentials, id); + } + + // Transports Related methods + public static TransportType[] GetTransportsTypes() + { + try + { + return s.GetTransportsTypes(credentials); + } + catch (Exception e) + { + MessageBox.Show(e.Message); + } + return null; + } + + public static Transport[] GetTransports() + { + return s.GetTransports(credentials); + } + + public static GuiField[] GetTransportGui(string type) + { + try + { + return s.GetTransportGui(credentials, type); + } + catch (Exception e) + { + MessageBox.Show(e.Message, "Exception invoking GetTransportGui!!!"); + return null; + } + + } + + public static GuiFieldValue[] GetTransport(string id) + { + return s.GetTransport(credentials, id); + } + + + public static string CreateTransport(string name, string comments, int priority, bool positiveNets, string type, GuiFieldValue[] data) + { + insertNameCommentsPriorityNet(name, comments, priority, positiveNets, ref data); + + return s.CreateTransport(credentials, type, data); + } + + public static bool ModifyTransport(string name, string comments, int priority, bool positiveNets, string id, GuiFieldValue[] data) + { + insertNameCommentsPriorityNet(name, comments, priority, positiveNets, ref data); + + return s.ModifyTransport(credentials, id, data); + } + + public static bool RemoveTransport(string id) + { + return s.RemoveTransport(credentials, id); + } + + public static string CheckTransport(string id) + { + return s.CheckTransport(credentials, id); + } + + // Networks (for transports) Related methods + public static Network[] GetNetworks() + { + return s.GetNetworks(credentials); + } + + public static string[] GetNetworksForTransport(string id) + { + return s.getNetworksForTransport(credentials, id); + } + + public static bool SetNetworksForTransport(string id, string[] networks) + { + return s.setNetworksForTransport(credentials, id, networks); + } + + public static Network GetNetwork(string id) + { + return s.GetNetwork(credentials, id); + } + + public static bool CreateNetwork(Network net) + { + return s.CreateNetwork(credentials, net); + } + + public static bool ModifyNetwork(Network net) + { + return s.ModifyNetwork(credentials, net); + } + + public static bool RemoveNetworks(string[] ids) + { + return s.RemoveNetworks(credentials, ids); + } + + + // Deployed service related + public static DeployedService[] GetDeployedServices(bool all = false) + { + return s.GetDeployedServices(credentials, all); + } + + public static DeployedService GetDeployedService(string id) + { + return s.GetDeployedService(credentials, id); + } + + public static bool RemoveDeployedService(string id) + { + return s.RemoveDeployedService(credentials, id); + } + + public static string CreateDeployedService(DeployedService deployedService) + { + return s.CreateDeployedService(credentials, deployedService); + } + + public static bool ModifyDeployedService(DeployedService deployedService) + { + return s.ModifyDeployedService(credentials, deployedService); + } + + public static Group[] GetGroupsAssignedToDeployedService(string deployedServiceId) + { + return s.GetGroupsAssignedToDeployedService(credentials, deployedServiceId); + } + + public static bool AssignGroupToDeployedService(string deployedServiceId, string groupId) + { + return s.AssignGroupToDeployedService(credentials, deployedServiceId, groupId); + } + + public static bool RemoveGroupsFromDeployedService(string deployedServiceId, string[] groupIds) + { + return s.RemoveGroupsFromDeployedService(credentials, deployedServiceId, groupIds); + } + + public static Transport[] GetTransportsAssignedToDeployedService(string idDeployedService) + { + return s.GetTransportsAssignedToDeployedService(credentials, idDeployedService); + } + + public static bool AssignTransportToDeployedService(string deployedServiceId, string groupId) + { + return s.AssignTransportToDeployedService(credentials, deployedServiceId, groupId); + } + + public static bool RemoveTransportFromDeployedService(string deployedServiceId, string[] groupIds) + { + return s.RemoveTransportFromDeployedService(credentials, deployedServiceId, groupIds); + } + + public static DeployedServicePublication[] getPublications(DeployedService deployedService) + { + return s.GetPublications(credentials, deployedService.id); + } + + public static bool PublishDeployedService(DeployedService deployedService) + { + return s.PublishDeployedService(credentials, deployedService.id); + } + + public static bool CancelPublication(string id) + { + return s.CancelPublication(credentials, id); + } + + + public static CachedDeployedService[] GetCachedDeployedServices(DeployedService deployedService) + { + return s.GetCachedDeployedServices(credentials, deployedService.id); + } + + public static AssignedDeployedService[] GetAssignedDeployedServices(DeployedService deployedService) + { + return s.GetAssignedDeployedServices(credentials, deployedService.id); + } + + public static AssignableDeployedService[] GetAssignableDeployedServices(string idParent) + { + return s.GetAssignableDeployedServices(credentials, idParent); + } + + public static bool AssignDeployedService(string idParent, string idDeployedUserService, string idUser) + { + return s.AssignDeployedService(credentials, idParent, idDeployedUserService, idUser); + } + + public static bool RemoveUserService(string[] ids) + { + return s.RemoveUserService(credentials, ids); + } + + public static string GetUserDeployedServiceError(string id) + { + return s.GetUserDeployedServiceError(credentials, id); + } + + + // Utility methods + public static bool FlushCache() + { + return s.FlushCache(credentials); + } + + public static Configuration[] GetConfiguration() + { + return s.GetConfiguration(credentials); + } + + public static bool UpdateConfiguration(Configuration[] configuration) + { + return s.UpdateConfiguration(credentials, configuration); + } + + // Calbacks + + public static GuiFieldValue[] InvokeChooseCallback(string name, GuiFieldValue[] parameters) + { + try + { + return s.InvokeChooseCallback(credentials, name, parameters); + } + catch (Exception e) + { + MessageBox.Show(e.Message, "Exception invoking getServiceGui!!!"); + return null; + } + + } + + } +} diff --git a/client/administration/UdsAdmin/xmlrpc/Util.cs b/client/administration/UdsAdmin/xmlrpc/Util.cs new file mode 100644 index 000000000..23f8e4887 --- /dev/null +++ b/client/administration/UdsAdmin/xmlrpc/Util.cs @@ -0,0 +1,76 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace UdsAdmin.xmlrpc +{ + internal class Util + { + public static string GetStringFromState(string state, string osState = "") + { + switch (state) + { + case Constants.STATE_USABLE: + if (osState != "" && osState != Constants.STATE_USABLE ) + return Strings.waitingOsReady; + return Strings.stateUsable; + case Constants.STATE_LAUNCHING: + return Strings.stateLaunching; + case Constants.STATE_PREPARING: + return Strings.statePreparing; + case Constants.STATE_CANCELING: + return Strings.stateCanceling; + case Constants.STATE_CANCELED: + return Strings.stateCanceled; + case Constants.STATE_REMOVABLE: + return Strings.stateRemovable; + case Constants.STATE_REMOVING: + return Strings.stateRemoving; + case Constants.STATE_REMOVED: + return Strings.stateRemoved; + case Constants.STATE_ERROR: + return Strings.stateError; + // From here, user, groups, ... states + case Constants.STATE_ACTIVE: + return Strings.stateActive; + case Constants.STATE_BLOCKED: + return Strings.stateBlocked; + case Constants.STATE_INACTIVE: + return Strings.stateInactive; + default: + return Strings.stateUnknown; + } + } + + } +} diff --git a/client/administration/UdsAdmin/xmlrpc/structs.cs b/client/administration/UdsAdmin/xmlrpc/structs.cs new file mode 100644 index 000000000..c05e81513 --- /dev/null +++ b/client/administration/UdsAdmin/xmlrpc/structs.cs @@ -0,0 +1,474 @@ +// +// Copyright (c) 2012 Virtual Cable S.L. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// * Neither the name of Virtual Cable S.L. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// author: Adolfo Gómez, dkmaster at dkmon dot com + +using System; +using System.Collections.Generic; +using System.Text; +using CookComputing.XmlRpc; + +namespace UdsAdmin.xmlrpc +{ + + public class BaseType + { + public string name; + public string type; + public string description; + public string icon; + + public override string ToString() + { + return name; + } + + } + + public class BaseItemData + { + public string id; + public string name; + public string comments; + public string type; + public string typeName; + + public override string ToString() + { + return name + "," + comments; + } + + public override bool Equals(object obj) + { + bool eq = base.Equals(obj); + if (eq == true) + return eq; + if (!(obj is BaseItemData)) + return false; + return ((BaseItemData)obj).id == id; + } + + public override int GetHashCode() { return 0; } + } + + public class SimpleInfo + { + public string id; + public string name; + + public SimpleInfo() + { + id = name = ""; + } + + + public SimpleInfo(string id, string name) + { + this.id = id; + this.name = name; + } + + public override string ToString() + { + return name; + } + } + + public struct LoginData + { + public string credentials; + public string versionRequired; + public string url; // Download url for new version if needed + [XmlRpcMissingMapping(MappingAction.Ignore)] // Right now, linux url is not used for anything... :-) + public string urlLinux; // Download url for linux version + public bool isAdmin; + } + + public class GuiItem + { + public string defvalue; + public int length; + public bool required; + public string label; + public bool rdonly; + public int order; + public string tooltip; + public string type; + // Choice values (available only for choices) + [XmlRpcMissingMapping(MappingAction.Ignore)] + public Choice[] values; + + [XmlRpcMissingMapping(MappingAction.Ignore)] + public ChoiceCallback fills; + + // For multichoices + [XmlRpcMissingMapping(MappingAction.Ignore)] + public int rows; + } + + public class GuiField + { + public string name; + public string value; // For "modify" operations + public GuiItem gui; + } + + public class PrefGroup + { + public string moduleLabel; + public GuiField[] prefs; + } + + public struct GuiFieldValue + { + public string name; + [XmlRpcMissingMapping(MappingAction.Ignore)] + public string value; + [XmlRpcMissingMapping(MappingAction.Ignore)] + public Choice[] values; + + public GuiFieldValue(string name, string value) + { + this.name = name; + this.value = value; + this.values = null; + } + + public GuiFieldValue(string name, Choice[] values) + { + this.name = name; + this.value = null; + this.values = values; + } + + static public string getData(GuiFieldValue[] fields, string field) + { + foreach( GuiFieldValue g in fields ) + if( g.name == field ) + return g.value; + return ""; + } + } + + public class ServiceProviderType : BaseType + { + } + + public class ServiceProvider : BaseItemData + { + } + + public class ServiceType : BaseType + { + } + + public class ServiceInfo + { + public bool needsPublication; + public int maxDeployed; + public bool usesCache; + public bool usesCacheL2; + public string cacheTooltip; + public string cacheTooltipL2; + public bool needsManager; + public bool mustAssignManually; + public string typeName; // Type of the service + } + + public class Service : BaseItemData + { + public string idParent; + [XmlRpcMissingMapping(MappingAction.Ignore)] + public ServiceInfo info; + } + + public class AuthenticatorType : BaseType + { + public bool isExternalSource; + public bool canSearchUsers; + public bool canSearchGroups; + public bool needsPassword; + public string userNameLabel; + public string groupNameLabel; + public string passwordLabel; + public bool canCreateUsers; + } + + public class Authenticator : BaseItemData + { + public string priority; + } + + public class Group + { + public string idParent; + [XmlRpcMissingMapping(MappingAction.Ignore)] + public string nameParent; + public string id; + public string name; + public string comments; + public bool active; + + public override string ToString() + { + return name + ", " + comments; + } + } + + public class User + { + public string idParent; + [XmlRpcMissingMapping(MappingAction.Ignore)] + public string nameParent; + public string id; + public string name; + public string password; + public string oldPassword; // To check if password has changed, cause it's encripted at database and can't be reversed + public string realName; + public string comments; + public string state; + public DateTime lastAccess; + public bool staffMember; + public bool isAdmin; + [XmlRpcMissingMapping(MappingAction.Ignore)] + public Group[] groups; // For internal authenticators, active groups are those that the user belongs to, inactive those not + + public override string ToString() + { + return name + "(" + realName + ")" + ", " + comments; + } + } + + public class OSManagerType : BaseType + { + } + + public class OSManager : BaseItemData + { + } + + + public class TransportType : BaseType + { + } + + public class Transport : BaseItemData + { + public string priority; + public string[] networks; + } + + public class Network + { + public string id; + public string name; + public string netStart; + public string netEnd; + + public Network() + { + id = name = netStart = netEnd = ""; + } + + public override string ToString() + { + return name; + } + } + + public class DeployedService + { + public string id; + public string name; + public string comments; + public string idService; + public string idOsManager; + public string state; + public int initialServices; + public int cacheL1; + public int cacheL2; + public int maxServices; + [XmlRpcMissingMapping(MappingAction.Ignore)] + public string serviceName; + [XmlRpcMissingMapping(MappingAction.Ignore)] + public string osManagerName; + public SimpleInfo[] transports; + [XmlRpcMissingMapping(MappingAction.Ignore)] + public SimpleInfo[] groups; + [XmlRpcMissingMapping(MappingAction.Ignore)] + public ServiceInfo info; + } + + public class DeployedServicePublication + { + public string idParent; + public string id; + public string state; + public DateTime publishDate; + public string reason; + public string revision; + } + + public class UserDeployedService + { + public string idParent; + public string id; + public string uniqueId; + public string friendlyName; + public string state; + public string osState; + public DateTime stateDate; + public DateTime creationDate; + public string revision; + } + + public class CachedDeployedService : UserDeployedService + { + public string cacheLevel; + } + + public class AssignedDeployedService : UserDeployedService + { + public string user; + public bool inUse; + public DateTime inUseDate; + } + + public class AssignableDeployedService + { + public string id; + public string name; + + public override string ToString() + { + return name; + } + } + + public class ResultTest + { + public bool ok; + public string message; + } + + public class Configuration + { + public string section; + public string key; + public string value; + public bool crypt; + + public Configuration() + { + section = key = value = ""; + crypt = false; + } + + public Configuration(string section, string key, string value, bool crypt) + { + this.section = section; this.key = key; this.value = value; this.crypt = crypt; + } + }; + + public struct ChoiceCallback + { + public string callbackName; + public string[] parameters; + } + + public struct Choice + { + public string id; + public string text; + + public Choice(string id, string text) + { + this.id = id; + this.text = text; + } + + public override string ToString() + { + return text; + } + + public override bool Equals(object obj) + { + bool eq = base.Equals(obj); + if (eq == true) + return eq; + if (!(obj is Choice)) + return false; + return ((Choice)obj).id == id; + } + + public override int GetHashCode() { return 0; } + } + + // Comparators + public class ServiceProviderTypeSorterByName : IComparer + { + public int Compare(ServiceProviderType a, ServiceProviderType b) + { + return a.name.CompareTo(b.name); + } + } + + public class ServiceTypeSorterByName : IComparer + { + public int Compare(ServiceType a, ServiceType b) + { + return a.name.CompareTo(b.name); + } + } + + + public class AuthenticatorTypeSorterByName : IComparer + { + public int Compare(AuthenticatorType a, AuthenticatorType b) + { + return a.name.CompareTo(b.name); + } + } + + public class OSManagerTypeSorterByName : IComparer + { + public int Compare(OSManagerType a, OSManagerType b) + { + return a.name.CompareTo(b.name); + } + } + + public class TransportTypeSorterByName : IComparer + { + public int Compare(TransportType a, TransportType b) + { + return a.name.CompareTo(b.name); + } + } + +} diff --git a/client/administration/installer/UDSAdminInstaller/.project b/client/administration/installer/UDSAdminInstaller/.project new file mode 100644 index 000000000..8f9652cb4 --- /dev/null +++ b/client/administration/installer/UDSAdminInstaller/.project @@ -0,0 +1,11 @@ + + + UDSAdminInstaller + + + + + + + + diff --git a/client/administration/installer/UDSAdminInstaller/UDSAdminSetup.exe b/client/administration/installer/UDSAdminInstaller/UDSAdminSetup.exe new file mode 100644 index 000000000..3b8f60612 Binary files /dev/null and b/client/administration/installer/UDSAdminInstaller/UDSAdminSetup.exe differ diff --git a/client/administration/installer/UDSAdminInstaller/license.txt b/client/administration/installer/UDSAdminInstaller/license.txt new file mode 100644 index 000000000..985b510fc --- /dev/null +++ b/client/administration/installer/UDSAdminInstaller/license.txt @@ -0,0 +1,27 @@ +Copyright (c) 2012 Virtual Cable S.L. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Virtual Cable S.L. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/client/administration/installer/UDSAdminInstaller/udsadmin.nsi b/client/administration/installer/UDSAdminInstaller/udsadmin.nsi new file mode 100644 index 000000000..411fed925 --- /dev/null +++ b/client/administration/installer/UDSAdminInstaller/udsadmin.nsi @@ -0,0 +1,163 @@ +# Auto-generated by EclipseNSIS Script Wizard +# 28-nov-2011 9:41:00 + +Name "UDS Administration" + +# General Symbol Definitions +!define REGKEY "SOFTWARE\$(^Name)" +!define VERSION 1.0 +!define COMPANY "Virtual Cable S.L." +!define URL http://www.virtualcable.es + +# MultiUser Symbol Definitions +!define MULTIUSER_EXECUTIONLEVEL Standard +!define MULTIUSER_INSTALLMODE_COMMANDLINE +!define MULTIUSER_INSTALLMODE_INSTDIR "UDS Administration Client" +!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "${REGKEY}" +!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUE "Path" + +# MUI Symbol Definitions +!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico" +!define MUI_FINISHPAGE_NOAUTOCLOSE +!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico" +!define MUI_UNFINISHPAGE_NOAUTOCLOSE +!define MUI_LANGDLL_REGISTRY_ROOT HKLM +!define MUI_LANGDLL_REGISTRY_KEY ${REGKEY} +!define MUI_LANGDLL_REGISTRY_VALUENAME InstallerLanguage + +# Included files +!include MultiUser.nsh +!include Sections.nsh +!include MUI2.nsh + +# Reserved Files +!insertmacro MUI_RESERVEFILE_LANGDLL + +# Variables +Var StartMenuGroup + +# Installer pages +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_LICENSE license.txt +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_INSTFILES +!insertmacro MUI_PAGE_FINISH +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES + +# Installer languages +!insertmacro MUI_LANGUAGE English +!insertmacro MUI_LANGUAGE Spanish +!insertmacro MUI_LANGUAGE French +!insertmacro MUI_LANGUAGE German + +# Installer attributes +OutFile UDSAdminSetup.exe +InstallDir "UDS Administration Client" +CRCCheck on +XPStyle on +ShowInstDetails show +VIProductVersion 1.0.0.0 +VIAddVersionKey /LANG=${LANG_ENGLISH} ProductName "UDS Administration Client" +VIAddVersionKey /LANG=${LANG_ENGLISH} ProductVersion "${VERSION}" +VIAddVersionKey /LANG=${LANG_ENGLISH} CompanyName "${COMPANY}" +VIAddVersionKey /LANG=${LANG_ENGLISH} CompanyWebsite "${URL}" +VIAddVersionKey /LANG=${LANG_ENGLISH} FileVersion "${VERSION}" +VIAddVersionKey /LANG=${LANG_ENGLISH} FileDescription "" +VIAddVersionKey /LANG=${LANG_ENGLISH} LegalCopyright "" +InstallDirRegKey HKLM "${REGKEY}" Path +ShowUninstDetails show + +# Installer sections +Section -Main SEC0000 + SetOutPath $INSTDIR + SetOverwrite on + File ..\..\UdsAdmin\bin\Release\CookComputing.XmlRpcV2.dll + File ..\..\UdsAdmin\bin\Release\UdsAdmin.exe + File ..\..\UdsAdmin\bin\Release\UdsAdmin.exe.config + SetOutPath $SMPROGRAMS\$StartMenuGroup + CreateShortcut "$SMPROGRAMS\$StartMenuGroup\UDS Administration Client.lnk" $INSTDIR\UdsAdmin.exe + SetOutPath $INSTDIR\de + File ..\..\UdsAdmin\bin\Release\de\UdsAdmin.resources.dll + SetOutPath $INSTDIR\es + File ..\..\UdsAdmin\bin\Release\es\UdsAdmin.resources.dll + SetOutPath $INSTDIR\fr + File ..\..\UdsAdmin\bin\Release\fr\UdsAdmin.resources.dll + WriteRegStr HKLM "${REGKEY}\Components" Main 1 +SectionEnd + +Section -post SEC0001 + WriteRegStr HKLM "${REGKEY}" Path $INSTDIR + SetOutPath $INSTDIR + WriteUninstaller $INSTDIR\UDSAdminRemover.exe + SetOutPath $SMPROGRAMS\$StartMenuGroup + CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^UninstallLink).lnk" $INSTDIR\UDSAdminRemover.exe + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "${VERSION}" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Publisher "${COMPANY}" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\UDSAdminRemover.exe + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\UDSAdminRemover.exe + WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1 + WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1 +SectionEnd + +# Macro for selecting uninstaller sections +!macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID + Push $R0 + ReadRegStr $R0 HKLM "${REGKEY}\Components" "${SECTION_NAME}" + StrCmp $R0 1 0 next${UNSECTION_ID} + !insertmacro SelectSection "${UNSECTION_ID}" + GoTo done${UNSECTION_ID} +next${UNSECTION_ID}: + !insertmacro UnselectSection "${UNSECTION_ID}" +done${UNSECTION_ID}: + Pop $R0 +!macroend + +# Uninstaller sections +Section /o -un.Main UNSEC0000 + Delete /REBOOTOK $INSTDIR\fr\UdsAdmin.resources.dll + Delete /REBOOTOK $INSTDIR\es\UdsAdmin.resources.dll + Delete /REBOOTOK $INSTDIR\de\UdsAdmin.resources.dll + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\UDS Administration Client.lnk" + Delete /REBOOTOK $INSTDIR\UdsAdmin.exe.config + Delete /REBOOTOK $INSTDIR\UdsAdmin.exe + Delete /REBOOTOK $INSTDIR\CookComputing.XmlRpcV2.dll + DeleteRegValue HKLM "${REGKEY}\Components" Main +SectionEnd + +Section -un.post UNSEC0001 + DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$(^UninstallLink).lnk" + Delete /REBOOTOK $INSTDIR\UDSAdminRemover.exe + DeleteRegValue HKLM "${REGKEY}" Path + DeleteRegKey /IfEmpty HKLM "${REGKEY}\Components" + DeleteRegKey /IfEmpty HKLM "${REGKEY}" + RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup + RmDir /REBOOTOK $INSTDIR +SectionEnd + +# Installer functions +Function .onInit + InitPluginsDir + StrCpy $StartMenuGroup "Virtual Cable\UDS Administration Client" + !insertmacro MUI_LANGDLL_DISPLAY + !insertmacro MULTIUSER_INIT +FunctionEnd + +# Uninstaller functions +Function un.onInit + StrCpy $StartMenuGroup "Virtual Cable\UDS Administration Client" + !insertmacro MUI_UNGETLANGUAGE + !insertmacro MULTIUSER_UNINIT + !insertmacro SELECT_UNSECTION Main ${UNSEC0000} +FunctionEnd + +# Installer Language Strings +# TODO Update the Language Strings with the appropriate translations. + +LangString ^UninstallLink ${LANG_ENGLISH} "Uninstall $(^Name)" +LangString ^UninstallLink ${LANG_SPANISH} "Uninstall $(^Name)" +LangString ^UninstallLink ${LANG_FRENCH} "Uninstall $(^Name)" +LangString ^UninstallLink ${LANG_GERMAN} "Uninstall $(^Name)" diff --git a/client/administration/xmlrpc/CookComputing.XmlRpcV2.dll b/client/administration/xmlrpc/CookComputing.XmlRpcV2.dll new file mode 100644 index 000000000..2c52939a0 Binary files /dev/null and b/client/administration/xmlrpc/CookComputing.XmlRpcV2.dll differ diff --git a/linuxActor/.project b/linuxActor/.project new file mode 100644 index 000000000..23ca636d7 --- /dev/null +++ b/linuxActor/.project @@ -0,0 +1,17 @@ + + + linuxActor + + + + + + org.python.pydev.PyDevBuilder + + + + + + org.python.pydev.pythonNature + + diff --git a/linuxActor/.pydevproject b/linuxActor/.pydevproject new file mode 100644 index 000000000..6ca10d9e1 --- /dev/null +++ b/linuxActor/.pydevproject @@ -0,0 +1,10 @@ + + + + +python2.6 +python 2.6 + +/linuxActor/src + + diff --git a/linuxActor/.settings/org.eclipse.core.resources.prefs b/linuxActor/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..e8ab30bb9 --- /dev/null +++ b/linuxActor/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,8 @@ +#Thu Nov 17 08:31:37 CET 2011 +eclipse.preferences.version=1 +encoding//src/actor.py=utf-8 +encoding//src/uds/actor/__init__.py=utf-8 +encoding//src/uds/actor/daemon.py=utf-8 +encoding//src/uds/actor/renamer/__init__.py=utf-8 +encoding//src/uds/actor/renamer/debian.py=utf-8 +encoding//src/uds/actor/rpc.py=utf-8 diff --git a/linuxActor/.settings/org.eclipse.mylyn.tasks.ui.prefs b/linuxActor/.settings/org.eclipse.mylyn.tasks.ui.prefs new file mode 100644 index 000000000..1f33b4559 --- /dev/null +++ b/linuxActor/.settings/org.eclipse.mylyn.tasks.ui.prefs @@ -0,0 +1,4 @@ +#Tue Jan 03 02:54:54 CET 2012 +eclipse.preferences.version=1 +project.repository.kind=mantis +project.repository.url=http\://192.168.0.6/mantis diff --git a/linuxActor/src/Makefile b/linuxActor/src/Makefile new file mode 100644 index 000000000..9d316af17 --- /dev/null +++ b/linuxActor/src/Makefile @@ -0,0 +1,26 @@ +LIBDIR = $(DESTDIR)/usr/share/pyshared/udsactor +BINDIR = $(DESTDIR)/usr/bin +CFGDIR = $(DESTDIR)/etc/udsactor +clean: + rm -f *.py[co] */*.py[co] +install: + mkdir -p $(LIBDIR) + mkdir -p $(BINDIR) + mkdir -p $(CFGDIR) + + mkdir -p $(LIBDIR)/uds/actor/renamer + + cp actor.py $(LIBDIR)/ + cp uds/*.py $(LIBDIR)/uds + cp uds/actor/*.py $(LIBDIR)/uds/actor + cp uds/actor/renamer/*.py $(LIBDIR)/uds/actor/renamer + + cp runActor.sh $(BINDIR)/udsactor + + cp udsactor.cfg $(CFGDIR) + + chmod 0755 $(BINDIR)/udsactor +uninstall: + rm -rf $(LIBDIR) + rm -f $(BINDIR)/udsactor + rm -rf $(CFGDIR) \ No newline at end of file diff --git a/linuxActor/src/actor.py b/linuxActor/src/actor.py new file mode 100644 index 000000000..e43508b60 --- /dev/null +++ b/linuxActor/src/actor.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +''' +Created on Nov 16, 2011 + +@author: dkmaster +''' + +import sys, time, logging +from uds.actor.daemon import Daemon +from uds.actor.rpc import Rpc +from uds.actor import net +from uds.actor.renamer import rename + +logger = logging.getLogger('uds') + +class MyDaemon(Daemon): + def run(self): + while True: + # Wait for networks to become ready + info = net.getExternalIpAndMacs() + if len(info) > 0: + break + time.sleep(4) + # Now, get info of what to do + Rpc.initialize() + + # waits for a valid command (maybe broker down or not reachable, so we loop here till we know what to do (that is, broker is reachable)) + todo = None + while todo is None: + Rpc.resetId() + todo = Rpc.getInfo() + if todo is None: + time.sleep(4) + + # We can get 'rename:newname', ''. Anything else is an error + data = todo.split(':') + + if data[0] == 'rename': + logger.info('Renaming to {0}'.format(data[1])) + rename(data[1]) + Rpc.setReady() + elif todo == '': + logger.info('Unmanaged machine') + # Unmanaged machine, exit + return + else: + # Error, log and exit + logger.error('Unknown command received: {0}'.format(todo)) + return + + # Keep notifiyin ip changes + info = net.getExternalIpAndMacs() + # We have "info" with know interfaces + while True: + newInfo = net.getExternalIpAndMacs() + for k in info.keys(): + if info[k]['ip'] != newInfo[k]['ip']: + if Rpc.notifyIpChange() is not None: + info = newInfo + else: + logger.info('Could not notify IP address. Will retry later.') + break + time.sleep(5) + return + + +if __name__ == '__main__': + if len(sys.argv) == 3: + if 'login' == sys.argv[1]: + logger.debug('Notifiyin login') + Rpc.initialize() + Rpc.login(sys.argv[2]) + sys.exit(0) + elif 'logout' == sys.argv[1]: + logger.debug('Notifiyin logout') + Rpc.initialize() + Rpc.logout(sys.argv[2]) + sys.exit(0) + + logger.debug('Executing actor') + daemon = MyDaemon('/var/run/udsactor.pid') + if len(sys.argv) == 2: + if 'start' == sys.argv[1]: + daemon.start() + elif 'stop' == sys.argv[1]: + daemon.stop() + elif 'restart' == sys.argv[1]: + daemon.restart() + else: + print "Unknown command" + sys.exit(2) + sys.exit(0) + else: + print "usage: %s start|stop|restart|login 'username'|logout 'username'" % sys.argv[0] + sys.exit(2) + diff --git a/linuxActor/src/debian/changelog b/linuxActor/src/debian/changelog new file mode 100644 index 000000000..ebcd24b67 --- /dev/null +++ b/linuxActor/src/debian/changelog @@ -0,0 +1,3 @@ +udsactor (1.0) stable; urgency=low + * Initial version + -- Adolfo Gómez García Fri, 18 Nov 2011 05:35:11 +0100 \ No newline at end of file diff --git a/linuxActor/src/debian/compat b/linuxActor/src/debian/compat new file mode 100644 index 000000000..c7930257d --- /dev/null +++ b/linuxActor/src/debian/compat @@ -0,0 +1 @@ +7 \ No newline at end of file diff --git a/linuxActor/src/debian/config b/linuxActor/src/debian/config new file mode 100644 index 000000000..15abfcbb9 --- /dev/null +++ b/linuxActor/src/debian/config @@ -0,0 +1,46 @@ +#!/bin/bash -e + +. /usr/share/debconf/confmodule + +Q=0 +Q_DONE=3 + +nextState() { + if [[ $1 -eq 30 ]]; then + Q=$((Q-1)) + else + Q=$((Q+1)) + fi +} + +if [[ -f /etc/udsactor/udsactor.cfg ]]; then + TMPFILE=$(mktemp /tmp/udsactor.cfg.XXXXX) + trap "rm -f $TMPFILE" 0 + cat /etc/udsactor/udsactor.cfg | sed -e "s/\\[.*\\]//; s/ *= */=/; s/False/false/; s/True/true/" > $TMPFILE + . $TMPFILE + db_set udsactor/server $server + db_set udsactor/secure $ssl + db_set udsactor/timeout $timeout +fi + +db_capb backup + +while [[ $Q -lt $Q_DONE ]]; do + case $Q in + 0) + db_input high udsactor/server || true + db_go || true + nextState 0 + ;; + 1) + db_input high udsactor/secure || true + db_go || RET=$? + nextState $RET + ;; + 2) + db_input high udsactor/timeout || true + db_go || RET=$? + nextState 0 + ;; + esac +done diff --git a/linuxActor/src/debian/control b/linuxActor/src/debian/control new file mode 100644 index 000000000..1bb358358 --- /dev/null +++ b/linuxActor/src/debian/control @@ -0,0 +1,14 @@ +Source: udsactor +Section: contrib/net +Priority: extra +Maintainer: Adolfo Gómez García +Build-Depends: debhelper (>= 7), po-debconf +Standards-Version: 3.9.2 +Homepage: http://www.virtualcable.es + +Package: udsactor +Architecture: all +Depends: python (>= 2.6), ${misc:Depends} +Description: UDS Actor for Universal Destop Services + This package provides the actor needed for integration of + debian with uds services platform. diff --git a/linuxActor/src/debian/copyright b/linuxActor/src/debian/copyright new file mode 100644 index 000000000..c47d0a70b --- /dev/null +++ b/linuxActor/src/debian/copyright @@ -0,0 +1,26 @@ +Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135 +Name: udsactor +Maintainer: Adolfo Gómez García +Source: http://www.virtualcable.es/ + +Copyright: 2010 Virtual Cable S.L. +License: GPL-2+ + +License: GPL-2+ +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. +. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +. +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +. +On Debian systems, the full text of the GNU General Public +License version 2 can be found in the file +`/usr/share/common-licenses/GPL-2'. \ No newline at end of file diff --git a/linuxActor/src/debian/dirs b/linuxActor/src/debian/dirs new file mode 100644 index 000000000..2c662cfdc --- /dev/null +++ b/linuxActor/src/debian/dirs @@ -0,0 +1,2 @@ +/usr/bin/ +/usr/share/pyshared/udsactor diff --git a/linuxActor/src/debian/docs b/linuxActor/src/debian/docs new file mode 100644 index 000000000..b2b2a781e --- /dev/null +++ b/linuxActor/src/debian/docs @@ -0,0 +1 @@ +readme.txt diff --git a/linuxActor/src/debian/files b/linuxActor/src/debian/files new file mode 100644 index 000000000..db5df6fac --- /dev/null +++ b/linuxActor/src/debian/files @@ -0,0 +1 @@ +udsactor_1.0_all.deb contrib/net extra diff --git a/linuxActor/src/debian/init b/linuxActor/src/debian/init new file mode 100755 index 000000000..2d6ed8856 --- /dev/null +++ b/linuxActor/src/debian/init @@ -0,0 +1,21 @@ +#!/bin/sh -e +### BEGIN INIT INFO +# Provides: uds-actor +# Required-Start: $local_fs $remote_fs $network $syslog $named +# Required-Stop: $local_fs $remote_fs $network $syslog $named +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: UDS Actor +### END INIT INFO +# + +case "$1" in + start|stop|restart) + /usr/bin/udsactor $1 + ;; + force-reload) + ./actor restart + ;; + *) echo "Usage: $0 {start|stop|restart|force-reload}" >&2; exit 1 ;; +esac + diff --git a/linuxActor/src/debian/po/POTFILES.in b/linuxActor/src/debian/po/POTFILES.in new file mode 100644 index 000000000..98e8416d9 --- /dev/null +++ b/linuxActor/src/debian/po/POTFILES.in @@ -0,0 +1 @@ +[type: gettext/rfc822deb] templates \ No newline at end of file diff --git a/linuxActor/src/debian/po/templates.pot b/linuxActor/src/debian/po/templates.pot new file mode 100644 index 000000000..248e6f491 --- /dev/null +++ b/linuxActor/src/debian/po/templates.pot @@ -0,0 +1,58 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: agomez@virtualcable.es\n" +"POT-Creation-Date: 2011-11-21 11:40+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: string +#. Description +#: ../templates:1001 +msgid "UDS Server address:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:1001 +msgid "" +"The actor needs the address of the server in order to communicate with it. " +"Provide here full address (or i) of the UDS server" +msgstr "" + +#. Type: boolean +#. Description +#: ../templates:2001 +msgid "Use secure (https) connection to communicate with UDS server?" +msgstr "" + +#. Type: boolean +#. Description +#: ../templates:2001 +msgid "" +"If selected, the communication will be done using https. If not selected, " +"the communication will be done using http" +msgstr "" + +#. Type: string +#. Description +#: ../templates:3001 +msgid "Timeout in communications with UDS server:" +msgstr "" + +#. Type: string +#. Description +#: ../templates:3001 +msgid "The timeout is expressed in seconds" +msgstr "" diff --git a/linuxActor/src/debian/postinst b/linuxActor/src/debian/postinst new file mode 100644 index 000000000..272f94d8b --- /dev/null +++ b/linuxActor/src/debian/postinst @@ -0,0 +1,38 @@ +#!/bin/sh + +. /usr/share/debconf/confmodule + +set -e + +case "$1" in + configure) + # Ensure actor is not running + db_get udsactor/server + server=$RET + db_get udsactor/secure + ssl=$RET + if [ "$ssl" = "true" ]; then ssl=True; else ssl=False; fi + db_get udsactor/timeout + timeout=$RET + TMPFILE=$(mktemp /tmp/udsactor.cfg.XXXXX) + trap "rm -f $TMPFILE" 0 + cat /etc/udsactor/udsactor.cfg | sed -e "s/server=.*/server=$server/; s/ssl=.*/ssl=$ssl/; s/timeout=.*/timeout=$timeout/" > $TMPFILE + cp $TMPFILE /etc/udsactor/udsactor.cfg + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +# Don't know why, but descriptors get "weird" when launched daemon, so we tell here to debconf to stop. +# Solved not starting the service right now, defered to next reboot + + +exit 0 \ No newline at end of file diff --git a/linuxActor/src/debian/rules b/linuxActor/src/debian/rules new file mode 100755 index 000000000..cacfb7071 --- /dev/null +++ b/linuxActor/src/debian/rules @@ -0,0 +1,44 @@ +#!/usr/bin/make -f +# -*- makefile -*- +configure: configure-stamp +configure-stamp: + dh_testdir + touch configure-stamp +build: build-arch build-indep +build-arch: build-stamp +build-indep: build-stamp +build-stamp: configure-stamp + dh_testdir + $(MAKE) + touch $@ +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + dh_clean +install: build + dh_testdir + dh_testroot + dh_prep + dh_installdirs + $(MAKE) DESTDIR=$(CURDIR)/debian/udsactor install +binary-arch: build install + # emptyness +binary-indep: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installdebconf + dh_installinit --no-start + dh_python2=python + dh_compress + dh_link + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb +binary: binary-indep +.PHONY: build clean binary-indep binary install configure diff --git a/linuxActor/src/debian/templates b/linuxActor/src/debian/templates new file mode 100644 index 000000000..28432e3f5 --- /dev/null +++ b/linuxActor/src/debian/templates @@ -0,0 +1,19 @@ +Template: udsactor/server +Type: string +Default: +_Description: UDS Server address: + The actor needs the address of the server in order to communicate with it. + Provide here full address (or i) of the UDS server + +Template: udsactor/secure +Type: boolean +Default: true +_Description: Use secure (https) connection to communicate with UDS server? + If selected, the communication will be done using https. + If not selected, the communication will be done using http + +Template: udsactor/timeout +Type: string +Default: 5 +_Description: Timeout in communications with UDS server: + The timeout is expressed in seconds \ No newline at end of file diff --git a/linuxActor/src/readme.txt b/linuxActor/src/readme.txt new file mode 100644 index 000000000..64c14f772 --- /dev/null +++ b/linuxActor/src/readme.txt @@ -0,0 +1 @@ +This package provides the actor needed for using with UDS infrastructure. diff --git a/linuxActor/src/runActor.sh b/linuxActor/src/runActor.sh new file mode 100644 index 000000000..fbb141953 --- /dev/null +++ b/linuxActor/src/runActor.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +cd /usr/share/pyshared/udsactor +python actor.py $@ diff --git a/linuxActor/src/uds/__init__.py b/linuxActor/src/uds/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/linuxActor/src/uds/actor/__init__.py b/linuxActor/src/uds/actor/__init__.py new file mode 100644 index 000000000..3bf7f8746 --- /dev/null +++ b/linuxActor/src/uds/actor/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +''' +Created on Nov 16, 2011 + +@author: dkmaster +''' +import logging, logging.handlers +from config import config + +# Initializes logging facility (don't using dictConfig) + +log = logging.getLogger('uds') +log.setLevel(config['debug']) + +formatter = logging.Formatter('%(levelname)s %(asctime)s %(module)s %(message)s') + +fileHandler = logging.handlers.RotatingFileHandler(filename = config['log'], mode = 'a', maxBytes = config['maxsize'], backupCount = config['backups'], encoding = 'utf-8') +fileHandler.setLevel(logging.DEBUG) +fileHandler.setFormatter(formatter) + +#streamHandler = logging.StreamHandler() +#streamHandler.setLevel(logging.DEBUG) +#streamHandler.setFormatter(formatter) + +log.addHandler(fileHandler) +#log.addHandler(streamHandler) diff --git a/linuxActor/src/uds/actor/config.py b/linuxActor/src/uds/actor/config.py new file mode 100644 index 000000000..0176141d4 --- /dev/null +++ b/linuxActor/src/uds/actor/config.py @@ -0,0 +1,50 @@ +''' +Created on Nov 17, 2011 + +@author: dkmaster +''' +import os + +# Config file format: +# [broker] +# server = host:port (required) +# ssl = [True|False] (defaults to False) +# timeout = Timeout in seconds for xmlrpc (defaults to 10) +# [logging] +# log = /path/to/log (required, defaults to /tmp/udsactor.log) +# debug = [ERROR|INFO|DEBUG|WARN| (defaults to ERROR) +# maxsize = Max size of log file, in megas (defaults to 20) +# backups = Number of backups to keep of log file (defaults to 3) + + +import ConfigParser, logging, sys + +CONFIGFILE = '/etc/udsactor/udsactor.cfg' + +cfg = ConfigParser.SafeConfigParser(defaults={ 'server' : '', 'ssl' : False, 'timeout' : '10', + 'log' : '/tmp/udsactor.log', 'debug' : 'ERROR', 'maxsize' : '20', 'backups' : '3' }) +cfg.read(CONFIGFILE) + +levels = { + 'WARN' : logging.WARN, + 'INFO' : logging.INFO, + 'DEBUG': logging.DEBUG, + 'ERROR': logging.ERROR + } +try: + config = { + 'server' : cfg.get('broker', 'server'), + 'ssl' : cfg.getboolean('broker', 'ssl'), + 'timeout' : cfg.getint('broker', 'timeout'), + 'log' : cfg.get('logging', 'log'), + 'debug' : levels.get(cfg.get('logging', 'debug'), logging.ERROR), + 'maxsize' : cfg.getint('logging', 'maxsize')*1024*1024, + 'backups' : cfg.getint('logging', 'backups') + } + # Config file is used only in "root mode", in user mode we overwrite it + if os.getuid() != 0: + config['log'] = os.getenv('HOME', '/tmp') + "/udsactor.log" +except Exception, e: + sys.stderr.write("Error reading configuration file: " + str(e)) + sys.exit(2) + diff --git a/linuxActor/src/uds/actor/daemon.py b/linuxActor/src/uds/actor/daemon.py new file mode 100644 index 000000000..0427fc317 --- /dev/null +++ b/linuxActor/src/uds/actor/daemon.py @@ -0,0 +1,132 @@ +# -*- coding: utf-8 -*- +''' +@author: : http://www.jejik.com/authors/sander_marechal/ +@see: : http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/ +''' +import sys, os, time, atexit +from signal import SIGTERM + +class Daemon: + """ + A generic daemon class. + + Usage: subclass the Daemon class and override the run() method + """ + def __init__(self, pidfile, stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'): + self.stdin = stdin + self.stdout = stdout + self.stderr = stderr + self.pidfile = pidfile + + def daemonize(self): + """ + do the UNIX double-fork magic, see Stevens' "Advanced + Programming in the UNIX Environment" for details (ISBN 0201563177) + http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC16 + """ + try: + pid = os.fork() + if pid > 0: + # exit first parent + sys.exit(0) + except OSError, e: + sys.stderr.write("fork #1 failed: %d (%s)\n" % (e.errno, e.strerror)) + sys.exit(1) + + # decouple from parent environment + os.chdir("/") + os.setsid() + os.umask(0) + + # do second fork + try: + pid = os.fork() + if pid > 0: + # exit from second parent + sys.exit(0) + except OSError, e: + sys.stderr.write("fork #2 failed: %d (%s)\n" % (e.errno, e.strerror)) + sys.exit(1) + + # redirect standard file descriptors + sys.stdout.flush() + sys.stderr.flush() + si = file(self.stdin, 'r') + so = file(self.stdout, 'a+') + se = file(self.stderr, 'a+', 0) + os.dup2(si.fileno(), sys.stdin.fileno()) + os.dup2(so.fileno(), sys.stdout.fileno()) + os.dup2(se.fileno(), sys.stderr.fileno()) + + # write pidfile + atexit.register(self.delpid) + pid = str(os.getpid()) + file(self.pidfile,'w+').write("%s\n" % pid) + + def delpid(self): + os.remove(self.pidfile) + + def start(self): + """ + Start the daemon + """ + # Check for a pidfile to see if the daemon already runs + try: + pf = file(self.pidfile,'r') + pid = int(pf.read().strip()) + pf.close() + except IOError: + pid = None + + if pid: + message = "pidfile %s already exist. Daemon already running?\n" + sys.stderr.write(message % self.pidfile) + sys.exit(1) + + # Start the daemon + self.daemonize() + self.run() + + def stop(self): + """ + Stop the daemon + """ + # Get the pid from the pidfile + try: + pf = file(self.pidfile,'r') + pid = int(pf.read().strip()) + pf.close() + except IOError: + pid = None + + if not pid: + message = "pidfile %s does not exist. Daemon not running?\n" + sys.stderr.write(message % self.pidfile) + return # not an error in a restart + + # Try killing the daemon process + try: + while 1: + os.kill(pid, SIGTERM) + time.sleep(1) + except OSError, err: + err = str(err) + if err.find("No such process") > 0: + if os.path.exists(self.pidfile): + os.remove(self.pidfile) + else: + print str(err) + sys.exit(1) + + def restart(self): + """ + Restart the daemon + """ + self.stop() + self.start() + + def run(self): + """ + You should override this method when you subclass Daemon. It will be called after the process has been + daemonized by start() or restart(). + """ diff --git a/linuxActor/src/uds/actor/net.py b/linuxActor/src/uds/actor/net.py new file mode 100644 index 000000000..d471d43f3 --- /dev/null +++ b/linuxActor/src/uds/actor/net.py @@ -0,0 +1,62 @@ +''' +@author: Ben Mackey (getHwAddr) and paul cannon (getIpAddr) +@see: http://code.activestate.com/recipes/439094-get-the-ip-address-associated-with-a-network-inter/ +''' +import fcntl, socket, struct, array, platform + +def getMacAddr(ifname): + if isinstance(ifname, list): + return dict([ (name, getMacAddr(name)) for name in ifname ]) + try: + s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + info = fcntl.ioctl(s.fileno(), 0x8927, struct.pack('256s', ifname[:15])) + return ''.join(['%02x:' % ord(char) for char in info[18:24]])[:-1] + except Exception: + return None + +def getIpAddr(ifname): + if isinstance(ifname, list): + return dict([ (name, getIpAddr(name)) for name in ifname ]) + try: + s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + return socket.inet_ntoa(fcntl.ioctl( + s.fileno(), + 0x8915, # SIOCGIFADDR + struct.pack('256s', ifname[:15]) + )[20:24]) + except Exception: + return None + +def getInterfaces(): + max_possible = 128 # arbitrary. raise if needed. + space = max_possible * 16 + if platform.architecture()[0] == '32bit': + offset, length = 32, 32 + elif platform.architecture()[0] == '64bit': + offset, length = 16, 40 + else: + raise OSError('Unknown arquitecture {0}'.format( platform.architecture()[0])) + + s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + names = array.array('B', '\0' * space) + outbytes = struct.unpack('iL', fcntl.ioctl( + s.fileno(), + 0x8912, # SIOCGIFCONF + struct.pack('iL', space, names.buffer_info()[0]) + ))[0] + namestr = names.tostring() + return [namestr[i:i+offset].split('\0', 1)[0] for i in range(0, outbytes, length)] + +def getIpAndMac(ifname): + ip, mac = getIpAddr(ifname), getMacAddr(ifname) + if isinstance(ifname, list): + return dict( [ (key, { 'ip': ip[key], 'mac': mac[key] }) for key in ip.keys() ] ) + return (ip, mac) + +def getExternalIpAndMacs(): + res = getIpAndMac(getInterfaces()) + for key in res.keys(): + if res[key]['mac'] == '00:00:00:00:00:00': + del res[key] + return res + diff --git a/linuxActor/src/uds/actor/renamer/__init__.py b/linuxActor/src/uds/actor/renamer/__init__.py new file mode 100644 index 000000000..779188799 --- /dev/null +++ b/linuxActor/src/uds/actor/renamer/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +''' +Created on Nov 17, 2011 + +@author: dkmaster +''' +import platform, logging, os, sys, pkgutil + +logger = logging.getLogger(__name__) + +renamers = {} + +def rename(newName): + distribution = platform.dist()[0].lower() + if renamers.has_key(distribution): + return renamers[distribution](newName) + + logger.error('Renamer for platform "{0}" not found'.format(distribution)) + return False + +pkgpath = os.path.dirname(sys.modules[__name__].__file__) +for _, name, _ in pkgutil.iter_modules([pkgpath]): + __import__(name, globals(), locals(), [], -1) diff --git a/linuxActor/src/uds/actor/renamer/debian.py b/linuxActor/src/uds/actor/renamer/debian.py new file mode 100644 index 000000000..0c46ec46b --- /dev/null +++ b/linuxActor/src/uds/actor/renamer/debian.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +''' +Created on Nov 17, 2011 + +@author: dkmaster +''' + +from . import renamers +import logging, os + +logger = logging.getLogger(__name__) + +def rename(newName): + logger.debug('Debian renamer') + f = open('/etc/hostname', 'w') + f.write(newName) + f.close() + os.system('/bin/hostname %s' % newName) + + # add name to "hosts" + f = open('/etc/hosts', 'r') + lines = f.readlines() + f.close() + f = open('/etc/hosts', 'w') + f.write("127.0.1.1\t%s\n" % newName) + for l in lines: + if l[:9] == '127.0.1.1': + continue + f.write(l) + f.close() + + return True +# All names in lower case +renamers['debian'] = rename +renamers['ubuntu'] = rename \ No newline at end of file diff --git a/linuxActor/src/uds/actor/rpc.py b/linuxActor/src/uds/actor/rpc.py new file mode 100644 index 000000000..b6d435dc8 --- /dev/null +++ b/linuxActor/src/uds/actor/rpc.py @@ -0,0 +1,89 @@ +# -*- coding: utf-8 -*- +''' +Created on Nov 17, 2011 + +@author: dkmaster +''' +import logging, xmlrpclib, socket +import net +from config import config + +logger = logging.getLogger(__name__) + +LOGIN_MSG = 'login' +LOGOUT_MSG = 'logout' +READY_MSG = 'ready' +INFO_MSG = 'info' +IP_MSG = 'ip' + +class Rpc(object): + + _manager = None + + def __init__(self, broker, ssl, timeout=10): + url = ( ssl and 'https' or 'http' ) + '://' + broker + '/xmlrpc' + logger.debug('Remote address: {0}'.format(url)) + self._server = xmlrpclib.ServerProxy(uri = url, verbose=False) + self._id = None + socket.setdefaulttimeout(timeout) + + @staticmethod + def initialize(): + Rpc._manager = Rpc(config['server'], config['ssl'], config['timeout']) + + def test(self): + try: + self._server.test() + logger.debug('Test successful') + return True + except Exception: + logger.error('Test unsuccessful') + return False + + def message(self, msg, data): + try: + if self._id is None: + self._id = ','.join( [ v['mac'] for v in net.getExternalIpAndMacs().values() ] ) + logger.debug('Sending message to broker: {0} -> {1}, {2}'.format(self._id, msg, data)) + return self._server.message(self._id, msg, data) + except Exception: + return None + return '' + + @staticmethod + def login(username): + if Rpc._manager is None: # Not managed + return + return Rpc._manager.message(LOGIN_MSG, username) + + @staticmethod + def logout(username): + if Rpc._manager is None: # Not managed + return + return Rpc._manager.message(LOGOUT_MSG, username) + + @staticmethod + def getInfo(): + if Rpc._manager is None: # Not managed + return + return Rpc._manager.message(INFO_MSG, '') + + @staticmethod + def setReady(): + if Rpc._manager is None: # Not managed + return + interfaces = ','.join( [ v['mac'] + '=' + v['ip'] for v in net.getExternalIpAndMacs().values() ] ) + return Rpc._manager.message(READY_MSG, interfaces) + + @staticmethod + def notifyIpChange(): + if Rpc._manager is None: # Not managed + return + interfaces = ','.join( [ v['mac'] + '=' + v['ip'] for v in net.getExternalIpAndMacs().values() ] ) + return Rpc._manager.message(IP_MSG, interfaces) + + @staticmethod + def resetId(): + logger.debug('Reseting rpc id') + Rpc._manager._id = None + diff --git a/linuxActor/src/udsactor.cfg b/linuxActor/src/udsactor.cfg new file mode 100644 index 000000000..4bb199007 --- /dev/null +++ b/linuxActor/src/udsactor.cfg @@ -0,0 +1,13 @@ +[broker] + +server=192.168.0.1 +ssl=False +timeout=5 + +[logging] + +debug=DEBUG +log=/var/log/udsactor.log +# Size in megas +maxsize=20 +backups=3 \ No newline at end of file diff --git a/linuxActorNX/.project b/linuxActorNX/.project new file mode 100644 index 000000000..ff272a3c9 --- /dev/null +++ b/linuxActorNX/.project @@ -0,0 +1,11 @@ + + + linuxActorNX + + + + + + + + diff --git a/linuxActorNX/.settings/org.eclipse.mylyn.tasks.ui.prefs b/linuxActorNX/.settings/org.eclipse.mylyn.tasks.ui.prefs new file mode 100644 index 000000000..2a1042326 --- /dev/null +++ b/linuxActorNX/.settings/org.eclipse.mylyn.tasks.ui.prefs @@ -0,0 +1,4 @@ +#Tue Jan 03 02:54:49 CET 2012 +eclipse.preferences.version=1 +project.repository.kind=mantis +project.repository.url=http\://192.168.0.6/mantis diff --git a/linuxActorNX/src/Makefile b/linuxActorNX/src/Makefile new file mode 100644 index 000000000..83d97a453 --- /dev/null +++ b/linuxActorNX/src/Makefile @@ -0,0 +1,13 @@ +BINDIR = $(DESTDIR)/usr/bin + +clean: + echo "Clean" +install: + mkdir -p $(BINDIR) + cp udsnxstart.sh $(BINDIR)/udsnxstart + cp udsnxstop.sh $(BINDIR)/udsnxstop + + chmod 0755 $(BINDIR)/udsnxstart + chmod 0755 $(BINDIR)/udsnxstop +uninstall: + echo "Uninstall" diff --git a/linuxActorNX/src/debian/changelog b/linuxActorNX/src/debian/changelog new file mode 100644 index 000000000..7e6398e83 --- /dev/null +++ b/linuxActorNX/src/debian/changelog @@ -0,0 +1,3 @@ +udsactor-nx (1.0) stable; urgency=low + * Initial version + -- Adolfo Gómez García Fri, 21 Nov 2011 23:35:11 +0100 \ No newline at end of file diff --git a/linuxActorNX/src/debian/compat b/linuxActorNX/src/debian/compat new file mode 100644 index 000000000..c7930257d --- /dev/null +++ b/linuxActorNX/src/debian/compat @@ -0,0 +1 @@ +7 \ No newline at end of file diff --git a/linuxActorNX/src/debian/control b/linuxActorNX/src/debian/control new file mode 100644 index 000000000..c34be58a8 --- /dev/null +++ b/linuxActorNX/src/debian/control @@ -0,0 +1,14 @@ +Source: udsactor-nx +Section: contrib/net +Priority: extra +Maintainer: Adolfo Gómez García +Build-Depends: debhelper (>= 7) +Standards-Version: 3.9.2 +Homepage: http://www.virtualcable.es + +Package: udsactor-nx +Architecture: all +Depends: nxnode (>= 3.5.0), udsactor (>= 1.0), ${misc:Depends} +Description: UDS Actor component for nx + This package provides connection between uds actor and nx + diff --git a/linuxActorNX/src/debian/copyright b/linuxActorNX/src/debian/copyright new file mode 100644 index 000000000..c47d0a70b --- /dev/null +++ b/linuxActorNX/src/debian/copyright @@ -0,0 +1,26 @@ +Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135 +Name: udsactor +Maintainer: Adolfo Gómez García +Source: http://www.virtualcable.es/ + +Copyright: 2010 Virtual Cable S.L. +License: GPL-2+ + +License: GPL-2+ +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. +. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +. +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +. +On Debian systems, the full text of the GNU General Public +License version 2 can be found in the file +`/usr/share/common-licenses/GPL-2'. \ No newline at end of file diff --git a/linuxActorNX/src/debian/dirs b/linuxActorNX/src/debian/dirs new file mode 100644 index 000000000..e69de29bb diff --git a/linuxActorNX/src/debian/docs b/linuxActorNX/src/debian/docs new file mode 100644 index 000000000..b2b2a781e --- /dev/null +++ b/linuxActorNX/src/debian/docs @@ -0,0 +1 @@ +readme.txt diff --git a/linuxActorNX/src/debian/files b/linuxActorNX/src/debian/files new file mode 100644 index 000000000..2b2f737e8 --- /dev/null +++ b/linuxActorNX/src/debian/files @@ -0,0 +1 @@ +udsactor-nx_1.0_all.deb contrib/net extra diff --git a/linuxActorNX/src/debian/postinst b/linuxActorNX/src/debian/postinst new file mode 100644 index 000000000..9d629ce6c --- /dev/null +++ b/linuxActorNX/src/debian/postinst @@ -0,0 +1,37 @@ +#!/bin/sh + +NXNODECFG=/usr/NX/etc/node.cfg + +. /usr/share/debconf/confmodule + +set -e + +case "$1" in + configure) + TMPFILE=$(mktemp /tmp/node.cfg.XXXXX) + trap "rm -f $TMPFILE" 0 + cat $NXNODECFG | sed -e "s/.*udsnxst.*//; s/\(UserScriptAfterSessionStart *=.*\)/#\1/;s/\(UserScriptAfterSessionClose *=.*\)/#\1/" > $TMPFILE + echo >> $TMPFILE + echo "# Added by udsactor-nx (udsnxstart and udsnxstop)" >> $TMPFILE + echo UserScriptAfterSessionStart = \"/usr/bin/udsnxstart\" >> $TMPFILE + echo UserScriptAfterSessionClose = \"/usr/bin/udsnxstop\" >> $TMPFILE + cp $TMPFILE $NXNODECFG + invoke-rc.d nxserver restart + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +# Don't know why, but descriptors get "weird" when launched daemon, so we tell here to debconf to stop. +# Solved not starting the service right now, defered to next reboot + + +exit 0 \ No newline at end of file diff --git a/linuxActorNX/src/debian/postrm b/linuxActorNX/src/debian/postrm new file mode 100644 index 000000000..d8d174246 --- /dev/null +++ b/linuxActorNX/src/debian/postrm @@ -0,0 +1,28 @@ +#!/bin/sh + +NXNODECFG=/usr/NX/etc/node.cfg + +. /usr/share/debconf/confmodule + +set -e + +case "$1" in + purge) + ;; + remove) + TMPFILE=$(mktemp /tmp/node.cfg.XXXXX) + trap "rm -f $TMPFILE" 0 + cat $NXNODECFG | sed -e "s/.*udsnxst.*//" > $TMPFILE + cp $TMPFILE $NXNODECFG + invoke-rc.d nxserver restart + ;; + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# diff --git a/linuxActorNX/src/debian/rules b/linuxActorNX/src/debian/rules new file mode 100755 index 000000000..80c231304 --- /dev/null +++ b/linuxActorNX/src/debian/rules @@ -0,0 +1,41 @@ +#!/usr/bin/make -f +# -*- makefile -*- +configure: configure-stamp +configure-stamp: + dh_testdir + touch configure-stamp +build: build-arch build-indep +build-arch: build-stamp +build-indep: build-stamp +build-stamp: configure-stamp + dh_testdir + $(MAKE) + touch $@ +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + dh_clean +install: build + dh_testdir + dh_testroot + dh_prep + dh_installdirs + $(MAKE) DESTDIR=$(CURDIR)/debian/udsactor-nx install +binary-arch: build install + # emptyness +binary-indep: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_compress + dh_link + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb +binary: binary-indep +.PHONY: build clean binary-indep binary install configure diff --git a/linuxActorNX/src/readme.txt b/linuxActorNX/src/readme.txt new file mode 100644 index 000000000..6a894a2a7 --- /dev/null +++ b/linuxActorNX/src/readme.txt @@ -0,0 +1 @@ +This package provides the interaction between nx and uds diff --git a/linuxActorNX/src/udsnxstart.sh b/linuxActorNX/src/udsnxstart.sh new file mode 100644 index 000000000..d54d7eeab --- /dev/null +++ b/linuxActorNX/src/udsnxstart.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec /usr/bin/udsactor login $2 & \ No newline at end of file diff --git a/linuxActorNX/src/udsnxstop.sh b/linuxActorNX/src/udsnxstop.sh new file mode 100644 index 000000000..73846f8af --- /dev/null +++ b/linuxActorNX/src/udsnxstop.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec /usr/bin/udsactor logout $2 & \ No newline at end of file diff --git a/nxtransport/.classpath b/nxtransport/.classpath new file mode 100644 index 000000000..fb5011632 --- /dev/null +++ b/nxtransport/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/nxtransport/.project b/nxtransport/.project new file mode 100644 index 000000000..097b8833b --- /dev/null +++ b/nxtransport/.project @@ -0,0 +1,17 @@ + + + nxtransport + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/nxtransport/.settings/org.eclipse.mylyn.tasks.ui.prefs b/nxtransport/.settings/org.eclipse.mylyn.tasks.ui.prefs new file mode 100644 index 000000000..1113c3499 --- /dev/null +++ b/nxtransport/.settings/org.eclipse.mylyn.tasks.ui.prefs @@ -0,0 +1,4 @@ +#Tue Jan 03 02:54:43 CET 2012 +eclipse.preferences.version=1 +project.repository.kind=mantis +project.repository.url=http\://192.168.0.6/mantis diff --git a/nxtransport/description.jardesc b/nxtransport/description.jardesc new file mode 100644 index 000000000..77028d3b4 --- /dev/null +++ b/nxtransport/description.jardesc @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/nxtransport/jar/nxtransport.jar b/nxtransport/jar/nxtransport.jar new file mode 100644 index 000000000..c859f30cd Binary files /dev/null and b/nxtransport/jar/nxtransport.jar differ diff --git a/nxtransport/src/NxTransportApplet.java b/nxtransport/src/NxTransportApplet.java new file mode 100644 index 000000000..4817571c7 --- /dev/null +++ b/nxtransport/src/NxTransportApplet.java @@ -0,0 +1,135 @@ + +import java.applet.*; +import java.awt.*; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.Hashtable; + +import es.virtualcable.nx.LinuxApplet; +import es.virtualcable.nx.MacApplet; +import es.virtualcable.nx.OsApplet; +import es.virtualcable.nx.WindowsApplet; + +public class NxTransportApplet extends Applet { + /** + * + */ + private static final long serialVersionUID = 6553108857320035827L; + /** + * + */ + //private int width; + //private int height; + private OsApplet applet; + + public void init() { + //width = getSize().width; + //height = getSize().height; + setBackground(Color.lightGray); + + try { + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + try { + String os = System.getProperty("os.name"); + if( os.startsWith("Windows") ) + applet = new WindowsApplet(); + else if( os.startsWith("Linux")) + applet = new LinuxApplet(); + else if (os.startsWith("Mac")) + applet = new MacApplet(); + else + throw new Exception("Invalid os!!!"); + + Hashtable params = parseParams(simpleUnscrambler(getParameter("data"))); + String baseUrl = getCodeBase().toString(); + + Dimension scrSize = Toolkit.getDefaultToolkit().getScreenSize(); + applet.setParameters(params, baseUrl, scrSize.width, scrSize.height); + applet.init(); + + return null; // nothing to return + } catch (Exception e) { + System.out.println("Exception:" + e.getMessage()); + e.printStackTrace(); + return null; + } + } + }); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + public void start() { + try { + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + try { + applet.start(); + return null; // nothing to return + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + }); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public void destroy() { + try { + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + try { + applet.destroy(); + return null; // nothing to return + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + }); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public void paint(Graphics g) { + g.setColor(Color.black); + g.drawString("UDS NX connector", 8, 16); + } + + private Hashtable parseParams(String params) + { + Hashtable res = new Hashtable(); + String[] parms = params.split("\t"); + for( int i = 0; i < parms.length; i++) { + String[] val = parms[i].split(":"); + if( val.length == 1 ) + res.put(val[0], ""); + else + res.put(val[0], val[1]); + } + return res; + } + + private String simpleUnscrambler(String in) + { + int len = in.length(); + StringBuilder res = new StringBuilder(len/2); + int val = (int)'M'; + int pos = 0; + for( int i = 0; i < len; i += 2, pos++) { + String b = in.substring(i, i+2); + int c = Integer.parseInt(b, 16)^val; + val = (val ^ pos)&0xFF; + res.append((char)c); + } + return res.toString(); + } + +} diff --git a/nxtransport/src/es/virtualcable/nx/LinuxApplet.java b/nxtransport/src/es/virtualcable/nx/LinuxApplet.java new file mode 100644 index 000000000..d85e504b7 --- /dev/null +++ b/nxtransport/src/es/virtualcable/nx/LinuxApplet.java @@ -0,0 +1,104 @@ +package es.virtualcable.nx; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Hashtable; +import java.util.UUID; + +public class LinuxApplet implements OsApplet { + + private final String[] paths = { "/usr/NX/bin/", "/usr/local/bin/", "/usr/bin/" }; + private final String nxclient = "nxclient"; + + private Hashtable params; + private String tmpDir = ""; + // private String baseUrl = ""; + private String nxFileName = ""; + private String scrWidth; + private String scrHeight; + + public void start() { + tmpDir = System.getProperty("java.io.tmpdir") + File.separator; + nxFileName = tmpDir + UUID.randomUUID().toString() + ".nxs"; + + String width = params.get("width"); + String height = params.get("height"); + boolean fullScreen = false; + + if( width.equals("-1")) + { + width = scrWidth; + height = scrHeight; + fullScreen = true; + } + + NxFile nx = new NxFile(fullScreen, width, height); + nx.host = params.get("ip"); + nx.username = params.get("user"); + nx.password = params.get("pass"); + nx.cachedisk = params.get("cacheDisk"); + nx.cachemem = params.get("cacheMem"); + nx.port = params.get("port"); + nx.desktop = params.get("session"); + nx.linkSpeed = params.get("connection"); + + try { + nx.saveFile( nxFileName ); + } catch (IOException e) { + javax.swing.JOptionPane.showMessageDialog(null, "Can't save nx temporal file: " + e.getMessage()); + e.printStackTrace(); + return; + } + + String execPath = ""; + + for(int i = 0; i < paths.length; i++ ) + { + File f = new File(paths[i] + nxclient); + if( f.exists() ) + { + execPath = paths[i] + nxclient; + break; + } + } + + if( execPath.length() == 0 ) + { + javax.swing.JOptionPane.showMessageDialog(null, "Can't find nxclient client.\nShould be at /usr/NX/bin, /usr/bin or /usr/local/bin\nPlease, install it"); + System.err.println("Can't find nxclient."); + return; + } + + ArrayList exec = new ArrayList(); + exec.add(execPath); + exec.add("--session"); + exec.add(nxFileName); + + try { + ProcessBuilder pb = new ProcessBuilder(exec); + pb.start(); + } catch(Exception e) { + javax.swing.JOptionPane.showMessageDialog(null,"Exception at applet:\n" + e.getMessage()); + e.printStackTrace(); + return; + } + } + + public void init() { + } + + public void destroy() { + // TODO Auto-generated method stub + + } + + public void setParameters(Hashtable parameters, String urlBase, + int screenWidth, int screenHeight) { + params = parameters; + // baseUrl = urlBase; + scrWidth = Integer.toString(screenWidth); + scrHeight = Integer.toString(screenHeight); + } + +} diff --git a/nxtransport/src/es/virtualcable/nx/MacApplet.java b/nxtransport/src/es/virtualcable/nx/MacApplet.java new file mode 100644 index 000000000..67891f36e --- /dev/null +++ b/nxtransport/src/es/virtualcable/nx/MacApplet.java @@ -0,0 +1,104 @@ +package es.virtualcable.nx; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Hashtable; +import java.util.UUID; + +public class MacApplet implements OsApplet { + + private final String[] paths = { "/Applications/NX Client for OSX.app/Contents/MacOS/" }; + private final String nxclient = "nxclient"; + + private Hashtable params; + private String tmpDir = ""; + // private String baseUrl = ""; + private String nxFileName = ""; + private String scrWidth; + private String scrHeight; + + public void start() { + tmpDir = System.getProperty("java.io.tmpdir") + File.separator; + nxFileName = tmpDir + UUID.randomUUID().toString() + ".nxs"; + + String width = params.get("width"); + String height = params.get("height"); + boolean fullScreen = false; + + if( width.equals("-1")) + { + width = scrWidth; + height = scrHeight; + fullScreen = true; + } + + NxFile nx = new NxFile(fullScreen, width, height); + nx.host = params.get("ip"); + nx.username = params.get("user"); + nx.password = params.get("pass"); + nx.cachedisk = params.get("cacheDisk"); + nx.cachemem = params.get("cacheMem"); + nx.port = params.get("port"); + nx.desktop = params.get("session"); + nx.linkSpeed = params.get("connection"); + + try { + nx.saveFile( nxFileName ); + } catch (IOException e) { + javax.swing.JOptionPane.showMessageDialog(null, "Can't save nx temporal file: " + e.getMessage()); + e.printStackTrace(); + return; + } + + String execPath = ""; + + for(int i = 0; i < paths.length; i++ ) + { + File f = new File(paths[i] + nxclient); + if( f.exists() ) + { + execPath = paths[i] + nxclient; + break; + } + } + + if( execPath.length() == 0 ) + { + javax.swing.JOptionPane.showMessageDialog(null, "Can't find nxclient client.\nShould be at /Applications/NX Client for OSX.app/Contents/MacOS/\nPlease, install it"); + System.err.println("Can't find nxclient."); + return; + } + + ArrayList exec = new ArrayList(); + exec.add(execPath); + exec.add("--session"); + exec.add(nxFileName); + + try { + ProcessBuilder pb = new ProcessBuilder(exec); + pb.start(); + } catch(Exception e) { + javax.swing.JOptionPane.showMessageDialog(null,"Exception at applet:\n" + e.getMessage()); + e.printStackTrace(); + return; + } + } + + public void init() { + } + + public void destroy() { + // TODO Auto-generated method stub + + } + + public void setParameters(Hashtable parameters, String urlBase, + int screenWidth, int screenHeight) { + params = parameters; + // baseUrl = urlBase; + scrWidth = Integer.toString(screenWidth); + scrHeight = Integer.toString(screenHeight); + } + +} diff --git a/nxtransport/src/es/virtualcable/nx/NXPassword.java b/nxtransport/src/es/virtualcable/nx/NXPassword.java new file mode 100644 index 000000000..da853ddd6 --- /dev/null +++ b/nxtransport/src/es/virtualcable/nx/NXPassword.java @@ -0,0 +1,122 @@ +package es.virtualcable.nx; + +import java.util.HashMap; + +public class NXPassword { + // Encoding method extracted from nomachine web site: + // http://www.nomachine.com/ar/view.php?ar_id=AR01C00125 + + private static final int numValidCharList = 85; + private static final String dummyString = "{{{{"; + private static final char[] validCharList = { + '!', '#', '$', '%', '&', '(', ')', '*', '+', '-', + '.', '0', '1', '2', '3', '4', '5', '6', '7', '8', + '9', ':', ';', '<', '>', '?', '@', 'A', 'B', 'C', + 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', + 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '[', ']', '_', 'a', 'b', 'c', 'd', + 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', + 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', + 'y', 'z', '{', '|', '}' + }; + + private static StringBuilder encodePassword(String p) + { + StringBuilder sPass = new StringBuilder(":"); + + if (p.length() == 0) + return new StringBuilder(""); + + for (int i = 0; i < p.length(); i++) + { + char c = (char)p.charAt(i); + sPass.append(c+i+1).append(":"); + } + + return sPass; + } + + private static int findCharInList(char c) + { + int i = -1; + + for (int j = 0; j < numValidCharList; j++) + { + if (validCharList[j] == c) + { + i = j; + return i; + } + } + + return i; + } + + private static char getRandomValidCharFromList() + { + // int k = (int)(java.lang.System.currentTimeMillis() % 60); + int k = 0; + return validCharList[k]; + } + + public static String scrambleString(String s) + { + StringBuilder pass = new StringBuilder(); + + if (s == null || s.length() == 0) + return s; + + StringBuilder str = encodePassword(s); + + if (str.length() < 32) + str.append(dummyString); + + pass.append(str.reverse()); + + if (pass.length() < 32) + pass.append(dummyString); + + int k = getRandomValidCharFromList(); + int l = k + pass.length() - 2; + + pass.insert(0, (char)k); + + for (int i1 = 1; i1 < (int)pass.length(); i1++) + { + int j = findCharInList(pass.charAt(i1)); + + if (j == -1) + return s; + + int i = (j + l * (i1 + 1)) % numValidCharList; + + pass.setCharAt(i1,validCharList[i]); + } + + char c = (char)(getRandomValidCharFromList() + 2); + pass.append(c); + + // Convert entities + HashMap replacements = new HashMap(); + replacements.put('&', "&"); + replacements.put('<', "<"); + replacements.put('"', """); + replacements.put('\'', "'"); + // And convert $ to \$ + replacements.put('$', "\\$"); + + StringBuilder result = new StringBuilder(); + for( int i = 0; i < pass.length(); i++ ) + { + c = pass.charAt(i); + if( replacements.containsKey(c) ) + result.append(replacements.get(c)); + else + result.append(c); + } + + return result.toString(); + } + + +} diff --git a/nxtransport/src/es/virtualcable/nx/NxFile.java b/nxtransport/src/es/virtualcable/nx/NxFile.java new file mode 100644 index 000000000..e40cddc26 --- /dev/null +++ b/nxtransport/src/es/virtualcable/nx/NxFile.java @@ -0,0 +1,192 @@ +package es.virtualcable.nx; + +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; + +public class NxFile { + private static final String EMPTY_PASSWORD = "EMPTY_PASSWORD"; + + public boolean fullScreen; + public String width; + public String height; + public String cachemem = "4"; + public String cachedisk = "32"; + public String keyboardLayout = ""; + public String linkSpeed = "wan"; + public String host = ""; + public String port = ""; + public String username = ""; + public String password = ""; + public String desktop = "gnome"; + + public NxFile(boolean fullScreen, String width, String height) { + this.fullScreen = fullScreen; + this.width = width; + this.height = height; + } + + public void saveFile(String fname) throws IOException { + String rememberPass = "true"; + String pass = NXPassword.scrambleString(password); + if( pass == "" ) + { + rememberPass = "false"; + pass = EMPTY_PASSWORD; + } + String resolution = width + "x" + height; + if( fullScreen ) + resolution = "fullscreen"; + + String save = NXTemplate.replaceAll("\\{CACHEMEM\\}", cachemem); + save = save.replaceAll("\\{CACHEDISK\\}", cachedisk); + save = save.replaceAll("\\{KEYLAYOUT\\}", keyboardLayout); + save = save.replaceAll("\\{LINKSPEED\\}", linkSpeed); + save = save.replaceAll("\\{REMEMBERPASS\\}", rememberPass); + save = save.replaceAll("\\{RESOLUTION\\}", resolution); + save = save.replaceAll("\\{WIDTH\\}", width); + save = save.replaceAll("\\{HEIGHT\\}", height); + save = save.replaceAll("\\{HOST\\}", host); + save = save.replaceAll("\\{PORT\\}", port); + save = save.replaceAll("\\{DESKTOP\\}", desktop); + save = save.replaceAll("\\{USERNAME\\}", username); + save = save.replaceAll("\\{PASSWORD\\}", pass); + + FileWriter fstream = new FileWriter(fname); + PrintWriter out = new PrintWriter(fstream); + out.write(save); + out.close(); + } + + public static void main(String [] args) + { + NxFile nx = new NxFile(true, "1024", "768"); + try { + nx.saveFile(""); + } catch( Exception e ) + { + System.out.println(e); + } + } + + // NX Template used to generate file + private static final String NXTemplate = + "\n" + + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + ""; + +} diff --git a/nxtransport/src/es/virtualcable/nx/OsApplet.java b/nxtransport/src/es/virtualcable/nx/OsApplet.java new file mode 100644 index 000000000..819378392 --- /dev/null +++ b/nxtransport/src/es/virtualcable/nx/OsApplet.java @@ -0,0 +1,15 @@ +package es.virtualcable.nx; + +import java.util.Hashtable; + +public interface OsApplet { + + void setParameters(Hashtable parameters, String urlBase, int screenWidth, int screenHeight); + + void init(); + + void start(); + + void destroy(); + +} diff --git a/nxtransport/src/es/virtualcable/nx/WindowsApplet.java b/nxtransport/src/es/virtualcable/nx/WindowsApplet.java new file mode 100644 index 000000000..2588cea27 --- /dev/null +++ b/nxtransport/src/es/virtualcable/nx/WindowsApplet.java @@ -0,0 +1,86 @@ +package es.virtualcable.nx; + +import java.io.File; +import java.io.IOException; +import java.util.Hashtable; +import java.util.UUID; + +import es.virtualcable.windows.WinRegistry; + +public class WindowsApplet implements OsApplet { + + private Hashtable params; + private String tmpDir = ""; + // private String baseUrl = ""; + private String nxFileName = ""; + private String scrWidth; + private String scrHeight; + + public void setParameters(Hashtable parameters, String urlBase, + int screenWidth, int screenHeight) { + params = parameters; + // baseUrl = urlBase; + scrWidth = Integer.toString(screenWidth); + scrHeight = Integer.toString(screenHeight); + } + + public void start() { + try { + tmpDir = System.getProperty("java.io.tmpdir") + File.separator; + System.out.println(tmpDir); + nxFileName = tmpDir + UUID.randomUUID().toString() + ".nxs"; + + String width = params.get("width"); + String height = params.get("height"); + boolean fullScreen = false; + + if( width.equals("-1")) + { + width = scrWidth; + height = scrHeight; + fullScreen = true; + } + + NxFile nx = new NxFile(fullScreen, width, height); + nx.host = params.get("ip"); + nx.username = params.get("user"); + nx.password = params.get("pass"); + nx.cachedisk = params.get("cacheDisk"); + nx.cachemem = params.get("cacheMem"); + nx.port = params.get("port"); + nx.desktop = params.get("session"); + nx.linkSpeed = params.get("connection"); + + try { + nx.saveFile( nxFileName ); + } catch (IOException e) { + javax.swing.JOptionPane.showMessageDialog(null, "Can't save nx temporal file: " + e.getMessage()); + e.printStackTrace(); + return; + } + + String cmd = WinRegistry.readString(WinRegistry.HKEY_CURRENT_USER, "Software\\Classes\\NXClient.session\\shell\\open\\command", ""); + if ( null == cmd ) + javax.swing.JOptionPane.showMessageDialog(null, "Can't find Nomachine client. Please, install it"); + else + { + nxFileName = nxFileName.replace("\\", "\\\\"); + cmd = cmd.replaceAll("%1", nxFileName); + System.out.println(cmd); + // Process p = + Runtime.getRuntime().exec( cmd ); + } + } catch (Exception e) { + javax.swing.JOptionPane.showMessageDialog(null,"Exception at applet:\n" + e.getMessage()); + e.printStackTrace(); + return; + } + } + + public void init() { + } + + public void destroy() { + } + +} diff --git a/nxtransport/src/es/virtualcable/windows/WinRegistry.java b/nxtransport/src/es/virtualcable/windows/WinRegistry.java new file mode 100644 index 000000000..cd9ff892a --- /dev/null +++ b/nxtransport/src/es/virtualcable/windows/WinRegistry.java @@ -0,0 +1,392 @@ +package es.virtualcable.windows; + +/* Code borrowed from http://stackoverflow.com/questions/62289/read-write-to-windows-registry-using-java. */ +/* Original author don't found, if someone found him, please note it here */ + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.HashMap; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; +import java.util.prefs.Preferences; + +public class WinRegistry { + public static final int HKEY_CURRENT_USER = 0x80000001; + public static final int HKEY_LOCAL_MACHINE = 0x80000002; + public static final int REG_SUCCESS = 0; + public static final int REG_NOTFOUND = 2; + public static final int REG_ACCESSDENIED = 5; + + private static final int KEY_ALL_ACCESS = 0xf003f; + private static final int KEY_READ = 0x20019; + private static Preferences userRoot = Preferences.userRoot(); + private static Preferences systemRoot = Preferences.systemRoot(); + + private static Class userClass = userRoot.getClass(); + private static Method regOpenKey = null; + private static Method regCloseKey = null; + private static Method regQueryValueEx = null; + private static Method regEnumValue = null; + private static Method regQueryInfoKey = null; + private static Method regEnumKeyEx = null; + private static Method regCreateKeyEx = null; + private static Method regSetValueEx = null; + private static Method regDeleteKey = null; + private static Method regDeleteValue = null; + + static { + try { + regOpenKey = userClass.getDeclaredMethod("WindowsRegOpenKey", + new Class[] { int.class, byte[].class, int.class }); + regOpenKey.setAccessible(true); + regCloseKey = userClass.getDeclaredMethod("WindowsRegCloseKey", + new Class[] { int.class }); + regCloseKey.setAccessible(true); + regQueryValueEx = userClass.getDeclaredMethod("WindowsRegQueryValueEx", + new Class[] { int.class, byte[].class }); + regQueryValueEx.setAccessible(true); + regEnumValue = userClass.getDeclaredMethod("WindowsRegEnumValue", + new Class[] { int.class, int.class, int.class }); + regEnumValue.setAccessible(true); + regQueryInfoKey = userClass.getDeclaredMethod("WindowsRegQueryInfoKey1", + new Class[] { int.class }); + regQueryInfoKey.setAccessible(true); + regEnumKeyEx = userClass.getDeclaredMethod( + "WindowsRegEnumKeyEx", new Class[] { int.class, int.class, + int.class }); + regEnumKeyEx.setAccessible(true); + regCreateKeyEx = userClass.getDeclaredMethod( + "WindowsRegCreateKeyEx", new Class[] { int.class, + byte[].class }); + regCreateKeyEx.setAccessible(true); + regSetValueEx = userClass.getDeclaredMethod( + "WindowsRegSetValueEx", new Class[] { int.class, + byte[].class, byte[].class }); + regSetValueEx.setAccessible(true); + regDeleteValue = userClass.getDeclaredMethod( + "WindowsRegDeleteValue", new Class[] { int.class, + byte[].class }); + regDeleteValue.setAccessible(true); + regDeleteKey = userClass.getDeclaredMethod( + "WindowsRegDeleteKey", new Class[] { int.class, + byte[].class }); + regDeleteKey.setAccessible(true); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + private WinRegistry() { } + + /** + * Read a value from key and value name + * @param hkey HKEY_CURRENT_USER/HKEY_LOCAL_MACHINE + * @param key + * @param valueName + * @return the value + * @throws IllegalArgumentException + * @throws IllegalAccessException + * @throws InvocationTargetException + */ + public static String readString(int hkey, String key, String valueName) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException + { + if (hkey == HKEY_LOCAL_MACHINE) { + return readString(systemRoot, hkey, key, valueName); + } + else if (hkey == HKEY_CURRENT_USER) { + return readString(userRoot, hkey, key, valueName); + } + else { + throw new IllegalArgumentException("hkey=" + hkey); + } + } + + /** + * Read value(s) and value name(s) form given key + * @param hkey HKEY_CURRENT_USER/HKEY_LOCAL_MACHINE + * @param key + * @return the value name(s) plus the value(s) + * @throws IllegalArgumentException + * @throws IllegalAccessException + * @throws InvocationTargetException + */ + public static Map readStringValues(int hkey, String key) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException + { + if (hkey == HKEY_LOCAL_MACHINE) { + return readStringValues(systemRoot, hkey, key); + } + else if (hkey == HKEY_CURRENT_USER) { + return readStringValues(userRoot, hkey, key); + } + else { + throw new IllegalArgumentException("hkey=" + hkey); + } + } + + /** + * Read the value name(s) from a given key + * @param hkey HKEY_CURRENT_USER/HKEY_LOCAL_MACHINE + * @param key + * @return the value name(s) + * @throws IllegalArgumentException + * @throws IllegalAccessException + * @throws InvocationTargetException + */ + public static List readStringSubKeys(int hkey, String key) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException + { + if (hkey == HKEY_LOCAL_MACHINE) { + return readStringSubKeys(systemRoot, hkey, key); + } + else if (hkey == HKEY_CURRENT_USER) { + return readStringSubKeys(userRoot, hkey, key); + } + else { + throw new IllegalArgumentException("hkey=" + hkey); + } + } + + /** + * Create a key + * @param hkey HKEY_CURRENT_USER/HKEY_LOCAL_MACHINE + * @param key + * @throws IllegalArgumentException + * @throws IllegalAccessException + * @throws InvocationTargetException + */ + public static void createKey(int hkey, String key) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException + { + int [] ret; + if (hkey == HKEY_LOCAL_MACHINE) { + ret = createKey(systemRoot, hkey, key); + regCloseKey.invoke(systemRoot, new Object[] { new Integer(ret[0]) }); + } + else if (hkey == HKEY_CURRENT_USER) { + ret = createKey(userRoot, hkey, key); + regCloseKey.invoke(userRoot, new Object[] { new Integer(ret[0]) }); + } + else { + throw new IllegalArgumentException("hkey=" + hkey); + } + if (ret[1] != REG_SUCCESS) { + throw new IllegalArgumentException("rc=" + ret[1] + " key=" + key); + } + } + + /** + * Write a value in a given key/value name + * @param hkey + * @param key + * @param valueName + * @param value + * @throws IllegalArgumentException + * @throws IllegalAccessException + * @throws InvocationTargetException + */ + public static void writeStringValue + (int hkey, String key, String valueName, String value) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException + { + if (hkey == HKEY_LOCAL_MACHINE) { + writeStringValue(systemRoot, hkey, key, valueName, value); + } + else if (hkey == HKEY_CURRENT_USER) { + writeStringValue(userRoot, hkey, key, valueName, value); + } + else { + throw new IllegalArgumentException("hkey=" + hkey); + } + } + + /** + * Delete a given key + * @param hkey + * @param key + * @throws IllegalArgumentException + * @throws IllegalAccessException + * @throws InvocationTargetException + */ + public static void deleteKey(int hkey, String key) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException + { + int rc = -1; + if (hkey == HKEY_LOCAL_MACHINE) { + rc = deleteKey(systemRoot, hkey, key); + } + else if (hkey == HKEY_CURRENT_USER) { + rc = deleteKey(userRoot, hkey, key); + } + if (rc != REG_SUCCESS) { + throw new IllegalArgumentException("rc=" + rc + " key=" + key); + } + } + + /** + * delete a value from a given key/value name + * @param hkey + * @param key + * @param value + * @throws IllegalArgumentException + * @throws IllegalAccessException + * @throws InvocationTargetException + */ + public static void deleteValue(int hkey, String key, String value) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException + { + int rc = -1; + if (hkey == HKEY_LOCAL_MACHINE) { + rc = deleteValue(systemRoot, hkey, key, value); + } + else if (hkey == HKEY_CURRENT_USER) { + rc = deleteValue(userRoot, hkey, key, value); + } + if (rc != REG_SUCCESS) { + throw new IllegalArgumentException("rc=" + rc + " key=" + key + " value=" + value); + } + } + + // ===================== + + private static int deleteValue + (Preferences root, int hkey, String key, String value) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException + { + int[] handles = (int[]) regOpenKey.invoke(root, new Object[] { + new Integer(hkey), toCstr(key), new Integer(KEY_ALL_ACCESS) }); + if (handles[1] != REG_SUCCESS) { + return handles[1]; // can be REG_NOTFOUND, REG_ACCESSDENIED + } + int rc =((Integer) regDeleteValue.invoke(root, + new Object[] { + new Integer(handles[0]), toCstr(value) + })).intValue(); + regCloseKey.invoke(root, new Object[] { new Integer(handles[0]) }); + return rc; + } + + private static int deleteKey(Preferences root, int hkey, String key) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException + { + int rc =((Integer) regDeleteKey.invoke(root, + new Object[] { new Integer(hkey), toCstr(key) })).intValue(); + return rc; // can REG_NOTFOUND, REG_ACCESSDENIED, REG_SUCCESS + } + + private static String readString(Preferences root, int hkey, String key, String value) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException + { + int[] handles = (int[]) regOpenKey.invoke(root, new Object[] { + new Integer(hkey), toCstr(key), new Integer(KEY_READ) }); + if (handles[1] != REG_SUCCESS) { + return null; + } + byte[] valb = (byte[]) regQueryValueEx.invoke(root, new Object[] { + new Integer(handles[0]), toCstr(value) }); + regCloseKey.invoke(root, new Object[] { new Integer(handles[0]) }); + return (valb != null ? new String(valb).trim() : null); + } + + private static Map readStringValues + (Preferences root, int hkey, String key) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException + { + HashMap results = new HashMap(); + int[] handles = (int[]) regOpenKey.invoke(root, new Object[] { + new Integer(hkey), toCstr(key), new Integer(KEY_READ) }); + if (handles[1] != REG_SUCCESS) { + return null; + } + int[] info = (int[]) regQueryInfoKey.invoke(root, + new Object[] { new Integer(handles[0]) }); + + int count = info[2]; // count + int maxlen = info[3]; // value length max + for(int index=0; index readStringSubKeys + (Preferences root, int hkey, String key) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException + { + List results = new ArrayList(); + int[] handles = (int[]) regOpenKey.invoke(root, new Object[] { + new Integer(hkey), toCstr(key), new Integer(KEY_READ) + }); + if (handles[1] != REG_SUCCESS) { + return null; + } + int[] info = (int[]) regQueryInfoKey.invoke(root, + new Object[] { new Integer(handles[0]) }); + + int count = info[2]; // count + int maxlen = info[3]; // value length max + for(int index=0; index + + + + + diff --git a/nxtuntransport/.project b/nxtuntransport/.project new file mode 100644 index 000000000..2730eeacf --- /dev/null +++ b/nxtuntransport/.project @@ -0,0 +1,17 @@ + + + nxtuntransport + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/nxtuntransport/.settings/org.eclipse.mylyn.tasks.ui.prefs b/nxtuntransport/.settings/org.eclipse.mylyn.tasks.ui.prefs new file mode 100644 index 000000000..1113c3499 --- /dev/null +++ b/nxtuntransport/.settings/org.eclipse.mylyn.tasks.ui.prefs @@ -0,0 +1,4 @@ +#Tue Jan 03 02:54:43 CET 2012 +eclipse.preferences.version=1 +project.repository.kind=mantis +project.repository.url=http\://192.168.0.6/mantis diff --git a/nxtuntransport/description.jardesc b/nxtuntransport/description.jardesc new file mode 100644 index 000000000..d9cad7439 --- /dev/null +++ b/nxtuntransport/description.jardesc @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/nxtuntransport/jar/nxtuntransport.jar b/nxtuntransport/jar/nxtuntransport.jar new file mode 100644 index 000000000..6ec27d4f2 Binary files /dev/null and b/nxtuntransport/jar/nxtuntransport.jar differ diff --git a/nxtuntransport/src/NxTunTransportApplet.java b/nxtuntransport/src/NxTunTransportApplet.java new file mode 100644 index 000000000..a228ca37f --- /dev/null +++ b/nxtuntransport/src/NxTunTransportApplet.java @@ -0,0 +1,135 @@ + +import java.applet.*; +import java.awt.*; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.Hashtable; + +import es.virtualcable.nx.LinuxApplet; +import es.virtualcable.nx.MacApplet; +import es.virtualcable.nx.OsApplet; +import es.virtualcable.nx.WindowsApplet; + +public class NxTunTransportApplet extends Applet { + /** + * + */ + private static final long serialVersionUID = 6553108857320035827L; + /** + * + */ + //private int width; + //private int height; + private OsApplet applet; + + public void init() { + //width = getSize().width; + //height = getSize().height; + setBackground(Color.lightGray); + + try { + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + try { + String os = System.getProperty("os.name"); + if( os.startsWith("Windows") ) + applet = new WindowsApplet(); + else if( os.startsWith("Linux")) + applet = new LinuxApplet(); + else if (os.startsWith("Mac")) + applet = new MacApplet(); + else + throw new Exception("Invalid os!!!"); + + Hashtable params = parseParams(simpleUnscrambler(getParameter("data"))); + String baseUrl = getCodeBase().toString(); + + Dimension scrSize = Toolkit.getDefaultToolkit().getScreenSize(); + applet.setParameters(params, baseUrl, scrSize.width, scrSize.height); + applet.init(); + + return null; // nothing to return + } catch (Exception e) { + System.out.println("Exception:" + e.getMessage()); + e.printStackTrace(); + return null; + } + } + }); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + public void start() { + try { + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + try { + applet.start(); + return null; // nothing to return + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + }); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public void destroy() { + try { + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + try { + applet.destroy(); + return null; // nothing to return + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + }); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public void paint(Graphics g) { + g.setColor(Color.black); + g.drawString("UDS NX Tunel Connector", 8, 16); + } + + private Hashtable parseParams(String params) + { + Hashtable res = new Hashtable(); + String[] parms = params.split("\t"); + for( int i = 0; i < parms.length; i++) { + String[] val = parms[i].split(":"); + if( val.length == 1 ) + res.put(val[0], ""); + else + res.put(val[0], val[1]); + } + return res; + } + + private String simpleUnscrambler(String in) + { + int len = in.length(); + StringBuilder res = new StringBuilder(len/2); + int val = (int)'M'; + int pos = 0; + for( int i = 0; i < len; i += 2, pos++) { + String b = in.substring(i, i+2); + int c = Integer.parseInt(b, 16)^val; + val = (val ^ pos)&0xFF; + res.append((char)c); + } + return res.toString(); + } + +} diff --git a/nxtuntransport/src/es/virtualcable/nx/FreePortFinder.java b/nxtuntransport/src/es/virtualcable/nx/FreePortFinder.java new file mode 100644 index 000000000..d9ddc5fea --- /dev/null +++ b/nxtuntransport/src/es/virtualcable/nx/FreePortFinder.java @@ -0,0 +1,40 @@ +package es.virtualcable.nx; + +import java.io.IOException; +import java.net.*; +import java.util.Random; + + +public class FreePortFinder { + + private final static int START_PORT = 35000; + private final static int START_PORT_MAX = 44000; + private final static int END_PORT = 45500; + + public static boolean isFree(int port) + { + boolean free = true; + try { + InetAddress addr = InetAddress.getByName("localhost"); + SocketAddress sa = new InetSocketAddress(addr, port); + ServerSocket socket = new ServerSocket(); + socket.bind(sa); + socket.close(); + } catch (IOException e) { + free = false; + } + return free; + } + + public static int findFreePort() + { + Random rnd = new Random(); + int startPort = START_PORT + rnd.nextInt(START_PORT_MAX-START_PORT); + for( int port = startPort; port < END_PORT; port ++) + { + if( isFree(port) ) + return port; + } + return -1; + } +} diff --git a/nxtuntransport/src/es/virtualcable/nx/LinuxApplet.java b/nxtuntransport/src/es/virtualcable/nx/LinuxApplet.java new file mode 100644 index 000000000..894c96277 --- /dev/null +++ b/nxtuntransport/src/es/virtualcable/nx/LinuxApplet.java @@ -0,0 +1,130 @@ +package es.virtualcable.nx; + +import java.io.File; +import java.io.IOException; +import java.util.Hashtable; +import java.util.Map; +import java.util.UUID; + + +public class LinuxApplet implements OsApplet { + + private final String[] paths = { "/usr/NX/bin/", "/usr/local/bin/", "/usr/bin/" }; + private final String nxclient = "nxclient"; + + private Hashtable params; + private String tmpDir = ""; + private String baseUrl = ""; + private String nxFileName = ""; + private String jarFileName = ""; + private String scrWidth; + private String scrHeight; + private String tunPort = ""; + + public void start() { + try { + tmpDir = System.getProperty("java.io.tmpdir") + File.separator; + nxFileName = tmpDir + UUID.randomUUID().toString() + ".nxs"; + jarFileName = tmpDir + UUID.randomUUID().toString() + ".jar"; + + //System.out.println(nxFileName); + + String width = params.get("width"); + String height = params.get("height"); + boolean fullScreen = false; + + if( width.equals("-1")) + { + width = scrWidth; + height = scrHeight; + fullScreen = true; + } + + if( downloadJar() == false) + return; + tunPort = Integer.toString(FreePortFinder.findFreePort()); + + NxFile nx = new NxFile(fullScreen, width, height); + nx.host = "127.0.0.1"; + nx.port = tunPort; + nx.username = params.get("user"); + nx.password = params.get("pass"); + nx.cachedisk = params.get("cacheDisk"); + nx.cachemem = params.get("cacheMem"); + nx.desktop = params.get("session"); + nx.linkSpeed = params.get("connection"); + + try { + nx.saveFile( nxFileName ); + } catch (IOException e) { + javax.swing.JOptionPane.showMessageDialog(null, "Can't save nx temporal file: " + e.getMessage()); + e.printStackTrace(); + return; + } + + String execPath = ""; + + for(int i = 0; i < paths.length; i++ ) + { + File f = new File(paths[i] + nxclient); + if( f.exists() ) + { + execPath = paths[i] + nxclient; + break; + } + } + + if( execPath.length() == 0 ) + { + javax.swing.JOptionPane.showMessageDialog(null, "Can't find nxclient client.\nShould be at /usr/NX/bin, /usr/bin or /usr/local/bin\nPlease, install it"); + System.err.println("Can't find nxclient."); + return; + } + + executeTunnel(execPath); + + } catch (Exception e) { + javax.swing.JOptionPane.showMessageDialog(null,"Exception at applet:\n" + e.getMessage()); + e.printStackTrace(); + return; + } + } + + public void init() { + } + + public void destroy() { + } + + private void executeTunnel(String nxCmd) throws IOException + { + String java = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java"; + String [] exec = { java, "-jar", jarFileName, tunPort, nxCmd, "--session", nxFileName }; + ProcessBuilder pb = new ProcessBuilder( exec ); + Map env = pb.environment(); + env.put("TPARAMS", params.get("tun")); + /*System.out.println("TPARAMS: " + params.get("tun")); + for (String str : exec) { + System.out.print(str + " "); + } + System.out.println();*/ + pb.start(); + + } + + public void setParameters(Hashtable parameters, String urlBase, + int screenWidth, int screenHeight) { + params = parameters; + baseUrl = urlBase; + scrWidth = Integer.toString(screenWidth); + scrHeight = Integer.toString(screenHeight); + + } + + private boolean downloadJar() + { + return util.download(baseUrl, "2", jarFileName); + } + + +} diff --git a/nxtuntransport/src/es/virtualcable/nx/MacApplet.java b/nxtuntransport/src/es/virtualcable/nx/MacApplet.java new file mode 100644 index 000000000..183e8cb4d --- /dev/null +++ b/nxtuntransport/src/es/virtualcable/nx/MacApplet.java @@ -0,0 +1,130 @@ +package es.virtualcable.nx; + +import java.io.File; +import java.io.IOException; +import java.util.Hashtable; +import java.util.Map; +import java.util.UUID; + + +public class MacApplet implements OsApplet { + + private final String[] paths = { "/Applications/NX Client for OSX.app/Contents/MacOS/" }; + private final String nxclient = "nxclient"; + + private Hashtable params; + private String tmpDir = ""; + private String baseUrl = ""; + private String nxFileName = ""; + private String jarFileName = ""; + private String scrWidth; + private String scrHeight; + private String tunPort = ""; + + public void start() { + try { + tmpDir = System.getProperty("java.io.tmpdir") + File.separator; + nxFileName = tmpDir + UUID.randomUUID().toString() + ".nxs"; + jarFileName = tmpDir + UUID.randomUUID().toString() + ".jar"; + + //System.out.println(nxFileName); + + String width = params.get("width"); + String height = params.get("height"); + boolean fullScreen = false; + + if( width.equals("-1")) + { + width = scrWidth; + height = scrHeight; + fullScreen = true; + } + + if( downloadJar() == false) + return; + tunPort = Integer.toString(FreePortFinder.findFreePort()); + + NxFile nx = new NxFile(fullScreen, width, height); + nx.host = "127.0.0.1"; + nx.port = tunPort; + nx.username = params.get("user"); + nx.password = params.get("pass"); + nx.cachedisk = params.get("cacheDisk"); + nx.cachemem = params.get("cacheMem"); + nx.desktop = params.get("session"); + nx.linkSpeed = params.get("connection"); + + try { + nx.saveFile( nxFileName ); + } catch (IOException e) { + javax.swing.JOptionPane.showMessageDialog(null, "Can't save nx temporal file: " + e.getMessage()); + e.printStackTrace(); + return; + } + + String execPath = ""; + + for(int i = 0; i < paths.length; i++ ) + { + File f = new File(paths[i] + nxclient); + if( f.exists() ) + { + execPath = paths[i] + nxclient; + break; + } + } + + if( execPath.length() == 0 ) + { + javax.swing.JOptionPane.showMessageDialog(null, "Can't find nxclient client.\nShould be at /Applications/NX Client for OSX.app/Contents/MacOS/\nPlease, install it"); + System.err.println("Can't find nxclient."); + return; + } + + executeTunnel(execPath); + + } catch (Exception e) { + javax.swing.JOptionPane.showMessageDialog(null,"Exception at applet:\n" + e.getMessage()); + e.printStackTrace(); + return; + } + } + + public void init() { + } + + public void destroy() { + } + + private void executeTunnel(String nxCmd) throws IOException + { + String java = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java"; + String [] exec = { java, "-jar", jarFileName, tunPort, nxCmd, "--session", nxFileName }; + ProcessBuilder pb = new ProcessBuilder( exec ); + Map env = pb.environment(); + env.put("TPARAMS", params.get("tun")); + System.out.println("TPARAMS: " + params.get("tun")); + for (String str : exec) { + System.out.print(str + " "); + } + System.out.println(); + pb.start(); + + } + + public void setParameters(Hashtable parameters, String urlBase, + int screenWidth, int screenHeight) { + params = parameters; + baseUrl = urlBase; + scrWidth = Integer.toString(screenWidth); + scrHeight = Integer.toString(screenHeight); + + } + + private boolean downloadJar() + { + return util.download(baseUrl, "2", jarFileName); + } + + +} diff --git a/nxtuntransport/src/es/virtualcable/nx/NXPassword.java b/nxtuntransport/src/es/virtualcable/nx/NXPassword.java new file mode 100644 index 000000000..da853ddd6 --- /dev/null +++ b/nxtuntransport/src/es/virtualcable/nx/NXPassword.java @@ -0,0 +1,122 @@ +package es.virtualcable.nx; + +import java.util.HashMap; + +public class NXPassword { + // Encoding method extracted from nomachine web site: + // http://www.nomachine.com/ar/view.php?ar_id=AR01C00125 + + private static final int numValidCharList = 85; + private static final String dummyString = "{{{{"; + private static final char[] validCharList = { + '!', '#', '$', '%', '&', '(', ')', '*', '+', '-', + '.', '0', '1', '2', '3', '4', '5', '6', '7', '8', + '9', ':', ';', '<', '>', '?', '@', 'A', 'B', 'C', + 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', + 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '[', ']', '_', 'a', 'b', 'c', 'd', + 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', + 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', + 'y', 'z', '{', '|', '}' + }; + + private static StringBuilder encodePassword(String p) + { + StringBuilder sPass = new StringBuilder(":"); + + if (p.length() == 0) + return new StringBuilder(""); + + for (int i = 0; i < p.length(); i++) + { + char c = (char)p.charAt(i); + sPass.append(c+i+1).append(":"); + } + + return sPass; + } + + private static int findCharInList(char c) + { + int i = -1; + + for (int j = 0; j < numValidCharList; j++) + { + if (validCharList[j] == c) + { + i = j; + return i; + } + } + + return i; + } + + private static char getRandomValidCharFromList() + { + // int k = (int)(java.lang.System.currentTimeMillis() % 60); + int k = 0; + return validCharList[k]; + } + + public static String scrambleString(String s) + { + StringBuilder pass = new StringBuilder(); + + if (s == null || s.length() == 0) + return s; + + StringBuilder str = encodePassword(s); + + if (str.length() < 32) + str.append(dummyString); + + pass.append(str.reverse()); + + if (pass.length() < 32) + pass.append(dummyString); + + int k = getRandomValidCharFromList(); + int l = k + pass.length() - 2; + + pass.insert(0, (char)k); + + for (int i1 = 1; i1 < (int)pass.length(); i1++) + { + int j = findCharInList(pass.charAt(i1)); + + if (j == -1) + return s; + + int i = (j + l * (i1 + 1)) % numValidCharList; + + pass.setCharAt(i1,validCharList[i]); + } + + char c = (char)(getRandomValidCharFromList() + 2); + pass.append(c); + + // Convert entities + HashMap replacements = new HashMap(); + replacements.put('&', "&"); + replacements.put('<', "<"); + replacements.put('"', """); + replacements.put('\'', "'"); + // And convert $ to \$ + replacements.put('$', "\\$"); + + StringBuilder result = new StringBuilder(); + for( int i = 0; i < pass.length(); i++ ) + { + c = pass.charAt(i); + if( replacements.containsKey(c) ) + result.append(replacements.get(c)); + else + result.append(c); + } + + return result.toString(); + } + + +} diff --git a/nxtuntransport/src/es/virtualcable/nx/NxFile.java b/nxtuntransport/src/es/virtualcable/nx/NxFile.java new file mode 100644 index 000000000..88673b15e --- /dev/null +++ b/nxtuntransport/src/es/virtualcable/nx/NxFile.java @@ -0,0 +1,192 @@ +package es.virtualcable.nx; + +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; + +public class NxFile { + private static final String EMPTY_PASSWORD = "EMPTY_PASSWORD"; + + public boolean fullScreen; + public String width; + public String height; + public String cachemem = "4"; + public String cachedisk = "32"; + public String keyboardLayout = ""; + public String linkSpeed = "wan"; + public String host = ""; + public String port = ""; + public String username = ""; + public String password = ""; + public String desktop = "gnome"; + + public NxFile(boolean fullScreen, String width, String height) { + this.fullScreen = fullScreen; + this.width = width; + this.height = height; + } + + public void saveFile(String fname) throws IOException { + String rememberPass = "true"; + String pass = NXPassword.scrambleString(password); + if( pass == "" ) + { + rememberPass = "false"; + pass = EMPTY_PASSWORD; + } + String resolution = width + "x" + height; + if( fullScreen ) + resolution = "fullscreen"; + + String save = NXTemplate.replaceAll("\\{CACHEMEM\\}", cachemem); + save = save.replaceAll("\\{CACHEDISK\\}", cachedisk); + save = save.replaceAll("\\{KEYLAYOUT\\}", keyboardLayout); + save = save.replaceAll("\\{LINKSPEED\\}", linkSpeed); + save = save.replaceAll("\\{REMEMBERPASS\\}", rememberPass); + save = save.replaceAll("\\{RESOLUTION\\}", resolution); + save = save.replaceAll("\\{WIDTH\\}", width); + save = save.replaceAll("\\{HEIGHT\\}", height); + save = save.replaceAll("\\{HOST\\}", host); + save = save.replaceAll("\\{PORT\\}", port); + save = save.replaceAll("\\{DESKTOP\\}", desktop); + save = save.replaceAll("\\{USERNAME\\}", username); + save = save.replaceAll("\\{PASSWORD\\}", pass); + + FileWriter fstream = new FileWriter(fname); + PrintWriter out = new PrintWriter(fstream); + out.write(save); + out.close(); + } + + public static void main(String [] args) + { + NxFile nx = new NxFile(true, "1024", "768"); + try { + nx.saveFile(""); + } catch( Exception e ) + { + e.printStackTrace(); + } + } + + // NX Template used to generate file + private static final String NXTemplate = + "\n" + + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + ""; + +} diff --git a/nxtuntransport/src/es/virtualcable/nx/OsApplet.java b/nxtuntransport/src/es/virtualcable/nx/OsApplet.java new file mode 100644 index 000000000..819378392 --- /dev/null +++ b/nxtuntransport/src/es/virtualcable/nx/OsApplet.java @@ -0,0 +1,15 @@ +package es.virtualcable.nx; + +import java.util.Hashtable; + +public interface OsApplet { + + void setParameters(Hashtable parameters, String urlBase, int screenWidth, int screenHeight); + + void init(); + + void start(); + + void destroy(); + +} diff --git a/nxtuntransport/src/es/virtualcable/nx/WindowsApplet.java b/nxtuntransport/src/es/virtualcable/nx/WindowsApplet.java new file mode 100644 index 000000000..1b810da43 --- /dev/null +++ b/nxtuntransport/src/es/virtualcable/nx/WindowsApplet.java @@ -0,0 +1,116 @@ +package es.virtualcable.nx; + +import java.io.File; +import java.io.IOException; +import java.util.Hashtable; +import java.util.Map; +import java.util.UUID; + +import es.virtualcable.nx.FreePortFinder; +import es.virtualcable.nx.util; +import es.virtualcable.windows.WinRegistry; + +public class WindowsApplet implements OsApplet { + + private Hashtable params; + private String tmpDir = ""; + private String baseUrl = ""; + private String nxFileName = ""; + private String jarFileName = ""; + private String scrWidth; + private String scrHeight; + private String tunPort = ""; + + + public void setParameters(Hashtable parameters, String urlBase, + int screenWidth, int screenHeight) { + params = parameters; + baseUrl = urlBase; + scrWidth = Integer.toString(screenWidth); + scrHeight = Integer.toString(screenHeight); + } + + public void start() { + try { + tmpDir = System.getProperty("java.io.tmpdir") + File.separator; + nxFileName = tmpDir + UUID.randomUUID().toString() + ".nxs"; + jarFileName = tmpDir + UUID.randomUUID().toString() + ".jar"; + + //System.out.println(nxFileName); + + String width = params.get("width"); + String height = params.get("height"); + boolean fullScreen = false; + + if( width.equals("-1")) + { + width = scrWidth; + height = scrHeight; + fullScreen = true; + } + + if( downloadJar() == false) + return; + tunPort = Integer.toString(FreePortFinder.findFreePort()); + + NxFile nx = new NxFile(fullScreen, width, height); + nx.host = "127.0.0.1"; + nx.port = tunPort; + nx.username = params.get("user"); + nx.password = params.get("pass"); + nx.cachedisk = params.get("cacheDisk"); + nx.cachemem = params.get("cacheMem"); + nx.desktop = params.get("session"); + nx.linkSpeed = params.get("connection"); + + try { + nx.saveFile( nxFileName ); + } catch (IOException e) { + javax.swing.JOptionPane.showMessageDialog(null, "Can't save nx temporal file: " + e.getMessage()); + e.printStackTrace(); + return; + } + + String cmd = WinRegistry.readString(WinRegistry.HKEY_CURRENT_USER, "Software\\Classes\\NXClient.session\\shell\\open\\command", ""); + if ( null == cmd ) + javax.swing.JOptionPane.showMessageDialog(null, "Can't find Nomachine client. Please, install it"); + else + { + nxFileName = nxFileName.replace("\\", "\\\\"); + System.out.println(nxFileName); + cmd = cmd.replaceAll("%1", nxFileName); + executeTunnel(cmd); + + } + } catch (Exception e) { + javax.swing.JOptionPane.showMessageDialog(null,"Exception at applet:\n" + e.getMessage()); + e.printStackTrace(); + return; + } + } + + public void init() { + } + + public void destroy() { + } + + private void executeTunnel(String nxCmd) throws IOException + { + String java = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java.exe"; + String cmd = "\"" + java + "\" -jar " + jarFileName + " " + tunPort + " " + nxCmd; + ProcessBuilder pb = new ProcessBuilder( cmd ); + Map env = pb.environment(); + env.put("TPARAMS", params.get("tun")); + System.out.println("TPARAMS: " + params.get("tun")); + System.out.println(cmd); + pb.start(); + + } + + private boolean downloadJar() + { + return util.download(baseUrl, "2", jarFileName); + } + +} diff --git a/nxtuntransport/src/es/virtualcable/nx/util.java b/nxtuntransport/src/es/virtualcable/nx/util.java new file mode 100644 index 000000000..b377782cf --- /dev/null +++ b/nxtuntransport/src/es/virtualcable/nx/util.java @@ -0,0 +1,49 @@ +package es.virtualcable.nx; + +import java.io.BufferedInputStream; +import java.io.IOException; +import java.io.InputStream; + +public class util { + + public static boolean download(String baseUrl, String id, String outputFileName) + { + try { + java.net.URL u = new java.net.URL(baseUrl + id); + java.net.URLConnection uc = u.openConnection(); + String contentType = uc.getContentType(); + int contentLength = uc.getContentLength(); + if (contentType.startsWith("text/") || contentLength == -1) { + throw new IOException("This is not a binary file."); + } + InputStream raw = uc.getInputStream(); + InputStream in = new BufferedInputStream(raw); + byte[] data = new byte[contentLength]; + int bytesRead = 0; + int offset = 0; + while (offset < contentLength) { + bytesRead = in.read(data, offset, data.length - offset); + if (bytesRead == -1) + break; + offset += bytesRead; + } + in.close(); + + if (offset != contentLength) { + throw new IOException("Only read " + offset + " bytes; Expected " + contentLength + " bytes"); + } + + java.io.FileOutputStream out = new java.io.FileOutputStream(outputFileName); + out.write(data); + out.flush(); + out.close(); + + } catch(Exception e) { + System.out.println("Unable to download component, already present or network error? " + e.getMessage()); + return false; + } + return true; + } + + +} diff --git a/nxtuntransport/src/es/virtualcable/windows/WinRegistry.java b/nxtuntransport/src/es/virtualcable/windows/WinRegistry.java new file mode 100644 index 000000000..cd9ff892a --- /dev/null +++ b/nxtuntransport/src/es/virtualcable/windows/WinRegistry.java @@ -0,0 +1,392 @@ +package es.virtualcable.windows; + +/* Code borrowed from http://stackoverflow.com/questions/62289/read-write-to-windows-registry-using-java. */ +/* Original author don't found, if someone found him, please note it here */ + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.HashMap; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; +import java.util.prefs.Preferences; + +public class WinRegistry { + public static final int HKEY_CURRENT_USER = 0x80000001; + public static final int HKEY_LOCAL_MACHINE = 0x80000002; + public static final int REG_SUCCESS = 0; + public static final int REG_NOTFOUND = 2; + public static final int REG_ACCESSDENIED = 5; + + private static final int KEY_ALL_ACCESS = 0xf003f; + private static final int KEY_READ = 0x20019; + private static Preferences userRoot = Preferences.userRoot(); + private static Preferences systemRoot = Preferences.systemRoot(); + + private static Class userClass = userRoot.getClass(); + private static Method regOpenKey = null; + private static Method regCloseKey = null; + private static Method regQueryValueEx = null; + private static Method regEnumValue = null; + private static Method regQueryInfoKey = null; + private static Method regEnumKeyEx = null; + private static Method regCreateKeyEx = null; + private static Method regSetValueEx = null; + private static Method regDeleteKey = null; + private static Method regDeleteValue = null; + + static { + try { + regOpenKey = userClass.getDeclaredMethod("WindowsRegOpenKey", + new Class[] { int.class, byte[].class, int.class }); + regOpenKey.setAccessible(true); + regCloseKey = userClass.getDeclaredMethod("WindowsRegCloseKey", + new Class[] { int.class }); + regCloseKey.setAccessible(true); + regQueryValueEx = userClass.getDeclaredMethod("WindowsRegQueryValueEx", + new Class[] { int.class, byte[].class }); + regQueryValueEx.setAccessible(true); + regEnumValue = userClass.getDeclaredMethod("WindowsRegEnumValue", + new Class[] { int.class, int.class, int.class }); + regEnumValue.setAccessible(true); + regQueryInfoKey = userClass.getDeclaredMethod("WindowsRegQueryInfoKey1", + new Class[] { int.class }); + regQueryInfoKey.setAccessible(true); + regEnumKeyEx = userClass.getDeclaredMethod( + "WindowsRegEnumKeyEx", new Class[] { int.class, int.class, + int.class }); + regEnumKeyEx.setAccessible(true); + regCreateKeyEx = userClass.getDeclaredMethod( + "WindowsRegCreateKeyEx", new Class[] { int.class, + byte[].class }); + regCreateKeyEx.setAccessible(true); + regSetValueEx = userClass.getDeclaredMethod( + "WindowsRegSetValueEx", new Class[] { int.class, + byte[].class, byte[].class }); + regSetValueEx.setAccessible(true); + regDeleteValue = userClass.getDeclaredMethod( + "WindowsRegDeleteValue", new Class[] { int.class, + byte[].class }); + regDeleteValue.setAccessible(true); + regDeleteKey = userClass.getDeclaredMethod( + "WindowsRegDeleteKey", new Class[] { int.class, + byte[].class }); + regDeleteKey.setAccessible(true); + } + catch (Exception e) { + e.printStackTrace(); + } + } + + private WinRegistry() { } + + /** + * Read a value from key and value name + * @param hkey HKEY_CURRENT_USER/HKEY_LOCAL_MACHINE + * @param key + * @param valueName + * @return the value + * @throws IllegalArgumentException + * @throws IllegalAccessException + * @throws InvocationTargetException + */ + public static String readString(int hkey, String key, String valueName) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException + { + if (hkey == HKEY_LOCAL_MACHINE) { + return readString(systemRoot, hkey, key, valueName); + } + else if (hkey == HKEY_CURRENT_USER) { + return readString(userRoot, hkey, key, valueName); + } + else { + throw new IllegalArgumentException("hkey=" + hkey); + } + } + + /** + * Read value(s) and value name(s) form given key + * @param hkey HKEY_CURRENT_USER/HKEY_LOCAL_MACHINE + * @param key + * @return the value name(s) plus the value(s) + * @throws IllegalArgumentException + * @throws IllegalAccessException + * @throws InvocationTargetException + */ + public static Map readStringValues(int hkey, String key) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException + { + if (hkey == HKEY_LOCAL_MACHINE) { + return readStringValues(systemRoot, hkey, key); + } + else if (hkey == HKEY_CURRENT_USER) { + return readStringValues(userRoot, hkey, key); + } + else { + throw new IllegalArgumentException("hkey=" + hkey); + } + } + + /** + * Read the value name(s) from a given key + * @param hkey HKEY_CURRENT_USER/HKEY_LOCAL_MACHINE + * @param key + * @return the value name(s) + * @throws IllegalArgumentException + * @throws IllegalAccessException + * @throws InvocationTargetException + */ + public static List readStringSubKeys(int hkey, String key) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException + { + if (hkey == HKEY_LOCAL_MACHINE) { + return readStringSubKeys(systemRoot, hkey, key); + } + else if (hkey == HKEY_CURRENT_USER) { + return readStringSubKeys(userRoot, hkey, key); + } + else { + throw new IllegalArgumentException("hkey=" + hkey); + } + } + + /** + * Create a key + * @param hkey HKEY_CURRENT_USER/HKEY_LOCAL_MACHINE + * @param key + * @throws IllegalArgumentException + * @throws IllegalAccessException + * @throws InvocationTargetException + */ + public static void createKey(int hkey, String key) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException + { + int [] ret; + if (hkey == HKEY_LOCAL_MACHINE) { + ret = createKey(systemRoot, hkey, key); + regCloseKey.invoke(systemRoot, new Object[] { new Integer(ret[0]) }); + } + else if (hkey == HKEY_CURRENT_USER) { + ret = createKey(userRoot, hkey, key); + regCloseKey.invoke(userRoot, new Object[] { new Integer(ret[0]) }); + } + else { + throw new IllegalArgumentException("hkey=" + hkey); + } + if (ret[1] != REG_SUCCESS) { + throw new IllegalArgumentException("rc=" + ret[1] + " key=" + key); + } + } + + /** + * Write a value in a given key/value name + * @param hkey + * @param key + * @param valueName + * @param value + * @throws IllegalArgumentException + * @throws IllegalAccessException + * @throws InvocationTargetException + */ + public static void writeStringValue + (int hkey, String key, String valueName, String value) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException + { + if (hkey == HKEY_LOCAL_MACHINE) { + writeStringValue(systemRoot, hkey, key, valueName, value); + } + else if (hkey == HKEY_CURRENT_USER) { + writeStringValue(userRoot, hkey, key, valueName, value); + } + else { + throw new IllegalArgumentException("hkey=" + hkey); + } + } + + /** + * Delete a given key + * @param hkey + * @param key + * @throws IllegalArgumentException + * @throws IllegalAccessException + * @throws InvocationTargetException + */ + public static void deleteKey(int hkey, String key) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException + { + int rc = -1; + if (hkey == HKEY_LOCAL_MACHINE) { + rc = deleteKey(systemRoot, hkey, key); + } + else if (hkey == HKEY_CURRENT_USER) { + rc = deleteKey(userRoot, hkey, key); + } + if (rc != REG_SUCCESS) { + throw new IllegalArgumentException("rc=" + rc + " key=" + key); + } + } + + /** + * delete a value from a given key/value name + * @param hkey + * @param key + * @param value + * @throws IllegalArgumentException + * @throws IllegalAccessException + * @throws InvocationTargetException + */ + public static void deleteValue(int hkey, String key, String value) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException + { + int rc = -1; + if (hkey == HKEY_LOCAL_MACHINE) { + rc = deleteValue(systemRoot, hkey, key, value); + } + else if (hkey == HKEY_CURRENT_USER) { + rc = deleteValue(userRoot, hkey, key, value); + } + if (rc != REG_SUCCESS) { + throw new IllegalArgumentException("rc=" + rc + " key=" + key + " value=" + value); + } + } + + // ===================== + + private static int deleteValue + (Preferences root, int hkey, String key, String value) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException + { + int[] handles = (int[]) regOpenKey.invoke(root, new Object[] { + new Integer(hkey), toCstr(key), new Integer(KEY_ALL_ACCESS) }); + if (handles[1] != REG_SUCCESS) { + return handles[1]; // can be REG_NOTFOUND, REG_ACCESSDENIED + } + int rc =((Integer) regDeleteValue.invoke(root, + new Object[] { + new Integer(handles[0]), toCstr(value) + })).intValue(); + regCloseKey.invoke(root, new Object[] { new Integer(handles[0]) }); + return rc; + } + + private static int deleteKey(Preferences root, int hkey, String key) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException + { + int rc =((Integer) regDeleteKey.invoke(root, + new Object[] { new Integer(hkey), toCstr(key) })).intValue(); + return rc; // can REG_NOTFOUND, REG_ACCESSDENIED, REG_SUCCESS + } + + private static String readString(Preferences root, int hkey, String key, String value) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException + { + int[] handles = (int[]) regOpenKey.invoke(root, new Object[] { + new Integer(hkey), toCstr(key), new Integer(KEY_READ) }); + if (handles[1] != REG_SUCCESS) { + return null; + } + byte[] valb = (byte[]) regQueryValueEx.invoke(root, new Object[] { + new Integer(handles[0]), toCstr(value) }); + regCloseKey.invoke(root, new Object[] { new Integer(handles[0]) }); + return (valb != null ? new String(valb).trim() : null); + } + + private static Map readStringValues + (Preferences root, int hkey, String key) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException + { + HashMap results = new HashMap(); + int[] handles = (int[]) regOpenKey.invoke(root, new Object[] { + new Integer(hkey), toCstr(key), new Integer(KEY_READ) }); + if (handles[1] != REG_SUCCESS) { + return null; + } + int[] info = (int[]) regQueryInfoKey.invoke(root, + new Object[] { new Integer(handles[0]) }); + + int count = info[2]; // count + int maxlen = info[3]; // value length max + for(int index=0; index readStringSubKeys + (Preferences root, int hkey, String key) + throws IllegalArgumentException, IllegalAccessException, + InvocationTargetException + { + List results = new ArrayList(); + int[] handles = (int[]) regOpenKey.invoke(root, new Object[] { + new Integer(hkey), toCstr(key), new Integer(KEY_READ) + }); + if (handles[1] != REG_SUCCESS) { + return null; + } + int[] info = (int[]) regQueryInfoKey.invoke(root, + new Object[] { new Integer(handles[0]) }); + + int count = info[2]; // count + int maxlen = info[3]; // value length max + for(int index=0; index + + + + + diff --git a/rdptransport/java/.project b/rdptransport/java/.project new file mode 100644 index 000000000..fb728e4c4 --- /dev/null +++ b/rdptransport/java/.project @@ -0,0 +1,17 @@ + + + rdp + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/rdptransport/java/.settings/org.eclipse.core.resources.prefs b/rdptransport/java/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..2db27b5bf --- /dev/null +++ b/rdptransport/java/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +#Wed Dec 28 00:15:05 CET 2011 +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/rdptransport/java/.settings/org.eclipse.mylyn.tasks.ui.prefs b/rdptransport/java/.settings/org.eclipse.mylyn.tasks.ui.prefs new file mode 100644 index 000000000..1a79ace0a --- /dev/null +++ b/rdptransport/java/.settings/org.eclipse.mylyn.tasks.ui.prefs @@ -0,0 +1,4 @@ +#Tue Jan 03 02:53:59 CET 2012 +eclipse.preferences.version=1 +project.repository.kind=mantis +project.repository.url=http\://192.168.0.6/mantis diff --git a/rdptransport/java/descrdp.jardesc b/rdptransport/java/descrdp.jardesc new file mode 100644 index 000000000..bc09190ff --- /dev/null +++ b/rdptransport/java/descrdp.jardesc @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/rdptransport/java/description.jardesc b/rdptransport/java/description.jardesc new file mode 100644 index 000000000..580985655 --- /dev/null +++ b/rdptransport/java/description.jardesc @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/rdptransport/java/jar/rdp.jar b/rdptransport/java/jar/rdp.jar new file mode 100644 index 000000000..57828b99f Binary files /dev/null and b/rdptransport/java/jar/rdp.jar differ diff --git a/rdptransport/java/src/RdpApplet.java b/rdptransport/java/src/RdpApplet.java new file mode 100644 index 000000000..1d221366d --- /dev/null +++ b/rdptransport/java/src/RdpApplet.java @@ -0,0 +1,135 @@ + +import java.applet.*; +import java.awt.*; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.Hashtable; +import es.virtualcable.rdp.LinuxApplet; +import es.virtualcable.rdp.OsApplet; +import es.virtualcable.rdp.WindowsApplet; +import es.virtualcable.rdp.MacApplet; + +public class RdpApplet extends Applet { + /** + * + */ + private static final long serialVersionUID = -7930346560654300533L; + //private int width; + //private int height; + private OsApplet applet; + private String appletStr = "UDS RDP Connector"; + + public void init() { + //width = getSize().width; + //height = getSize().height; + setBackground(Color.lightGray); + + try { + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + try { + String os = System.getProperty("os.name"); + if( os.startsWith("Windows") ) + applet = new WindowsApplet(); + else if( os.startsWith("Linux")) + applet = new LinuxApplet(); + else if (os.startsWith("Mac")) + applet = new MacApplet(); + else + throw new Exception("Invalid os!!!"); + + Hashtable params = parseParams(unscramble(getParameter("data"))); + String baseUrl = getCodeBase().toString(); + if( params.get("tun") != null ) + appletStr = "UDS RDP Tunnel Connector"; + + Dimension scrSize = Toolkit.getDefaultToolkit().getScreenSize(); + + applet.setParameters(params, baseUrl, scrSize.width, scrSize.height); + applet.init(); + + return null; // nothing to return + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + }); + } catch (Exception e) { + e.printStackTrace(); + } + + } + + public void start() { + try { + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + try { + applet.start(); + return null; // nothing to return + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + }); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public void destroy() { + try { + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + try { + applet.destroy(); + return null; // nothing to return + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + }); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public void paint(Graphics g) { + g.setColor(Color.black); + g.drawString(appletStr, 8, 16); + } + + private Hashtable parseParams(String params) + { + Hashtable res = new Hashtable(); + String[] parms = params.split("\t"); + for( int i = 0; i < parms.length; i++) { + String[] val = parms[i].split(":"); + if( val.length == 1 ) + res.put(val[0], ""); + else + res.put(val[0], val[1]); + } + return res; + } + + private String unscramble(String in) + { + int len = in.length(); + StringBuilder res = new StringBuilder(len/2); + int val = 0x32; + for( int i = 0; i < len; i += 2) { + String b = in.substring(i, i+2); + int c = Integer.parseInt(b, 16)^val; + val = (val + c) & 0xFF; + res.append((char)c); + } + + return res.reverse().toString(); + } + + +} diff --git a/rdptransport/java/src/es/virtualcable/rdp/FreePortFinder.java b/rdptransport/java/src/es/virtualcable/rdp/FreePortFinder.java new file mode 100644 index 000000000..1e5f8b16a --- /dev/null +++ b/rdptransport/java/src/es/virtualcable/rdp/FreePortFinder.java @@ -0,0 +1,40 @@ +package es.virtualcable.rdp; + +import java.io.IOException; +import java.net.*; +import java.util.Random; + + +public class FreePortFinder { + + private final static int START_PORT = 35000; + private final static int START_PORT_MAX = 44000; + private final static int END_PORT = 45500; + + public static boolean isFree(int port) + { + boolean free = true; + try { + InetAddress addr = InetAddress.getByName("localhost"); + SocketAddress sa = new InetSocketAddress(addr, port); + ServerSocket socket = new ServerSocket(); + socket.bind(sa); + socket.close(); + } catch (IOException e) { + free = false; + } + return free; + } + + public static int findFreePort() + { + Random rnd = new Random(); + int startPort = START_PORT + rnd.nextInt(START_PORT_MAX-START_PORT); + for( int port = startPort; port < END_PORT; port ++) + { + if( isFree(port) ) + return port; + } + return -1; + } +} diff --git a/rdptransport/java/src/es/virtualcable/rdp/LinuxApplet.java b/rdptransport/java/src/es/virtualcable/rdp/LinuxApplet.java new file mode 100644 index 000000000..5d1a2263e --- /dev/null +++ b/rdptransport/java/src/es/virtualcable/rdp/LinuxApplet.java @@ -0,0 +1,187 @@ +package es.virtualcable.rdp; + +import java.io.File; +import java.util.ArrayList; +import java.util.Hashtable; +import java.util.Map; +import java.util.UUID; + +public class LinuxApplet implements OsApplet { + private final String[] paths = { "/usr/local/bin/", "/usr/bin/" }; + private final String rdesktop = "rdesktop"; + + private Hashtable params; + private String jarFileName = ""; + private String tmpDir = ""; + private String baseUrl = ""; + private String tunPort = ""; + + private void addParameterIfNotEmpty(ArrayList exec, String param, String value) + { + if( value.length() == 0 ) + return; + if( param.indexOf(' ') != -1 ) + exec.add( param + "\"" + value + "\""); + else + exec.add(param + value); + } + + public void start() { + try { + String colors = params.get("c"); + String width = params.get("w"); + String height = params.get("h"); + String server = params.get("s"); // Server + String user = params.get("u"); // User + String password = params.get("p"); // password + String domain = params.get("d"); // domain + + tmpDir = System.getProperty("java.io.tmpdir") + File.separator; + jarFileName = tmpDir + UUID.randomUUID().toString() + ".jar"; + + boolean redirectSmartcards = params.get("sc").equals("1"); + boolean redirectDrives = params.get("dr").equals("1"); + boolean redirectSerials = params.get("se").equals("1"); + boolean redirectPrinters = params.get("pr").equals("1"); + boolean redirectAudio = params.get("au").equals("1"); + boolean compression = params.get("cr").equals("1"); + + String home = System.getProperty("user.home"); + + ArrayList exec = new ArrayList(); + + if(params.get("tun") != null) + { + if( downloadJar() == false) + return; + tunPort = Integer.toString(FreePortFinder.findFreePort()); + server = "localhost:" + tunPort; + String java = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java"; + exec.add(java); exec.add("-jar"); exec.add(jarFileName); exec.add(tunPort); + } + + String execPath = ""; + + for(int i = 0; i < paths.length; i++ ) + { + File f = new File(paths[i] + rdesktop); + if( f.exists() ) + { + execPath = paths[i] + rdesktop; + break; + } + } + + if( execPath.length() == 0 ) + { + javax.swing.JOptionPane.showMessageDialog(null, "Can't find rdesktop client.\nShould be at /usr/bin or /usr/local/bin\nPlease, install it"); + return; + } + + exec.add(execPath); + + addParameterIfNotEmpty(exec, "-u", user); + addParameterIfNotEmpty(exec, "-d", domain); + if( password.length() != 0 ) + exec.add("-p-"); + addParameterIfNotEmpty(exec, "-a", colors); + if( width.equals("-1") ) + exec.add("-f"); + else + exec.add("-g" + width + "x" + height); + + exec.add("-TUDS-RDP"); + exec.add("-P"); + + if( redirectSmartcards ) + { + } + + if( compression ) + { + exec.add("-z"); + } + + if( redirectDrives ) + exec.add("-rdisk:home=\"" + home + "\""); + + if( redirectAudio ) + exec.add("-rsound:local"); + else + exec.add("-rsound:off"); + + if( redirectSerials ) + exec.add("-rcomport:COM1=/dev/ttyS0"); + + if( redirectPrinters ) // Will have to look at local cups to find printer + { + } + + exec.add(server); + +/* Iterator it = exec.iterator(); + while( it.hasNext()) { + System.out.print(it.next() + " "); + } + System.out.println(); +*/ + Process p; + try { + ProcessBuilder pb = new ProcessBuilder(exec); + if( params.get("tun") != null) + { + Map env = pb.environment(); + env.put("TPARAMS", params.get("tun")); + //System.out.println("TPARAMS: " + params.get("tun")); + } + p = pb.start(); + } catch(Exception e) { + javax.swing.JOptionPane.showMessageDialog(null,"Exception launching " + execPath + ":\n" + e.getMessage()); + e.printStackTrace(); + return; + } + + if( password.length() != 0 ) + { + try { + p.getOutputStream().write(password.getBytes()); + p.getOutputStream().write( new byte[]{'\n'} ); + p.getOutputStream().flush(); + } + catch( Exception e ) { + javax.swing.JOptionPane.showMessageDialog(null,"Exception communicating with " + execPath + ":\n" + e.getMessage()); + return; + + } + } + } + catch(Exception e) + { + javax.swing.JOptionPane.showMessageDialog(null,"Exception at applet:\n" + e.getMessage()); + e.printStackTrace(); + return; + } + + + } + + public void init() { + + } + + public void destroy() { + + } + + public void setParameters(Hashtable parameters, + String urlBase, int screenWidth, int screenHeight) { + params = parameters; + baseUrl = urlBase; + } + + private boolean downloadJar() + { + return util.download(baseUrl, "3", jarFileName); + } + +} diff --git a/rdptransport/java/src/es/virtualcable/rdp/MacApplet.java b/rdptransport/java/src/es/virtualcable/rdp/MacApplet.java new file mode 100644 index 000000000..ee20ab2cd --- /dev/null +++ b/rdptransport/java/src/es/virtualcable/rdp/MacApplet.java @@ -0,0 +1,206 @@ +package es.virtualcable.rdp; + +import java.io.File; +import java.util.ArrayList; +import java.util.Hashtable; +import java.util.Map; +import java.util.UUID; + +public class MacApplet implements OsApplet { + private final String[] paths = { "/usr/bin/" }; + private final String open = "open"; + private final String cordPath = "/Applications/CoRD.app/Contents/MacOS/CoRD"; + + private Hashtable params; + private String jarFileName = ""; + private String tmpDir = ""; + private String baseUrl = ""; + private String tunPort = ""; + + private String convSpaces(String value) + { + final String weird = "$#$_$#$"; + if( value == null || value.isEmpty()) + return ""; + String res = value.replaceAll(" ", "%20"); + res = res.replaceAll("&", weird); + return res.replaceAll(weird, "&"); + } + + private void Cord(ArrayList exec, String user, String password, String server, + String domain, String colors, String width, String height, boolean redirectAudio, + boolean redirectSmartcards, boolean redirectDrives, + boolean redirectSerials, boolean redirectPrinters) + { + String url = "rdp://"; + + if(!user.isEmpty()) { + url += user; + if(!password.isEmpty()) + url += ":" + password; + url += "@"; + } + + url += server + "/"; + if(!domain.isEmpty()) + url += domain; + url += "?screenDepth=" + colors + "&"; + if(width.equals("-1")) + url += "fullscreen=true"; + else + url += "screenWidth="+width+"&screenHeight="+height; + + url += "&forwardAudio="; + + if( redirectAudio ) + url += "0"; + else + url += "1"; + + if( redirectSmartcards ) // Not supported by Cord + { + } + + if( redirectDrives ) + url += "&forwardDisks=true"; + + if( redirectSerials ) + { + } + + if( redirectPrinters ) + url += "&forwardPrinters=true"; + + exec.add(url); + + } + + public void start() { + try { + String colors = params.get("c"); + String width = params.get("w"); + String height = params.get("h"); + String server = params.get("s"); // Server + String user = convSpaces(params.get("u")); // User + String password = convSpaces(params.get("p")); // password + String domain = convSpaces(params.get("d")); // domain + + tmpDir = System.getProperty("java.io.tmpdir") + File.separator; + jarFileName = tmpDir + UUID.randomUUID().toString() + ".jar"; + + boolean redirectSmartcards = params.get("sc").equals("1"); + boolean redirectDrives = params.get("dr").equals("1"); + boolean redirectSerials = params.get("se").equals("1"); + boolean redirectPrinters = params.get("pr").equals("1"); + boolean redirectAudio = params.get("au").equals("1"); + //boolean compression = params.get("cr").equals("1"); + + //String home = System.getProperty("user.home"); + + ArrayList exec = new ArrayList(); + + if(params.get("tun") != null) + { + if( downloadJar() == false) + return; + tunPort = Integer.toString(FreePortFinder.findFreePort()); + server = "127.0.0.1:" + tunPort; + String java = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java"; + exec.add(java); exec.add("-jar"); exec.add(jarFileName); exec.add(tunPort); + } + + String execPath = ""; + + for(int i = 0; i < paths.length; i++ ) + { + File f = new File(paths[i] + open); + if( f.exists() ) + { + execPath = paths[i] + open; + break; + } + } + + if(( new File(cordPath)).exists() == false ) + { + javax.swing.JOptionPane.showMessageDialog(null, "Can't find CoRD client. Please, install it before proceeding."); + return; + } + + if( execPath.length() == 0 ) + { + javax.swing.JOptionPane.showMessageDialog(null, "Can't find rdesktop client.\nShould be at /usr/bin or /usr/local/bin\nPlease, install it"); + return; + } + + exec.add(execPath); + + Cord(exec, user, password, server, domain, colors, width, height, redirectAudio, redirectSmartcards, + redirectDrives, redirectSerials, redirectPrinters); + +/* Iterator it = exec.iterator(); + while( it.hasNext()) { + System.out.print(it.next() + " "); + } + System.out.println(); +*/ + Process p; + try { + ProcessBuilder pb = new ProcessBuilder(exec); + if( params.get("tun") != null) + { + Map env = pb.environment(); + env.put("TPARAMS", params.get("tun")); + //System.out.println("TPARAMS: " + params.get("tun")); + } + p = pb.start(); + } catch(Exception e) { + javax.swing.JOptionPane.showMessageDialog(null,"Exception launching " + execPath + ":\n" + e.getMessage()); + e.printStackTrace(); + return; + } + + if( password.length() != 0 ) + { + try { + p.getOutputStream().write(password.getBytes()); + p.getOutputStream().write( new byte[]{'\n'} ); + p.getOutputStream().flush(); + } + catch( Exception e ) { + javax.swing.JOptionPane.showMessageDialog(null,"Exception communicating with " + execPath + ":\n" + e.getMessage()); + return; + + } + } + } + catch(Exception e) + { + javax.swing.JOptionPane.showMessageDialog(null,"Exception at applet:\n" + e.getMessage()); + e.printStackTrace(); + return; + } + + + } + + public void init() { + + } + + public void destroy() { + + } + + public void setParameters(Hashtable parameters, + String urlBase, int screenWidth, int screenHeight) { + params = parameters; + baseUrl = urlBase; + } + + private boolean downloadJar() + { + return util.download(baseUrl, "3", jarFileName); + } + +} diff --git a/rdptransport/java/src/es/virtualcable/rdp/OsApplet.java b/rdptransport/java/src/es/virtualcable/rdp/OsApplet.java new file mode 100644 index 000000000..ef3f41814 --- /dev/null +++ b/rdptransport/java/src/es/virtualcable/rdp/OsApplet.java @@ -0,0 +1,15 @@ +package es.virtualcable.rdp; + +import java.util.Hashtable; + +public interface OsApplet { + + void setParameters(Hashtable parameters, String urlBase, int screenWidth, int screenHeight); + + void init(); + + void start(); + + void destroy(); + +} diff --git a/rdptransport/java/src/es/virtualcable/rdp/WinRdpFile.java b/rdptransport/java/src/es/virtualcable/rdp/WinRdpFile.java new file mode 100644 index 000000000..97a550f7a --- /dev/null +++ b/rdptransport/java/src/es/virtualcable/rdp/WinRdpFile.java @@ -0,0 +1,94 @@ +package es.virtualcable.rdp; + +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import net.sourceforge.jdpapi.DataProtector; + +public class WinRdpFile { + public String width; + public String height; + public boolean fullScreen; + public String bpp; + public String address = ""; + public String username = ""; + public String domain = ""; + public String password = ""; + public boolean redirectSerials = false; + public boolean redirectPrinters = false; + public boolean redirectDrives = false; + public boolean redirectSmartcards = false; + public boolean redirectAudio = false; + public boolean compression = false; + + public WinRdpFile(boolean fullScreen, String width, String height, String bpp) { + this.width = width; + this.height = height; + this.bpp = bpp; + this.fullScreen = fullScreen; + } + + public void saveFile(String fname) throws IOException { + DataProtector d = new DataProtector(true); + String pass = encode(d.protect(this.password)); + String screenMode = fullScreen ? "2" : "1"; + String audioMode = redirectAudio ? "0" : "2"; + String serials = redirectSerials ? "1" : "0"; + String drives = redirectDrives ? "1" : "0"; + String scards = redirectSmartcards ? "1" : "0"; + String printers = redirectPrinters ? "1" : "0"; + String compression = this.compression ? "1" : "0"; + + FileWriter fstream = new FileWriter(fname); + PrintWriter out = new PrintWriter(fstream); + out.println("screen mode id:i:" + screenMode); + out.println("desktopwidth:i:"+this.width); + out.println("desktopheight:i:"+this.height); + out.println("session bpp:i:"+this.bpp); + out.println("auto connect:i:1"); + out.println("full address:s:"+this.address); + out.println("compression:i:"+compression); + out.println("keyboardhook:i:2"); + out.println("audiomode:i:"+audioMode); + out.println("redirectdrives:i:" + drives); + out.println("redirectprinters:i:" + printers); + out.println("redirectcomports:i:" + serials); + out.println("redirectsmartcards:i:" + scards); + out.println("redirectclipboard:i:1"); + out.println("displayconnectionbar:i:0"); + if( this.username.length() != 0) { + out.println("username:s:"+this.username); + out.println("domain:s:"+this.domain); + out.println("password 51:b:"+pass); + } + out.println("alternate shell:s:"); + out.println("shell working directory:s:"); + out.println("disable wallpaper:i:1"); + out.println("disable full window drag:i:1"); + out.println("disable menu anims:i:1"); + out.println("disable themes:i:1"); + out.println("bitmapcachepersistenable:i:1"); + out.println("authentication level:i:0"); + out.println("enablecredsspsupport:i:1"); + out.println("prompt for credentials:i:0"); + out.println("negotiate security layer:i:1"); + out.close(); + } + + protected static final byte[] Hexhars = { + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; + + public static String encode(byte[] b) { + + StringBuilder s = new StringBuilder(2 * b.length); + for (int i = 0; i < b.length; i++) { + int v = b[i] & 0xff; + s.append((char) Hexhars[v >> 4]); + s.append((char) Hexhars[v & 0xf]); + } + + return s.toString(); + } + +} diff --git a/rdptransport/java/src/es/virtualcable/rdp/WindowsApplet.java b/rdptransport/java/src/es/virtualcable/rdp/WindowsApplet.java new file mode 100644 index 000000000..07a367f53 --- /dev/null +++ b/rdptransport/java/src/es/virtualcable/rdp/WindowsApplet.java @@ -0,0 +1,133 @@ +package es.virtualcable.rdp; + +import java.io.File; +import java.io.IOException; +import java.util.Hashtable; +import java.util.Map; +import java.util.UUID; + +import es.virtualcable.rdp.util; + +public class WindowsApplet implements OsApplet { + + private static final String MSTSC_CMD = "c:\\windows\\system32\\mstsc.exe"; + + private Hashtable params; + private String scrWidth; + private String scrHeight; + private String tmpDir = ""; + private String rdpFileName = ""; + private String dllFileName = ""; + private String jarFileName = ""; + private String baseUrl = ""; + private String tunPort = ""; + + public void setParameters(Hashtable parameters, String urlBase, + int screenWidth, int screenHeight) { + params = parameters; + baseUrl = urlBase; + scrWidth = Integer.toString(screenWidth); + scrHeight = Integer.toString(screenHeight); + } + + public void start() { + try { + tmpDir = System.getProperty("java.io.tmpdir") + File.separator; + rdpFileName = tmpDir + UUID.randomUUID().toString() + ".tmp"; + dllFileName = tmpDir + UUID.randomUUID().toString() + ".tmp"; + jarFileName = tmpDir + UUID.randomUUID().toString() + ".jar"; + if( downloadDll() == false ) + return; + + if(params.get("tun") != null) + { + if( downloadJar() == false) + return; + tunPort = Integer.toString(FreePortFinder.findFreePort()); + } + + System.load(dllFileName); + + String width = params.get("w"); + String height = params.get("h"); + boolean fullScreen = false; + + if( width.equals("-1")) + { + width = scrWidth; + height = scrHeight; + fullScreen = true; + } + + WinRdpFile rdp = new WinRdpFile(fullScreen, width, height, params.get("c")); + if( params.get("tun") != null ) + { + rdp.address = "127.0.0.1:" + tunPort; + } + else + rdp.address = params.get("s"); // Server + rdp.username = params.get("u"); // User + rdp.password = params.get("p"); // password + rdp.domain = params.get("d"); // domain + rdp.redirectSmartcards = params.get("sc").equals("1"); + rdp.redirectDrives = params.get("dr").equals("1"); + rdp.redirectSerials = params.get("se").equals("1"); + rdp.redirectPrinters = params.get("pr").equals("1"); + rdp.redirectAudio = params.get("au").equals("1"); + rdp.compression = params.get("cr").equals("1"); + + try { + rdp.saveFile( rdpFileName ); + if( params.get("tun") != null ) + executeTunnel(); + else + executeDirect(); + + } catch (IOException e) { + e.printStackTrace(); + return; + } + + // Process p = + } catch (Exception e) { + javax.swing.JOptionPane.showMessageDialog(null,"Exception at applet:\n" + e.getMessage()); + e.printStackTrace(); + return; + } + } + + public void init() { + } + + public void destroy() { + } + + private void executeTunnel() throws IOException + { + String java = System.getProperty("java.home") + File.separator + "bin" + File.separator + "java.exe"; + String [] cmd = { java, "-jar", jarFileName, tunPort, MSTSC_CMD, rdpFileName }; + ProcessBuilder pb = new ProcessBuilder( cmd ); + Map env = pb.environment(); + env.put("TPARAMS", params.get("tun")); + //System.out.println("TPARAMS: " + params.get("tun")); + //System.out.println("java: " + java + " -jar " + jarFileName + " " + MSTSC_CMD + " " + rdpFileName); + pb.start(); + + } + + private void executeDirect() throws IOException + { + Runtime.getRuntime().exec( MSTSC_CMD + " \"" + rdpFileName + "\"" ); + } + + private boolean downloadDll() + { + return util.download(baseUrl, "2", dllFileName); + } + + private boolean downloadJar() + { + return util.download(baseUrl, "3", jarFileName); + } + +} diff --git a/rdptransport/java/src/es/virtualcable/rdp/util.java b/rdptransport/java/src/es/virtualcable/rdp/util.java new file mode 100644 index 000000000..44fcf65df --- /dev/null +++ b/rdptransport/java/src/es/virtualcable/rdp/util.java @@ -0,0 +1,49 @@ +package es.virtualcable.rdp; + +import java.io.BufferedInputStream; +import java.io.IOException; +import java.io.InputStream; + +public class util { + + public static boolean download(String baseUrl, String id, String outputFileName) + { + try { + java.net.URL u = new java.net.URL(baseUrl + id); + java.net.URLConnection uc = u.openConnection(); + String contentType = uc.getContentType(); + int contentLength = uc.getContentLength(); + if (contentType.startsWith("text/") || contentLength == -1) { + throw new IOException("This is not a binary file."); + } + InputStream raw = uc.getInputStream(); + InputStream in = new BufferedInputStream(raw); + byte[] data = new byte[contentLength]; + int bytesRead = 0; + int offset = 0; + while (offset < contentLength) { + bytesRead = in.read(data, offset, data.length - offset); + if (bytesRead == -1) + break; + offset += bytesRead; + } + in.close(); + + if (offset != contentLength) { + throw new IOException("Only read " + offset + " bytes; Expected " + contentLength + " bytes"); + } + + java.io.FileOutputStream out = new java.io.FileOutputStream(outputFileName); + out.write(data); + out.flush(); + out.close(); + + } catch(Exception e) { + System.out.println("Unable to download file, already present or network error? " + e.getMessage()); + return false; + } + return true; + } + + +} diff --git a/rdptransport/java/src/manifest b/rdptransport/java/src/manifest new file mode 100644 index 000000000..e3467bb08 --- /dev/null +++ b/rdptransport/java/src/manifest @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Sealed: true + diff --git a/rdptransport/java/src/net/sourceforge/jdpapi/DPAPI.java b/rdptransport/java/src/net/sourceforge/jdpapi/DPAPI.java new file mode 100644 index 000000000..95f651edf --- /dev/null +++ b/rdptransport/java/src/net/sourceforge/jdpapi/DPAPI.java @@ -0,0 +1,27 @@ +package net.sourceforge.jdpapi; + + +class DPAPI { + + /** + * See the CryptProtectData + * documentation for more details + * + * @param input Plaintext to encrypt + * @param entropy Additional entropy to include when encrypting (optional) + * @param localMachine If true, allow all users on the machine to decrypt the return ciphertext + * @return ciphertext + */ + static native byte [] CryptProtectData(String input, byte [] entropy, boolean localMachine); + + /** + * See the CryptUnprotectData + * documentation for more details + * + * @param input Ciphertext + * @param entropy Entropy that was included when {@code input} was encrypted + * @return + */ + static native String CryptUnprotectData(byte [] input, byte [] entropy); + +} \ No newline at end of file diff --git a/rdptransport/java/src/net/sourceforge/jdpapi/DPAPIException.java b/rdptransport/java/src/net/sourceforge/jdpapi/DPAPIException.java new file mode 100644 index 000000000..6bc5019a0 --- /dev/null +++ b/rdptransport/java/src/net/sourceforge/jdpapi/DPAPIException.java @@ -0,0 +1,28 @@ +package net.sourceforge.jdpapi; + +/** + * Exception that can be thrown from the native DPAPI + * + * @author Kevin Conaway + */ +public class DPAPIException extends RuntimeException { + + private static final long serialVersionUID = 1l; + + public DPAPIException() { + super(); + } + + public DPAPIException(String message, Throwable cause) { + super(message, cause); + } + + public DPAPIException(String message) { + super(message); + } + + public DPAPIException(Throwable cause) { + super(cause); + } + +} \ No newline at end of file diff --git a/rdptransport/java/src/net/sourceforge/jdpapi/DataProtector.java b/rdptransport/java/src/net/sourceforge/jdpapi/DataProtector.java new file mode 100644 index 000000000..7aed18083 --- /dev/null +++ b/rdptransport/java/src/net/sourceforge/jdpapi/DataProtector.java @@ -0,0 +1,75 @@ +package net.sourceforge.jdpapi; + +/** + *

An interface to the Microsoft Data Protection API (DPAPI).

+ * + *

See MSDN for more information

+ * + * @author Kevin Conaway + */ +public class DataProtector { + + private final byte [] entropy; + private final boolean localMachine; + + /** + * @param entropy Additional entropy to include when encrypting (optional) + * @param localMachine If true, allow all users on the machine to decrypt a given ciphertext + * + */ + public DataProtector(byte[] entropy, boolean localMachine) { + this.entropy = entropy; + this.localMachine = localMachine; + } + + /** + * @param entropy + * @see #DataProtector(byte[], boolean) + */ + public DataProtector(byte[] entropy) { + this(entropy, false); + } + + /** + * @param localMachine + * @see #DataProtector(byte[], boolean) + */ + public DataProtector(boolean localMachine) { + this(null, localMachine); + } + + /** + * Initializes the protector with no additional entropy + * and {@code localMachine} set to false + * @see #DataProtector(byte[], boolean) + */ + public DataProtector() { + this(false); + } + + /** + *

Protect {@code input} using the Microsoft DPAPI CryptProtectData function.

+ * + *

See the CryptProtectData + * documentation for more details

+ * + * @param input Plaintext to encrypt + * @return ciphertext + */ + public byte[] protect(String input) { + return DPAPI.CryptProtectData(input, entropy, localMachine); + } + + /** + *

Unprotect {@code input} using the Microsoft DPAPI CryptUnprotectData function.

+ * + *

See the CryptUnprotectData + * documentation for more details

+ * + * @param input Ciphertext + * @return Plaintext + */ + public String unprotect(byte [] input) { + return DPAPI.CryptUnprotectData(input, entropy); + } +} \ No newline at end of file diff --git a/rdptransport/rdppass.sln b/rdptransport/rdppass.sln new file mode 100644 index 000000000..a2057bce4 --- /dev/null +++ b/rdptransport/rdppass.sln @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual C++ Express 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rdppass", "rdppass\rdppass.vcxproj", "{93D07375-5BA0-4EE5-BE8F-68B0DF187BFF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testPass", "testPass\testPass.vcxproj", "{7616C72B-2571-4DF9-8BF7-8B32359CE489}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {93D07375-5BA0-4EE5-BE8F-68B0DF187BFF}.Debug|Win32.ActiveCfg = Debug|Win32 + {93D07375-5BA0-4EE5-BE8F-68B0DF187BFF}.Debug|Win32.Build.0 = Debug|Win32 + {93D07375-5BA0-4EE5-BE8F-68B0DF187BFF}.Release|Win32.ActiveCfg = Release|Win32 + {93D07375-5BA0-4EE5-BE8F-68B0DF187BFF}.Release|Win32.Build.0 = Release|Win32 + {7616C72B-2571-4DF9-8BF7-8B32359CE489}.Debug|Win32.ActiveCfg = Debug|Win32 + {7616C72B-2571-4DF9-8BF7-8B32359CE489}.Debug|Win32.Build.0 = Debug|Win32 + {7616C72B-2571-4DF9-8BF7-8B32359CE489}.Release|Win32.ActiveCfg = Release|Win32 + {7616C72B-2571-4DF9-8BF7-8B32359CE489}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/rdptransport/rdppass.suo b/rdptransport/rdppass.suo new file mode 100644 index 000000000..f282c90e8 Binary files /dev/null and b/rdptransport/rdppass.suo differ diff --git a/rdptransport/rdppass/ReadMe.txt b/rdptransport/rdppass/ReadMe.txt new file mode 100644 index 000000000..1068cbaaa --- /dev/null +++ b/rdptransport/rdppass/ReadMe.txt @@ -0,0 +1,54 @@ +======================================================================== + BIBLIOTECA DE VÍNCULOS DINÁMICOS: rdppass + Información general del proyecto +======================================================================== + +AppWizard ha creado este archivo DLL rdppass. + +Este archivo incluye un resumen acerca del contenido de los archivos que +constituyen su aplicación rdppass. + + +rdppass.vcxproj + Éste es el archivo de proyecto principal para los proyectos de VC++ + generados mediante un Asistente para aplicaciones. + Contiene información acerca de la versión de Visual C++ con la que + se generó el archivo, así como información acerca de las plataformas, + configuraciones y características del proyecto seleccionadas en el + asistente para aplicaciones. + +rdppass.vcxproj.filters + Éste es el archivo de filtros para los proyectos de VC++ generados + mediante un asistente para aplicaciones. + Contiene información acerca de la asociación entre los archivos de + un proyecto y los filtros. Esta asociación se usa en el IDE para mostrar + la agrupación de archivos con extensiones similares bajo un nodo + específico (por ejemplo, los archivos ".cpp" se asocian con el filtro + "Archivos de código fuente"). + +rdppass.cpp + Éste es el archivo de código fuente DLL principal. + + Cuando se crea este archivo DLL, no exporta símbolos. Por lo tanto, no + creará un archivo .lib cuando se genere. Si desea que este proyecto sea + una dependencia de otro proyecto, es preciso agregar código para exportar + algunos símbolos del archivo DLL para crear una biblioteca de exportación, + o establecer la propiedad Omitir biblioteca de entrada en Sí en la página + de propiedades General en la carpeta Vinculador del cuadro de diálogo + Páginas de propiedades del proyecto. + +///////////////////////////////////////////////////////////////////////////// +Otros archivos estándar: + +StdAfx.h, StdAfx.cpp + Estos archivos se utilizan para crear un archivo de encabezado precompilado + (PCH) denominado rdppass.pch y un archivo de tipos + precompilado denominado StdAfx.obj. + +///////////////////////////////////////////////////////////////////////////// +Otras notas: + +El asistente para aplicaciones utiliza comentarios "TODO:" para indicar las +partes del código fuente que tendrá que agregar o personalizar. + +///////////////////////////////////////////////////////////////////////////// diff --git a/rdptransport/rdppass/dllmain.cpp b/rdptransport/rdppass/dllmain.cpp new file mode 100644 index 000000000..8e7951c07 --- /dev/null +++ b/rdptransport/rdppass/dllmain.cpp @@ -0,0 +1,19 @@ +// dllmain.cpp : Define el punto de entrada de la aplicacin DLL. +#include "stdafx.h" + +BOOL APIENTRY DllMain( HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + diff --git a/rdptransport/rdppass/dpapi.cpp b/rdptransport/rdppass/dpapi.cpp new file mode 100644 index 000000000..6aecb6b83 --- /dev/null +++ b/rdptransport/rdppass/dpapi.cpp @@ -0,0 +1,133 @@ +#include "stdafx.h" +#include +#include +#include +#include +#include "net_sourceforge_jdpapi_DPAPI.h" + +void throwByName(JNIEnv *env, const char *name, const char *msg) { + jclass cls = env->FindClass(name); + /* if cls is NULL, an exception has already been thrown */ + if (cls != NULL) { + env->ThrowNew(cls, msg); + } + /* free the local ref */ + env->DeleteLocalRef(cls); + } + +void throwLastError(JNIEnv *env) { + DWORD errorCode = GetLastError(); + LPVOID buf; + + int messageFlags = FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS; + + FormatMessage(messageFlags, NULL, errorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &buf, 0, NULL); + + throwByName(env, "net/sourceforge/jdpapi/DPAPIException", (char *) buf); + LocalFree(buf); + } + +DWORD getFlags(jboolean useLocalMachine) { + DWORD flags = CRYPTPROTECT_UI_FORBIDDEN; + if (useLocalMachine) { + flags |= CRYPTPROTECT_LOCAL_MACHINE; + } + return flags; +} + +DATA_BLOB getBlobFromBytes(JNIEnv *env, jbyteArray bytes) { + DATA_BLOB result; + + if (bytes != NULL) { + result.pbData = (BYTE *) env->GetByteArrayElements(bytes, JNI_FALSE); + result.cbData = (DWORD) env->GetArrayLength(bytes); + } else { + result.pbData = NULL; + result.cbData = 0; + } + return result; +} + +void freeBytesFromBlob(JNIEnv *env, jbyteArray originalBytes, DATA_BLOB blob) { + if (originalBytes != NULL) { + env->ReleaseByteArrayElements(originalBytes, (jbyte*) blob.pbData, JNI_ABORT); + } +} + +jstring getJStringFromBlob(JNIEnv *env, DATA_BLOB blob) { + char * str = new char[blob.cbData + 1]; + memcpy(str, blob.pbData, blob.cbData); + str[blob.cbData] = NULL; + + jstring result = env->NewStringUTF(str); + + delete str; + LocalFree(blob.pbData); + + return result; +} + +jbyteArray getJByteArrayFromBlob(JNIEnv *env, DATA_BLOB blob) { + jbyteArray result = env->NewByteArray(blob.cbData); + env->SetByteArrayRegion(result, 0, blob.cbData, (jbyte *)blob.pbData); + + LocalFree(blob.pbData); + return result; +} + +DATA_BLOB getBlobFromJString(JNIEnv *env, jstring str) { + DATA_BLOB result; + + const jchar *nativeString = env->GetStringChars(str, 0); + jsize len = env->GetStringLength(str); + result.pbData = (BYTE *) nativeString; + result.cbData = (DWORD)len*sizeof(wchar_t); + + return result; +} + +void freeJStringFromBlob(JNIEnv *env, jstring original, DATA_BLOB blob) { + env->ReleaseStringChars(original, (const jchar *) blob.pbData); +} + +JNIEXPORT jbyteArray JNICALL Java_net_sourceforge_jdpapi_DPAPI_CryptProtectData + (JNIEnv *env, jclass clazz, jstring key, jbyteArray entropyBytes, jboolean useLocalMachine) { + + DATA_BLOB output; + DATA_BLOB input = getBlobFromJString(env, key); + DATA_BLOB entropy = getBlobFromBytes(env, entropyBytes); + +// BOOL completed = CryptProtectData(&input, L"psw", &entropy, NULL, NULL, getFlags(useLocalMachine), &output); + BOOL completed = CryptProtectData(&input, L"psw", NULL, NULL, NULL, CRYPTPROTECT_UI_FORBIDDEN, &output); + + freeBytesFromBlob(env, entropyBytes, entropy); + freeJStringFromBlob(env, key, input); + + if (!completed) { + throwLastError(env); + return NULL; + } + + return getJByteArrayFromBlob(env, output); +} + + +JNIEXPORT jstring JNICALL Java_net_sourceforge_jdpapi_DPAPI_CryptUnprotectData + (JNIEnv *env, jclass clazz, jbyteArray data, jbyteArray entropyBytes) { + + DATA_BLOB output; + DATA_BLOB input = getBlobFromBytes(env, data); + DATA_BLOB entropy = getBlobFromBytes(env, entropyBytes); + + BOOL completed = CryptUnprotectData(&input, (LPWSTR *) NULL, &entropy, NULL, NULL, getFlags(JNI_FALSE), &output); + + freeBytesFromBlob(env, entropyBytes, entropy); + freeBytesFromBlob(env, data, input); + + if (!completed) { + throwLastError(env); + return NULL; + } + + return getJStringFromBlob(env, output); +} \ No newline at end of file diff --git a/rdptransport/rdppass/net_sourceforge_jdpapi_DPAPI.h b/rdptransport/rdppass/net_sourceforge_jdpapi_DPAPI.h new file mode 100644 index 000000000..c36ca4dca --- /dev/null +++ b/rdptransport/rdppass/net_sourceforge_jdpapi_DPAPI.h @@ -0,0 +1,29 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class net_sourceforge_jdpapi_DPAPI */ + +#ifndef _Included_net_sourceforge_jdpapi_DPAPI +#define _Included_net_sourceforge_jdpapi_DPAPI +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: net_sourceforge_jdpapi_DPAPI + * Method: CryptProtectData + * Signature: (Ljava/lang/String;[BZ)[B + */ +JNIEXPORT jbyteArray JNICALL Java_net_sourceforge_jdpapi_DPAPI_CryptProtectData + (JNIEnv *, jclass, jstring, jbyteArray, jboolean); + +/* + * Class: net_sourceforge_jdpapi_DPAPI + * Method: CryptUnprotectData + * Signature: ([B[B)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_net_sourceforge_jdpapi_DPAPI_CryptUnprotectData + (JNIEnv *, jclass, jbyteArray, jbyteArray); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/rdptransport/rdppass/rdppass.cpp b/rdptransport/rdppass/rdppass.cpp new file mode 100644 index 000000000..633780da3 --- /dev/null +++ b/rdptransport/rdppass/rdppass.cpp @@ -0,0 +1,6 @@ +// rdppass.cpp: define las funciones exportadas de la aplicacin DLL. +// + +#include "stdafx.h" + + diff --git a/rdptransport/rdppass/rdppass.vcxproj b/rdptransport/rdppass/rdppass.vcxproj new file mode 100644 index 000000000..41714d2a3 --- /dev/null +++ b/rdptransport/rdppass/rdppass.vcxproj @@ -0,0 +1,107 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {93D07375-5BA0-4EE5-BE8F-68B0DF187BFF} + Win32Proj + rdppass + + + + DynamicLibrary + true + Unicode + + + DynamicLibrary + false + true + Unicode + Static + + + + + + + + + + + + + true + + + false + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;RDPPASS_EXPORTS;%(PreprocessorDefinitions) + C:\Program Files %28x86%29\Java\jdk1.5.0_22\include;C:\Program Files %28x86%29\Java\jdk1.5.0_22\include\win32;%(AdditionalIncludeDirectories) + + + Windows + true + crypt32.lib;%(AdditionalDependencies) + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;RDPPASS_EXPORTS;%(PreprocessorDefinitions) + C:\Program Files %28x86%29\Java\jdk1.5.0_22\include;C:\Program Files %28x86%29\Java\jdk1.5.0_22\include\win32;%(AdditionalIncludeDirectories) + + + Windows + true + true + true + crypt32.lib;%(AdditionalDependencies) + LinkVerbose + + + + + + + + + + + + + false + + + false + + + + + + + Create + Create + + + + + + \ No newline at end of file diff --git a/rdptransport/rdppass/rdppass.vcxproj.filters b/rdptransport/rdppass/rdppass.vcxproj.filters new file mode 100644 index 000000000..915022aba --- /dev/null +++ b/rdptransport/rdppass/rdppass.vcxproj.filters @@ -0,0 +1,45 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + Archivos de encabezado + + + Archivos de encabezado + + + Archivos de encabezado + + + + + Archivos de código fuente + + + Archivos de código fuente + + + Archivos de código fuente + + + Archivos de código fuente + + + \ No newline at end of file diff --git a/rdptransport/rdppass/rdppass.vcxproj.user b/rdptransport/rdppass/rdppass.vcxproj.user new file mode 100644 index 000000000..695b5c78b --- /dev/null +++ b/rdptransport/rdppass/rdppass.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/rdptransport/rdppass/stdafx.cpp b/rdptransport/rdppass/stdafx.cpp new file mode 100644 index 000000000..4b41d38e8 --- /dev/null +++ b/rdptransport/rdppass/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp: archivo de cdigo fuente que contiene slo las inclusiones estndar +// rdppass.pch ser el encabezado precompilado +// stdafx.obj contiene la informacin de tipos precompilada + +#include "stdafx.h" + +// TODO: mencionar los encabezados adicionales que se necesitan en STDAFX.H +// pero no en este archivo diff --git a/rdptransport/rdppass/stdafx.h b/rdptransport/rdppass/stdafx.h new file mode 100644 index 000000000..355b4a8c3 --- /dev/null +++ b/rdptransport/rdppass/stdafx.h @@ -0,0 +1,16 @@ +// stdafx.h: archivo de inclusin de los archivos de inclusin estndar del sistema +// o archivos de inclusin especficos de un proyecto utilizados frecuentemente, +// pero rara vez modificados +// + +#pragma once + +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN // Excluir material rara vez utilizado de encabezados de Windows +// Archivos de encabezado de Windows: +#include + + + +// TODO: mencionar aqu los encabezados adicionales que el programa necesita diff --git a/rdptransport/rdppass/targetver.h b/rdptransport/rdppass/targetver.h new file mode 100644 index 000000000..da80cd8f3 --- /dev/null +++ b/rdptransport/rdppass/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// La inclusin de SDKDDKVer.h define la plataforma Windows ms alta disponible. + +// Si desea compilar la aplicacin para una plataforma Windows anterior, incluya WinSDKVer.h y +// establezca la macro _WIN32_WINNT en la plataforma que desea admitir antes de incluir SDKDDKVer.h. + +#include diff --git a/rdptransport/testPass/ReadMe.txt b/rdptransport/testPass/ReadMe.txt new file mode 100644 index 000000000..d53c3e4ba --- /dev/null +++ b/rdptransport/testPass/ReadMe.txt @@ -0,0 +1,46 @@ +======================================================================== + APLICACIÓN DE CONSOLA: testPass + Información general del proyecto +======================================================================== + +AppWizard ha creado esta aplicación testPass. + +Este archivo incluye un resumen acerca del contenido de los archivos que +constituyen su aplicación testPass. + + +testPass.vcxproj + Éste es el archivo de proyecto principal para los proyectos de VC++ + generados mediante un Asistente para aplicaciones. + Contiene información acerca de la versión de Visual C++ con la que + se generó el archivo, así como información acerca de las plataformas, + configuraciones y características del proyecto seleccionadas en el + asistente para aplicaciones. + +testPass.vcxproj.filters + Éste es el archivo de filtros para los proyectos de VC++ generados + mediante un asistente para aplicaciones. + Contiene información acerca de la asociación entre los archivos de + un proyecto y los filtros. Esta asociación se usa en el IDE para mostrar + la agrupación de archivos con extensiones similares bajo un nodo + específico (por ejemplo, los archivos ".cpp" se asocian con el filtro + "Archivos de código fuente"). + +testPass.cpp + Ésta es la aplicación principal del archivo de código fuente. + +///////////////////////////////////////////////////////////////////////////// +Otros archivos estándar: + +StdAfx.h, StdAfx.cpp + Estos archivos se utilizan para crear un archivo de encabezado precompilado + (PCH) denominado testPass.pch y un archivo de tipos + precompilado denominado StdAfx.obj. + +///////////////////////////////////////////////////////////////////////////// +Otras notas: + +El asistente para aplicaciones utiliza comentarios "TODO:" para indicar las +partes del código fuente que tendrá que agregar o personalizar. + +///////////////////////////////////////////////////////////////////////////// diff --git a/rdptransport/testPass/stdafx.cpp b/rdptransport/testPass/stdafx.cpp new file mode 100644 index 000000000..e2bbbec2b --- /dev/null +++ b/rdptransport/testPass/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp: archivo de cdigo fuente que contiene slo las inclusiones estndar +// testPass.pch ser el encabezado precompilado +// stdafx.obj contiene la informacin de tipos precompilada + +#include "stdafx.h" + +// TODO: mencionar los encabezados adicionales que se necesitan en STDAFX.H +// pero no en este archivo diff --git a/rdptransport/testPass/stdafx.h b/rdptransport/testPass/stdafx.h new file mode 100644 index 000000000..3e732adcf --- /dev/null +++ b/rdptransport/testPass/stdafx.h @@ -0,0 +1,15 @@ +// stdafx.h: archivo de inclusin de los archivos de inclusin estndar del sistema +// o archivos de inclusin especficos de un proyecto utilizados frecuentemente, +// pero rara vez modificados +// + +#pragma once + +#include "targetver.h" + +#include +#include + + + +// TODO: mencionar aqu los encabezados adicionales que el programa necesita diff --git a/rdptransport/testPass/targetver.h b/rdptransport/testPass/targetver.h new file mode 100644 index 000000000..da80cd8f3 --- /dev/null +++ b/rdptransport/testPass/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// La inclusin de SDKDDKVer.h define la plataforma Windows ms alta disponible. + +// Si desea compilar la aplicacin para una plataforma Windows anterior, incluya WinSDKVer.h y +// establezca la macro _WIN32_WINNT en la plataforma que desea admitir antes de incluir SDKDDKVer.h. + +#include diff --git a/rdptransport/testPass/testPass.cpp b/rdptransport/testPass/testPass.cpp new file mode 100644 index 000000000..581787017 --- /dev/null +++ b/rdptransport/testPass/testPass.cpp @@ -0,0 +1,115 @@ +// testPass.cpp: define el punto de entrada de la aplicacin de consola. +// + +#include "stdafx.h" +#include +#include +#include + +void MyHandleError(char *s); + +char arr[] = { '0', '1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' }; + +void byteToHex(BYTE data) +{ + int n1 = data & 0x0f; + int n2 = (data>>4) & 0x0f; + printf("%c%c", arr[n2], arr[n1]); + +} + +void bytesToHex(BYTE* data, size_t len) +{ + for( int i = 0; i < len; i++ ) + byteToHex(data[i]); + printf("\n"); +} + +int _tmain(int argc, _TCHAR* argv[]) +{ + wchar_t* pass = L"temporal"; + printf("Size of wchar_t: %d\n", sizeof(wchar_t)); + DATA_BLOB DataIn; + DATA_BLOB DataOut; + DATA_BLOB DataVerify; + BYTE *pbDataInput =(BYTE *)pass; + DWORD cbDataInput = 16;//strlen((char *)pbDataInput)+1; + DataIn.pbData = pbDataInput; + DataIn.cbData = cbDataInput; + //------------------------------------------------------------------- + // Begin processing. + + printf("The data to be encrypted is: %s\n",pass); + + //------------------------------------------------------------------- + // Begin protect phase. + + if(CryptProtectData( + &DataIn, + L"psw", // A description string. + NULL, // Optional entropy + // not used. + NULL, // Reserved. + NULL, // Pass a PromptStruct. + CRYPTPROTECT_UI_FORBIDDEN, + &DataOut)) + { + printf("The encryption phase worked. \n"); + printf("Data len: %d\n", DataOut.cbData); + printf("01000000D08C9DDF0115D1118C7A00C04FC297EB01000000FE75A256A68D3C4C881421C753628A9800000000080000007000730077000000106600000001000020000000D2A595F857AC73031C75AA190BCEF52327E7FE2B51A35D6C6AC03703DE115714000000000E8000000002000020000000F1C8AC290D19EFE11EEAA10B6A9F933105ADC8C04526A139000E7F535F2FCF6E20000000104E256EF4ABD26A8A7F506938E2A23127D7F9EB1CFFEEB6356445043F1E02C140000000ACC013C6D269C09DEB9B951E952348C12A5259C7A475AF66ED3861D9F8D1D1057449761332A4B624905CD043FEEB45918E0AE26245801E5ED229C43DF7872876\n"); + bytesToHex(DataOut.pbData, DataOut.cbData); + } + else + { + MyHandleError("Encryption error!"); + } + //------------------------------------------------------------------- + // Begin unprotect phase. + + if (CryptUnprotectData( + &DataOut, + NULL, + NULL, // Optional entropy + NULL, // Reserved + NULL, // Optional PromptStruct + CRYPTPROTECT_UI_FORBIDDEN, + &DataVerify)) + { + printf("The decrypted data is: %s\n", DataVerify.pbData); + } + else + { + MyHandleError("Decryption error!"); + } + //------------------------------------------------------------------- + // At this point, memcmp could be used to compare DataIn.pbData and + // DataVerify.pbDate for equality. If the two functions worked + // correctly, the two byte strings are identical. + + //------------------------------------------------------------------- + // Clean up. + + LocalFree(DataOut.pbData); + LocalFree(DataVerify.pbData); + char c; + scanf("%c", &c); +} // End of main + +//------------------------------------------------------------------- +// This example uses the function MyHandleError, a simple error +// handling function, to print an error message to the +// standard error (stderr) file and exit the program. +// For most applications, replace this function with one +// that does more extensive error reporting. + +void MyHandleError(char *s) +{ + fprintf(stderr,"An error occurred in running the program. \n"); + fprintf(stderr,"%s\n",s); + fprintf(stderr, "Error number %x.\n", GetLastError()); + fprintf(stderr, "Program terminating. \n"); + exit(1); +} // End of MyHandleError + + + diff --git a/rdptransport/testPass/testPass.vcxproj b/rdptransport/testPass/testPass.vcxproj new file mode 100644 index 000000000..7c65e7530 --- /dev/null +++ b/rdptransport/testPass/testPass.vcxproj @@ -0,0 +1,93 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {7616C72B-2571-4DF9-8BF7-8B32359CE489} + Win32Proj + testPass + + + + Application + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + true + + + false + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + crypt32.lib;%(AdditionalDependencies) + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + + + Console + true + true + true + crypt32.lib;%(AdditionalDependencies) + + + + + + + + + + + + Create + Create + + + + + + + \ No newline at end of file diff --git a/rdptransport/testPass/testPass.vcxproj.filters b/rdptransport/testPass/testPass.vcxproj.filters new file mode 100644 index 000000000..6ca300c9c --- /dev/null +++ b/rdptransport/testPass/testPass.vcxproj.filters @@ -0,0 +1,36 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + Archivos de encabezado + + + Archivos de encabezado + + + + + Archivos de código fuente + + + Archivos de código fuente + + + \ No newline at end of file diff --git a/rdptransport/testPass/testPass.vcxproj.user b/rdptransport/testPass/testPass.vcxproj.user new file mode 100644 index 000000000..695b5c78b --- /dev/null +++ b/rdptransport/testPass/testPass.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/server/.project b/server/.project new file mode 100644 index 000000000..c72ed172e --- /dev/null +++ b/server/.project @@ -0,0 +1,18 @@ + + + uds + + + + + + org.python.pydev.PyDevBuilder + + + + + + org.python.pydev.pythonNature + org.python.pydev.django.djangoNature + + diff --git a/server/.pydevproject b/server/.pydevproject new file mode 100644 index 000000000..f0c43afa2 --- /dev/null +++ b/server/.pydevproject @@ -0,0 +1,16 @@ + + + + +python2.7 +python 2.7 + +DJANGO_MANAGE_LOCATION +src/manage.py +DJANGO_SETTINGS_MODULE +server.settings + + +/uds/src + + diff --git a/server/.settings/org.eclipse.core.resources.prefs b/server/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..aee1c1056 --- /dev/null +++ b/server/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,168 @@ +eclipse.preferences.version=1 +encoding//documentation/_downloads/samples/services/SampleProvider.py=utf-8 +encoding//documentation/_downloads/samples/services/SamplePublication.py=utf-8 +encoding//documentation/_downloads/samples/services/SampleService.py=utf-8 +encoding//documentation/_downloads/samples/services/SampleUserDeploymentOne.py=utf-8 +encoding//documentation/_downloads/samples/services/SampleUserDeploymentTwo.py=utf-8 +encoding//documentation/_downloads/samples/services/__init__.py=utf-8 +encoding//documentation/conf.py=utf-8 +encoding//src/server/settings.py=utf-8 +encoding//src/server/urls.py=utf-8 +encoding//src/uds/__init__.py=utf-8 +encoding//src/uds/auths/ActiveDirectory/Authenticator.py=utf-8 +encoding//src/uds/auths/ActiveDirectory/__init__.py=utf-8 +encoding//src/uds/auths/Dummy/Authenticator.py=utf-8 +encoding//src/uds/auths/Dummy/__init__.py=utf-8 +encoding//src/uds/auths/EDirectory/Authenticator.py=utf-8 +encoding//src/uds/auths/EDirectory/__init__.py=utf-8 +encoding//src/uds/auths/IP/Authenticator.py=utf-8 +encoding//src/uds/auths/IP/__init__.py=utf-8 +encoding//src/uds/auths/InternalDB/Authenticator.py=utf-8 +encoding//src/uds/auths/InternalDB/__init__.py=utf-8 +encoding//src/uds/auths/RegexLdap/Authenticator.py=utf-8 +encoding//src/uds/auths/RegexLdap/__init__.py=utf-8 +encoding//src/uds/auths/SAML/SAML.py=utf-8 +encoding//src/uds/auths/SAML/__init__.py=utf-8 +encoding//src/uds/auths/Sample/SampleAuth.py=utf-8 +encoding//src/uds/auths/Sample/__init__.py=utf-8 +encoding//src/uds/auths/SimpleLDAP/Authenticator.py=utf-8 +encoding//src/uds/auths/SimpleLDAP/__init__.py=utf-8 +encoding//src/uds/auths/__init__.py=utf-8 +encoding//src/uds/core/BaseModule.py=utf-8 +encoding//src/uds/core/Environment.py=utf-8 +encoding//src/uds/core/Serializable.py=utf-8 +encoding//src/uds/core/__init__.py=utf-8 +encoding//src/uds/core/auths/AuthsFactory.py=utf-8 +encoding//src/uds/core/auths/BaseAuthenticator.py=utf-8 +encoding//src/uds/core/auths/Exceptions.py=utf-8 +encoding//src/uds/core/auths/Group.py=utf-8 +encoding//src/uds/core/auths/GroupsManager.py=utf-8 +encoding//src/uds/core/auths/User.py=utf-8 +encoding//src/uds/core/auths/__init__.py=utf-8 +encoding//src/uds/core/auths/auth.py=utf-8 +encoding//src/uds/core/jobs/DelayedTask.py=utf-8 +encoding//src/uds/core/jobs/DelayedTaskRunner.py=utf-8 +encoding//src/uds/core/jobs/Job.py=utf-8 +encoding//src/uds/core/jobs/JobsFactory.py=utf-8 +encoding//src/uds/core/jobs/Scheduler.py=utf-8 +encoding//src/uds/core/managers/CryptoManager.py=utf-8 +encoding//src/uds/core/managers/DownloadsManager.py=utf-8 +encoding//src/uds/core/managers/PublicationManager.py=utf-8 +encoding//src/uds/core/managers/TaskManager.py=utf-8 +encoding//src/uds/core/managers/UserPrefsManager.py=utf-8 +encoding//src/uds/core/managers/UserServiceManager.py=utf-8 +encoding//src/uds/core/osmanagers/BaseOsManager.py=utf-8 +encoding//src/uds/core/osmanagers/OSManagersFactory.py=utf-8 +encoding//src/uds/core/services/BaseDeployed.py=utf-8 +encoding//src/uds/core/services/BasePublication.py=utf-8 +encoding//src/uds/core/services/BaseService.py=utf-8 +encoding//src/uds/core/services/BaseServiceProvider.py=utf-8 +encoding//src/uds/core/services/Exceptions.py=utf-8 +encoding//src/uds/core/services/ServiceProviderFactory.py=utf-8 +encoding//src/uds/core/services/__init__.py=utf-8 +encoding//src/uds/core/transports/BaseTransport.py=utf-8 +encoding//src/uds/core/transports/TransportsFactory.py=utf-8 +encoding//src/uds/core/ui/UserInterface.py=utf-8 +encoding//src/uds/core/util/AutoAttributes.py=utf-8 +encoding//src/uds/core/util/Cache.py=utf-8 +encoding//src/uds/core/util/Config.py=utf-8 +encoding//src/uds/core/util/Log.py=utf-8 +encoding//src/uds/core/util/OsDetector.py=utf-8 +encoding//src/uds/core/util/State.py=utf-8 +encoding//src/uds/core/util/StateQueue.py=utf-8 +encoding//src/uds/core/util/Storage.py=utf-8 +encoding//src/uds/core/util/UniqueIDGenerator.py=utf-8 +encoding//src/uds/core/util/UniqueMacGenerator.py=utf-8 +encoding//src/uds/core/util/UniqueNameGenerator.py=utf-8 +encoding//src/uds/core/util/connection.py=utf-8 +encoding//src/uds/core/util/modfinder.py=utf-8 +encoding//src/uds/core/workers/AssignedAndUnused.py=utf-8 +encoding//src/uds/core/workers/CacheCleaner.py=utf-8 +encoding//src/uds/core/workers/DeployedServiceCleaner.py=utf-8 +encoding//src/uds/core/workers/PublicationCleaner.py=utf-8 +encoding//src/uds/core/workers/ServiceCacheUpdater.py=utf-8 +encoding//src/uds/core/workers/UserServiceCleaner.py=utf-8 +encoding//src/uds/dispatchers/pam/urls.py=utf-8 +encoding//src/uds/dispatchers/pam/views.py=utf-8 +encoding//src/uds/dispatchers/test/urls.py=utf-8 +encoding//src/uds/dispatchers/test/views.py=utf-8 +encoding//src/uds/management/commands/config.py=utf-8 +encoding//src/uds/management/commands/taskManager.py=utf-8 +encoding//src/uds/migrations/0001_initial.py=utf-8 +encoding//src/uds/migrations/0002_auto__del_unique_userpreference_name_module.py=utf-8 +encoding//src/uds/migrations/0004_auto__add_field_deployedservice_state_date.py=utf-8 +encoding//src/uds/migrations/0005_auto__add_field_config_crypt.py=utf-8 +encoding//src/uds/models.py=utf-8 +encoding//src/uds/osmanagers/LinuxOsManager/LinuxOsManager.py=utf-8 +encoding//src/uds/osmanagers/LinuxOsManager/__init__.py=utf-8 +encoding//src/uds/osmanagers/NoneOsManager/Manager.py=utf-8 +encoding//src/uds/osmanagers/NoneOsManager/__init__.py=utf-8 +encoding//src/uds/osmanagers/WindowsOsManager/WinDomainOsManager.py=utf-8 +encoding//src/uds/osmanagers/WindowsOsManager/WindowsOsManager.py=utf-8 +encoding//src/uds/osmanagers/WindowsOsManager/__init__.py=utf-8 +encoding//src/uds/osmanagers/__init__.py=utf-8 +encoding//src/uds/services/PhysicalMachines/IPMachineDeployed.py=utf-8 +encoding//src/uds/services/PhysicalMachines/IPMachinesService.py=utf-8 +encoding//src/uds/services/PhysicalMachines/ServiceProvider.py=utf-8 +encoding//src/uds/services/PhysicalMachines/__init__.py=utf-8 +encoding//src/uds/services/Sample/SampleProvider.py=utf-8 +encoding//src/uds/services/Sample/SamplePublication.py=utf-8 +encoding//src/uds/services/Sample/SampleService.py=utf-8 +encoding//src/uds/services/Sample/SampleUserDeploymentOne.py=utf-8 +encoding//src/uds/services/Sample/SampleUserDeploymentTwo.py=utf-8 +encoding//src/uds/services/Sample/__init__.py=utf-8 +encoding//src/uds/services/Vmware/Helpers.py=utf-8 +encoding//src/uds/services/Vmware/PublicationVC.py=utf-8 +encoding//src/uds/services/Vmware/ServiceProviderVC.py=utf-8 +encoding//src/uds/services/Vmware/VCLinkedCloneDeployed.py=utf-8 +encoding//src/uds/services/Vmware/VCLinkedCloneService.py=utf-8 +encoding//src/uds/services/Vmware/__init__.py=utf-8 +encoding//src/uds/services/Vmware/client/Client.py=utf-8 +encoding//src/uds/services/Vmware/client/Exceptions.py=utf-8 +encoding//src/uds/services/Vmware/client/Server.py=utf-8 +encoding//src/uds/services/Vmware/client/Task.py=utf-8 +encoding//src/uds/services/Vmware/client/ws/VimService_types.py=utf-8 +encoding//src/uds/services/__init__.py=utf-8 +encoding//src/uds/tests.py=utf-8 +encoding//src/uds/transports/NX/NXTransport.py=utf-8 +encoding//src/uds/transports/NX/__init__.py=utf-8 +encoding//src/uds/transports/NX/web.py=utf-8 +encoding//src/uds/transports/RDP/RDPTransport.py=utf-8 +encoding//src/uds/transports/RDP/TSRDPTransport.py=utf-8 +encoding//src/uds/transports/RDP/__init__.py=utf-8 +encoding//src/uds/transports/RDP/web.py=utf-8 +encoding//src/uds/transports/RGS/RGSTransport.py=utf-8 +encoding//src/uds/transports/RGS/TRGSTransport.py=utf-8 +encoding//src/uds/transports/RGS/__init__.py=utf-8 +encoding//src/uds/transports/RGS/web.py=utf-8 +encoding//src/uds/transports/TSNX/TSNXTransport.py=utf-8 +encoding//src/uds/transports/TSNX/__init__.py=utf-8 +encoding//src/uds/transports/TSNX/web.py=utf-8 +encoding//src/uds/transports/__init__.py=utf-8 +encoding//src/uds/urls.py=utf-8 +encoding//src/uds/views.py=utf-8 +encoding//src/uds/web/errors.py=utf-8 +encoding//src/uds/web/forms/LoginForm.py=utf-8 +encoding//src/uds/web/transformers.py=utf-8 +encoding//src/uds/web/views.py=utf-8 +encoding//src/uds/xmlrpc/actor/Actor.py=utf-8 +encoding//src/uds/xmlrpc/auths/AdminAuth.py=utf-8 +encoding//src/uds/xmlrpc/auths/Authenticators.py=utf-8 +encoding//src/uds/xmlrpc/auths/Groups.py=utf-8 +encoding//src/uds/xmlrpc/auths/UserPreferences.py=utf-8 +encoding//src/uds/xmlrpc/auths/Users.py=utf-8 +encoding//src/uds/xmlrpc/osmanagers/OSManagers.py=utf-8 +encoding//src/uds/xmlrpc/services/DeployedServices.py=utf-8 +encoding//src/uds/xmlrpc/services/Publications.py=utf-8 +encoding//src/uds/xmlrpc/services/ServiceProviders.py=utf-8 +encoding//src/uds/xmlrpc/services/Services.py=utf-8 +encoding//src/uds/xmlrpc/services/UserDeployedServices.py=utf-8 +encoding//src/uds/xmlrpc/tools/Cache.py=utf-8 +encoding//src/uds/xmlrpc/tools/Config.py=utf-8 +encoding//src/uds/xmlrpc/transports/Networks.py=utf-8 +encoding//src/uds/xmlrpc/transports/Transports.py=utf-8 +encoding//src/uds/xmlrpc/util/Callbacks.py=utf-8 +encoding//src/uds/xmlrpc/util/Exceptions.py=utf-8 +encoding//src/uds/xmlrpc/util/Helpers.py=utf-8 +encoding//src/uds/xmlrpc/util/TestTransport.py=utf-8 +encoding//src/uds/xmlrpc/views.py=utf-8 diff --git a/server/.settings/org.eclipse.ltk.core.refactoring.prefs b/server/.settings/org.eclipse.ltk.core.refactoring.prefs new file mode 100644 index 000000000..6599c0710 --- /dev/null +++ b/server/.settings/org.eclipse.ltk.core.refactoring.prefs @@ -0,0 +1,3 @@ +#Wed Jun 15 12:44:29 CEST 2011 +eclipse.preferences.version=1 +org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false diff --git a/server/.settings/org.eclipse.mylyn.tasks.ui.prefs b/server/.settings/org.eclipse.mylyn.tasks.ui.prefs new file mode 100644 index 000000000..0f638bd2c --- /dev/null +++ b/server/.settings/org.eclipse.mylyn.tasks.ui.prefs @@ -0,0 +1,4 @@ +#Tue Jan 03 02:43:56 CET 2012 +eclipse.preferences.version=1 +project.repository.kind=mantis +project.repository.url=http\://192.168.0.6/mantis diff --git a/server/.settings/org.eclipse.wst.css.core.prefs b/server/.settings/org.eclipse.wst.css.core.prefs new file mode 100644 index 000000000..aaad38b58 --- /dev/null +++ b/server/.settings/org.eclipse.wst.css.core.prefs @@ -0,0 +1,3 @@ +#Thu Jan 19 07:33:49 CET 2012 +css-profile//src/uds/templates/uds/base.html=org.eclipse.wst.css.core.cssprofile.css3 +eclipse.preferences.version=1 diff --git a/server/.settings/org.eclipse.wst.html.core.prefs b/server/.settings/org.eclipse.wst.html.core.prefs new file mode 100644 index 000000000..86d79db53 --- /dev/null +++ b/server/.settings/org.eclipse.wst.html.core.prefs @@ -0,0 +1,3 @@ +#Thu Jan 19 07:33:49 CET 2012 +document-type//src/uds/templates/uds/base.html=-//W3C//DTD XHTML 1.0 Transitional//EN +eclipse.preferences.version=1 diff --git a/server/documentation/Makefile b/server/documentation/Makefile new file mode 100644 index 000000000..8cbfba742 --- /dev/null +++ b/server/documentation/Makefile @@ -0,0 +1,153 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = a4 +BUILDDIR = _build + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + -rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/UDS.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/UDS.qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/UDS" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/UDS" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." diff --git a/server/documentation/_downloads/samples/auths/SampleAuth.py b/server/documentation/_downloads/samples/auths/SampleAuth.py new file mode 100644 index 000000000..7b3699b8f --- /dev/null +++ b/server/documentation/_downloads/samples/auths/SampleAuth.py @@ -0,0 +1,307 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' +from django.utils.translation import ugettext_noop as translatable +from uds.core.ui.UserInterface import gui +from uds.core import auths + +import logging + +logger = logging.getLogger(__name__) + +class SampleAuth(auths.Authenticator): + ''' + This class represents a sample authenticator. + + As this, it will provide: + * The authenticator functionality + * 3 Groups, "Mortals", "Gods" and "Daemons", just random group names selected.. :-), + plus groups that we enter at Authenticator form, from admin interface. + * Search of groups (inside the 3 groups used in this sample plus entered) + * Search for people (will return the search string + 000...999 as usernames) + * The Required form description for administration interface, so admins can create + new authenticators of this kind. + + In this sample, we will provide a simple standard auth, with owner drawn + login form that will simply show users that has been created and allow web user + to select one of them. + + For this class to get visible at administration client as a authenticator type, + we MUST register it at package __init__ + + :note: At class level, the translations must be simply marked as so + using ugettext_noop. This is done in this way because we will translate + the string when it is sent to the administration client. + ''' + + #: Name of type, used at administration interface to identify this + #: authenticator (i.e. LDAP, SAML, ...) + #: This string will be translated when provided to admin interface + #: using ugettext, so you can mark it as "translatable" at derived classes (using ugettext_noop) + #: if you want so it can be translated. + typeName = translatable('Sample Authenticator') + + #: Name of type used by Managers to identify this type of service + #: We could have used here the Class name, but we decided that the + #: module implementator will be the one that will provide a name that + #: will relation the class (type) and that name. + typeType = 'SampleAuthenticator' + + #: Description shown at administration level for this authenticator. + #: This string will be translated when provided to admin interface + #: using ugettext, so you can mark it as "translatable" at derived classes (using ugettext_noop) + #: if you want so it can be translated. + typeDescription = translatable('Sample dummy authenticator') + + + #: Icon file, used to represent this authenticator at administration interface + #: This file should be at same folder as this class is, except if you provide + #: your own :py:meth:uds.core.BaseModule.BaseModule.icon method. + iconFile = 'auth.png' + + #: Mark this authenticator as that the users comes from outside the UDS + #: database, that are most authenticator (except Internal DB) + #: True is the default value, so we do not need it in fact + # isExternalSource = True + + #: If we need to enter the password for this user when creating a new + #: user at administration interface. Used basically by internal authenticator. + #: False is the default value, so this is not needed in fact + #: needsPassword = False + + #: Label for username field, shown at administration interface user form. + userNameLabel = translatable('Fake User') + + # Label for group field, shown at administration interface user form. + groupNameLabel = translatable('Fake Group') + + #: Definition of this type of authenticator form + #: We will define a simple form where we will use a simple + #: list editor to allow entering a few group names + + groups = gui.EditableList(label=translatable('Groups'), values = ['Gods', 'Daemons', 'Mortals']) + + def initialize(self, values): + ''' + Simply check if we have + at least one group in the list + ''' + + # To avoid problems, we only check data if values are passed + # If values are not passed in, form data will only be available after + # unserialization, and at this point all will be default values + # so self.groups.value will be [] + if values is not None and len(self.groups.value) < 2: + raise auths.Authenticator.ValidationException(translatable('We need more that two items!')) + + def searchUsers(self, pattern): + ''' + Here we will receive a pattern for searching users. + + This method is invoked from interface, so an administrator can search users. + + If we do not provide this method, the authenticator will not provide search + facility for users. In our case, we will simply return a list of users + (array of dictionaries with ids and names) with the pattern plus 1..10 + ''' + return [ { 'id' : '{0}-{1}'.format(pattern, a), 'name' : '{0} number {1}'.format(pattern, a) } for a in range(1, 10)] + + def searchGroups(self, pattern): + ''' + Here we we will receive a patter for searching groups. + + In this sample, we will try to locate elements that where entered at + sample authenticator form (when created), and return the ones that + contains the pattern indicated. + ''' + pattern = pattern.lower() + res = [] + for g in self.groups.value: + if g.lower().find(pattern) != -1: + res.append({'id' : g, 'name' : ''}) + return res + + def authenticate(self, username, credentials, groupsManager): + ''' + This method is invoked by UDS whenever it needs an user to be authenticated. + It is used from web interface, but also from administration interface to + check credentials and access of user. + + The tricky part of this method is the groupsManager, but it's easy to + understand what is used it for. + + Imagine some authenticator, for example, an LDAP. It has its users, it has + its groups, and it has it relations (which user belongs to which group). + + Now think about UDS. UDS know nothing about this, it only knows what + the administator has entered at admin interface (groups mainly, but he can + create users also). + + UDS knows about this groups, but we need to relation those with the ones + know by the authenticator. + + To do this, we have created a simple mechanism, where the authenticator + receives a groupsManager, that knows all groups known by UDS, and has + the method so the authenticator can say, for the username being validated, + to which uds groups it belongs to. + + This is done using the :py:meth:uds.core.auths.GroupsManager.GroupsManager.validate + method of the provided groups manager. + + At return, UDS will do two things: + * If there is no group inside the groupsManager mareked as valid, it will + denied access. + * If there is some groups marked as valid, it will refresh the known + UDS relations (this means that the database will be refresehd so the user + has valid groups). + + This also means that the group membership is only checked at user login (well, + in fact its also checked when an administrator tries to modify an user) + + So, authenticate must not also validate the user credentials, but also + indicate the group membership of this user inside UDS. + + :note: groupsManager is an in/out parameter + ''' + if username != credentials: # All users with same username and password are allowed + return False + + # Now the tricky part. We will make this user belong to groups that contains at leat + # two letters equals to the groups names known by UDS + # For this, we will ask the groups manager for the groups names, and will check that and, + # if the user match this criteria, will mark that group as valid + for g in groupsManager.getGroupsNames(): + if len(set(g.lower()).intersection(username.lower())) >= 2: + groupsManager.validate(g) + + return True + + def getGroups(self, username, groupsManager): + ''' + As with authenticator part related to groupsManager, this + method will fill the groups to which the specified username belongs to. + + We have to fill up groupsManager from two different places, so it's not + a bad idea to make a method that get the "real" authenticator groups and + them simply call to :py:meth:uds.core.auths.GroupsManager.GroupsManager.validate + + In our case, we simply repeat the process that we also do at authenticate + ''' + for g in groupsManager.getGroupsNames(): + if len(set(g.lower()).intersection(username.lower())) >= 2: + groupsManager.validate(g) + + def getHtml(self, request): + ''' + If we override this method from the base one, we are telling UDS + that we want to draw our own authenticator. + + This way, we can do whataver we want here (for example redirect to a site + for a single sign on) generation our ouwn html (and javascript ofc). + + ''' + # Here there is a sample, commented out + # In this sample, we will make a list of valid users, and when clicked, + # it will fill up original form with username and same password, and submit it. + #res = '' + #for u in self.dbAuthenticator().users.all(): + # res += '{0}
'.format(u.name) + # + #res += '' + #return res + + # I know, this is a bit ugly, but this is just a sample :-) + + res = '

Login name:

' + res +='

Login

' + return res + + + def authCallback(self, parameters): + ''' + We provide this as a sample of callback for an user. + We will accept all petitions that has "user" parameter + + This method will get invoked by url redirections, probably by an SSO. + + The idea behind this is that we can provide: + * Simple user/password authentications + * Own authentications (not UDS, authenticator "owned"), but with no redirections + * Own authentications via redirections (as most SSO will do) + + Here, we will receive the parameters for this + ''' + user = parameters.get('user', None) + + return user + + def createUser(self, usrData): + ''' + This method provides a "check oportunity" to authenticators for users created + manually at administration interface. + + If we do not provide this method, the administration interface will not allow + to create new users "by hand", i mean, the "new" options from menus will dissapear. + + usrData is a dictionary that contains the input parameters from user, + with at least name, realName, comments, state & password. + + We can modify this parameters, we can modify ALL, but name is not recommended to + modify it unles you know what you are doing. + + Here, we will set the state to "Inactive" and realName to the same as username, but twice :-) + ''' + from uds.core.util.State import State + usrData['realName'] = usrData['name'] + ' ' + usrData['name'] + usrData['state'] = State.INACTIVE + + def modifyUser(self, usrData): + ''' + This method provides a "check opportunity" to authenticator for users modified + at administration interface. + + If we do not provide this method, nothing will happen (default one does nothing, but + it's valid). + + usrData is a dictionary that contains the input parameters from user, + with at least name, realName, comments, state & password. + + We can modify this parameters, we can modify ALL, but name is not recommended to + modify it unless you know what you are doing. + + Here, we will simply update the realName of the user, and (we have to take care + this this kind of things) modify the userName to a new one, the original plus '-1' + ''' + usrData['realName'] = usrData['name'] + ' ' + usrData['name'] + usrData['name'] = usrData['name'] + '-1' diff --git a/server/documentation/_downloads/samples/auths/__init__.py b/server/documentation/_downloads/samples/auths/__init__.py new file mode 100644 index 000000000..548fde418 --- /dev/null +++ b/server/documentation/_downloads/samples/auths/__init__.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +''' +Dummy test authenticator. Not used in production (it doesn't registers itself) + +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' +from uds.core import auths +from SampleAuth import SampleAuth + +# Commented, this auth exists for testing purposes only +auths.factory().insert(SampleAuth) diff --git a/server/documentation/_downloads/samples/auths/auth.png b/server/documentation/_downloads/samples/auths/auth.png new file mode 100644 index 000000000..c8560b1d5 Binary files /dev/null and b/server/documentation/_downloads/samples/auths/auth.png differ diff --git a/server/documentation/_downloads/samples/services/SampleProvider.py b/server/documentation/_downloads/samples/services/SampleProvider.py new file mode 100644 index 000000000..4f38368f3 --- /dev/null +++ b/server/documentation/_downloads/samples/services/SampleProvider.py @@ -0,0 +1,196 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +Created on Jun 22, 2012 + +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext_noop as translatable, ugettext as _ +from uds.core.services import ServiceProvider +from SampleService import ServiceOne, ServiceTwo +from uds.core.ui import gui + +import logging + +logger = logging.getLogger(__name__) + + +class Provider(ServiceProvider): + ''' + This class represents the sample services provider + + In this class we provide: + * The Provider functionality + * The basic configuration parameters for the provider + * The form fields needed by administrators to configure this provider + + :note: At class level, the translation must be simply marked as so + using ugettext_noop. This is so cause we will translate the string when + sent to the administration client. + + For this class to get visible at administration client as a provider type, + we MUST register it at package __init__. + + ''' + #: What kind of services we offer, this are classes inherited from Service + offers = [ServiceOne, ServiceTwo] + #: Name to show the administrator. This string will be translated BEFORE + #: sending it to administration interface, so don't forget to + #: mark it as translatable (using ugettext_noop) + typeName = translatable('Sample Provider') + #: Type used internally to identify this provider + typeType = 'SampleProvider' + #: Description shown at administration interface for this provider + typeDescription = translatable('Sample (and dummy) service provider') + #: Icon file used as icon for this provider. This string will be translated + #: BEFORE sending it to administration interface, so don't forget to + #: mark it as translatable (using ugettext_noop) + iconFile = 'provider.png' + + # now comes the form fields + # There is always two fields that are requested to the admin, that are: + # Service Name, that is a name that the admin uses to name this provider + # Description, that is a short description that the admin gives to this provider + # Now we are going to add a few fields that we need to use this provider + # Remember that these are "dummy" fields, that in fact are not required + # but used for sample purposes + # If we don't indicate an order, the output order of fields will be + # "random" + + #: Remote host. Here core will translate label and tooltip, remember to + #: mark them as translatable using ugettext_noop. + remoteHost = gui.TextField(oder=1, + length = 64, + label = translatable('Remote host'), + tooltip = translatable('This fields contains a remote host'), + required = True, + ) + #: Name of your pet (sample, not really needed :-) ) + petName = gui.TextField(order=2, + length = 32, + label = translatable('Your pet\'s name'), + tooltip = translatable('If you like, write the name of your pet'), + requred = False, + defvalue = 'Tux' #: This will not get translated + ) + #: Age of Methuselah (matusalén in spanish) + #: in Spain there is a well-known to say that something is very old, + #: "Tiene mas años que matusalén"(is older than Methuselah) + methAge = gui.NumericField(order = 3, + length = 4, # That is, max allowed value is 9999 + label = translatable('Age of Methuselah'), + tooltip = translatable('If you know it, please, tell me!!!'), + required = True, #: Numeric fields have always a value, so this not really needed + defvalue = '4500' + ) + + #: Is Methuselah istill alive? + methAlive = gui.CheckBoxField(order = 4, + label = translatable('Is Methuselah still alive?'), + tooltip = translatable('If you fails, this will not get saved :-)'), + required = True, #: Also means nothing. Check boxes has always a value + defvalue = gui.TRUE #: By default, at new item, check this + ) + + # There is more fields type, but not here the best place to cover it + def initialize(self, values = None): + ''' + We will use the "autosave" feature for form fields, that is more than + enought for most providers. (We simply need to store data provided by user + and, maybe, initialize some kind of connection with this values). + + Normally provider values are rally used at sevice level, cause we never + instantiate nothing except a service from a provider. + ''' + + # If you say meth is alive, you are wrong!!! (i guess..) + # values are only passed from administration client. Internals + # instantiations are always empty. + if values is not None and self.methAlive.isTrue(): + raise ServiceProvider.ValidationException(_('Methuselah is not alive!!! :-)')) + + # Marshal and unmarshal are defaults ones, also enought + + # As we use "autosave" fields feature, dictValues is also provided by + # base class so we don't have to mess with all those things... + + @staticmethod + def test(env, data): + ''' + Create your test method here so the admin can push the "check" button + and this gets executed. + Args: + env: environment passed for testing (temporal environment passed) + + data: data passed for testing (data obtained from the form + definition) + + Returns: + Array of two elements, first is True of False, depending on test + (True is all right, false is error), + second is an String with error, preferably internacionalizated.. + + In this case, wi well do nothing more that use the provider params + + Note also that this is an static method, that will be invoked using + the admin user provided data via administration client, and a temporary + environment that will be erased after invoking this method + ''' + try: + # We instantiate the provider, but this may fail... + instance = Provider(env, data) + logger.debug('Methuselah has {0} years and is {1} :-)' + .format(instance.methAge.value, instance.methAlive.value)) + except ServiceProvider.ValidationException as e: + # If we say that meth is alive, instantiation will + return [False, str(e)] + except Exception as e: + logger.exception("Exception caugth!!!") + return [False, str(e)] + return [True, _('Nothing tested, but all went fine..')] + + # Congratulations!!!, the needed part of your first simple provider is done! + # Now you can go to administration panel, and check it + # + # From now onwards, we implement our own methods, that will be used by, + # for example, services derived from this provider + def host(self): + ''' + Sample method, in fact in this we just return + the value of host field, that is an string + ''' + return self.remoteHost.value + + + def methYears(self): + ''' + Another sample return, it will in fact return the Methuselah years + ''' diff --git a/server/documentation/_downloads/samples/services/SamplePublication.py b/server/documentation/_downloads/samples/services/SamplePublication.py new file mode 100644 index 000000000..f9ccfd5b8 --- /dev/null +++ b/server/documentation/_downloads/samples/services/SamplePublication.py @@ -0,0 +1,272 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext as _ +from uds.core.services import Publication +from uds.core.util.State import State +from datetime import datetime +import logging + +logger = logging.getLogger(__name__) + +class SamplePublication(Publication): + ''' + This class shows how a publication is developed. + + In order to a publication to work correctly, we must provide at least the + following methods: + * Of course, the __init__ + * :py:meth:`.publish` + * :py:meth:`.checkState` + * :py:meth:`.finish` + + Also, of course, methods from :py:class:`uds.core.Serializable.Serializable` + + + Publication do not have an configuration interface, all data contained + inside an instance of a Publication must be serialized if you want them between + method calls. + + It's not waranteed that the class will not be serialized/deserialized + between methods calls, so, first of all, implement the marshal and umnarshal + mehods needed by all serializable classes. + + Also a thing to note is that operations requested to Publications must be + *as fast as posible*. The operations executes in a separated thread, + and so it cant take a bit more time to execute, but it's recommended that + the operations executes as fast as posible, and, if it will take a long time, + split operation so we can keep track of state. + + This means that, if we have "slow" operations, we must + + We first of all declares an estimation of how long a publication will take. + This value is instance based, so if we override it in our class, the suggested + time could change. + + The class attribute that indicates this suggested time is "suggestedTime", and + it's expressed in seconds, (i.e. "suggestedTime = 10") + ''' + + suggestedTime = 5 #: Suggested recheck time if publication is unfinished in seconds + + def initialize(self): + ''' + This method will be invoked by default __init__ of base class, so it gives + us the oportunity to initialize whataver we need here. + + In our case, we setup a few attributes.. + ''' + + # We do not check anything at marshal method, so we ensure that + # default values are correctly handled by marshal. + self._name = 'test' + self._reason = '' # No error, no reason for it + self._number = 1 + + def marshal(self): + ''' + returns data from an instance of Sample Publication serialized + ''' + return '\t'.join( [self._name, self._reason, str(self._number)] ) + + def unmarshal(self, data): + ''' + deserializes the data and loads it inside instance. + ''' + logger.debug('Data: {0}'.format(data)) + vals = data.split('\t') + logger.debug('Values: {0}'.format(vals)) + self._name = vals[0] + self._reason = vals[1] + self._number = int(vals[2]) + + + def publish(self): + ''' + This method is invoked whenever the administrator requests a new publication. + + The method is not invoked directly (i mean, that the administration request + do no makes a call to this method), but a DelayedTask is saved witch will + initiate all publication stuff (and, of course, call this method). + + You MUST implement it, so the publication do really something. + All publications can be synchronous or asynchronous. + + The main difference between both is that first do whatever needed, (the + action must be fast enough to do not block core), returning State.FINISHED. + + The second (asynchronous) are publications that could block the core, so + it have to be done in more than one step. + + An example publication could be a copy of a virtual machine, where: + * First we invoke the copy operation to virtualization provider + * Second, we kept needed values inside instance so we can serialize + them whenever requested + * Returns an State.RUNNING, indicating the core that the publication + has started but has to finish sometime later. (We do no check + again the state and keep waiting here, because we will block the + core untill this operation is finished). + + In our example wi will simple assign a name, and set number to 5. We + will use this number later, to make a "delay" at check if the publication + has finished. (see method checkState) + + We also will make this publication an "stepped one", that is, it will not + finish at publish call but a later checkState call + + Take care with instantiating threads from here. Whenever a publish returns + "State.RUNNING", the core will recheck it later, but not using this instance + and maybe that even do not use this server. + + If you want to use threadings or somethin likt it, use DelayedTasks and + do not block it. You also musht provide the mechanism to allow those + DelayedTask to communicate with the publication. + + One sample could be, for example, to copy a bunch of files, but we know + that this copy can take a long time and don't want it to take make it + all here, but in a separate task. Now, do you remember that "environment" + that is unique for every instance?, well, we can create a delayed task, + and pass that environment (owned by this intance) as a mechanism for + informing when the task is finished. (We insert at delayed tasks queue + an instance, not a class itself, so we can instantiate a class and + store it at delayed task queue. + + Also note that, in that case, this class can also acomplish that by simply + using the suggestedTime attribute and the checkState method in most cases. + ''' + self._number = 5 + self._reason = '' + return State.RUNNING + + def checkState(self): + ''' + Our publish method will initiate publication, but will not finish it. + So in our sample, wi will only check if _number reaches 0, and if so + return that we have finished, else we will return that we are working + on it. + + One publish returns State.RUNNING, this task will get called untill + checkState returns State.FINISHED. + + Also, wi will make the publication fail one of every 10 calls to this + method. + + Note: Destroying an publication also makes use of this method, so you + must keep the info of that you are checking (publishing or destroying...) + In our case, destroy is 1-step action so this will no get called while + destroying... + ''' + import random + self._number -= 1 + # Serialization will take care of storing self._number + + # One of every 10 calls + if random.randint(0, 9) == 9: + self._reason = _('Random integer was 9!!! :-)') + return State.ERROR + + if self._number <= 0: + return State.FINISHED + else: + return State.RUNNING + + + def finish(self): + ''' + Invoked when Publication manager noticed that the publication has finished. + This give us the oportunity of cleaning up things (as stored vars, etc..), + or initialize variables that will be needed in a later phase (by deployed + services) + + Returned value, if any, is ignored + ''' + import string + import random + # Make simply a random string + self._name = ''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(10)) + + def reasonOfError(self): + ''' + If a publication produces an error, here we must notify the reason why + it happened. This will be called just after publish or checkState + if they return State.ERROR + + Returns an string, in our case, set at checkState + ''' + return self._reason + + def destroy(self): + ''' + This is called once a publication is no more needed. + + This method do whatever needed to clean up things, such as + removing created "external" data (environment gets cleaned by core), + etc.. + + The retunred value is the same as when publishing, State.RUNNING, + State.FINISHED or State.ERROR. + ''' + self._name = '' + self._reason = '' # In fact, this is not needed, but cleaning up things... :-) + + # We do not do anything else to destroy this instance of publication + return State.FINISHED + + + def cancel(self): + ''' + Invoked for canceling the current operation. + This can be invoked directly by an administration or by the clean up + of the deployed service (indirectly). + When administrator requests it, the cancel is "delayed" and not + invoked directly. + + Also, take into account that cancel is the initiation of, maybe, a + multiple-step action, so it returns, as publish and destroy does. + + In our case, cancel simply invokes "destroy", that cleans up + things and returns that the action has finished in 1 step. + ''' + return self.destroy() + + # Here ends the publication needed methods. + # Methods provided below are specific for this publication + # and will be used by user deployments that uses this kind of publication + + def getBaseName(self): + ''' + This sample method (just for this sample publication), provides + the name generater for this publication. This is just a sample, and + this will do the work + ''' + return self._name diff --git a/server/documentation/_downloads/samples/services/SampleService.py b/server/documentation/_downloads/samples/services/SampleService.py new file mode 100644 index 000000000..e38c96f6d --- /dev/null +++ b/server/documentation/_downloads/samples/services/SampleService.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext_noop as translatable, ugettext as _ +from uds.core.services import Service +from SamplePublication import SamplePublication +from SampleUserDeploymentOne import SampleUserDeploymentOne +from SampleUserDeploymentTwo import SampleUserDeploymentTwo + +from uds.core.ui import gui + +import logging + +logger = logging.getLogger(__name__) + +class ServiceOne(Service): + ''' + Basic service, the first part (variables) include the description of the service. + + Remember to fill all variables needed, but at least you must define: + * typeName + * typeType + * typeDescription + * iconFile (defaults to service.png) + * publicationType, type of publication in case it needs publication. + If this is not provided, core will assume that the service do not + needs publishing. + * deployedType, type of deployed user service. Do not forget this!!! + + The rest of them can be ommited, but its recommended that you fill all + declarations shown in this sample (that in fact, are all) + + This description informs the core what this service really provides, + and how this is done. Look at description of class variables for more + information. + + ''' + #: Name to show the administrator. This string will be translated BEFORE + #: sending it to administration interface, so don't forget to + #: mark it as translatable (using ugettext_noop) + typeName = translatable('Sample Service One') + #: Type used internally to identify this provider + typeType = 'SampleService1' + #: Description shown at administration interface for this provider + typeDescription = translatable('Sample (and dummy) service ONE') + #: Icon file used as icon for this provider. This string will be translated + #: BEFORE sending it to administration interface, so don't forget to + #: mark it as translatable (using ugettext_noop) + iconFile = 'service.png' + + # Functional related data + + #: If the service provides more than 1 "deployed user" (-1 = no limit, + #: 0 = ???? (do not use it!!!), N = max number to deploy + maxDeployed = -1 + #: If we need to generate "cache" for this service, so users can access the + #: provided services faster. Is usesCache is True, you will need also + #: set publicationType, do take care about that! + usesCache = False + #: Tooltip shown to user when this item is pointed at admin interface, none + #: because we don't use it + cacheTooltip = translatable('None') + #: If we need to generate a "Level 2" cache for this service (i.e., L1 + #: could be running machines and L2 suspended machines) + usesCache_L2 = False + #: Tooltip shown to user when this item is pointed at admin interface, None + #: also because we don't use it + cacheTooltip_L2 = translatable('None') + + #: If the service needs a s.o. manager (managers are related to agents + #: provided by services itselfs, i.e. virtual machines with actors) + needsManager = False + #: If true, the system can't do an automatic assignation of a deployed user + #: service from this service + mustAssignManually = False + + #: Types of publications (preparated data for deploys) + #: In our case, we do no need a publication, so this is None + publicationType = None + #: Types of deploys (services in cache and/or assigned to users) + deployedType = SampleUserDeploymentOne + + # Now the form part, this service will have only two "dummy" fields + # If we don't indicate an order, the output order of fields will be + # "random" + + colour = gui.ChoiceField(order = 1, + label = translatable('Colour'), + tooltip = translatable('Colour of the field'), + # In this case, the choice can have none value selected by default + required = True, + values = [ gui.choiceItem('red', 'Red'), + gui.choiceItem('green', 'Green'), + gui.choiceItem('blue', 'Blue'), + gui.choiceItem('nonsense', 'Blagenta') + ], + defvalue = '1' # Default value is the ID of the choicefield + ) + + passw = gui.PasswordField(order = 2, + label = translatable('Password'), + tooltip = translatable('Password for testing purposes'), + required = True, + defvalue = '1234' #: Default password are nonsense?? :-) + ) + + baseName = gui.TextField(order = 3, + label = translatable('Services names'), + tooltip = translatable('Base name for this user services'), + # In this case, the choice can have none value selected by default + required = True, + defvalue = '' # Default value is the ID of the choicefield + ) + + def initialize(self, values): + ''' + We check here form values to see if they are valid. + + Note that we check them throught FROM variables, that already has been + initialized by __init__ method of base class, before invoking this. + ''' + + # We don't need to check anything, bat because this is a sample, we do + # As in provider, we receive values only at new Service creation, + # so we only need to validate params if values is not None + if values is not None: + if self.colour.value == 'nonsense': + raise Service.ValidationException('The selected colour is invalid!!!') + + + # Services itself are non testeable right now, so we don't even have + # to provide one!!! + + + # Congratulations!!!, the needed part of your first simple service is done! + # Now you can go to administration panel, and check it + # + # From now onwards, we implement our own methods, that will be used by, + # for example, services derived from this provider + + def getColour(self): + ''' + Simply returns colour, for deployed user services. + + Remember that choiceField.value returns the id part of the ChoiceItem + ''' + return self.colour.value + + def getPassw(self): + ''' + Simply returns passwd, for deloyed user services + ''' + return self.passw.value + + def getBaseName(self): + ''' + ''' + return self.baseName.value + + + +class ServiceTwo(Service): + ''' + Just a second service, no comments here (almost same that ServiceOne + ''' + typeName = translatable('Sample Service Two') + typeType = 'SampleService2' + typeDescription = translatable('Sample (and dummy) service ONE+ONE') + iconFile = 'provider.png' #: We reuse provider icon here :-) + + # Functional related data + maxDeployed = 5 + usesCache = True + cacheTooltip = translatable('L1 cache for dummy elements') + usesCache_L2 = True + cacheTooltip_L2 = translatable('L2 cache for dummy elements') + + needsManager = False + mustAssignManually = False + + #: Types of publications. In this case, we will include a publication + #: type for this one + #: Note that this is a MUST if you indicate that needPublication + publicationType = SamplePublication + #: Types of deploys (services in cache and/or assigned to users) + deployedType = SampleUserDeploymentTwo + + + # Gui, we will use here the EditableList field + names = gui.EditableList(label=translatable('List of names')) + + def __init__(self, environment, parent, values = None): + ''' + We here can get a HUGE list from client. + Right now, this is treated same as other fields, in a near + future we will se how to handle this better + ''' + super(ServiceTwo, self).__init__(environment, parent, values) + + # No checks here + + def getNames(self): + ''' + For using at deployed services, really nothing + ''' + return self.names.value diff --git a/server/documentation/_downloads/samples/services/SampleUserDeploymentOne.py b/server/documentation/_downloads/samples/services/SampleUserDeploymentOne.py new file mode 100644 index 000000000..e49d4a157 --- /dev/null +++ b/server/documentation/_downloads/samples/services/SampleUserDeploymentOne.py @@ -0,0 +1,373 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from uds.core.services import UserDeployment +from uds.core.util.State import State +import logging + +logger = logging.getLogger(__name__) + +class SampleUserDeploymentOne(UserDeployment): + ''' + This class generates the user consumable elements of the service tree. + + After creating at administration interface an Deployed Service, UDS will + create consumable services for users using UserDeployment class as + provider of this elements. + + + At class instantiation, this will receive an environment with"generator", + that are classes that provides a way to generate unique items. + + The generators provided right now are 'mac' and 'name'. To get more info + about this, look at py:class:`uds.core.util.UniqueMacGenerator.UniqueNameGenerator` + and py:class:`uds.core.util.UniqueNameGenerator.UniqueNameGenerator` + + This first sample do not uses cache. To see one with cache, see + SampleUserDeploymentTwo. The main difference are the "...Cache".." methods, + that here are not needed. + + As sample also of environment storage usage, wi will use here the provider + storage to keep all our needed info, leaving marshal and unmarshal (needed + by Serializble classes, like this) empty (that is, returns '' first and does + nothing the second one) + + Also Remember, if you don't include this class as the deployedType of the + SampleServiceOne, or whenever you trie to access a service of SampleServiceOne, + you will get an excetion that says that you havent included the deployedType. + ''' + + #: Recheck every five seconds by default (for task methods) + suggestedTime = 5 + + # Serializable needed methods + def marshal(self): + ''' + Does nothing right here, we will use envoronment storage in this sample + ''' + return '' + + def unmarshal(self, str_): + ''' + Does nothing here also, all data are keeped at environment storage + ''' + pass + + + def getName(self): + ''' + We override this to return a name to display. Default inplementation + (in base class), returns getUniqueIde() value + This name will help user to identify elements, and is only used + at administration interface. + + We will use here the environment name provided generator to generate + a name for this element. + + The namaGenerator need two params, the base name and a length for a + numeric incremental part for generating unique names. This are unique for + all UDS names generations, that is, UDS will not generate this name again + until this name is freed, or object is removed, what makes its environment + to also get removed, that makes all uniques ids (names and macs right now) + to also get released. + + Every time get method of a generator gets called, the generator creates + a new unique name, so we keep the first generated name cached and don't + generate more names. (Generator are simple utility classes) + ''' + name = self.storage().readData('name') + if name is None: + name = self.nameGenerator().get( self.service().getBaseName() + + '-' + self.service().getColour(), 3 ) + # Store value for persistence + self.storage().saveData('name', name) + + return name + + def setIp(self, ip): + ''' + In our case, there is no OS manager associated with this, so this method + will never get called, but we put here as sample. + + Whenever an os manager actor notifies the broker the state of the service + (mainly machines), the implementation of that os manager can (an probably will) + need to notify the IP of the deployed service. Remember that UDS treats with + IP services, so will probable needed in every service that you will create. + :note: This IP is the IP of the "consumed service", so the transport can + access it. + ''' + self.storage().saveData('ip', str(ip)) + + def getUniqueId(self): + ''' + Return and unique identifier for this service. + In our case, we will generate a mac name, that can be also as sample + of 'mac' generator use, and probably will get used something like this + at some services. + + The get method of a mac generator takes one param, that is the mac range + to use to get an unused mac. + ''' + mac = self.storage().readData('mac') + if mac is None: + mac = self.macGenerator().get( '00:00:00:00:00:00-00:FF:FF:FF:FF:FF' ) + self.storage().saveData('mac', mac) + return mac + + def getIp(self): + ''' + We need to implement this method, so we can return the IP for transports + use. If no IP is known for this service, this must return None + + If our sample do not returns an IP, IP transport will never work with + this service. Remember in real cases to return a valid IP address if + the service is accesible and you alredy know that (for example, because + the IP has been assigend via setIp by an os manager) or because + you get it for some other method. + + Storage returns None if key is not stored. + + :note: Keeping the IP address is responsibility of the User Deployment. + Every time the core needs to provide the service to the user, or + show the IP to the administrator, this method will get called + + ''' + ip = self.storage().readData('ip') + if ip is None: + ip = '192.168.0.34' # Sample IP for testing purposses only + return ip + + def setReady(self): + ''' + This is a task method. As that, the expected return values are + State values RUNNING, FINISHED or ERROR. + + The method is invoked whenever a machine is provided to an user, right + before presenting it (via transport rendering) to the user. + + This method exist for this kind of situations (i will explain it with a + sample) + + Imagine a Service tree (Provider, Service, ...) for virtual machines. + This machines will get created by the UserDeployment implementation, but, + at some time, the machine can be put at in an state (suspend, shut down) + that will make the transport impossible to connect with it. + + This method, in this case, will check the state of the machine, and if + it is "ready", that is, powered on and accesible, it will return + "State.FINISHED". If the machine is not accesible (has ben erased, for + example), it will return "State.ERROR" and store a reason of error so UDS + can ask for it and present this information to the Administrator. + + If the machine powered off, or suspended, or any other state that is not + directly usable but can be put in an usable state, it will return + "State.RUNNING", and core will use checkState to see when the operation + has finished. + + I hope this sample is enough to explain the use of this method.. + ''' + + # In our case, the service is always ready + return State.FINISHED + + def deployForUser(self, user): + ''' + Deploys an service instance for an user. + + This is a task method. As that, the excepted return values are + State values RUNNING, FINISHED or ERROR. + + The user parameter is not realy neded, but provided. It indicates the + Database User Object (see py:mod:`uds.modules`) to which this deployed + user service will be assigned to. + + This method will get called whenever a new deployed service for an user + is needed. This will give this class the oportunity to create + a service that is assigned to an user. + + The way of using this method is as follows: + + If the service gets created in "one step", that is, before the return + of this method, the consumable service for the user gets created, it + will return "State.FINISH". + If the service needs more steps (as in this case), we will return + "State.RUNNING", and if it has an error, it wil return "State.ERROR" and + store an error string so administration interface can show it. + + We do not use user for anything, as in most cases will be. + ''' + import random + + self.storage().saveData('count', '0') + + # random fail + if random.randint(0, 9) == 9: + self.storage().saveData('error', 'Random error at deployForUser :-)') + return State.ERROR + + return State.RUNNING + + + def checkState(self): + ''' + Our deployForUser method will initiate the consumable service deployment, + but will not finish it. + + So in our sample, we will only check if a number reaches 5, and if so + return that we have finished, else we will return that we are working + on it. + + One deployForUser returns State.RUNNING, this task will get called until + checkState returns State.FINISHED. + + Also, we will make the publication fail one of every 10 calls to this + method. + + Note: Destroying, canceling and deploying for cache also makes use of + this method, so you must keep the info of that you are checking if you + need it. + In our case, destroy is 1-step action so this will no get called while + destroying, and cancel will simply invoke destroy + ''' + import random + + count = int(self.storage().readData('count')) + 1 + # Count is always a valid value, because this method will never get + # called before deployForUser, deployForCache, destroy or cancel. + # In our sample, we only use checkState in case of deployForUser, + # so at first call count will be 0. + if count >= 5: + return State.FINISHED + + # random fail + if random.randint(0, 9) == 9: + self.storage().saveData('error', 'Random error at checkState :-)') + return State.ERROR + + self.storage().saveData('count', str(count)) + return State.RUNNING + + def finish(self): + ''' + Invoked when the core notices that the deployment of a service has finished. + (No matter wether it is for cache or for an user) + + This gives the oportunity to make something at that moment. + :note: You can also make these operations at checkState, this is really + not needed, but can be provided (default implementation of base class does + nothing) + ''' + # Note that this is not really needed, is just a sample of storage use + self.storage().remove('count') + + def assignToUser(self, user): + ''' + This method is invoked whenever a cache item gets assigned to an user. + This gives the User Deployment an oportunity to do whatever actions + are required so the service puts at a correct state for using by a service. + + In our sample, the service is always ready, so this does nothing. + + This is not a task method. All level 1 cache items can be diretly + assigned to an user with no more work needed, but, if something is needed, + here you can do whatever you need + ''' + pass + + def userLoggedIn(self, user): + ''' + This method must be available so os managers can invoke it whenever + an user get logged into a service. + + Default implementation does nothing, so if you are going to do nothing, + you don't need to implement it. + + The responability of notifying it is of os manager actor, and it's + directly invoked by os managers (right now, linux os manager and windows + os manager) + + The user provided is just an string, that is provided by actor. + ''' + # We store the value at storage, but never get used, just an example + self.storage().saveData('user', user) + + def userLoggedOut(self, user): + ''' + This method must be available so os managers can invoke it whenever + an user get logged out if a service. + + Default implementation does nothing, so if you are going to do nothing, + you don't need to implement it. + + The responability of notifying it is of os manager actor, and it's + directly invoked by os managers (right now, linux os manager and windows + os manager) + + The user provided is just an string, that is provided by actor. + ''' + # We do nothing more that remove the user + self.storage().remove('user') + + def reasonOfError(self): + ''' + Returns the reason of the error. + + Remember that the class is responsible of returning this whenever asked + for it, and it will be asked everytime it's needed to be shown to the + user (when the administation asks for it). + ''' + return self.storage().readData('error') or 'No error' + + def destroy(self): + ''' + This is a task method. As that, the excepted return values are + State values RUNNING, FINISHED or ERROR. + + Invoked for destroying a deployed service + Do whatever needed here, as deleting associated data if needed (i.e. a copy of the machine, snapshots, etc...) + @return: State.FINISHED if no more checks/steps for deployment are needed, State.RUNNING if more steps are needed (steps checked using checkState) + ''' + return State.FINISHED + + def cancel(self): + ''' + This is a task method. As that, the excepted return values are + State values RUNNING, FINISHED or ERROR. + + This can be invoked directly by an administration or by the clean up + of the deployed service (indirectly). + When administrator requests it, the cancel is "delayed" and not + invoked directly. + ''' + return State.FINISHED + \ No newline at end of file diff --git a/server/documentation/_downloads/samples/services/SampleUserDeploymentTwo.py b/server/documentation/_downloads/samples/services/SampleUserDeploymentTwo.py new file mode 100644 index 000000000..687971e7f --- /dev/null +++ b/server/documentation/_downloads/samples/services/SampleUserDeploymentTwo.py @@ -0,0 +1,469 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from uds.core.services import UserDeployment +from uds.core.util.State import State +import logging + +logger = logging.getLogger(__name__) + +class SampleUserDeploymentTwo(UserDeployment): + ''' + This class generates the user consumable elements of the service tree. + + This is almost the same as SampleUserDeploymentOne, but differs that this one + uses the publication to get data from it, in a very basic way. + + After creating at administration interface an Deployed Service, UDS will + create consumable services for users using UserDeployment class as + provider of this elements. + + At class instantiation, this will receive an environment with"generator", + that are classes that provides a way to generate unique items. + + The generators provided right now are 'mac' and 'name'. To get more info + about this, look at py:class:`uds.core.util.UniqueMacGenerator.UniqueNameGenerator` + and py:class:`uds.core.util.UniqueNameGenerator.UniqueNameGenerator` + + As sample also of environment storage usage, wi will use here the provider + storage to keep all our needed info, leaving marshal and unmarshal (needed + by Serializable classes, like this) empty (that is, returns '' first and does + nothing the second one) + + Also Remember, if you don't include this class as the deployedType of the + SampleServiceTwo, or whenever you try to access a service of SampleServiceTwo, + you will get an exception that says that you haven't included the deployedType. + ''' + + #: Recheck every five seconds by default (for task methods) + suggestedTime = 2 + + def initialize(self): + ''' + Initialize default attributes values here. We can do whatever we like, + but for this sample this is just right... + ''' + self._name = '' + self._ip = '' + self._mac = '' + self._error = '' + self._count = 0 + + # Serializable needed methods + def marshal(self): + ''' + Marshal own data, in this sample we will marshal internal needed + attributes. + + In this case, the data will be store with the database record. To + minimize database storage usage, we will "zip" data before returning it. + Anyway, we should keep this data as low as possible, we also have an + storage for loading larger data. + + :note: It's a good idea when providing marshalers, to store a 'version' + beside the values, so we can, at a later stage, treat with old + data for current modules. + ''' + data = '\t'.join(['v1', self._name, self._ip, self._mac, self._error, + str(self._count)]) + return data.encode('zip') + + def unmarshal(self, str_): + ''' + We unmarshal the content. + ''' + data = str_.decode('zip').split('\t') + # Data Version check + # If we include some new data at some point in a future, we can + # add "default" values at v1 check, and load new values at 'v2' check. + if data[0] == 'v1': + self._name, self._ip, self._mac, self._error, count = data[1:] + self._count = int(count) + + def getName(self): + ''' + We override this to return a name to display. Default implementation + (in base class), returns getUniqueIde() value + This name will help user to identify elements, and is only used + at administration interface. + + We will use here the environment name provided generator to generate + a name for this element. + + The namaGenerator need two params, the base name and a length for a + numeric incremental part for generating unique names. This are unique for + all UDS names generations, that is, UDS will not generate this name again + until this name is freed, or object is removed, what makes its environment + to also get removed, that makes all unique ids (names and macs right now) + to also get released. + + Every time get method of a generator gets called, the generator creates + a new unique name, so we keep the first generated name cached and don't + generate more names. (Generator are simple utility classes) + ''' + if self._name == '': + self._name = self.nameGenerator().get( self.publication().getBaseName(), + 3 ) + # self._name will be stored when object is marshaled + return self._name + + def setIp(self, ip): + ''' + In our case, there is no OS manager associated with this, so this method + will never get called, but we put here as sample. + + Whenever an os manager actor notifies the broker the state of the service + (mainly machines), the implementation of that os manager can (an probably will) + need to notify the IP of the deployed service. Remember that UDS treats with + IP services, so will probable needed in every service that you will create. + :note: This IP is the IP of the "consumed service", so the transport can + access it. + ''' + self._ip = ip + + def getUniqueId(self): + ''' + Return and unique identifier for this service. + In our case, we will generate a mac name, that can be also as sample + of 'mac' generator use, and probably will get used something like this + at some services. + + The get method of a mac generator takes one param, that is the mac range + to use to get an unused mac. + + The mac generated is not used by anyone, it will not depend on + the range, the generator will take care that this mac is unique + and in the range provided, or it will return None. The ranges + are wide enough to ensure that we always will get a mac address + in this case, but if this is not your case, take into account that + None is a possible return value, and in that case, you should return an + invalid id right now. Every time a task method is invoked, the core + will try to update the value of the unique id using this method, so + that id can change with time. (In fact, it's not unique at database level, + it's unique in the sense that you must return an unique id that can, for + example, be used by os managers to identify this element). + + :note: Normally, getting out of macs in the mac pool is a bad thing... :-) + ''' + if self._mac == '': + self._mac = self.macGenerator().get( '00:00:00:00:00:00-00:FF:FF:FF:FF:FF' ) + return self._mac + + def getIp(self): + ''' + We need to implement this method, so we can return the IP for transports + use. If no IP is known for this service, this must return None + + If our sample do not returns an IP, IP transport will never work with + this service. Remember in real cases to return a valid IP address if + the service is accesible and you alredy know that (for example, because + the IP has been assigend via setIp by an os manager) or because + you get it for some other method. + + Storage returns None if key is not stored. + + :note: Keeping the IP address is responsibility of the User Deployment. + Every time the core needs to provide the service to the user, or + show the IP to the administrator, this method will get called + + ''' + if self._ip == '': + return '192.168.0.34' # Sample IP for testing purposes only + return self._ip + + def setReady(self): + ''' + This is a task method. As that, the excepted return values are + State values RUNNING, FINISHED or ERROR. + + The method is invoked whenever a machine is provided to an user, right + before presenting it (via transport rendering) to the user. + + This method exist for this kind of situations (i will explain it with a + sample) + + Imagine a Service tree (Provider, Service, ...) for virtual machines. + This machines will get created by the UserDeployment implementation, but, + at some time, the machine can be put at in an state (suspend, shut down) + that will make the transport impossible to connect with it. + + This method, in this case, will check the state of the machine, and if + it is "ready", that is, powered on and accessible, it will return + "State.FINISHED". If the machine is not accessible (has been erased, for + example), it will return "State.ERROR" and store a reason of error so UDS + can ask for it and present this information to the Administrator. + + If the machine powered off, or suspended, or any other state that is not + directly usable but can be put in an usable state, it will return + "State.RUNNING", and core will use checkState to see when the operation + has finished. + + I hope this sample is enough to explain the use of this method.. + ''' + + # In our case, the service is always ready + return State.FINISHED + + def deployForUser(self, user): + ''' + Deploys an service instance for an user. + + This is a task method. As that, the excepted return values are + State values RUNNING, FINISHED or ERROR. + + The user parameter is not realy neded, but provided. It indicates the + Database User Object (see py:mod:`uds.modules`) to which this deployed + user service will be assigned to. + + This method will get called whenever a new deployed service for an user + is needed. This will give this class the oportunity to create + a service that is assigned to an user. + + The way of using this method is as follows: + + If the service gets created in "one step", that is, before the return + of this method, the consumable service for the user gets created, it + will return "State.FINISH". + If the service needs more steps (as in this case), we will return + "State.RUNNING", and if it has an error, it wil return "State.ERROR" and + store an error string so administration interface can show it. + + We do not use user for anything, as in most cases will be. + ''' + import random + + self._count = 0 + + # random fail + if random.randint(0, 9) == 9: + # Note that we can mark this string as translatable, and return + # it translated at reasonOfError method + self._error = 'Random error at deployForUser :-)' + return State.ERROR + + return State.RUNNING + + def deployForCache(self, cacheLevel): + ''' + Deploys a user deployment as cache. + + This is a task method. As that, the expected return values are + State values RUNNING, FINISHED or ERROR. + + In our sample, this will do exactly the same as deploy for user, + except that it will never will give an error. + + See deployForUser for a description of what this method should do. + + :note: deployForCache is invoked whenever a new cache element is needed + for an specific user deployment. It will also indicate for what + cache level (L1, L2) is the deployment + ''' + self._count = 0 + return State.RUNNING + + def moveToCache(self, newLevel): + ''' + This method is invoked whenever the core needs to move from the current + cache level to a new cache level an user deployment. + + This is a task method. As that, the expected return values are + State values RUNNING, FINISHED or ERROR. + + We only provide newLevel, because there is only two cache levels, so if + newLevel is L1, the actual is L2, and if it is L2, the actual is L1. + + Actually there is no possibility to move assigned services again back to + cache. If some service needs that kind of functionallity, this must be + provided at service level (for example, when doing publishing creating + a number of services that will be used, released and reused by users). + + Also, user deployments that are at cache level 2 will never get directly + assigned to user. First, it will pass to L1 and then it will get assigned. + + A good sample of a real implementation of this is moving a virtual machine + from a "suspended" state to "running" state to assign it to an user. + + In this sample, there is L2 cache also, but moving from L1 to L2 and + from L2 to L1 is doing really nothing, so this method will do nothing. + + In a real scenario, we will, for example, suspend or resume virtual machine + and, return State.RUNNING and at checkState check if this task is completed. + ''' + pass + + def checkState(self): + ''' + Our deployForUser method will initiate the consumable service deployment, + but will not finish it. + + So in our sample, we will only check if a number reaches 5, and if so + return that we have finished, else we will return that we are working + on it. + + One deployForUser returns State.RUNNING, this task will get called until + checkState returns State.FINISHED. + + Also, we will make the user deployment fail one of every 10 calls to this + method. + + Note: Destroying, canceling and deploying for cache also makes use of + this method, so you must keep the info of that you are checking if you + need it. + + In our case, destroy is 1-step action so this will no get called while + destroying, and cancel will simply invoke destroy. Cache deployment is + exactly as user deployment, except that the core will not assign it to + anyone, and cache moving operations is + ''' + import random + + self._count += 1 + # Count is always a valid value, because this method will never get + # called before deployForUser, deployForCache, destroy or cancel. + # In our sample, we only use checkState in case of deployForUser, + # so at first call count will be 0. + if self._count >= 5: + return State.FINISHED + + # random fail + if random.randint(0, 9) == 9: + self._error = 'Random error at checkState :-)' + return State.ERROR + + return State.RUNNING + + def finish(self): + ''' + Invoked when the core notices that the deployment of a service has finished. + (No matter whether it is for cache or for an user) + + This gives the opportunity to make something at that moment. + + :note: You can also make these operations at checkState, this is really + not needed, but can be provided (default implementation of base class does + nothing) + ''' + # We set count to 0, not needed but for sample purposes + self._count = 0 + + def assignToUser(self, user): + ''' + This method is invoked whenever a cache item gets assigned to an user. + This is not a task method right now, simply a notification. This means + that L1 cache items must be directly usable (except for the readyness part) + by users in a single step operation. + + Note that there will be an setReady call before letting the user consume + this user deployment, so this is more informational (so, if you keep at + what cache level is this instance, you can update it) than anything else. + + This is not a task method. All level 1 cache items can be dircetly + assigned to an user with no more work needed, but, if something is needed, + here you can do whatever you need. + + user is a Database user object. + ''' + logger.debug('Assigned to user {0}'.format(user)) + + def userLoggedIn(self, user): + ''' + This method must be available so os managers can invoke it whenever + an user get logged into a service. + + Default implementation does nothing, so if you are going to do nothing, + you don't need to implement it. + + The responsibility of notifying it is of os manager actor, and it's + directly invoked by os managers (right now, linux os manager and windows + os manager) + + The user provided is just an string, that is provided by actors. + ''' + # We store the value at storage, but never get used, just an example + self.storage().saveData('user', user) + + def userLoggedOut(self, user): + ''' + This method must be available so os managers can invoke it whenever + an user get logged out if a service. + + Default implementation does nothing, so if you are going to do nothing, + you don't need to implement it. + + The responability of notifying it is of os manager actor, and it's + directly invoked by os managers (right now, linux os manager and windows + os manager) + + The user provided is just an string, that is provided by actor. + ''' + # We do nothing more that remove the user + self.storage().remove('user') + + def reasonOfError(self): + ''' + Returns the reason of the error. + + Remember that the class is responsible of returning this whenever asked + for it, and it will be asked everytime it's needed to be shown to the + user (when the administation asks for it). + + :note: Remember that you can use ugettext to translate this error to + user language whenever it is possible. (This one will get invoked + directly from admin interface and, as so, will have translation + environment correctly set up. + ''' + return self._error + + def destroy(self): + ''' + This is a task method. As that, the excepted return values are + State values RUNNING, FINISHED or ERROR. + + Invoked for destroying a deployed service + Do whatever needed here, as deleting associated data if needed (i.e. a copy of the machine, snapshots, etc...) + @return: State.FINISHED if no more checks/steps for deployment are needed, State.RUNNING if more steps are needed (steps checked using checkState) + ''' + return State.FINISHED + + def cancel(self): + ''' + This is a task method. As that, the excepted return values are + State values RUNNING, FINISHED or ERROR. + + This can be invoked directly by an administration or by the clean up + of the deployed service (indirectly). + When administrator requests it, the cancel is "delayed" and not + invoked directly. + ''' + return State.FINISHED diff --git a/server/documentation/_downloads/samples/services/__init__.py b/server/documentation/_downloads/samples/services/__init__.py new file mode 100644 index 000000000..38a9126af --- /dev/null +++ b/server/documentation/_downloads/samples/services/__init__.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +Sample Service module. + +This package simply shows how a new service can be implemented. + + +The first thing to do in every package that is a module is register the +class that is responsible of providing the module with the system. + +For this, we must simply import the class at __init__, UDS will take care +of the rest +''' + +from SampleProvider import Provider + diff --git a/server/documentation/_downloads/samples/services/provider.png b/server/documentation/_downloads/samples/services/provider.png new file mode 100644 index 000000000..d2a954d44 Binary files /dev/null and b/server/documentation/_downloads/samples/services/provider.png differ diff --git a/server/documentation/_downloads/samples/services/service.png b/server/documentation/_downloads/samples/services/service.png new file mode 100644 index 000000000..c7b626c40 Binary files /dev/null and b/server/documentation/_downloads/samples/services/service.png differ diff --git a/server/documentation/_images/LogoUDS.png b/server/documentation/_images/LogoUDS.png new file mode 100644 index 000000000..f3196430b Binary files /dev/null and b/server/documentation/_images/LogoUDS.png differ diff --git a/server/documentation/api/index.rst b/server/documentation/api/index.rst new file mode 100644 index 000000000..1353be239 --- /dev/null +++ b/server/documentation/api/index.rst @@ -0,0 +1,9 @@ +============== +UDS's core API +============== + +.. toctree:: + + models + modules + /development/samples/samples diff --git a/server/documentation/api/models.rst b/server/documentation/api/models.rst new file mode 100644 index 000000000..e2639d1a6 --- /dev/null +++ b/server/documentation/api/models.rst @@ -0,0 +1,24 @@ +=================== +UDS Database Models +=================== + +This section describes de models used in UDS. + +The models described here are implemented using Django models, so you can get more +info about Django models functionalty at `Django project website `_ + +The function of the models inside UDS is to provide the persistence needed by +the core and by other utility classes that are provided, such as a Cache, Storage +or unique IDs. + +Right now the models are used all over UDS, but with time we will limit the use +of this models to be done through managers or utility clases designed for that +purpose. + +.. toctree:: + + models/services + models/authentication + models/transport + models/other + diff --git a/server/documentation/api/models/authentication.rst b/server/documentation/api/models/authentication.rst new file mode 100644 index 000000000..75d64235e --- /dev/null +++ b/server/documentation/api/models/authentication.rst @@ -0,0 +1,25 @@ +============================= +Authentication Related models +============================= +.. toctree:: + :maxdepth: 2 + +.. module:: uds.models + +.. autoclass:: Authenticator + :members: + :show-inheritance: + +.. autoclass:: User + :members: + :show-inheritance: + +.. autoclass:: Group + :members: + :show-inheritance: + +.. autoclass:: UserPreference + :members: + :show-inheritance: + + diff --git a/server/documentation/api/models/other.rst b/server/documentation/api/models/other.rst new file mode 100644 index 000000000..6c6f9e2e1 --- /dev/null +++ b/server/documentation/api/models/other.rst @@ -0,0 +1,41 @@ +============ +Other models +============ + +Environment related +------------------- + +.. module:: uds.models + +.. toctree:: + :maxdepth: 2 + +.. autoclass:: Cache + :members: + :show-inheritance: + +.. autoclass:: Storage + :members: + :show-inheritance: + +.. autoclass:: UniqueId + :members: + :show-inheritance: + +Module related +-------------- + +.. autoclass:: Config + :members: + :show-inheritance: + +Scheduling and background workers related +----------------------------------------- + +.. autoclass:: Scheduler + :members: + :show-inheritance: + +.. autoclass:: DelayedTask + :members: + :show-inheritance: diff --git a/server/documentation/api/models/services.rst b/server/documentation/api/models/services.rst new file mode 100644 index 000000000..c11794cfb --- /dev/null +++ b/server/documentation/api/models/services.rst @@ -0,0 +1,33 @@ +====================== +Service Related models +====================== + +This models takes cares of persistence of the Services and its associated elements. + + DESCRIBE HIEARARCHY HERE + + +.. toctree:: + :maxdepth: 2 + +.. module:: uds.models + +.. autoclass:: Provider + :members: + :show-inheritance: + +.. autoclass:: Service + :members: + :show-inheritance: + +.. autoclass:: DeployedService + :members: + :show-inheritance: + +.. autoclass:: DeployedServicePublication + :members: + :show-inheritance: + +.. autoclass:: UserService + :members: + :show-inheritance: diff --git a/server/documentation/api/models/transport.rst b/server/documentation/api/models/transport.rst new file mode 100644 index 000000000..3fb2545c6 --- /dev/null +++ b/server/documentation/api/models/transport.rst @@ -0,0 +1,18 @@ +======================== +Transport Related models +======================== +.. toctree:: + :maxdepth: 2 + +.. module:: uds.models + +.. autoclass:: Transport + :members: + :show-inheritance: + +.. autoclass:: Network + :members: + :show-inheritance: + + + diff --git a/server/documentation/api/modules.rst b/server/documentation/api/modules.rst new file mode 100644 index 000000000..5aaebc0d0 --- /dev/null +++ b/server/documentation/api/modules.rst @@ -0,0 +1,18 @@ +=========== +UDS Modules +=========== + + +Modules are the basic component of plugin architecture of UDS. + +As so, they are spreadly covered here, and with +:doc:`samples ` must give enough information for +allowing anyone to develop their own modules. + +.. toctree:: + + modules/BaseModule + modules/FormFields + modules/ServiceModules + modules/AuthenticatorModule + diff --git a/server/documentation/api/modules/AuthenticatorModule.rst b/server/documentation/api/modules/AuthenticatorModule.rst new file mode 100644 index 000000000..b210793a0 --- /dev/null +++ b/server/documentation/api/modules/AuthenticatorModule.rst @@ -0,0 +1,27 @@ +===================== +Authenticator Modules +===================== + +Authenticator modules are responsible of providing the user authentication +part inside UDS. + +They are composed of a package where it is provided and, at least, the following +elements: + + * One icon for administration interface representation. Icon is png file of + 16x16. + * One class, derived from uds.core.auths.Authenticator, providing the needed + logic for that authenticator. + * Registration of the class inside uds at package's __init__. + +All packages included inside uds.auths will automatically be imported, but +the authenticators needs to register as valid authenticators, and the best place +to do that is at the authenticator's package __init__. + +The best way to understand what you need to create your own authenticator, +is to look at :doc:`modules samples ` + + +.. toctree:: + + auths/Authenticator \ No newline at end of file diff --git a/server/documentation/api/modules/BaseModule.rst b/server/documentation/api/modules/BaseModule.rst new file mode 100644 index 000000000..d2d30187e --- /dev/null +++ b/server/documentation/api/modules/BaseModule.rst @@ -0,0 +1,57 @@ +=========== +Base Module +=========== + +The Base module is the base class used for all modules of UDS. + +In order to deveplop an UDS Module, there is a number of basic methods that you must provide. + +There are the clases that are base of BaseModule, that are: + * BaseModule_ + * Environmentable_ + * Serializable_ + * UserInterface_ + +.. toctree:: + +BaseModule +---------- + +.. module:: uds.core.BaseModule + +.. autoclass:: BaseModule + :members: + +Environmentable +--------------- + +.. module:: uds.core.Environment + +.. autoclass:: Environmentable + :members: + + +Serializable +------------ + +.. module:: uds.core.Serializable + +.. autoclass:: Serializable + :members: + + +UserInterface +------------- + + UserInterface is the class responsible for managing the Field Descriptions of modules. + + This fields descriptions are intended for allowing an easy exposition of configuration form via the + administration interface. + + You can obtain more information about user interface fields at :doc:`User interface fields types `. + +.. module:: uds.core.ui.UserInterface + +.. autoclass:: UserInterface + :members: + diff --git a/server/documentation/api/modules/FormFields.rst b/server/documentation/api/modules/FormFields.rst new file mode 100644 index 000000000..3b15da2a1 --- /dev/null +++ b/server/documentation/api/modules/FormFields.rst @@ -0,0 +1,33 @@ +Form Fields +=========== + +Form Fields are utility clases provided for allowing easy communication of modules +and administration interface. + +It helps to define the administration level forms that will be used to manage +different modules (service providers, services, authenticators, transports, ...) + +All modules that needs to be presented to admin users, use UserInterface as one +of their base class. + +Think that not all interfaces needed by different modules need a direct representation +at administration interface level, (for example, UserDeployment do not need to be +managed by administrators, nor publications, both corresponding to service modules). + +.. module:: uds.core.ui.UserInterface + +.. toctree:: + + +The types of fields provided are: + * :py:class:`gui.TextField` + * :py:class:`gui.NumericField` + * :py:class:`gui.PasswordField` + * :py:class:`gui.HiddenField` + * :py:class:`gui.CheckBoxField` + * :py:class:`gui.ChoiceField` + * :py:class:`gui.MultiChoiceField` + * :py:class:`gui.EditableList` + +.. autoclass:: gui + :members: InputField, TextField, NumericField, PasswordField, HiddenField, CheckBoxField, ChoiceField, MultiChoiceField, EditableList diff --git a/server/documentation/api/modules/ServiceModules.rst b/server/documentation/api/modules/ServiceModules.rst new file mode 100644 index 000000000..a3c9c1e44 --- /dev/null +++ b/server/documentation/api/modules/ServiceModules.rst @@ -0,0 +1,53 @@ +=============== +Service Modules +=============== + +Service modules are responsible for giving the user consumable ip services for +users. + +They are composed of a package where it is provided, at least, the following +elements: + + * One icon for administration interface representation. Icon is png file of + 16x16. + * A Full tree of classes, derived from interfaces (descrived below) + * Registration of the class inside UDS at package's __init__. + +All packages included inside uds.services will automatically be imported, but +the service providers (root of service trees) needs to register as valid +providers, and the best place to do that is at the authenticator's package __init__. + +the Full tree of classes needed by the service modules are: + + * **Provider**: This is the root tree of any service. It represents an agrupation + of services under the same root. As sample, a service provider can be an + Open nebula server, an VC, or whataver is a common root for a number of services. + * **Service**: This is the representation of what a service will give to an user. + As such, this is not what the user will consume, but this is more the definition + of what the user will consume. Before assigning a service to an user, the admin + will need to declare a "Deployed Service", that is a definition, using this service + an a number of other modules, of what the user will consume. Inside this service + we need to provide the information needed for deploying an user consumable item, + such as if it needs to be "prepared", if it supports cache, if it must be assigned + to an user "manually", and all the custom data that the user deployments and publications + will need. + * **Publication**. Some services, before being assigned to users, needs some kind of + preparation. This process of preparation is called here "publication". The service + itself will declare if it needs a publication and, if needed, who is responsible of + that. Services with needed publication will use this kind of class to provide + such preparation. + * **User Deployment**. This is what will provide the final user consumable service. + The user deployment is the last responsible for, using the provided service + and provided publication (if needed), to create the elements that the user will + consume. + +The best way to understand what you need to create your own services, +is to look at :doc:`modules samples ` + +.. toctree:: + + services/Provider + services/Service + services/Publication + services/UserDeployment + services/Exceptions \ No newline at end of file diff --git a/server/documentation/api/modules/auths/Authenticator.rst b/server/documentation/api/modules/auths/Authenticator.rst new file mode 100644 index 000000000..f30d9fb75 --- /dev/null +++ b/server/documentation/api/modules/auths/Authenticator.rst @@ -0,0 +1,15 @@ +======================= +Authenticator Interface +======================= + +The authenticator class is in fact an interface. UDS authenticators must derive +from this, and must provide the logic so UDS can manage the users and groups that +an authenticator provides. + + +.. toctree:: + +.. module:: uds.core.auths + +.. autoclass:: Authenticator + :members: diff --git a/server/documentation/api/modules/services/Exceptions.rst b/server/documentation/api/modules/services/Exceptions.rst new file mode 100644 index 000000000..f137b05be --- /dev/null +++ b/server/documentation/api/modules/services/Exceptions.rst @@ -0,0 +1,9 @@ +================== +Service Exceptions +================== + +.. toctree:: + +.. automodule:: uds.core.services.Exceptions + :members: + diff --git a/server/documentation/api/modules/services/Provider.rst b/server/documentation/api/modules/services/Provider.rst new file mode 100644 index 000000000..ad7fde37c --- /dev/null +++ b/server/documentation/api/modules/services/Provider.rst @@ -0,0 +1,27 @@ +================== +Provider interface +================== + +The provider class is the root class of the module. It keeps the common information +needed by all services provided by this "provider". + +Think about a provider as the class that will declare all stuff neded by core and +child services to provide and administrator user a way to create services to be +consumed by users. + +One good example is a Virtualization server. Here we keep information about that +server (ip address, protocol, ....) and services provided by that "provider" will +make use of that information to make the administrator not provide it once an again +for every service we put on that virtualization server. + +.. toctree:: + +.. module:: uds.core.services + +For a detailed example of a service provider, you can see the provided +:doc:`provider sample ` + +.. autoclass:: ServiceProvider + :members: + + diff --git a/server/documentation/api/modules/services/Publication.rst b/server/documentation/api/modules/services/Publication.rst new file mode 100644 index 000000000..290e91503 --- /dev/null +++ b/server/documentation/api/modules/services/Publication.rst @@ -0,0 +1,30 @@ +===================== +Publication interface +===================== + +The publication class is in fact an interface. It represents, in those case that +a service needs the preparation, the logic for that preparation. + +So the publication class is responsible of doing whatever is needed to get the +deployed service (that is the compound of a service, an os manager, transports +and authenticators) ready for deploying user consumables. + +Note that not all services needs to implement this class, only in those case +where that service declares that a publication is needed. + + +As functional sample of a publication, imagine that we want to assing KVM COW +machines to users. The publication class can make a clone of the base machine +(that the service itself has taken note of which one is), and then the COWs will +be created from this cloned machine. + +.. toctree:: + +.. module:: uds.core.services + +For a detailed example of a service provider, you can see the provided +:doc:`publication sample ` + +.. autoclass:: Publication + :members: + diff --git a/server/documentation/api/modules/services/Service.rst b/server/documentation/api/modules/services/Service.rst new file mode 100644 index 000000000..6e26c1281 --- /dev/null +++ b/server/documentation/api/modules/services/Service.rst @@ -0,0 +1,25 @@ +================= +Service interface +================= + +The service class is in fact an interface. It represents the base for all user +deployments (that is, consumable user services) that will be provided. + +As such, the service is responsible for keeping the information that, at deployments, +will be neded by provided user consumable services. + +A good sample of a service can be a KVM machine that will be copied COW and that COWs +will be assigned to users. In that case, we will collect which machine will be copied, +where it is to be copied, an a few more params that the user deployments will need. + +.. toctree:: + +.. module:: uds.core.services + +For a detailed example of a service provider, you can see the provided +:doc:`service sample ` + +.. autoclass:: Service + :members: + + diff --git a/server/documentation/api/modules/services/UserDeployment.rst b/server/documentation/api/modules/services/UserDeployment.rst new file mode 100644 index 000000000..6f97c2de9 --- /dev/null +++ b/server/documentation/api/modules/services/UserDeployment.rst @@ -0,0 +1,23 @@ +======================== +UserDeployment interface +======================== + +The user deployment class is in fact an interface. It represents the final consumable +that will be assigned to an user, and, as such, it must provide some mechanisms to +allow core to manage those consumables. + +A good sample of an user deployment can be a KVM Virtual Machine, cloned COW from +another, and assigned to an user. + +.. toctree:: + +.. module:: uds.core.services + +For detailed examples of a couple of user deployments, you can see the provided +:doc:`service sample ` and +:doc:`service sample ` + +.. autoclass:: UserDeployment + :members: + + diff --git a/server/documentation/conf.py b/server/documentation/conf.py new file mode 100644 index 000000000..239d5cf81 --- /dev/null +++ b/server/documentation/conf.py @@ -0,0 +1,256 @@ +# -*- coding: utf-8 -*- +# +# UDS documentation build configuration file, created by +# sphinx-quickstart on Mon Jun 18 01:41:48 2012. +# +# This file is execfile()d with the current directory set to its containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys, os + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath('../src/')) + +from server import settings +from django.core.management import setup_environ +setup_environ(settings) + +# -- General configuration ----------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.pngmath', 'sphinx.ext.mathjax', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode'] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'UDS' +copyright = u'2012, Virtual Cable S.L.U.' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '1.0' +# The full version, including alpha/beta/rc tags. +release = '1.0' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +#language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ['_build'] + +# The reST default role (used for this markup: `text`) to use for all documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + + +# -- Options for HTML output --------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# default, sphinxdoc, traditional, nature, scrolls, agogo, haiku, pyramid +html_theme = 'sphinxdoc' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +html_theme_options = { + # 'stickysidebar' : False, + # 'collapsiblesidebar' : True, + # 'externalrefs' : True, + +} + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = 'UDSdoc' + + +# -- Options for LaTeX output -------------------------------------------------- + +latex_elements = { +# The paper size ('letterpaper' or 'a4paper'). +'papersize': 'a4paper', + +# The font size ('10pt', '11pt' or '12pt'). +'pointsize': '10pt', + +# Additional stuff for the LaTeX preamble. +'preamble': '\setcounter{tocdepth}{6}', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, documentclass [howto/manual]). +latex_documents = [ + ('index', 'UDS.tex', u'UDS Documentation', + u'Virtual Cable S.L.U.', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +latex_logo = '_images/LogoUDS.png' + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +latex_show_pagerefs = True + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output -------------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', 'uds', u'UDS Documentation', + [u'Virtual Cable S.L.U.'], 1) +] + +# If true, show URL addresses after external links. +#man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------------ + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ('index', 'UDS', u'UDS Documentation', + u'Virtual Cable S.L.U.', 'UDS', 'Universal Desktop Services.', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +#texinfo_appendices = [] + +# If false, no module index is generated. +#texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#texinfo_show_urls = 'footnote' + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {'http://docs.python.org/': None} diff --git a/server/documentation/development/architecture.rst b/server/documentation/development/architecture.rst new file mode 100644 index 000000000..0bf2b1fd4 --- /dev/null +++ b/server/documentation/development/architecture.rst @@ -0,0 +1,36 @@ +================== +UDS's architecture +================== + +This section covers the current UDS Arquiceture & diagrams. + +UDS is built on the Django web framework, which itself is +built on Python, thus MyTARDIS follows the architectural model +of Django. + +Component Architecture +---------------------- + +This diagram shows the major components of UDS. + +* Core components + * `Apache Http `_ + * `WSGI `_ + * `Django `_ + * `Python `_. + +* RDBMS + UDS is currently being developed/testing on Mysql 5 Database. + May other databases will work also, but no one else has been tested. + +Functional Architecture +----------------------- + +UDS is build using Django as base support for Web acess and Database access. + +Over this, UDS uses the following diagram: + +DIAGRAM + +Core + Basic core funcionality. diff --git a/server/documentation/development/contributing.rst b/server/documentation/development/contributing.rst new file mode 100644 index 000000000..ec04f5a4c --- /dev/null +++ b/server/documentation/development/contributing.rst @@ -0,0 +1,3 @@ +=================== +Contributing to UDS +=================== diff --git a/server/documentation/development/repository.rst b/server/documentation/development/repository.rst new file mode 100644 index 000000000..36b5e39bd --- /dev/null +++ b/server/documentation/development/repository.rst @@ -0,0 +1,3 @@ +============== +UDS Repository +============== \ No newline at end of file diff --git a/server/documentation/development/samples/auths/Authenticator.rst b/server/documentation/development/samples/auths/Authenticator.rst new file mode 100644 index 000000000..f4394981f --- /dev/null +++ b/server/documentation/development/samples/auths/Authenticator.rst @@ -0,0 +1,15 @@ +==================== +Sample Authenticator +==================== + +The authenticator is the responsible of providing the needed mechanisms to UDS for +user authentication. + +As thatm this must provide a number of methods, that will allow UDS to manage +things the way it needs to. (Access users, groups, check credentials, etc...) + +Here you can :download:`Download sample ` + + +.. literalinclude:: /_downloads/samples/auths/SampleAuth.py + :linenos: diff --git a/server/documentation/development/samples/samples.rst b/server/documentation/development/samples/samples.rst new file mode 100644 index 000000000..604170bf2 --- /dev/null +++ b/server/documentation/development/samples/samples.rst @@ -0,0 +1,100 @@ +=================== +UDS Modules Samples +=================== + +In this section we cover basic samples of the different kind of mudules supported +by UDS. + +UDS is designed in a modular way, meaning this that it has a core that allows +a number of modules to get plugged inside the whole system. + +This modules are: + + * Services, including all stuff around them. + * Transports + * OS Managers + * Authenticators + +This secion will try to give sample of every module, what it must do and how this +must be done. + +Service Sample +-------------- + +A service is composed of several classes. This classes depends on how the service works. + +This are: + + * *Provider*, that is simply the "root" where services + descent, so we can configure just one part of the service parameters and rest + of them at service level. + + One sample of provider is a virtualization server, such as oVirt, Open Nebula, or + others like it. We can keep info about server at provider level, and info about + what we need in an specific service at service level. + + * *Service*, that is a service definition, that must be deployed at a later stage + to offer something to the users. + + Following our previous sample, if provider was an oVirt server, a service can + be a Virtual Machine cloned COW. + + * *Publication*, This class is optional. If service declares that needs a + publication for deployment of user instance, this class implements exactly + that, the publication for that service. Publications are in fact a way of + allowing services to prepare something in a stage prior to creating the + user consumable services. + + Following our previous sample, if provider was an oVirt Server and the service + was a Virtual Machine cloned for Cow, the poblication can be a full clone of + the service machine for making COWS from this one. + + * *DeployedService*, This class is the user consumed service itself. After a + service is created, it must be deployed, and deploy will mean that there will + be "instances" of that service (User Deployments) that will be consumed by + users. + + Following our previous sample, if the publication was a full copy machine, + an deployed service can be a machine in COW format using as base that + machine. + + +From theese, the only not really needed is Publication. Publication will only be +needed whenever a service needs a "preparation" before creating the user consumable +deployed services. For a service to be usable, we will need the full tree, meaning +this that we will provide all controllers (Provider, service or services, publication +or publications, deployed service or deployed services.). + +All class belonging to a service must be grouped under the same package, and we +well need to register this package for the system to recognize it as service. + +For this, we must register the Provider, that has references to rest of items. + +Provider declares which services it provides. Services declares which publication +and deployed service it needs. Provider can declare multiples services it offers, +but services has at most one publication and exatly one deployed service. + +So, by registering the Provider, we register the whole tree provided by de package. + +Here you can find samples of every class needed for creating a new package of +services. + +.. toctree:: + + services/whatisneeded + services/Provider + services/Service + services/Publication + services/DeployedServiceOne + services/DeployedServiceTwo + + +Authenticator Sample +-------------------- + +An authenticator is composed of a single class, derived from :py:class:`uds.core.auths.Authenticator`. + +Here you can find a sample of an authenticator. + +.. toctree:: + auths/Authenticator \ No newline at end of file diff --git a/server/documentation/development/samples/services/DeployedServiceOne.rst b/server/documentation/development/samples/services/DeployedServiceOne.rst new file mode 100644 index 000000000..abf2b43dd --- /dev/null +++ b/server/documentation/development/samples/services/DeployedServiceOne.rst @@ -0,0 +1,20 @@ +========================== +Sample User Deployment One +========================== + +User deployments are the class that are responsible for creating the ultimate consumable +user service, that is, for managing that whenever the core requests a new service for +an user, this classes will take responsibility to provide it. + +Here we cover SampleUserDeploymentOne that is for SampleServiceOne, do not needs to be +published and do not uses cache. + +You can easily follow the code to see what it does, and what you have to do if you +want to provide a new one. + +:download:`Download sample ` + + +.. literalinclude:: /_downloads/samples/services/SampleUserDeploymentOne.py + :linenos: + diff --git a/server/documentation/development/samples/services/DeployedServiceTwo.rst b/server/documentation/development/samples/services/DeployedServiceTwo.rst new file mode 100644 index 000000000..f3664a740 --- /dev/null +++ b/server/documentation/development/samples/services/DeployedServiceTwo.rst @@ -0,0 +1,20 @@ +========================== +Sample User Deployment Two +========================== + +User deployments are the class that are responsible for creating the ultimate consumable +user service, that is, for managing that whenever the core requests a new service for +an user, this classes will take responsibility to provide it. + +Here we cover SampleUserDeploymentTwo that is for SampleServiceTwo, needs to be +published and has L1 and L2 cache items. + +You can easily follow the code to see what it does, and what you have to do if you +want to provide a new one. + +:download:`Download sample ` + + +.. literalinclude:: /_downloads/samples/services/SampleUserDeploymentTwo.py + :linenos: + diff --git a/server/documentation/development/samples/services/Provider.rst b/server/documentation/development/samples/services/Provider.rst new file mode 100644 index 000000000..b792a6424 --- /dev/null +++ b/server/documentation/development/samples/services/Provider.rst @@ -0,0 +1,19 @@ +======================= +Sample Service Provider +======================= + +The service provider is the top of the tree of services needed clases. +It main function is to provide a base for services, where this services contains +a common parent that is, for example, a server, a range of IPs, etc... + +This sample covers a simple service provider, explains also a bit about FormFields +and shows what tasks must be done by a service provider. + +You can easily follow the code to see what it does, and what you have to do if you +want to provide a new one. + +:download:`Download sample ` + + +.. literalinclude:: /_downloads/samples/services/SampleProvider.py + :linenos: diff --git a/server/documentation/development/samples/services/Publication.rst b/server/documentation/development/samples/services/Publication.rst new file mode 100644 index 000000000..7d82cc0c4 --- /dev/null +++ b/server/documentation/development/samples/services/Publication.rst @@ -0,0 +1,23 @@ +================== +Sample publication +================== + +A publication is a class responsible for making a service defined available to be +consumed by users. + +Not all services needs publications as you have already seen if you are following +the samples. Publications are only needed for services that needs some kind of +preparation, as, for example, with Virtual Machines, clone the base virtual machine +so we can create COW copies from this clone. This kind of behavior needs a preparation +step, that is efectively to clone the virtual base, and that will be the task of a +publication for that kind of services. + +You can easily follow the code to see what it does, and what you have to do if you +want to provide a new one. + +:download:`Download sample ` + + +.. literalinclude:: /_downloads/samples/services/SamplePublication.py + :linenos: + diff --git a/server/documentation/development/samples/services/Service.rst b/server/documentation/development/samples/services/Service.rst new file mode 100644 index 000000000..49482e701 --- /dev/null +++ b/server/documentation/development/samples/services/Service.rst @@ -0,0 +1,15 @@ +============== +Sample service +============== + +Here we cover two services. ServiceOne, that do not needs publication and +ServiceTwo, that needs publication. + +This sample should be enought to guide you through the creation of a new service. + +:download:`Download sample ` + + +.. literalinclude:: /_downloads/samples/services/SampleService.py + :linenos: + diff --git a/server/documentation/development/samples/services/whatisneeded.rst b/server/documentation/development/samples/services/whatisneeded.rst new file mode 100644 index 000000000..20eb9ffbe --- /dev/null +++ b/server/documentation/development/samples/services/whatisneeded.rst @@ -0,0 +1,32 @@ +Needs for a service package +--------------------------- + +For a new package of services, you will need: + + + * One package (python package), of course :-). + * One icon for the provider, in png format an 16x16 size. Colours is left + to your election. This icon will be informed at Provider class. + * One icon for every service that the provider will expose. Same as provider + icons. These icons will be informed at Service class. Every single class + must provide its own icon. + * Registering the provider. For the samples show here, this will be at + __init__ of the package. + + The contents of the sample package __init__ file is: + + .. literalinclude:: /_downloads/samples/services/__init__.py + :linenos: + + :download:`Download sample ` + + * Put the package under the apropiate uds package. In the case of + services, this is under "uds.core". + + Core will look for all packages under "uds.services" and import them at + initialization of the server, so every package under this will get their + __init__ called, where we register the provider. + + * Follow the samples provided here as base + + \ No newline at end of file diff --git a/server/documentation/index.rst b/server/documentation/index.rst new file mode 100644 index 000000000..b7e3f500e --- /dev/null +++ b/server/documentation/index.rst @@ -0,0 +1,71 @@ +.. _index: + +=================== +UDS's documentation +=================== + +This documentation is provided so we can understand (hopefully) UDS, its internals, +and everything about it. + +Right now the documentation is not too ritch, but we are working on it so it will +get the needed level for this kind of project. + + +First Steps +=========== + +* **From scratch:** + :doc:`Overview ` | + :doc:`Installation ` + +.. toctree:: + :hidden: + + intro/overview + intro/install + +The internals of uds +==================== + +.. toctree:: + + development/architecture + development/development + api/index + +UDS Open source project +======================= + +* **Community:** + :doc:`How to get involved ` | + :doc:`The UDS source code repository ` + +.. toctree:: + :hidden: + + development/contributing + development/repository + + +Acknowledgements +================ + +We want to thaks all the people that has contributed to de project, an also +other Open Source project used to improve this one. + +List of other software used to build UDS: + + * `Django `_ + * `XML-RPC.NET Copyright (c) 2006 Charles Cook `_ + * `Darkglass reworked graphics `_ + * `Crystal project `_ + * `South `_ + * `Jsch `_ + * `JQuery `_ + * `Plugin detect library `_ + * `JQuery UI `_ + +I hope to do nor forget anythinh here, if i do, please, report it so we can credit +to every project that UDS makes use of. + + \ No newline at end of file diff --git a/server/documentation/intro/install.rst b/server/documentation/intro/install.rst new file mode 100644 index 000000000..39b17dcb8 --- /dev/null +++ b/server/documentation/intro/install.rst @@ -0,0 +1,46 @@ +============== +Installing UDS +============== + +In order to run UDS, you will need: + + * Django Server 1.4 + * South module for Django + * Mysql libraries for python + * Mysql Database + * Ldap Libraries for python + * Criptographic package for python + +Default transports are compiled in binary form, and keeped inside UDS repository, +so you won't need Java to put UDS to work. + +Once you have all of this, you will have to follow these steps: + + * Obtain UDS from repository, you can see how to do this from +:doc:`repository access documentation ` + * Configure a database for use with UDS. To do this, simple create a database + inside your Mysql server, and a user with all permissions in this database. + * Configure UDS settings. + Inside "server" folder, you will find "settings.py". This file contains the + configuration of UDS (if it runs in debug mode, ..). The most important part + here is the DATABASES section, where you will set up the database that UDS + will use. Simply change "host", "port", "udsername", "password" and "name" + to match your database settings. + Here, we have to take care that, if we left UDS in debug mode, Django will keep + track of all petitions to UDS, so memory will grow constantly. Do not get scared + if you see that UDS starts to waste too much memory. Simply restart it or, if it's + intended to be running for a while, set DEBUG variable to "False". + Important sections are: + + * Create initial database tables. + Inside UDS folder, where you downloaded it, you will see a "manage.py". + This python application is the responsible for managing UDS, from database creation, + migrations, backend start & stop, web server (testing web server btw), ... + To create initial databases, we will do: + + python manage.py sync + python manage.py migrate + + Now we have all databases and everything that UDS needs for starting up ready... :-) + + diff --git a/server/documentation/intro/overview.rst b/server/documentation/intro/overview.rst new file mode 100644 index 000000000..2e8705d7d --- /dev/null +++ b/server/documentation/intro/overview.rst @@ -0,0 +1,32 @@ +=============== +UDS at a glance +=============== + +UDS has been developed to make a single open source server that allows the access +to the growing ip services catalog. + +For this, we have try to make a framework that allows the use of any ip service, +focusing initially at VDI because it's the mayor need for the people we have +contacted initially . + +Also, first version of UDS has been developed "fast" (very fast indeed), so now +we need to make a revision an adapt de code of the framework so it's more +'pythonic'. (Think that i start learning python one day like this, and less than +a week later i started this proyect). So think that, althouth UDS is fully +functional, has been tested and is stable enought for any production environment, +there is a lot of work to do. + +As so, UDS not only provides default modules for a lot of things (virtualization +provider, authentication providers, protocols, ...), but also provides the core +itself to allow anyone who wants or needs something, incorporate it to the +catalog of UDS in an easy and fast way. + +* In order to use UDS, you must simply :doc:`Follow the installation guide `. + +* In order to design and implement your own modules, you must: + + * :doc:`Understand the architecture ` + * :doc:`See some module samples ` + +* In order to contribute, you must install UDS, understand it, an read the + :doc:`contributing guide ` \ No newline at end of file diff --git a/server/documentation/make.bat b/server/documentation/make.bat new file mode 100644 index 000000000..3ebfb5f05 --- /dev/null +++ b/server/documentation/make.bat @@ -0,0 +1,190 @@ +@ECHO OFF + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set BUILDDIR=_build +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . +set I18NSPHINXOPTS=%SPHINXOPTS% . +if NOT "%PAPER%" == "" ( + set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% + set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% +) + +if "%1" == "" goto help + +if "%1" == "help" ( + :help + echo.Please use `make ^` where ^ is one of + echo. html to make standalone HTML files + echo. dirhtml to make HTML files named index.html in directories + echo. singlehtml to make a single large HTML file + echo. pickle to make pickle files + echo. json to make JSON files + echo. htmlhelp to make HTML files and a HTML help project + echo. qthelp to make HTML files and a qthelp project + echo. devhelp to make HTML files and a Devhelp project + echo. epub to make an epub + echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter + echo. text to make text files + echo. man to make manual pages + echo. texinfo to make Texinfo files + echo. gettext to make PO message catalogs + echo. changes to make an overview over all changed/added/deprecated items + echo. linkcheck to check all external links for integrity + echo. doctest to run all doctests embedded in the documentation if enabled + goto end +) + +if "%1" == "clean" ( + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i + del /q /s %BUILDDIR%\* + goto end +) + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/html. + goto end +) + +if "%1" == "dirhtml" ( + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. + goto end +) + +if "%1" == "singlehtml" ( + %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. + goto end +) + +if "%1" == "pickle" ( + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the pickle files. + goto end +) + +if "%1" == "json" ( + %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the JSON files. + goto end +) + +if "%1" == "htmlhelp" ( + %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run HTML Help Workshop with the ^ +.hhp project file in %BUILDDIR%/htmlhelp. + goto end +) + +if "%1" == "qthelp" ( + %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run "qcollectiongenerator" with the ^ +.qhcp project file in %BUILDDIR%/qthelp, like this: + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\UDS.qhcp + echo.To view the help file: + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\UDS.ghc + goto end +) + +if "%1" == "devhelp" ( + %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. + goto end +) + +if "%1" == "epub" ( + %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The epub file is in %BUILDDIR%/epub. + goto end +) + +if "%1" == "latex" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "text" ( + %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The text files are in %BUILDDIR%/text. + goto end +) + +if "%1" == "man" ( + %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The manual pages are in %BUILDDIR%/man. + goto end +) + +if "%1" == "texinfo" ( + %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. + goto end +) + +if "%1" == "gettext" ( + %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The message catalogs are in %BUILDDIR%/locale. + goto end +) + +if "%1" == "changes" ( + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes + if errorlevel 1 exit /b 1 + echo. + echo.The overview file is in %BUILDDIR%/changes. + goto end +) + +if "%1" == "linkcheck" ( + %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck + if errorlevel 1 exit /b 1 + echo. + echo.Link check complete; look for any errors in the above output ^ +or in %BUILDDIR%/linkcheck/output.txt. + goto end +) + +if "%1" == "doctest" ( + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest + if errorlevel 1 exit /b 1 + echo. + echo.Testing of doctests in the sources finished, look at the ^ +results in %BUILDDIR%/doctest/output.txt. + goto end +) + +:end diff --git a/server/src/manage.py b/server/src/manage.py new file mode 100755 index 000000000..fa9aa7afc --- /dev/null +++ b/server/src/manage.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python +import os, sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "server.settings") + + from django.core.management import execute_from_command_line + + execute_from_command_line(sys.argv) diff --git a/server/src/server/__init__.py b/server/src/server/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/server/src/server/settings.py.sample b/server/src/server/settings.py.sample new file mode 100644 index 000000000..71a9a21f8 --- /dev/null +++ b/server/src/server/settings.py.sample @@ -0,0 +1,302 @@ +# -*- coding: utf-8 -*- +''' +Settings file for uds server (Django) +''' + +import os +import django +import django.conf.global_settings as DEFAULT_SETTINGS + +# calculated paths for django and the site +# used as starting points for various other paths +DJANGO_ROOT = os.path.dirname(os.path.realpath(django.__file__)) +SITE_ROOT = '/'.join(os.path.dirname(os.path.realpath(__file__)).split('/')[:-1]) + +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +ADMINS = ( + # ('Your Name', 'your_email@example.com'), +) + +MANAGERS = ADMINS + +# This mark can be used by a setup script to easy locate DB Section of the settings file +#DB_SECTION_START +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. + 'OPTIONS': { + #'init_command': 'SET storage_engine=INNODB, SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED', + 'init_command' : 'SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED', + }, + 'NAME': 'dbuds', # Or path to database file if using sqlite3. + 'USER': 'dbuds', # Not used with sqlite3. + 'PASSWORD': 'dbuds', # Not used with sqlite3. + 'HOST': '172.27.0.1', # Set to empty string for localhost. Not used with sqlite3. + 'PORT': '3306', # Set to empty string for default. Not used with sqlite3. + } +} +#DB_SECTION_END + +# Local time zone for this installation. Choices can be found here: +# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name +# although not all choices may be available on all operating systems. +# On Unix systems, a value of None will cause Django to use the same +# timezone as the operating system. +# If running in a Windows environment this must be set to the same as your +# system time zone. + +#TIME_SECTION_START +TIME_ZONE = 'Europe/Madrid' +#TIME_SECTION_END + +# Language code for this installation. All choices can be found here: +# http://www.i18nguy.com/unicode/language-identifiers.html +LANGUAGE_CODE = 'en' + +ugettext = lambda s: s + +LANGUAGES = ( + ('es', ugettext('Spanish')), + ('en', ugettext('English')), + ('fr', ugettext('French')), + ('de', ugettext('German')), +) + +SITE_ID = 1 + +# If you set this to False, Django will make some optimizations so as not +# to load the internationalization machinery. +USE_I18N = True + +# If you set this to False, Django will not format dates, numbers and +# calendars according to the current locale +USE_L10N = True + +# Absolute filesystem path to the directory that will hold user-uploaded files. +# Example: "/home/media/media.lawrence.com/media/" +MEDIA_ROOT = '' + +# URL that handles the media served from MEDIA_ROOT. Make sure to use a +# trailing slash. +# Examples: "http://media.lawrence.com/media/", "http://example.com/media/" +MEDIA_URL = '' + +# Absolute path to the directory static files should be collected to. +# Don't put anything in this directory yourself; store your static files +# in apps' "static/" subdirectories and in STATICFILES_DIRS. +# Example: "/home/media/media.lawrence.com/static/" +STATIC_ROOT = os.path.join(SITE_ROOT, 'static') + +# URL prefix for static files. +# Example: "http://media.lawrence.com/static/" +STATIC_URL = '/static/' + +# URL prefix for admin static files -- CSS, JavaScript and images. +# Make sure to use a trailing slash. +# Examples: "http://foo.com/static/admin/", "/static/admin/". +#ADMIN_MEDIA_PREFIX = '/static/admin/' + +# Additional locations of static files +STATICFILES_DIRS = ( + # Put strings here, like "/home/html/static" or "C:/www/django/static". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. +) + +# List of finder classes that know how to find static files in +# various locations. +STATICFILES_FINDERS = ( + 'django.contrib.staticfiles.finders.FileSystemFinder', + 'django.contrib.staticfiles.finders.AppDirectoriesFinder', +# 'django.contrib.staticfiles.finders.DefaultStorageFinder', +) + +#KEYS_SECTION_START +# Make this unique, and don't share it with anybody. +SECRET_KEY = 's5ky!7b5f#s35!e38xv%e-+iey6yi-#630x)tm1hf6_j8rie2*' +# This is a very long string, an RSA KEY (this can be changed, but if u loose it, all encription will be lost) +RSA_KEY = '-----BEGIN RSA PRIVATE KEY-----\nMIICXgIBAAKBgQC0qe1GlriQbHFYdKYRPBFDSS8Ne/TEKI2mtPKJf36XZTy6rIyH\nvUpT1gMScVjHjOISLNJQqktyv0G+ZGzLDmfkCUBev6JBlFwNeX3Dv/97Q0BsEzJX\noYHiDANUkuB30ukmGvG0sg1v4ccl+xs2Su6pFSc5bGINBcQ5tO0ZI6Q1nQIDAQAB\nAoGBAKA7Octqb+T/mQOX6ZXNjY38wXOXJb44LXHWeGnEnvUNf/Aci0L0epCidfUM\nfG33oKX4BMwwTVxHDrsa/HaXn0FZtbQeBVywZqMqWpkfL/Ho8XJ8Rsq8OfElrwek\nOCPXgxMzQYxoNHw8V97k5qhfupQ+h878BseN367xSyQ8plahAkEAuPgAi6aobwZ5\nFZhx/+6rmQ8sM8FOuzzm6bclrvfuRAUFa9+kMM2K48NAneAtLPphofqI8wDPCYgQ\nTl7O96GXVQJBAPoKtWIMuBHJXKCdUNOISmeEvEzJMPKduvyqnUYv17tM0JTV0uzO\nuDpJoNIwVPq5c3LJaORKeCZnt3dBrdH1FSkCQQC3DK+1hIvhvB0uUvxWlIL7aTmM\nSny47Y9zsc04N6JzbCiuVdeueGs/9eXHl6f9gBgI7eCD48QAocfJVygphqA1AkEA\nrvzZjcIK+9+pJHqUO0XxlFrPkQloaRK77uHUaW9IEjui6dZu4+2T/q7SjubmQgWR\nZy7Pap03UuFZA2wCoqJbaQJAUG0FVrnyUORUnMQvdDjAWps2sXoPvA8sbQY1W8dh\nR2k4TCFl2wD7LutvsdgdkiH0gWdh5tc1c4dRmSX1eQ27nA==\n-----END RSA PRIVATE KEY-----' +#KEYS_SECTION_END + +# List of callables that know how to import templates from various sources. +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', +# 'django.template.loaders.eggs.Loader', +) + +# Own context processors plus django's onw +TEMPLATE_CONTEXT_PROCESSORS = DEFAULT_SETTINGS.TEMPLATE_CONTEXT_PROCESSORS + ( + 'uds.core.util.Config.context_processor', +) + +MIDDLEWARE_CLASSES = ( + 'django.middleware.common.CommonMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.locale.LocaleMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', +) + +SESSION_EXPIRE_AT_BROWSER_CLOSE = True + +SESSION_COOKIE_HTTPONLY = False + +ROOT_URLCONF = 'server.urls' + +TEMPLATE_DIRS = ( + # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. + os.path.join(SITE_ROOT, 'templates') +) + +INSTALLED_APPS = ( + #'django.contrib.contenttypes', # Not used + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'south', + 'uds', +) + +# See http://docs.djangoproject.com/en/dev/topics/logging for +# more details on how to customize your logging configuration. +LOGDIR = SITE_ROOT + '/' + 'log' +LOGFILE = 'uds.log' +SERVICESFILE = 'services.log' +AUTHFILE = 'auth.log' +USEFILE = 'use.log' +LOGLEVEL = DEBUG and 'DEBUG' or 'INFO' +ROTATINGSIZE = 32*1024*1024 # 32 Megabytes before rotating files + +LOGGING = { + 'version': 1, + 'disable_existing_loggers': True, + 'formatters': { + 'verbose': { + 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s' + }, + 'simple': { + 'format': '%(levelname)s %(asctime)s %(module)s %(message)s' + }, + 'database': { + 'format': '%(levelname)s %(asctime)s Database %(message)s' + }, + 'auth': { + 'format': '%(asctime)s %(message)s' + }, + 'use': { + 'format': '%(asctime)s %(message)s' + } + }, + 'handlers': { + 'null': { + 'level':'DEBUG', + 'class':'django.utils.log.NullHandler', + }, + + 'file':{ + 'level':'DEBUG', + 'class':'logging.handlers.RotatingFileHandler', + 'formatter': 'simple', + 'filename': LOGDIR + '/' + LOGFILE, + 'mode': 'a', + 'maxBytes': ROTATINGSIZE, + 'backupCount': 3, + 'encoding': 'utf-8' + }, + + 'servicesFile':{ + 'level':'DEBUG', + 'class':'logging.handlers.RotatingFileHandler', + 'formatter': 'simple', + 'filename': LOGDIR + '/' + SERVICESFILE, + 'mode': 'a', + 'maxBytes': ROTATINGSIZE, + 'backupCount': 3, + 'encoding': 'utf-8' + }, + + 'authFile':{ + 'level':'DEBUG', + 'class':'logging.handlers.RotatingFileHandler', + 'formatter': 'auth', + 'filename': LOGDIR + '/' + AUTHFILE, + 'mode': 'a', + 'maxBytes': ROTATINGSIZE, + 'backupCount': 3, + 'encoding': 'utf-8' + }, + + 'useFile':{ + 'level':'DEBUG', + 'class':'logging.handlers.RotatingFileHandler', + 'formatter': 'use', + 'filename': LOGDIR + '/' + USEFILE, + 'mode': 'a', + 'maxBytes': ROTATINGSIZE, + 'backupCount': 3, + 'encoding': 'utf-8' + }, + + 'console':{ + 'level':'DEBUG', + 'class':'logging.StreamHandler', + 'formatter': 'simple' + }, + 'database':{ + 'level':'DEBUG', + 'class':'logging.StreamHandler', + 'formatter': 'database' + }, + 'mail_admins': { + 'level': 'ERROR', + 'class': 'django.utils.log.AdminEmailHandler', + } + }, + 'loggers': { + 'django': { + 'handlers':['null'], + 'propagate': True, + 'level':'INFO', + }, + 'django.request': { + 'handlers': ['file'], + 'level': 'ERROR', + 'propagate': False, + }, + 'django.db.backends': { + 'handlers': ['database'], + 'level': 'ERROR', + 'propagate': False, + }, + + 'uds': { + 'handlers': ['file'], + 'level': LOGLEVEL, + }, + + 'uds.services': { + 'handlers': ['servicesFile'], + 'level': LOGLEVEL, + 'propagate': False, + }, + # Custom Auth log + 'authLog': { + 'handlers' : ['authFile'], + 'level': 'INFO', + 'propagate': False, + }, + # Custom Services use log + 'useLog': { + 'handlers' : ['useFile'], + 'level': 'INFO', + 'propagate': False, + } + + } +} diff --git a/server/src/server/urls.py b/server/src/server/urls.py new file mode 100644 index 000000000..822d5f7e5 --- /dev/null +++ b/server/src/server/urls.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +''' +Url patterns for UDS project (Django) +''' + +from django.conf.urls.defaults import patterns, include + +# Uncomment the next two lines to enable the admin: +# from django.contrib import admin +# admin.autodiscover() + +urlpatterns = patterns('', + (r'^', include('uds.urls')) +) diff --git a/server/src/server/wsgi.py b/server/src/server/wsgi.py new file mode 100644 index 000000000..8906f5eee --- /dev/null +++ b/server/src/server/wsgi.py @@ -0,0 +1,34 @@ +""" +WSGI config for server project. + +This module contains the WSGI application used by Django's development server +and any production WSGI deployments. It should expose a module-level variable +named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover +this application via the ``WSGI_APPLICATION`` setting. + +Usually you will have the standard Django WSGI application here, but it also +might make sense to replace the whole Django WSGI application with a custom one +that later delegates to the Django one. For example, you could introduce WSGI +middleware here, or combine a Django application with an application of another +framework. + +""" +import os + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "server.settings") + +# This application object is used by any WSGI server configured to use this +# file. This includes Django's development server, if the WSGI_APPLICATION +# setting points here. +# Django 1.4 +#from django.core.wsgi import get_wsgi_application +#application = get_wsgi_application() + +# Django 1.3 +import django.core.handlers.wsgi +application = django.core.handlers.wsgi.WSGIHandler() + + +# Apply WSGI middleware here. +# from helloworld.wsgi import HelloWorldApplication +# application = HelloWorldApplication(application) diff --git a/server/src/uds/__init__.py b/server/src/uds/__init__.py new file mode 100644 index 000000000..15fe2208f --- /dev/null +++ b/server/src/uds/__init__.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + + + +from django.dispatch import dispatcher +from django.db.models import signals + +# Make sure that all services are "available" at service startup +import services # to make sure that the packages are initialized at this point +import auths# To make sure that the packages are initialized at this point +from osmanagers import * # To make sure that packages are initialized at this point +from transports import * # To make sure that packages are initialized at this point + + + +def modify_MySQL_storage(sender, **kwargs): + from django.db import connection + cursor = connection.cursor() + + innoDbTables = ( uds.models.UserService, uds.models.DeployedService, uds.models.DeployedServicePublication, + uds.models.Scheduler, uds.models.DelayedTask, ) + dicTables = { k._meta.db_table: True for k in innoDbTables } + + for model in kwargs['created_models']: + db_table=model._meta.db_table + if dicTables.has_key(db_table): + stmt = 'ALTER TABLE %s ENGINE=%s' % (db_table,'InnoDB') + cursor.execute(stmt) + +signals.post_syncdb.connect(modify_MySQL_storage, sender=uds.models) diff --git a/server/src/uds/auths/IP/Authenticator.py b/server/src/uds/auths/IP/Authenticator.py new file mode 100644 index 000000000..34b9d60bb --- /dev/null +++ b/server/src/uds/auths/IP/Authenticator.py @@ -0,0 +1,112 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +''' + +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' +from django.utils.translation import ugettext_noop as _ +from uds.core.auths import Authenticator +from uds.core.auths.GroupsManager import GroupsManager +from uds.models import Network +from uds.core.util.Config import Config +import logging, random, string + +logger = logging.getLogger(__name__) + +class IPAuth(Authenticator): + typeName = _('IP Authenticator') + typeType = 'IPAuth' + typeDescription = _('IP Authenticator') + iconFile = 'auth.png' + + needsPassword = False + userNameLabel = _('IP') + groupNameLabel = _('IP Range') + isExternalSource = True + + def __init__(self, dbAuth, environment, values = None): + super(IPAuth, self).__init__(dbAuth, environment, values) + # Ignore values + + def valuesDict(self): + res = {} + return res + + def __str__(self): + return "Internal IP Authenticator" + + def marshal(self): + return "v1" + + def unmarshal(self, str_): + data = str_.split('\t') + if data[0] == 'v1': + pass + + def getGroups(self, ip, groupsManager): + # these groups are a bit special. They are in fact ip-ranges, and we must check that the ip is in betwen + # The ranges are stored in group names + ip = Network.ipToLong(ip) + g = [] + for g in groupsManager.getGroupsNames(): + rangeStart, rangeEnd = g.split('-') + rangeStart = Network.ipToLong(rangeStart) + rangeEnd = Network.ipToLong(rangeEnd) + if ip >= rangeStart and ip <= rangeEnd: + groupsManager.validate(g) + + def authenticate(self, username, credentials, groupsManager): + if self.cache().get(username) == credentials: + self.cache().remove(username) + self.getGroups(username, groupsManager) + return True + return False + + + @staticmethod + def test(env, data): + return "Internal structures seems ok" + + def check(self): + return _("All seems fine in the authenticator.") + + def getHtml(self, request): + # doAutoLogin = Config.section('IPAUTH').value('autoLogin', '0').getBool() + gm = GroupsManager(self.dbAuthenticator()) + self.getGroups(request.ip, gm) + if len(gm.getValidGroups()) > 0 and self.dbAuthenticator().isValidUser(request.ip, True): + passw = ''.join(random.choice(string.letters + string.digits) for __ in xrange(12)) + self.cache().put(request.ip, passw) + return '' + else: + return '
This ip is not allowed to autologin (' + request.ip +')
' + # We will authenticate ip here, from request.ip + # If valid, it will simply submit form with ip submited and a cached generated random password diff --git a/server/src/uds/auths/IP/__init__.py b/server/src/uds/auths/IP/__init__.py new file mode 100644 index 000000000..5c267fcdc --- /dev/null +++ b/server/src/uds/auths/IP/__init__.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +''' + +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' +from uds.core.util.Config import Config +from Authenticator import IPAuth + +# Access configuration value as soon as we can, so it is available at db +Config.section('IPAUTH').value('autoLogin', '0').get() # If 1, try to autologin + diff --git a/server/src/uds/auths/IP/auth.png b/server/src/uds/auths/IP/auth.png new file mode 100644 index 000000000..9ec2bc52b Binary files /dev/null and b/server/src/uds/auths/IP/auth.png differ diff --git a/server/src/uds/auths/InternalDB/Authenticator.py b/server/src/uds/auths/InternalDB/Authenticator.py new file mode 100644 index 000000000..c05ee16d6 --- /dev/null +++ b/server/src/uds/auths/InternalDB/Authenticator.py @@ -0,0 +1,101 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +''' + +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' +from django.utils.translation import ugettext_noop as _ +from uds.core.auths import Authenticator +from uds.core.managers.CryptoManager import CryptoManager +from uds.models import Authenticator as dbAuthenticator +from uds.core.util.State import State +import hashlib +import logging + +logger = logging.getLogger(__name__) + +class InternalDBAuth(Authenticator): + typeName = _('Internal Database') + typeType = 'InternalDBAuth' + typeDescription = _('Internal dabasase authenticator. Doesn\'t uses external sources') + iconFile = 'auth.png' + + # If we need to enter the password for this user + needsPassword = True + + + def __init__(self, dbAuth, environment, values = None): + super(InternalDBAuth, self).__init__(dbAuth, environment, values) + # Ignore values + + def valuesDict(self): + res = {} + return res + + def __str__(self): + return "Internal DB Authenticator Authenticator" + + def marshal(self): + return "v1" + + def unmarshal(self, str_): + data = str_.split('\t') + if data[0] == 'v1': + pass + + def authenticate(self, username, credentials, groupsManager): + logger.debug('Username: {0}, Password: {1}'.format(username, credentials)) + auth = self.dbAuthenticator() + try: + usr = auth.users.filter(name=username, state=State.ACTIVE) + if len(usr) == 0: + return False + usr = usr[0] + # Internal Db Auth has its own groups, and if it active it is valid + if usr.password == hashlib.sha1(credentials).hexdigest(): + return True + return False + except dbAuthenticator.DoesNotExist: + return False + + def createUser(self, usrData): + pass + + @staticmethod + def test(env, data): + return [True, _("Internal structures seems ok")] + + def check(self): + return _("All seems fine in the authenticator.") + + + + \ No newline at end of file diff --git a/server/src/uds/auths/InternalDB/__init__.py b/server/src/uds/auths/InternalDB/__init__.py new file mode 100644 index 000000000..94105fc9f --- /dev/null +++ b/server/src/uds/auths/InternalDB/__init__.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +''' + +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' +from Authenticator import InternalDBAuth + diff --git a/server/src/uds/auths/InternalDB/auth.png b/server/src/uds/auths/InternalDB/auth.png new file mode 100644 index 000000000..9ec2bc52b Binary files /dev/null and b/server/src/uds/auths/InternalDB/auth.png differ diff --git a/server/src/uds/auths/RegexLdap/Authenticator.py b/server/src/uds/auths/RegexLdap/Authenticator.py new file mode 100644 index 000000000..2fd0d8864 --- /dev/null +++ b/server/src/uds/auths/RegexLdap/Authenticator.py @@ -0,0 +1,381 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +''' + +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' +from django.utils.translation import ugettext_noop as _ +from uds.core.ui.UserInterface import gui +from uds.core.auths import Authenticator +from uds.models import Authenticator as dbAuthenticator +from uds.core.util.State import State +import ldap, re + +import logging +from uds.core.auths.Exceptions import AuthenticatorException + +logger = logging.getLogger(__name__) + +LDAP_RESULT_LIMIT = 50 + +class RegexLdap(Authenticator): + + host = gui.TextField(length=64, label = _('Host'), order = 1, tooltip = _('VMWare VC Server IP or Hostname'), required = True) + port = gui.NumericField(length=5, label = _('Port'), defvalue = '389', order = 2, tooltip = _('Ldap port (389 for non ssl, 636 for ssl normally'), required = True) + ssl = gui.CheckBoxField(label = _('Use SSL'), order = 3, tooltip = _('If checked, will use a ssl connection to ldap (if port is 389, will use in fact port 636)')) + username = gui.TextField(length=64, label = _('Ldap User'), order = 4, tooltip = _('Username with read privileges on the base selected'), required = True) + password = gui.PasswordField(lenth=32, label = _('Password'), order = 5, tooltip = _('Password of the ldap user'), required = True) + timeout = gui.NumericField(length=3, label = _('Timeout'), defvalue = '10', order = 6, tooltip = _('Timeout in seconds of connection to LDAP'), required = True) + ldapBase = gui.TextField(length=64, label = _('Base'), order = 7, tooltip = _('Common search base (used for "users" and "groups"'), required = True) + userClass = gui.TextField(length=64, label = _('User class'), defvalue = 'posixAccount', order = 8, tooltip = _('Class for LDAP users (normally posixAccount)'), required = True) + userIdAttr = gui.TextField(length=64, label = _('User Id Attr'), defvalue = 'uid', order = 9, tooltip = _('Attribute that contains the user id'), required = True) + userNameAttr = gui.TextField(length=64, label = _('User Name Attr'), defvalue = 'uid', order = 10, tooltip = _('Attributes that contains the user name (list of comma separated values)'), required = True) + groupNameAttr = gui.TextField(length=64, label = _('Group Name Attr'), defvalue = 'cn', order = 11, tooltip = _('Attribute that contains the group name'), required = True) + regex = gui.TextField(length=64, label = _('Regular Exp. for groups'), defvalue = '^(.*)', order = 12, tooltip = _('Regular Expression to extract the group name'), required = True) + + typeName = _('Regex LDAP Authenticator') + typeType = 'RegexLdapAuthenticator' + typeDescription = _('Regular Expressions LDAP authenticator') + iconFile = 'auth.png' + + # If it has and external source where to get "new" users (groups must be declared inside UDS) + isExternalSource = True + # If we need to enter the password for this user + needsPassword = False + # Label for username field + userNameLabel = _('Username') + # Label for group field + groupNameLabel = _("Group") + # Label for password field + passwordLabel = _("Password") + + def __init__(self, dbAuth, environment, values = None): + super(RegexLdap, self).__init__(dbAuth, environment, values) + if values != None: + self._host = values['host'] + self._port = values['port'] + self._ssl = gui.strToBool(values['ssl']) + self._username = values['username'] + self._password = values['password'] + self._timeout = values['timeout'] + self._ldapBase = values['ldapBase'] + self._userClass = values['userClass'] + self._userIdAttr = values['userIdAttr'] + self._groupNameAttr = values['groupNameAttr'] + self._regex = values['regex'] + self._userNameAttr = values['userNameAttr'] + else: + self._host = None + self._port = None + self._ssl = None + self._username = None + self._password = None + self._timeout = None + self._ldapBase = None + self._userClass = None + self._userIdAttr = None + self._groupNameAttr = None + self._regex = None + self._userNameAttr = None + self._connection = None + + def valuesDict(self): + return { 'host' : self._host, 'port' : self._port, 'ssl' : gui.boolToStr(self._ssl), + 'username' : self._username, 'password' : self._password, 'timeout' : self._timeout, + 'ldapBase' : self._ldapBase, 'userClass' : self._userClass, + 'userIdAttr' : self._userIdAttr, 'groupNameAttr' : self._groupNameAttr, 'regex' : self._regex, + 'userNameAttr' : self._userNameAttr + } + + def __str__(self): + return "Ldap Auth: {0}:{1}@{2}:{3}, base = {4}, userClass = {5}, userIdAttr = {6}, groupNameAttr = {7}, reg.ex. = {8}, userName attr = {9}".format( + self._username, self._password, self._host, self._port, self._ldapBase, self._userClass, self._userIdAttr, self._groupNameAttr, self._regex, + self._userNameAttr) + + def marshal(self): + return str.join('\t', ['v1', + self._host, self._port, gui.boolToStr(self._ssl), self._username, self._password, self._timeout, + self._ldapBase, self._userClass, self._userIdAttr, self._groupNameAttr, self._regex, self._userNameAttr ]) + + def unmarshal(self, val): + data = val.split('\t') + if data[0] == 'v1': + logger.debug("Data: {0}".format(data[1:])) + self._host, self._port, self._ssl, self._username, self._password, self._timeout, self._ldapBase, self._userClass, self._userIdAttr, self._groupNameAttr, self._regex, self._userNameAttr = data[1:] + self._ssl = gui.strToBool(self._ssl) + + def __connection(self, username = None, password = None): + if self._connection is None or username is not None: # We want this method also to check credentials + l = None + cache = False + try: + #ldap.set_option(ldap.OPT_DEBUG_LEVEL, 9) + ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_NEVER) + schema = self._ssl and 'ldaps' or 'ldap' + port = self._port != '389' and ':' + self._port or '' + uri = "%s://%s%s" % (schema, self._host, port) + logger.debug('Ldap uri: {0}'.format(uri)) + l = ldap.initialize(uri=uri) + l.network_timeout = l.timeout = int(self._timeout) + l.protocol_version = ldap.VERSION3 + + if username is None: + cache = True + username = self._username + password = self._password + + l.simple_bind_s(who = username, cred = password) + except ldap.LDAPError, e: + str = _('Ldap connection error: ') + if type(e.message) == dict: + str += e.message.has_key('info') and e.message['info'] + ',' or '' + str += e.message.has_key('desc') and e.message['desc'] or '' + else : + str += str(e) + raise Exception(str) + if cache is True: + self._connection = l + else: + return l # Do not cache nor overwrite "global" connection + return self._connection + + def __getUser(self, username): + try: + con = self.__connection() + filter = '(&(objectClass=%s)(%s=%s))' % (self._userClass, self._userIdAttr, username) + attrlist = self._userNameAttr.split(',') + [self._userIdAttr, self._groupNameAttr] + logger.debug('Getuser filter: {0}, attr list: {1}'.format(filter, attrlist)) + res = con.search_ext_s(base = self._ldapBase, scope = ldap.SCOPE_SUBTREE, + filterstr = filter, attrlist = attrlist, sizelimit = LDAP_RESULT_LIMIT)[0] + usr = dict(( k, '' ) for k in attrlist) + usr.update(res[1]) + usr.update( {'dn' : res[0], '_id' : username }) + logger.debug('Usr: {0}'.format(usr)) + return usr + except Exception, e: + logger.exception('Exception:') + return None + + def __getGroups(self, usr): + grps = usr[self._groupNameAttr] + if type(grps) is not list: + grps = [grps] + logger.debug("Groups: {0}".format(grps)) + logger.debug("Re: {0}".format(self._regex)) + rg = re.compile(self._regex) + res = [] + for g in grps: + ma = rg.match(g) + if ma is not None: + for m in ma.groups(): + res.append(m) + logger.debug('Res: {0}'.format(res)) + return res + + def __getUserRealName(self, usr): + return ' '.join([ (type(usr.get(id, '')) is list and ' '.join(( str(k) for k in usr.get(id, ''))) or str(usr.get(id, ''))) for id in self._userNameAttr.split(',') ]).strip() + + def authenticate(self, username, credentials, groupsManager): + ''' + Must authenticate the user. + We can have to different situations here: + 1.- The authenticator is external source, what means that users may be unknown to system before callig this + 2.- The authenticator isn't external source, what means that users have been manually added to system and are known before this call + We receive the username, the credentials used (normally password, but can be a public key or something related to pk) and a group manager. + The group manager is responsible for letting know the authenticator which groups we currently has active. + @see: uds.core.auths.GroupsManager + ''' + try: + # Locate the user at LDAP + usr = self.__getUser(username) + + if usr is None: + return False + + # Let's see first if it credentials are fine + self.__connection(usr['dn'], credentials) # Will raise an exception if it can't connect + + groupsManager.validate(self.__getGroups(usr)) + + return True + + except Exception: + return False + + def createUser(self, usrData): + ''' + We must override this method in authenticators not based on external sources (i.e. database users, text file users, etc..) + External sources already has the user cause they are managed externally, so, it can at most test if the users exists on external source + before accepting it. + Groups are only used in case of internal users (non external sources) that must know to witch groups this user belongs to + @param usrData: Contains data received from user directly, that is, a dictionary with at least: name, realName, comments, state & password + @return: Raises an exception (AuthException) it things didn't went fine + ''' + res = self.__getUser(usrData['name']) + if res is None: + raise AuthenticatorException(_('Username not found')) + # Fills back realName field + usrData['realName'] = self.__getUserRealName(res) + + + def getRealName(self, username): + ''' + Tries to get the real name of an user + ''' + res = self.__getUser(username) + if res is None: + return username + return self.__getUserRealName(res) + + def modifyUser(self, usrData): + ''' + We must override this method in authenticators not based on external sources (i.e. database users, text file users, etc..) + Modify user has no reason on external sources, so it will never be used (probably) + Groups are only used in case of internal users (non external sources) that must know to witch groups this user belongs to + @param usrData: Contains data received from user directly, that is, a dictionary with at least: name, realName, comments, state & password + @return: Raises an exception it things doesn't go fine + ''' + return self.createUser(usrData) + + def createGroup(self, groupData): + ''' + We must override this method in authenticators not based on external sources (i.e. database users, text file users, etc..) + External sources already has its own groups and, at most, it can check if it exists on external source before accepting it + Groups are only used in case of internal users (non external sources) that must know to witch groups this user belongs to + @params groupData: a dict that has, at least, name, comments and active + @return: Raises an exception it things doesn't go fine + ''' + pass + + + def getGroups(self, username, groupsManager): + ''' + Looks for the real groups to which the specified user belongs + Updates groups manager with valid groups + Remember to override it in derived authentication if needed (external auths will need this, for internal authenticators this is never used) + ''' + user = self.__getUser(username) + if user is None: + raise AuthenticatorException(_('Username not found')) + groups = self.__getGroups(user) + res = [] + for g in groups: + gg = groupsManager.validate(g) + + def searchUsers(self, pattern): + try: + con = self.__connection() + res = [] + for r in con.search_ext_s(base = self._ldapBase, scope = ldap.SCOPE_SUBTREE, filterstr = '(&(objectClass=%s)(%s=%s*))' % (self._userClass, self._userIdAttr, pattern), sizelimit=LDAP_RESULT_LIMIT): + usrId = r[1].get(self._userIdAttr, '') + usrId = type(usrId) == list and usrId[0] or usrId + res.append( { 'id' : usrId, + 'name' : self.__getUserRealName(r[1]) } ) + return res + except Exception, e: + logger.exception("Exception: ") + raise AuthenticatorException(_('Too many results, be more specific')) + + @staticmethod + def test(env, data): + try: + auth = RegexLdap(None, env, data) + return auth.testConnection() + except Exception, e: + logger.error("Exception found testing Simple LDAP auth {0}: {1}".format(e.__class__, e)) + return [False, "Error testing connection"] + + def testConnection(self): + try: + con = self.__connection() + except Exception, e: + return [False, str(e)] + + try: + con.search_s(base = self._ldapBase, scope = ldap.SCOPE_BASE) + except Exception: + return [False, _('Ldap search base is incorrect')] + + try: + if len(con.search_ext_s(base = self._ldapBase, scope = ldap.SCOPE_SUBTREE, filterstr = '(objectClass=%s)' % self._userClass, sizelimit=1)) == 1: + raise Exception() + return [False, _('Ldap user class seems to be incorrect (no user found by that class)')] + except Exception, e: + # If found 1 or more, all right + pass + + try: + if len(con.search_ext_s(base = self._ldapBase, scope = ldap.SCOPE_SUBTREE, filterstr = '(objectClass=%s)' % self._groupClass, sizelimit=1)) == 1: + raise Exception() + return [False, _('Ldap group class seems to be incorrect (no group found by that class)')] + except Exception, e: + # If found 1 or more, all right + pass + + try: + if len(con.search_ext_s(base = self._ldapBase, scope = ldap.SCOPE_SUBTREE, filterstr = '(%s=*)' % self._userIdAttr, sizelimit=1)) == 1: + raise Exception() + return [False, _('Ldap user id attribute seems to be incorrect (no user found by that attribute)')] + except Exception, e: + # If found 1 or more, all right + pass + + try: + if self._groupNameAttr == 'dn': + raise Exception() # Can't search entries by dn, so this is not possible and dn is always retrieved + if len(con.search_ext_s(base = self._ldapBase, scope = ldap.SCOPE_SUBTREE, filterstr = '(%s=*)' % self._groupNameAttr, sizelimit=1)) == 1: + raise Exception() + return [False, _('Ldap group id attribute seems to be incorrect (no group found by that attribute)')] + except Exception, e: + # If found 1 or more, all right + pass + + # Now test objectclass and attribute of users + try: + if len(con.search_ext_s(base = self._ldapBase, scope = ldap.SCOPE_SUBTREE, filterstr = '(&(objectClass=%s)(%s=*))' % (self._userClass, self._userIdAttr), sizelimit=1)) == 1: + raise Exception() + return [False, _('Ldap user class or user id attr is probably wrong (can\'t find any user with both conditions)')] + except Exception as e: + # If found 1 or more, all right + pass + + # Now try to test regular expression to see if it matches anything ( + try: + # Check the existence of at least a () grouping + # Check validity of regular expression (try to compile it) + # this only right now + pass + except Exception as e: + pass + + + return [True, _("Connection params seem correct, test was succesfully executed")] + \ No newline at end of file diff --git a/server/src/uds/auths/RegexLdap/__init__.py b/server/src/uds/auths/RegexLdap/__init__.py new file mode 100644 index 000000000..3554b7412 --- /dev/null +++ b/server/src/uds/auths/RegexLdap/__init__.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +''' + +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' +from Authenticator import RegexLdap + diff --git a/server/src/uds/auths/RegexLdap/auth.png b/server/src/uds/auths/RegexLdap/auth.png new file mode 100644 index 000000000..47566edc6 Binary files /dev/null and b/server/src/uds/auths/RegexLdap/auth.png differ diff --git a/server/src/uds/auths/Sample/SampleAuth.py b/server/src/uds/auths/Sample/SampleAuth.py new file mode 100644 index 000000000..7b3699b8f --- /dev/null +++ b/server/src/uds/auths/Sample/SampleAuth.py @@ -0,0 +1,307 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' +from django.utils.translation import ugettext_noop as translatable +from uds.core.ui.UserInterface import gui +from uds.core import auths + +import logging + +logger = logging.getLogger(__name__) + +class SampleAuth(auths.Authenticator): + ''' + This class represents a sample authenticator. + + As this, it will provide: + * The authenticator functionality + * 3 Groups, "Mortals", "Gods" and "Daemons", just random group names selected.. :-), + plus groups that we enter at Authenticator form, from admin interface. + * Search of groups (inside the 3 groups used in this sample plus entered) + * Search for people (will return the search string + 000...999 as usernames) + * The Required form description for administration interface, so admins can create + new authenticators of this kind. + + In this sample, we will provide a simple standard auth, with owner drawn + login form that will simply show users that has been created and allow web user + to select one of them. + + For this class to get visible at administration client as a authenticator type, + we MUST register it at package __init__ + + :note: At class level, the translations must be simply marked as so + using ugettext_noop. This is done in this way because we will translate + the string when it is sent to the administration client. + ''' + + #: Name of type, used at administration interface to identify this + #: authenticator (i.e. LDAP, SAML, ...) + #: This string will be translated when provided to admin interface + #: using ugettext, so you can mark it as "translatable" at derived classes (using ugettext_noop) + #: if you want so it can be translated. + typeName = translatable('Sample Authenticator') + + #: Name of type used by Managers to identify this type of service + #: We could have used here the Class name, but we decided that the + #: module implementator will be the one that will provide a name that + #: will relation the class (type) and that name. + typeType = 'SampleAuthenticator' + + #: Description shown at administration level for this authenticator. + #: This string will be translated when provided to admin interface + #: using ugettext, so you can mark it as "translatable" at derived classes (using ugettext_noop) + #: if you want so it can be translated. + typeDescription = translatable('Sample dummy authenticator') + + + #: Icon file, used to represent this authenticator at administration interface + #: This file should be at same folder as this class is, except if you provide + #: your own :py:meth:uds.core.BaseModule.BaseModule.icon method. + iconFile = 'auth.png' + + #: Mark this authenticator as that the users comes from outside the UDS + #: database, that are most authenticator (except Internal DB) + #: True is the default value, so we do not need it in fact + # isExternalSource = True + + #: If we need to enter the password for this user when creating a new + #: user at administration interface. Used basically by internal authenticator. + #: False is the default value, so this is not needed in fact + #: needsPassword = False + + #: Label for username field, shown at administration interface user form. + userNameLabel = translatable('Fake User') + + # Label for group field, shown at administration interface user form. + groupNameLabel = translatable('Fake Group') + + #: Definition of this type of authenticator form + #: We will define a simple form where we will use a simple + #: list editor to allow entering a few group names + + groups = gui.EditableList(label=translatable('Groups'), values = ['Gods', 'Daemons', 'Mortals']) + + def initialize(self, values): + ''' + Simply check if we have + at least one group in the list + ''' + + # To avoid problems, we only check data if values are passed + # If values are not passed in, form data will only be available after + # unserialization, and at this point all will be default values + # so self.groups.value will be [] + if values is not None and len(self.groups.value) < 2: + raise auths.Authenticator.ValidationException(translatable('We need more that two items!')) + + def searchUsers(self, pattern): + ''' + Here we will receive a pattern for searching users. + + This method is invoked from interface, so an administrator can search users. + + If we do not provide this method, the authenticator will not provide search + facility for users. In our case, we will simply return a list of users + (array of dictionaries with ids and names) with the pattern plus 1..10 + ''' + return [ { 'id' : '{0}-{1}'.format(pattern, a), 'name' : '{0} number {1}'.format(pattern, a) } for a in range(1, 10)] + + def searchGroups(self, pattern): + ''' + Here we we will receive a patter for searching groups. + + In this sample, we will try to locate elements that where entered at + sample authenticator form (when created), and return the ones that + contains the pattern indicated. + ''' + pattern = pattern.lower() + res = [] + for g in self.groups.value: + if g.lower().find(pattern) != -1: + res.append({'id' : g, 'name' : ''}) + return res + + def authenticate(self, username, credentials, groupsManager): + ''' + This method is invoked by UDS whenever it needs an user to be authenticated. + It is used from web interface, but also from administration interface to + check credentials and access of user. + + The tricky part of this method is the groupsManager, but it's easy to + understand what is used it for. + + Imagine some authenticator, for example, an LDAP. It has its users, it has + its groups, and it has it relations (which user belongs to which group). + + Now think about UDS. UDS know nothing about this, it only knows what + the administator has entered at admin interface (groups mainly, but he can + create users also). + + UDS knows about this groups, but we need to relation those with the ones + know by the authenticator. + + To do this, we have created a simple mechanism, where the authenticator + receives a groupsManager, that knows all groups known by UDS, and has + the method so the authenticator can say, for the username being validated, + to which uds groups it belongs to. + + This is done using the :py:meth:uds.core.auths.GroupsManager.GroupsManager.validate + method of the provided groups manager. + + At return, UDS will do two things: + * If there is no group inside the groupsManager mareked as valid, it will + denied access. + * If there is some groups marked as valid, it will refresh the known + UDS relations (this means that the database will be refresehd so the user + has valid groups). + + This also means that the group membership is only checked at user login (well, + in fact its also checked when an administrator tries to modify an user) + + So, authenticate must not also validate the user credentials, but also + indicate the group membership of this user inside UDS. + + :note: groupsManager is an in/out parameter + ''' + if username != credentials: # All users with same username and password are allowed + return False + + # Now the tricky part. We will make this user belong to groups that contains at leat + # two letters equals to the groups names known by UDS + # For this, we will ask the groups manager for the groups names, and will check that and, + # if the user match this criteria, will mark that group as valid + for g in groupsManager.getGroupsNames(): + if len(set(g.lower()).intersection(username.lower())) >= 2: + groupsManager.validate(g) + + return True + + def getGroups(self, username, groupsManager): + ''' + As with authenticator part related to groupsManager, this + method will fill the groups to which the specified username belongs to. + + We have to fill up groupsManager from two different places, so it's not + a bad idea to make a method that get the "real" authenticator groups and + them simply call to :py:meth:uds.core.auths.GroupsManager.GroupsManager.validate + + In our case, we simply repeat the process that we also do at authenticate + ''' + for g in groupsManager.getGroupsNames(): + if len(set(g.lower()).intersection(username.lower())) >= 2: + groupsManager.validate(g) + + def getHtml(self, request): + ''' + If we override this method from the base one, we are telling UDS + that we want to draw our own authenticator. + + This way, we can do whataver we want here (for example redirect to a site + for a single sign on) generation our ouwn html (and javascript ofc). + + ''' + # Here there is a sample, commented out + # In this sample, we will make a list of valid users, and when clicked, + # it will fill up original form with username and same password, and submit it. + #res = '' + #for u in self.dbAuthenticator().users.all(): + # res += '{0}
'.format(u.name) + # + #res += '' + #return res + + # I know, this is a bit ugly, but this is just a sample :-) + + res = '

Login name:

' + res +='

Login

' + return res + + + def authCallback(self, parameters): + ''' + We provide this as a sample of callback for an user. + We will accept all petitions that has "user" parameter + + This method will get invoked by url redirections, probably by an SSO. + + The idea behind this is that we can provide: + * Simple user/password authentications + * Own authentications (not UDS, authenticator "owned"), but with no redirections + * Own authentications via redirections (as most SSO will do) + + Here, we will receive the parameters for this + ''' + user = parameters.get('user', None) + + return user + + def createUser(self, usrData): + ''' + This method provides a "check oportunity" to authenticators for users created + manually at administration interface. + + If we do not provide this method, the administration interface will not allow + to create new users "by hand", i mean, the "new" options from menus will dissapear. + + usrData is a dictionary that contains the input parameters from user, + with at least name, realName, comments, state & password. + + We can modify this parameters, we can modify ALL, but name is not recommended to + modify it unles you know what you are doing. + + Here, we will set the state to "Inactive" and realName to the same as username, but twice :-) + ''' + from uds.core.util.State import State + usrData['realName'] = usrData['name'] + ' ' + usrData['name'] + usrData['state'] = State.INACTIVE + + def modifyUser(self, usrData): + ''' + This method provides a "check opportunity" to authenticator for users modified + at administration interface. + + If we do not provide this method, nothing will happen (default one does nothing, but + it's valid). + + usrData is a dictionary that contains the input parameters from user, + with at least name, realName, comments, state & password. + + We can modify this parameters, we can modify ALL, but name is not recommended to + modify it unless you know what you are doing. + + Here, we will simply update the realName of the user, and (we have to take care + this this kind of things) modify the userName to a new one, the original plus '-1' + ''' + usrData['realName'] = usrData['name'] + ' ' + usrData['name'] + usrData['name'] = usrData['name'] + '-1' diff --git a/server/src/uds/auths/Sample/__init__.py b/server/src/uds/auths/Sample/__init__.py new file mode 100644 index 000000000..7ed261f46 --- /dev/null +++ b/server/src/uds/auths/Sample/__init__.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +''' +Sample authenticator. We import here the module, and uds.auths module will +take care of registering it as provider + +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' +from SampleAuth import SampleAuth + diff --git a/server/src/uds/auths/Sample/auth.png b/server/src/uds/auths/Sample/auth.png new file mode 100644 index 000000000..c8560b1d5 Binary files /dev/null and b/server/src/uds/auths/Sample/auth.png differ diff --git a/server/src/uds/auths/SimpleLDAP/Authenticator.py b/server/src/uds/auths/SimpleLDAP/Authenticator.py new file mode 100644 index 000000000..97e36689a --- /dev/null +++ b/server/src/uds/auths/SimpleLDAP/Authenticator.py @@ -0,0 +1,424 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +''' + +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' +from django.utils.translation import ugettext_noop as _ +from uds.core.ui.UserInterface import gui +from uds.core.auths import Authenticator +import ldap + +import logging +from uds.core.auths.Exceptions import AuthenticatorException + +logger = logging.getLogger(__name__) + +LDAP_RESULT_LIMIT = 50 + +class SimpleLDAPAuthenticator(Authenticator): + + host = gui.TextField(length=64, label = _('Host'), order = 1, tooltip = _('VMWare VC Server IP or Hostname'), required = True) + port = gui.NumericField(length=5, label = _('Port'), defvalue = '389', order = 2, tooltip = _('Ldap port (389 for non ssl, 636 for ssl normally'), required = True) + ssl = gui.CheckBoxField(label = _('Use SSL'), order = 3, tooltip = _('If checked, will use a ssl connection to ldap (if port is 389, will use in fact port 636)')) + username = gui.TextField(length=64, label = _('Ldap User'), order = 4, tooltip = _('Username with read privileges on the base selected'), required = True) + password = gui.PasswordField(lenth=32, label = _('Password'), order = 5, tooltip = _('Password of the ldap user'), required = True) + timeout = gui.NumericField(length=3, label = _('Timeout'), defvalue = '10', order = 6, tooltip = _('Timeout in seconds of connection to LDAP'), required = True) + ldapBase = gui.TextField(length=64, label = _('Base'), order = 7, tooltip = _('Common search base (used for "users" and "groups"'), required = True) + userClass = gui.TextField(length=64, label = _('User class'), defvalue = 'posixAccount', order = 8, tooltip = _('Class for LDAP users (normally posixAccount)'), required = True) + userIdAttr = gui.TextField(length=64, label = _('User Id Attr'), defvalue = 'uid', order = 9, tooltip = _('Attribute that contains the user id'), required = True) + userNameAttr = gui.TextField(length=64, label = _('User Name Attr'), defvalue = 'uid', order = 10, tooltip = _('Attributes that contains the user name (list of comma separated values)'), required = True) + groupClass = gui.TextField(length=64, label = _('Group class'), defvalue = 'posixGroup', order = 11, tooltip = _('Class for LDAP groups (normally poxisGroup)'), required = True) + groupIdAttr = gui.TextField(length=64, label = _('Group Id Attr'), defvalue = 'cn', order = 12, tooltip = _('Attribute that contains the group id'), required = True) + memberAttr = gui.TextField(length=64, label = _('Group membership attr'), defvalue = 'memberUid', order = 13, tooltip = _('Attribute of the group that contains the users belonging to it'), required = True) + + typeName = _('SimpleLDAP Authenticator') + typeType = 'SimpleLdapAuthenticator' + typeDescription = _('Simple LDAP authenticator') + iconFile = 'auth.png' + + # If it has and external source where to get "new" users (groups must be declared inside UDS) + isExternalSource = True + # If we need to enter the password for this user + needsPassword = False + # Label for username field + userNameLabel = _('Username') + # Label for group field + groupNameLabel = _("Group") + # Label for password field + passwordLabel = _("Password") + + def __init__(self, dbAuth, environment, values = None): + super(SimpleLDAPAuthenticator, self).__init__(dbAuth, environment, values) + if values != None: + self._host = values['host'] + self._port = values['port'] + self._ssl = gui.strToBool(values['ssl']) + self._username = values['username'] + self._password = values['password'] + self._timeout = values['timeout'] + self._ldapBase = values['ldapBase'] + self._userClass = values['userClass'] + self._groupClass = values['groupClass'] + self._userIdAttr = values['userIdAttr'] + self._groupIdAttr = values['groupIdAttr'] + self._memberAttr = values['memberAttr'] + self._userNameAttr = values['userNameAttr'].replace(' ', '') # Removes white spaces + else: + self._host = None + self._port = None + self._ssl = None + self._username = None + self._password = None + self._timeout = None + self._ldapBase = None + self._userClass = None + self._groupClass = None + self._userIdAttr = None + self._groupIdAttr = None + self._memberAttr = None + self._userNameAttr = None + self._connection = None + + def valuesDict(self): + return { 'host' : self._host, 'port' : self._port, 'ssl' : gui.boolToStr(self._ssl), + 'username' : self._username, 'password' : self._password, 'timeout' : self._timeout, + 'ldapBase' : self._ldapBase, 'userClass' : self._userClass, 'groupClass' : self._groupClass, + 'userIdAttr' : self._userIdAttr, 'groupIdAttr' : self._groupIdAttr, 'memberAttr' : self._memberAttr, + 'userNameAttr' : self._userNameAttr + } + + def __str__(self): + return "Ldap Auth: {0}:{1}@{2}:{3}, base = {4}, userClass = {5}, groupClass = {6}, userIdAttr = {7}, groupIdAttr = {8}, memberAttr = {9}, userName attr = {10}".format( + self._username, self._password, self._host, self._port, self._ldapBase, self._userClass, self._groupClass, self._userIdAttr, self._groupIdAttr, self._memberAttr, + self._userNameAttr) + + def marshal(self): + return str.join('\t', ['v1', + self._host, self._port, gui.boolToStr(self._ssl), self._username, self._password, self._timeout, + self._ldapBase, self._userClass, self._groupClass, self._userIdAttr, self._groupIdAttr, self._memberAttr, self._userNameAttr ]) + + def unmarshal(self, str): + data = str.split('\t') + if data[0] == 'v1': + logger.debug("Data: {0}".format(data[1:])) + self._host, self._port, self._ssl, self._username, self._password, self._timeout, self._ldapBase, self._userClass, self._groupClass, self._userIdAttr, self._groupIdAttr, self._memberAttr, self._userNameAttr = data[1:] + self._ssl = gui.strToBool(self._ssl) + + def __connection(self, username = None, password = None): + if self._connection is None or username is not None: # We want this method also to check credentials + l = None + cache = False + try: + #ldap.set_option(ldap.OPT_DEBUG_LEVEL, 9) + ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_NEVER) + schema = self._ssl and 'ldaps' or 'ldap' + port = self._port != '389' and ':' + self._port or '' + uri = "%s://%s%s" % (schema, self._host, port) + logger.debug('Ldap uri: {0}'.format(uri)) + l = ldap.initialize(uri=uri) + l.network_timeout = l.timeout = int(self._timeout) + l.protocol_version = ldap.VERSION3 + + if username is None: + cache = True + username = self._username + password = self._password + + l.simple_bind_s(who = username, cred = password) + except ldap.LDAPError, e: + str = _('Ldap connection error: ') + if type(e.message) == dict: + str += e.message.has_key('info') and e.message['info'] + ',' or '' + str += e.message.has_key('desc') and e.message['desc'] or '' + else : + str += str(e) + raise Exception(str) + if cache is True: + self._connection = l + else: + return l # Do not cache nor overwrite "global" connection + return self._connection + + def __getUser(self, username): + try: + con = self.__connection() + filter = '(&(objectClass=%s)(%s=%s))' % (self._userClass, self._userIdAttr, username) + attrlist = self._userNameAttr.split(',') + [self._userIdAttr] + logger.debug('Getuser filter: {0}, attr list: {1}'.format(filter, attrlist)) + res = con.search_ext_s(base = self._ldapBase, scope = ldap.SCOPE_SUBTREE, + filterstr = filter, attrlist = attrlist, sizelimit = LDAP_RESULT_LIMIT)[0] + usr = dict(( k, '' ) for k in attrlist) + usr.update(res[1]) + usr.update( {'dn' : res[0], '_id' : username }) + logger.debug('Usr: {0}'.format(usr)) + return usr + except Exception, e: + logger.exception('Exception:') + return None + + def __getGroup(self, groupName): + try: + con = self.__connection() + filter = '(&(objectClass=%s)(%s=%s))' % (self._groupClass, self._groupIdAttr, groupName) + attrlist = [self._memberAttr] + logger.debug('Getgroup filter: {0}, attr list {1}'.format(filter, attrlist)) + res = con.search_ext_s(base = self._ldapBase, scope = ldap.SCOPE_SUBTREE, + filterstr = filter, attrlist = attrlist, sizelimit = LDAP_RESULT_LIMIT)[0] + grp = dict(( k, [''] ) for k in attrlist) + grp.update(res[1]) + grp.update( {'dn' : res[0], '_id' : groupName }) + logger.debug('Group: {0}'.format(grp)) + return grp + except Exception, e: + logger.exception('Exception:') + return None + + + def __getGroups(self, usr): + try: + con = self.__connection() + filter = '(&(objectClass=%s)(|(%s=%s)(%s=%s)))' % (self._groupClass, self._memberAttr, usr['_id'], self._memberAttr, usr['dn']) + logger.debug('Filter: {0}'.format(filter)) + res = con.search_ext_s(base = self._ldapBase, scope = ldap.SCOPE_SUBTREE, filterstr = filter, attrlist = [self._groupIdAttr], + sizelimit = LDAP_RESULT_LIMIT) + groups = {} + for g in res: + v = g[1][self._groupIdAttr] + if type(v) is not list: + v = [v] + for gg in v: + groups[str(gg)] = g[0] + logger.debug('Groups: {0}'.format(groups)) + return groups + + except Exception: + return {} + + + def __getUserRealName(self, usr): + ''' + Tries to extract the real name for this user. Will return all atttributes (joint) + specified in _userNameAttr (comma separated). + ''' + return ' '.join([ (type(usr.get(id_, '')) is list and ' '.join(( str(k) for k in usr.get(id_, ''))) or str(usr.get(id_, ''))) for id_ in self._userNameAttr.split(',') ]).strip() + + def authenticate(self, username, credentials, groupsManager): + ''' + Must authenticate the user. + We can have to different situations here: + 1.- The authenticator is external source, what means that users may be unknown to system before callig this + 2.- The authenticator isn't external source, what means that users have been manually added to system and are known before this call + We receive the username, the credentials used (normally password, but can be a public key or something related to pk) and a group manager. + The group manager is responsible for letting know the authenticator which groups we currently has active. + @see: uds.core.auths.GroupsManager + ''' + try: + # Locate the user at LDAP + usr = self.__getUser(username) + + if usr is None: + return False + + # Let's see first if it credentials are fine + self.__connection(usr['dn'], credentials) # Will raise an exception if it can't connect + + groupsManager.validate(self.__getGroups(usr).keys()) + + return True + + except Exception: + return False + + def createUser(self, usrData): + ''' + Groups are only used in case of internal users (non external sources) that must know to witch groups this user belongs to + @param usrData: Contains data received from user directly, that is, a dictionary with at least: name, realName, comments, state & password + @return: Raises an exception (AuthException) it things didn't went fine + ''' + res = self.__getUser(usrData['name']) + if res is None: + raise AuthenticatorException(_('Username not found')) + # Fills back realName field + usrData['realName'] = self.__getUserRealName(res) + + def getRealName(self, username): + ''' + Tries to get the real name of an user + ''' + res = self.__getUser(username) + if res is None: + return username + return self.__getUserRealName(res) + + def modifyUser(self, usrData): + ''' + We must override this method in authenticators not based on external sources (i.e. database users, text file users, etc..) + Modify user has no reason on external sources, so it will never be used (probably) + Groups are only used in case of internal users (non external sources) that must know to witch groups this user belongs to + @param usrData: Contains data received from user directly, that is, a dictionary with at least: name, realName, comments, state & password + @return: Raises an exception it things don't goes fine + ''' + return self.createUser(usrData) + + def createGroup(self, groupData): + ''' + We must override this method in authenticators not based on external sources (i.e. database users, text file users, etc..) + External sources already has its own groups and, at most, it can check if it exists on external source before accepting it + Groups are only used in case of internal users (non external sources) that must know to witch groups this user belongs to + @params groupData: a dict that has, at least, name, comments and active + @return: Raises an exception it things don't goes fine + ''' + res = self.__getGroup(groupData['name']) + if res is None: + raise AuthenticatorException(_('Group not found')) + + + def getGroups(self, username, groupsManager): + ''' + Looks for the real groups to which the specified user belongs + Updates groups manager with valid groups + Remember to override it in derived authentication if needed (external auths will need this, for internal authenticators this is never used) + ''' + user = self.__getUser(username) + if user is None: + raise AuthenticatorException(_('Username not found')) + groupsManager.validate(self.__getGroups(user).keys()) + + def searchUsers(self, pattern): + try: + con = self.__connection() + res = [] + for r in con.search_ext_s(base = self._ldapBase, scope = ldap.SCOPE_SUBTREE, filterstr = '(&(objectClass=%s)(%s=%s*))' % (self._userClass, self._userIdAttr, pattern), sizelimit=LDAP_RESULT_LIMIT): + usrId = r[1].get(self._userIdAttr, '') + usrId = type(usrId) == list and usrId[0] or usrId + res.append( { 'id' : usrId, + 'name' : self.__getUserRealName(r[1]) } ) + return res + except Exception, e: + logger.exception("Exception: ") + raise AuthenticatorException(_('Too many results, be more specific')) + + def searchGroups(self, pattern): + try: + con = self.__connection() + res = [] + for r in con.search_ext_s(base = self._ldapBase, scope = ldap.SCOPE_SUBTREE, filterstr = '(&(objectClass=%s)(%s=%s*))' % (self._groupClass, self._groupIdAttr, pattern), sizelimit=LDAP_RESULT_LIMIT): + grpId = r[1].get(self._groupIdAttr, '') + grpId = type(grpId) == list and grpId[0] or grpId + res.append( { 'id' : grpId, + 'name' : grpId } ) + return res + except Exception, e: + logger.exception("Exception: ") + raise AuthenticatorException(_('Too many results, be more specific')) + + + @staticmethod + def test(env, data): + try: + auth = SimpleLDAPAuthenticator(None, env, data) + return auth.testConnection() + except Exception, e: + logger.error("Exception found testing Simple LDAP auth {0}: {1}".format(e.__class__, e)) + return [False, "Error testing connection"] + + def testConnection(self): + try: + con = self.__connection() + except Exception, e: + return [False, str(e)] + + try: + con.search_s(base = self._ldapBase, scope = ldap.SCOPE_BASE) + except Exception: + return [False, _('Ldap search base is incorrect')] + + try: + if len(con.search_ext_s(base = self._ldapBase, scope = ldap.SCOPE_SUBTREE, filterstr = '(objectClass=%s)' % self._userClass, sizelimit=1)) == 1: + raise Exception() + return [False, _('Ldap user class seems to be incorrect (no user found by that class)')] + except Exception, e: + # If found 1 or more, all right + pass + + try: + if len(con.search_ext_s(base = self._ldapBase, scope = ldap.SCOPE_SUBTREE, filterstr = '(objectClass=%s)' % self._groupClass, sizelimit=1)) == 1: + raise Exception() + return [False, _('Ldap group class seems to be incorrect (no group found by that class)')] + except Exception, e: + # If found 1 or more, all right + pass + + try: + if len(con.search_ext_s(base = self._ldapBase, scope = ldap.SCOPE_SUBTREE, filterstr = '(%s=*)' % self._userIdAttr, sizelimit=1)) == 1: + raise Exception() + return [False, _('Ldap user id attribute seems to be incorrect (no user found by that attribute)')] + except Exception, e: + # If found 1 or more, all right + pass + + try: + if len(con.search_ext_s(base = self._ldapBase, scope = ldap.SCOPE_SUBTREE, filterstr = '(%s=*)' % self._groupIdAttr, sizelimit=1)) == 1: + raise Exception() + return [False, _('Ldap group id attribute seems to be incorrect (no group found by that attribute)')] + except Exception, e: + # If found 1 or more, all right + pass + + # Now test objectclass and attribute of users + try: + if len(con.search_ext_s(base = self._ldapBase, scope = ldap.SCOPE_SUBTREE, filterstr = '(&(objectClass=%s)(%s=*))' % (self._userClass, self._userIdAttr), sizelimit=1)) == 1: + raise Exception() + return [False, _('Ldap user class or user id attr is probably wrong (can\'t find any user with both conditions)')] + except Exception, e: + # If found 1 or more, all right + pass + + # And group part, with membership + try: + res = con.search_ext_s(base = self._ldapBase, scope = ldap.SCOPE_SUBTREE, filterstr = '(&(objectClass=%s)(%s=*))' % (self._groupClass, self._groupIdAttr), attrlist = [self._memberAttr]) + if len(res) == 0: + raise Exception(_('Ldap group class or group id attr is probably wrong (can\'t find any group with both conditions)')) + ok = False + for r in res: + if r[1].has_key(self._memberAttr) is True: + ok = True + break + if ok is False: + raise Exception(_('Can\'t locate any group with the membership attribute specified')) + except Exception, e: + return [False, str(e)] + + + + return [True, _("Connection params seem correct, test was succesfully executed")] + \ No newline at end of file diff --git a/server/src/uds/auths/SimpleLDAP/__init__.py b/server/src/uds/auths/SimpleLDAP/__init__.py new file mode 100644 index 000000000..88d874bed --- /dev/null +++ b/server/src/uds/auths/SimpleLDAP/__init__.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +''' + +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' +from Authenticator import SimpleLDAPAuthenticator + diff --git a/server/src/uds/auths/SimpleLDAP/auth.png b/server/src/uds/auths/SimpleLDAP/auth.png new file mode 100644 index 000000000..47566edc6 Binary files /dev/null and b/server/src/uds/auths/SimpleLDAP/auth.png differ diff --git a/server/src/uds/auths/__init__.py b/server/src/uds/auths/__init__.py new file mode 100644 index 000000000..be007c225 --- /dev/null +++ b/server/src/uds/auths/__init__.py @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +Authentication modules for uds are contained inside this module. +To create a new authentication module, you will need to follow this steps: + 1.- Create the authentication module, probably based on an existing one + 2.- Insert the module as child of this module + 3.- Import the class of your authentication module at __init__. For example:: + from Authenticator import SimpleAthenticator + 4.- Done. At Server restart, the module will be recognized, loaded and treated + +The registration of modules is done locating subclases of :py:class:`uds.core.auths.Authentication` + +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' + +def __init__(): + ''' + This imports all packages that are descendant of this package, and, after that, + it register all subclases of authenticator as + ''' + import os.path, pkgutil + import sys + from uds.core import auths + + # Dinamycally import children of this package. The __init__.py files must register, if needed, inside AuthsFactory + pkgpath = os.path.dirname(sys.modules[__name__].__file__) + for _, name, _ in pkgutil.iter_modules([pkgpath]): + __import__(name, globals(), locals(), [], -1) + + a = auths.Authenticator + for cls in a.__subclasses__(): + auths.factory().insert(cls) + +__init__() diff --git a/server/src/uds/core/BaseModule.py b/server/src/uds/core/BaseModule.py new file mode 100644 index 000000000..5bd54c6f4 --- /dev/null +++ b/server/src/uds/core/BaseModule.py @@ -0,0 +1,266 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext as _ +from uds.core.ui.UserInterface import UserInterface +from uds.core.Environment import Environmentable +from uds.core.Serializable import Serializable +import base64, os.path, sys, logging + +logger = logging.getLogger(__name__) + +class BaseModule(UserInterface, Environmentable, Serializable): + ''' + Base class for all modules used by UDS. + This base module provides all the needed methods that modules must implement + + All modules must, at least, implement the following: + + * Attributes: + * :py:attr:`.typeName`: + Name for this type of module (human readable) to assign to the module (string) + This name will be used to let the administrator identify this module. + * :py:attr:`.typeType`: + Name for this type of module (machine only) to assing to the module (string) + This name will be used internally to identify when a serialized module corresponds with this class. + * :py:attr:`.typeDescription`: + Description for this type of module. + This descriptio will be used to let the administrator identify what this module provides + * :py:attr:`.iconFile`: This is an icon file, in png format, used at administration client to identify this module. + This parameter may be optionall if you override the "icon" method. + * Own Methods: + * :py:meth:`.__init__` + The default constructor. The environment value is always provided (see Environment), but the + default values provided can be None. + Remember to allow the instantiation of the module with default params, because when deserialization is done, + the process is first instatiate with an environment but no parameters and then call "unmarshal" from Serializable. + * :py:meth:`.test` + * :py:meth:`.check` + * :py:meth:`.destroy`: Optional + * :py:meth:`.icon`: Optional, if you provide an icon file, this method loads it from module folder, + but you can override this so the icon is obtained from other source. + * :py:meth:`.marshal` + By default, this method serializes the values provided by user in form fields. You can override it, + but now it's not needed because you can access config vars using Form Fields. + + Anyway, if you override this method, you must also override next one + * :py:meth:`.unmarshal` + By default, this method de-serializes the values provided by user in form fields. You can override it, + but now it's not needed because you can access config vars using Form Fields. + + Anyway, if you override this method, you must also override previous one + + * UserInterface Methods: + * :py:meth:`uds.core.ui.UserInterface.UserInterface.valuesDict` + This method, by default, provides the values contained in the form fields. If you don't override the marshal and + unmarshal, this method should be fine as is for you also. + + + Environmentable is a base class that provides utility method to access a separate Environment for every single + module. + ''' + #: Which coded to use to encode module by default. + #: This overrides the Environmentable and Serializable Attribute, but in all cases we are using 'base64' + CODEC = 'base64' # Can be zip, hez, bzip, base64, uuencoded + + #: Basic name used to provide the administrator an "huma readable" form for the module + typeName = 'Base Module' + #: Internal type name, used by system to locate this module + typeType = 'BaseModule' + #: Description of this module, used at admin level + typeDescription = 'Base Module' + #: Icon file, relative to module folders + iconFile = 'base.png' # This is expected to be png, use this format always + + class ValidationException(Exception): + ''' + Exception used to indicate that the params assigned are invalid + ''' + + @classmethod + def name(cls): + ''' + Returns "translated" typeName, using ugettext for transforming + cls.typeName + + Args: + cls: This is a class method, so cls is the class + + Returns: + Translated type name (using ugettext) + ''' + return _(cls.typeName) + + @classmethod + def type(cls): + ''' + Returns typeType + + Args: + cls: This is a class method, so cls is the class + + Returns: + the typeType of this class (or derived class) + ''' + return cls.typeType + + @classmethod + def description(cls): + ''' + This method returns the "translated" description, that is, using + ugettext for transforming cls.typeDescription. + + Args: + cls: This is a class method, so cls is the class + + Returns: + Translated description (using ugettext) + + ''' + return _(cls.typeDescription) + + + @classmethod + def icon(cls, inBase64 = True): + ''' + Reads the file specified by iconFile at module folder, and returns it content. + This is used to obtain an icon so administration can represent it. + + Args: + cls: Class + + inBase64: If true, the image will be returned as base 64 encoded + + Returns: + Base 64 encoded or raw image, obtained from the specified file at + 'iconFile' class attribute + ''' + logger.debug('Loading icon for class {0} ({1})'.format(cls, cls.iconFile)) + file_ = open( os.path.dirname(sys.modules[cls.__module__].__file__) + '/' + cls.iconFile, 'rb') + data = file_.read() + file_.close() + if inBase64 == True: + return base64.encodestring(data) + else: + return data + + @staticmethod + def test(env, data): + ''' + Test if the connection data is ok. + + Returns an array, first value indicates "Ok" if true, "Bad" or "Error" + if false. Second is a string describing operation + + Args: + env: environment passed for testing (temporal environment passed) + + data: data passed for testing (data obtained from the form + definition) + + Returns: + Array of two elements, first is True of False, depending on test + (True is all right, false is error), + second is an String with error, preferably internacionalizated.. + ''' + return [True, _("No connection checking method is implemented.")] + + def __init__(self, environment, values = None): + ''' + Do not forget to invoke this in your derived class using + "super(self.__class__, self).__init__(environment, values)". + + We want to use the env, cache and storage methods outside class. + If not called, you must implement your own methods. + + cache and storage are "convenient" methods to access _env.cache() and + _env.storage() + + The values param is passed directly to UserInterface base. + + The environment param is passed directly to environment. + + Values are passed to __initialize__ method. It this is not None, + the values contains a dictionary of values received from administration gui, + that contains the form data requested from user. + + If you override marshal, unmarshal and inherited UserInterface method + valuesDict, you must also take account of values (dict) provided at the + __init__ method of your class. + ''' + UserInterface.__init__(self, values) + Environmentable.__init__(self, environment) + Serializable.__init__(self) + + def __str__(self): + return "Base Module" + + def marshal(self): + ''' + By default and if not overriden by descendants, this method, overridden + from Serializable, and returns the serialization of + form field stored values. + ''' + return self.serializeForm() + + def unmarshal(self, str_): + ''' + By default and if not overriden by descendants, this method recovers + data serialized using serializeForm + ''' + self.unserializeForm(str_) + + def check(self): + ''' + Method that will provide the "check" capability for the module. + + The return value that this method must provide is simply an string, + preferable internacionalizated. + + Returns: + Internacionalized (using ugettext) string of result of the check. + ''' + return _("No check method provided.") + + def destroy(self): + ''' + Invoked before deleting an module from database. + + Do whatever needed here, as deleting associated data if needed + (no example come to my head right now... :-) ) + + Returns: + Nothing + ''' + pass + diff --git a/server/src/uds/core/Environment.py b/server/src/uds/core/Environment.py new file mode 100644 index 000000000..b0d2f189a --- /dev/null +++ b/server/src/uds/core/Environment.py @@ -0,0 +1,205 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' + +TEMP_ENV = 'temporary' +GLOBAL_ENV = 'global' + +class Environment(object): + ''' + Class to manipulate the associated environment with "environmentable" classes (mainly modules). + It purpose is to provide an "object owned" environment, so every db record can contain associated values + not stored with main module data. + The environment is composed of a "cache" and a "storage". First are volatile data, while second are persistent data. + ''' + + def __init__(self, uniqueKey, idGenerators = {}): + ''' + Initialized the Environment for the specified id + @param uniqueId: Key for this environment + @param idGenerators: Hash of generators of ids for this environment. This "generators of ids" feature + is used basically at User Services to auto-create ids for macs or names, using + {'mac' : UniqueMacGenerator, 'name' : UniqueNameGenerator } as argument. + ''' + from uds.core.util.Cache import Cache + from uds.core.util.Storage import Storage + self._key = uniqueKey + self._cache = Cache(uniqueKey) + self._storage = Storage(uniqueKey) + self._idGenerators = idGenerators + + def cache(self): + ''' + Method to acces the cache of the environment. + @return: a referente to a Cache instance + ''' + return self._cache + + def storage(self): + ''' + Method to acces the cache of the environment. + @return: a referente to an Storage Instance + ''' + return self._storage + + def idGenerators(self, generatorId): + ''' + The idea of generator of id is to obtain at some moment Ids with a proper generator. + If the environment do not contains generators of id, this method will return None. + The id generator feature is used by User Services to obtain different auto-id generators, as macs or names + @param generatorId: Id of the generator to obtain + @return: Generator for that id, or None if no generator for that id is found + ''' + if self._idGenerators.has_key(generatorId): + return self._idGenerators[generatorId] + return None + + def key(self): + ''' + @return: the key used for this environment + ''' + return self._key + + def clearRelatedData(self): + ''' + Removes all related information from database for this environment. + ''' + from uds.core.util.Cache import Cache + from uds.core.util.Storage import Storage + Cache.delete(self._key) + Storage.delete(self._key) + for __, v in self._idGenerators.iteritems(): + v.release() + + @staticmethod + def getEnvForTableElement(tblName, id_, idGeneratorsTypes = {}): + ''' + From a table name, and a id, tries to load the associated environment or creates a new + one if no environment exists at database. The table name and the id are used to obtain the key + for the environment, so each element at database can have its own environment. + @param tblName: Table name + @param id_: Id of the element (normally primary key of the record for which we want an environment) + @param idGeneratorsTypes: Associated Generators. Defaults to none + @return: Obtained associated environment (may be empty if none exists at database, but it will be valid) + ''' + name = 't-' + tblName + '-' + str(id_) + idGenerators = {} + for k,v in idGeneratorsTypes.iteritems(): + idGenerators[k] = v(name) + return Environment(name, idGenerators) + + @staticmethod + def getEnvForType(type_): + ''' + Obtains an environment associated with a type instead of a record + @param type_: Type + @return Associated Environment + ''' + return Environment('type-'+str(type_)) + + @staticmethod + def getTempEnv(): + ''' + Provides a temporary environment needed in some calls (test provider, for example) + It will not make environment persistent + ''' + return Environment(TEMP_ENV) # TODO: In fact, we should provide a "null" cache and a "null" storage, but for now this is right + + @staticmethod + def getGlobalEnv(): + ''' + Provides global environment + ''' + return Environment(GLOBAL_ENV) # This environment is a global environment for general utility. + +class Environmentable(object): + ''' + This is a base class provided for all objects that have an environment associated. These are mainly modules + ''' + + def __init__(self, environment): + ''' + Initialized the element + + Args: + environment: Environment to associate with + ''' + self._env = environment + + def setEnv(self, environment): + ''' + Assigns a new environment + + Args: + environment: Environment to assign + ''' + self._env = environment + + def env(self): + ''' + Utility method to access the envionment contained by this object + + Returns: + Environmnet for the object + ''' + return self._env + + def cache(self): + ''' + Utility method to access the cache of the environment containe by this object + + Returns: + Cache for the object + ''' + return self._env.cache() + + def storage(self): + ''' + Utility method to access the storage of the environment containe by this object + + Returns: + Storage for the object + ''' + return self._env.storage() + + def idGenerators(self, generatorId): + ''' + Utility method to access the id generator of the environment containe by this object + + Args: + generatorId: Id of the generator to obtain + + Returns: + Generator for the object and the id specified + ''' + return self._env.idGenerators(generatorId) + \ No newline at end of file diff --git a/server/src/uds/core/Serializable.py b/server/src/uds/core/Serializable.py new file mode 100644 index 000000000..d8c26624d --- /dev/null +++ b/server/src/uds/core/Serializable.py @@ -0,0 +1,94 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' + +class Serializable(object): + ''' + This class represents the interface that all serializable objects must provide. + + Every single serializable class must implement marshall & unmarshall methods. Also, the class must allow + to be initialized without parameters, so we can: + - Initialize the object with default values + - Read values from seralized data + ''' + # Codify codec constant + CODEC = 'base64' # Can be zip, hez, bzip, base64, uuencoded + + def __init__(self): + pass + + def marshal(self): + ''' + This is the method that must be overriden in order to serialize an object. + + The system will use in fact 'seralize' and 'deserialize' methods, but theese are + only suitable methods to "codify" serialized values + + :note: This method must be overridden + ''' + raise Exception('Base marshaler called!!!') + + def unmarshal(self, str_): + ''' + This is the method that must be overriden in order to unserialize an object. + + The system will use in fact 'seralize' and 'deserialize' methods, but theese are + only convenients methods to "codify" serialized values. + + Take into account that _str can be '' (empty string), but hopefully it will never be none. + In that case, initialize the object with default values + + Args: + str _ : String readed from persistent storage to deseralilize + + :note: This method must be overridden + ''' + raise Exception('Base unmarshaler called!!!') + + def serialize(self): + ''' + Serializes and "obfuscates' the data. + + The codec used to encode the string is obtained from the instance CODEC, so derived classes can + overwrite this attribute to set another codec + ''' + return self.marshal().encode(self.CODEC) + + def unserialize(self, str_): + ''' + des-obfuscates the data and then de-serializes it via unmarshal method + + The codec used to decode the string is obtained from the instance CODEC, so derived classes can + overwrite this attribute to set another codec + ''' + return self.unmarshal(str_.decode(self.CODEC)) + \ No newline at end of file diff --git a/server/src/uds/core/__init__.py b/server/src/uds/core/__init__.py new file mode 100644 index 000000000..ffd183bff --- /dev/null +++ b/server/src/uds/core/__init__.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +Core of UDS. +This package contains all core-related code for UDS +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +# Core needs tasks manager to register scheduled jobs, so we ensure of that here +from managers.TaskManager import TaskManager +import services +import auths + +TaskManager.registerScheduledTask() \ No newline at end of file diff --git a/server/src/uds/core/auths/AuthsFactory.py b/server/src/uds/core/auths/AuthsFactory.py new file mode 100644 index 000000000..b28f776e8 --- /dev/null +++ b/server/src/uds/core/auths/AuthsFactory.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +class AuthsFactory(object): + ''' + This class holds the register of all known authentication modules + inside UDS. + + It provides a way to register and recover Authentication providers. + ''' + _factory = None + + def __init__(self): + self._auths = {} + + @staticmethod + def factory(): + ''' + Returns the factory that keeps the register of authentication providers. + ''' + if AuthsFactory._factory == None: + AuthsFactory._factory = AuthsFactory() + return AuthsFactory._factory + + def providers(self): + ''' + Returns the list of authentication providers already registered. + ''' + return self._auths + + def insert(self, type_): + ''' + Registers a new authentication provider + ''' + self._auths[type_.type()] = type_ + + def lookup(self, typeName): + ''' + Tries to locate an authentication provider and by its name, and, if + not found, returns None + ''' + return self._auths.get(typeName, None) diff --git a/server/src/uds/core/auths/BaseAuthenticator.py b/server/src/uds/core/auths/BaseAuthenticator.py new file mode 100644 index 000000000..c5609a1e2 --- /dev/null +++ b/server/src/uds/core/auths/BaseAuthenticator.py @@ -0,0 +1,495 @@ +# -*- coding: utf-8 -*- +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +Base module for all authenticators + +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' +from uds.core.BaseModule import BaseModule +from django.utils.translation import ugettext_noop as translatable +from GroupsManager import GroupsManager +from Exceptions import InvalidUserException +import logging + +logger = logging.getLogger(__name__) + +class Authenticator(BaseModule): + ''' + This class represents the base interface to implement authenticators. + + An authenticator is responsible for managing user and groups of a kind + inside UDS. As so, it must provide a number of method and mechanics to + allow UDS to manage users and groups using that kind of authenticator. + + Some samples of authenticators are LDAP, Internal Database, SAML, CAS, ... + + As always, if you override __init__, do not forget to invoke base __init__ as this:: + + super(self.__class__, self).__init__(self, dbAuth, environment, values) + + This is a MUST, so internal structured gets filled correctly, so don't forget it!. + + The preferred method of doing initialization is to provide the :py:meth:`.initialize`, + and do not override __init__ method. This (initialize) will be invoked after + all internal initialization. + + There are basically two kind of authenticators, that are "Externals" and + "Internals". + + Internal authenticators are those where and administrator has created manually + the user at admin interface. The users are not created from an external source, + so if an user do not exist at UDS database, it will not be valid. + In other words, if you have an authenticator where you must create users, + you can modify them, you must assign passwords manually, and group membership + also must be assigned manually, the authenticator is not an externalSource. + + As you can notice, almost avery authenticator except internal db will be + external source, so, by default, attribute that indicates that is an external + source is set to True. + + + In fact, internal source authenticator is intended to allow UDS to identify + if the users come from internal DB (just the case of local authenticator), + or the users come from other sources. Also, this allos UDS to know when to + "update" group membership information for an user whenever it logs in. + + External authenticator are in fact all authenticators except local database, + so we have defined isExternalSource as True by default, that will be most + cases. + + :note: All attributes that are "translatable" here means that they will be + translated when provided to administration interface, so remember + to mark them in your own authenticators as "translatable" using + ugettext_noop. We have aliased it here to "translatable" so it's + easier to understand. + ''' + + #: Name of type, used at administration interface to identify this + #: authenticator (i.e. LDAP, SAML, ...) + #: This string will be translated when provided to admin interface + #: using ugettext, so you can mark it as "translatable" at derived classes (using ugettext_noop) + #: if you want so it can be translated. + typeName = translatable('Base Authenticator') + + #: Name of type used by Managers to identify this type of service + #: We could have used here the Class name, but we decided that the + #: module implementator will be the one that will provide a name that + #: will relation the class (type) and that name. + typeType = 'BaseAuthenticator' + + #: Description shown at administration level for this authenticator. + #: This string will be translated when provided to admin interface + #: using ugettext, so you can mark it as "translatable" at derived classes (using ugettext_noop) + #: if you want so it can be translated. + typeDescription = translatable('Base Authenticator') + + + #: Icon file, used to represent this authenticator at administration interface + #: This file should be at same folder as this class is, except if you provide + #: your own :py:meth:uds.core.BaseModule.BaseModule.icon method. + iconFile = 'auth.png' + + #: Mark this authenticator as that the users comes from outside the UDS + #: database, that are most authenticator (except Internal DB) + #: So, isInternalSource means that "user is kept at database only" + isExternalSource = True + + #: If we need to enter the password for this user when creating a new + #: user at administration interface. Used basically by internal authenticator. + needsPassword = False + + #: Label for username field, shown at administration interface user form. + userNameLabel = translatable('User name') + + #: Label for group field, shown at administration interface user form. + groupNameLabel = translatable('Group name') + + #: Label for password field, , shown at administration interface user form. + #: Not needed for external authenticators (where credentials are stored with + #: an already existing user. + passwordLabel = translatable('Password') + + from User import User + from Group import Group + + #: The type of user provided, normally standard user will be enough. + #: This is here so if we need it in some case, we can write our own + #: user class + userType = User + + #: The type of group provided, normally standard group will be enough + #: This is here so if we need it in some case, we can write our own + #: group class + groupType = Group + + def __init__(self, dbAuth, environment, values): + ''' + Instantiathes the authenticator. + @param dbAuth: Database object for the authenticator + @param environment: Environment for the authenticator + @param values: Values passed to element + ''' + self._dbAuth = dbAuth + super(Authenticator, self).__init__(environment, values) + self.initialize(values) + + def initialize(self, values): + ''' + This method will be invoked from __init__ constructor. + This is provided so you don't have to provide your own __init__ method, + and invoke base methods. + This will get invoked when all initialization stuff is done + + Args: + Values: If values is not none, this object is being initialized + from administration interface, and not unmarshal will be done. + If it's None, this is initialized internally, and unmarshal will + be called after this. + + Default implementation does nothing + ''' + pass + + def dbAuthenticator(self): + ''' + Helper method to access the Authenticator database object + ''' + return self._dbAuth + + def recreateGroups(self, user): + ''' + Helper method, not needed to be overriden. + It simply checks if the source is external and if so, recreates + the user groups for storing them at database. + + user param is a database user object + ''' + if self.isExternalSource == True: + groupsManager = GroupsManager(self._dbAuth) + self.getGroups(user.name, groupsManager) + user.groups = [ g.dbGroup() for g in groupsManager.getValidGroups()] + + def callbackUrl(self): + ''' + Helper method to return callback url for self (authenticator). + + This method will allow us to know where to do redirection in case + we need to use callback + ''' + from auth import authCallbackUrl + return authCallbackUrl(self.dbAuthenticator()) + + def searchUsers(self, pattern): + ''' + If you provide this method, the user will be allowed to search users, + that is, the search button at administration interface, at user form, + will be enabled. + + Returns an array of users that match the supplied pattern + If none found, returns empty array. + + Must return is an array of dictionaries that must contains 'id' and 'name' + example: [ {'id': 'user1', 'name': 'Nombre 1'} ] + + Args: + pattern: Pattern to search for (simple pattern, string) + + Returns + a list of found users for the pattern specified + ''' + return [] + + def searchGroups(self, pattern): + ''' + Returns an array of groups that match the supplied pattern + If none found, returns empty array. Items returned are BaseGroups (or derived) + If you override this method, the admin interface will allow the use of + "search" at group form. If not overriden, the search will not be allowed. + + Must return array of dictionaries that must contains 'id' and 'name' + example: [ {'id': 'user1', 'name': 'Nombre 1'} ] + + Default implementation returns empty array, but is never used because if + not overriden, search of groups will not be allowed. + ''' + return [] + + def authenticate(self, username, credentials, groupsManager): + ''' + This method must be overriden, and is responsible for authenticating + users. + + We can have to different situations here: + + * The authenticator is external source, what means that users may + be unknown to system before callig this + * The authenticator isn't external source, what means that users have + been manually added to system and are known before this call. + This will only happen at Internal DB Authenticator. + + We receive the username, the credentials used (normally password, but can + be a public key or something related to pk) and a group manager. + + The group manager is responsible for letting know the authenticator which + groups we currently has active. + + Args: + username: User name to authenticate + credentilas: Credentials for this user, (password, pki, or whatever needs to be used) + groupManager: Group manager to modify with groups to which this users belongs to. + + Returns: + True if authentication success, False if don't. + + See uds.core.auths.GroupsManager + + :note: This method must check not only that the user has valid credentials, but also + check the valid groups from groupsManager. + If this method returns false, of method getValidGroups of the groupsManager + passed into this method has no elements, the user will be considered invalid. + So remember to check validity of groups this user belongs to (inside the authenticator, + not inside UDS) using groupsManager.validate(group to which this users belongs to). + + This is done in this way, because UDS has only a subset of groups for this user, and + we let the authenticator decide inside wich groups of UDS this users is included. + ''' + return False + + def getForAuth(self, username): + ''' + Process the username for this authenticator and returns it. + This transformation is used for transports only, not for transforming + anything at login time. Transports that will need the username, will invoke + this method. + For example, ad authenticator can add '@domain' so transport use the complete + 'user@domain' instead of 'user'. + + Right now, all authenticators keep this value "as is", i mean, it simply + returns the unprocessed username + ''' + return username + + def getGroups(self, username, groupsManager): + ''' + Looks for the real groups to which the specified user belongs + Returns a list of groups. + Remember to override it in derived authentication if needed (external auths will need this, for internal authenticators this is never used) + ''' + return [] + + def getHtml(self, request): + ''' + If you override this method, and returns something different of None, + UDS will consider your authenticator as "Owner draw", that is, that it + will not use the standard form for user authentication. + + Args: + Request is the DJango request received for generating this html, + with included user ip at request.ip. + + We have here a few things that we should know for creating our own + html for authenticator: + + * We use jQuery, so your javascript can use it + * The id of the username input field is **id_user** + * The id of the password input field is **id_password** + * The id of the login form is **loginform** + * The id of the "back to login" link is **backToLogin** + + This is what happens when an authenticator that has getHtml method is + selected in the front end (from the combo shown): + + * The div with id **login** is hidden. + * The div with id **nonStandard** is shown + * Using Ajax, the html provided by this method is requested for + the authenticator + * The returned html is rendered inside **nonStandardLogin** div. + * The **nonStandard** div is shown. + + **nonStandard** div has two inner divs, **nonStandardLogin** and + **divBackToLogin**. If there is no standard auths, divBackToLogin is + erased. + + With this, and :py:meth:.authCallback method, we can add SSO engines + to UDS with no much problems. + ''' + return None + + def authCallback(self, parameters): + ''' + There is a view inside UDS, an url, that will redirect the petition + to this callback. + + If someone gets authenticated via this callback, the method will return + an "username" must be return. This username will be used to: + + * Add user to UDS + * Get user groups. + + So, if this callback is called, also get the membership to groups of the user, and keep them. + This method will have to keep track of those until UDS request that groups + using getGroups. (This is easy, using storage() provided with the environment (env()) + + If this returns None, or empty, the authentication will be considered "invalid" + and an error will be shown. + + :note: Keeping user information about group membership inside storage is highly recommended. + There will be calls to getGroups one an again, and also to getRealName, not just + at login, but at future (from admin interface, at user editing for example) + ''' + return None + + def getRealName(self, username): + ''' + Tries to get the real name of an user + + Default implementation returns just the same user name that is passed in. + ''' + return username + + def createUser(self, usrData): + ''' + This method is used when creating an user to allow the authenticator: + + * Check that the name inside usrData is fine + * Fill other (not name, if you don't know what are you doing) usrData dictionary values. + + This will be invoked from admin interface, when admin wants to create a new user + + modified usrData will be used to store values at database. + + Args: + usrData: Contains data received from user directly, that is a dictionary + with at least: name, realName, comments, state & password. + This is an in/out parameter, so you can modify, for example, + **realName** + + Returns: + Raises an exception if things didn't went fine, + return value is ignored, but modified usrData is used if this does not + raises an exception. + + Take care with whatever you modify here, you can even modify provided + name (login name!) to a new one! + + :note: If you have an SSO where you can't create an user from admin interface, + raise an exception here indicating that the creation can't be done. + Default implementation simply raises "AuthenticatorException" and + says that user can't be created manually + + ''' + raise InvalidUserException(translatable('Users can\'t be created inside this authenticator')) + + + def modifyUser(self, usrData): + ''' + This method is used when modifying an user to allow the authenticator: + + * Check that the name inside usrData is fine + * Fill other (not name, if you don't know what are you doing) usrData dictionary values. + + Args: + usrData: Contains data received from user directly, that is a dictionary + with at least: name, realName, comments, state & password. + This is an in/out parameter, so you can modify, for example, + **realName** + + + Returns: + Raises an exception if things didn't went fine, + return value is ignored, but modified usrData is used if this does not + raises an exception. + + Take care with whatever you modify here, you can even modify provided + name (login name!) to a new one! + + :note: By default, this will do nothing, as we can only modify "accesory" internal + data of users. + ''' + pass + + + def createGroup(self, groupData): + ''' + This method is used when creating a new group to allow the authenticator: + + * Check that the name inside groupData is fine + * Fill other (not name, if you don't know what are you doing) usrData dictionary values. + + This will be invoked from admin interface, when admin wants to create a new group. + + modified groupData will be used to store values at database. + + Args: + groupData: Contains data received from user directly, that is a dictionary + with at least: name, comments and active. + This is an in/out parameter, so you can modify, for example, + **comments** + + Returns: + Raises an exception if things didn't went fine, + return value is ignored, but modified groupData is used if this does not + raises an exception. + + Take care with whatever you modify here, you can even modify provided + name (group name) to a new one! + ''' + pass + + def removeUser(self, username): + ''' + Remove user is used whenever from the administration interface, or from other + internal workers, an user needs to be removed. + + This is a notification method, whenever an user gets removed from UDS, this + will get called. + + You can do here whatever you want, but you are not requested to do anything + at your authenticators. + + If this method raises an exception, the user will not be removed from UDS + ''' + pass + + # We don't have a "modify" group option. Once u have created it, the only way of changing it if removing it an recreating it with another name + + def removeGroup(self, groupname): + ''' + Remove user is used whenever from the administration interface, or from other + internal workers, an group needs to be removed. + + This is a notification method, whenever an group gets removed from UDS, this + will get called. + + You can do here whatever you want, but you are not requested to do anything + at your authenticators. + + If this method raises an exception, the group will not be removed from UDS + ''' + pass diff --git a/server/src/uds/core/auths/Exceptions.py b/server/src/uds/core/auths/Exceptions.py new file mode 100644 index 000000000..c68d17564 --- /dev/null +++ b/server/src/uds/core/auths/Exceptions.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' + +class AuthenticatorException(Exception): + ''' + Generic authentication exception + ''' + pass + +class InvalidUserException(Exception): + ''' + Invalid user specified. The user cant access the requested service + ''' + pass + +class InvalidAuthenticatorException(Exception): + ''' + Invalida authenticator has been specified + ''' + pass \ No newline at end of file diff --git a/server/src/uds/core/auths/Group.py b/server/src/uds/core/auths/Group.py new file mode 100644 index 000000000..e1178abb7 --- /dev/null +++ b/server/src/uds/core/auths/Group.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification,are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' + +import logging + +logger = logging.getLogger(__name__) + +class Group(object): + ''' + A group is simply a database group associated with its authenticator instance + + It's only constructor expect a database group as parameter. + ''' + + def __init__(self, dbGroup): + ''' + Initializes internal data + ''' + self._manager = dbGroup.getManager() + self._dbGroup = dbGroup + + def manager(self): + ''' + Returns the database authenticator associated with this group + ''' + return self._manager + + def dbGroup(self): + ''' + Returns the database group associated with this + ''' + return self._dbGroup diff --git a/server/src/uds/core/auths/GroupsManager.py b/server/src/uds/core/auths/GroupsManager.py new file mode 100644 index 000000000..84e4a574c --- /dev/null +++ b/server/src/uds/core/auths/GroupsManager.py @@ -0,0 +1,145 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from uds.core.util.State import State +from Group import Group +import logging + +logger = logging.getLogger(__name__) + +class GroupsManager(object): + ''' + Manages registered groups for an specific authenticator. + + Most authenticators (except internal database one, that is an special case) + has their database of users and passwords outside UDS. Think, for example, + about LDAP. It has its own database of users and groups, and has its own + correspondence of which user belongs to which group. + + UDS Only knows a subset of this groups, those that the administrator has + registered inside UDS. + + To manage the equivalence between groups from the authenticator and UDS groups, + we provide a list of "known groups" by uds. The authenticator then makes the + correspondence, marking the groups (UDS groups) that the user belongs to as + valid. + + Managed groups names are compared using case insensitive comparison. + ''' + + def __init__(self, dbAuthenticator): + ''' + Initializes the groups manager. + The dbAuthenticator is the database record of the authenticator + to which this groupsManager will be associated + ''' + self._groups = {} # We just get active groups, inactive aren't visible to this class + for g in dbAuthenticator.groups.filter(state = State.ACTIVE): + self._groups[g.name.lower()] = { 'group': Group(g), 'valid': False } + + def contains(self, groupName): + ''' + Returns true if this groups manager contains the specified group name (string) + ''' + return self._groups.has_key(groupName.lower()) + + def getGroupsNames(self): + ''' + Return all groups names managed by this groups manager. The names are returned + as where inserted inside Database (most probably using administration interface) + ''' + for g in self._groups.itervalues(): + yield g['group'].dbGroup().name + + def getValidGroups(self): + ''' + returns the list of valid groups (:py:class:uds.core.auths.Group.Group) + ''' + res = [] + for g in self._groups.itervalues(): + if g['valid'] is True: + res.append(g['group']) + return res + + def hasValidGroups(self): + ''' + Checks if this groups manager has at least one group that has been + validated (using :py:meth:.validate) + ''' + for g in self._groups.itervalues(): + if g['valid'] is True: + return True + return False + + def getGroup(self, groupName): + ''' + If this groups manager contains that group manager, it returns the + :py:class:uds.core.auths.Group.Group representing that group name. + ''' + if self._groups.has_key(groupName.lower()): + return self._groups[groupName.lower()]['group'] + else: + return None + + def validate(self, groupName): + ''' + Validates that the group groupName passed in is valid for this group manager. + + It check that the group specified is known by this group manager. + + Args: + groupName: string, list or tuple of values (strings) to check + + Returns nothing, it changes the groups this groups contains attributes, + so they reflect the known groups that are considered valid. + ''' + if type(groupName) is tuple or type(groupName) is list: + for n in groupName: + self.validate(n) + else: + if self._groups.has_key(groupName.lower()): + self._groups[groupName.lower()]['valid'] = True + + def isValid(self, groupName): + ''' + Checks if this group name is marked as valid inside this groups manager. + Returns True if group name is marked as valid, False if it isn't. + ''' + if self._groups.has_key(groupName.lower()): + return self._groups[groupName.lower()]['valid'] + return False + + def __str__(self): + return "Groupsmanager: {0}".format(self._groups) + + diff --git a/server/src/uds/core/auths/User.py b/server/src/uds/core/auths/User.py new file mode 100644 index 000000000..880c6ed5a --- /dev/null +++ b/server/src/uds/core/auths/User.py @@ -0,0 +1,101 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' + +import logging + +logger = logging.getLogger(__name__) + +class User(object): + ''' + An user represents a database user, associated with its authenticator (instance) + and its groups. + ''' + + def __init__(self, dbUser): + self._manager = dbUser.getManager() + self._grpsManager = None + self._dbUser = dbUser + self._groups = None + + + def _groupsManager(self): + ''' + If the groups manager for this user already exists, it returns this. + If it does not exists, it creates one default from authenticator and + returns it. + ''' + from GroupsManager import GroupsManager + + if self._grpsManager == None: + self._grpsManager = GroupsManager(self._manager.dbAuthenticator()) + return self._grpsManager + + def groups(self): + ''' + Returns the valid groups for this user. + To do this, it will validate groups throuht authenticator instance using + :py:meth:`uds.core.auths.Authenticator.getGroups` method. + + :note: Once obtained valid groups, it caches them until object removal. + ''' + from uds.models import User as DbUser + from Group import Group + + if self._groups == None: + if self._manager.isExternalSource == True: + self._manager.getGroups(self._dbUser.name, self._groupsManager()) + self._groups = self._groupsManager().getValidGroups() + # This is just for updating "cached" data of this user, we only get real groups at login and at modify user operation + usr = DbUser.objects.get(pk=self._dbUser.id) + usr.groups = [ g.dbGroup() for g in self._groups ] + else: + # From db + usr = DbUser.objects.get(pk=self._dbUser.id) + self._groups = [] + for g in usr.groups.all(): + self._groups.append(Group(g)) + return self._groups + + + def manager(self): + ''' + Returns the authenticator instance + ''' + return self._manager + + def dbUser(self): + ''' + Returns the database user + ''' + return self._dbUser + diff --git a/server/src/uds/core/auths/__init__.py b/server/src/uds/core/auths/__init__.py new file mode 100644 index 000000000..77e3c53ba --- /dev/null +++ b/server/src/uds/core/auths/__init__.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +UDS authentication related interfaces and classes + +From 1.0 onwards, the refactoring of UDS has started. + +We can access the base service interfaces the old method, or recommended +and easier use the new one, that is "from uds.core.services import ..." + +The new valid names for classes are: + + +I think this is an easier to use and understand way of accessing this classes + +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' +from BaseAuthenticator import Authenticator +from User import User +from Group import Group +from GroupsManager import GroupsManager +import Exceptions + +def factory(): + ''' + Returns factory for register/access to authenticators + ''' + from AuthsFactory import AuthsFactory + return AuthsFactory.factory() + + diff --git a/server/src/uds/core/auths/auth.png b/server/src/uds/core/auths/auth.png new file mode 100644 index 000000000..c8560b1d5 Binary files /dev/null and b/server/src/uds/core/auths/auth.png differ diff --git a/server/src/uds/core/auths/auth.py b/server/src/uds/core/auths/auth.py new file mode 100644 index 000000000..db0658c97 --- /dev/null +++ b/server/src/uds/core/auths/auth.py @@ -0,0 +1,204 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +Provides useful functions for authenticating, used by web interface. + + +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' +from functools import wraps +from django.http import HttpResponseRedirect +from uds.core.util.Config import GlobalConfig +from uds.core.auths import GroupsManager +from uds.core.auths import Authenticator +from uds.core.auths.Exceptions import InvalidAuthenticatorException +from uds.core.managers.CryptoManager import CryptoManager +from uds.core.util.State import State +from uds.models import User +import logging + +logger = logging.getLogger(__name__) + +USER_KEY = 'uk' +PASS_KEY = 'pk' + +def getIp(request): + ''' + Obtains the IP of a Django Request, even behind a proxy + + Returns the obtained IP, that is always be a valid ip address. + ''' + try: + request.ip = request.META['HTTP_X_FORWARDED_FOR'].split(",")[0] + except KeyError: + request.ip = request.META['REMOTE_ADDR'] + return request.ip + +# Decorator to make easier protect pages +def webLoginRequired(view_func): + ''' + Decorator to set protection to acces page + To use this decorator, the view must receive 'response' and 'user' + example: view(response, user) + ''' + @wraps(view_func) + def _wrapped_view(request, *args, **kwargs): + ''' + Wrapped function for decorator + ''' + user = request.session.get(USER_KEY) + if user is not None: + try: + user = User.objects.get(pk=user) + except User.DoesNotExist: + user = None + if user is None: + url = request.build_absolute_uri(GlobalConfig.LOGIN_URL.get()) + if GlobalConfig.REDIRECT_TO_HTTPS.getBool() is True: + url = url.replace('http://', 'https://') + logger.debug('No user found, redirecting to {0}'.format(url)) + return HttpResponseRedirect(url) + # Refresh session duration + #request.session.set_expiry(GlobalConfig.USER_SESSION_LENGTH.getInt()) + request.user = user + getIp(request) + return view_func(request, *args, **kwargs) + return _wrapped_view + +def __registerUser(authenticator, authInstance, username): + ''' + Check if this user already exists on database with this authenticator, if don't, create it with defaults + This will work correctly with both internal or externals cause we first authenticate the user, if internal and user do not exists in database + authenticate will return false, if external and return true, will create a reference in database + ''' + usr = authenticator.getOrCreateUser(username, authInstance.getRealName(username)) + if usr is not None and State.isActive(usr.state): + # Now we update database groups for this user + usr.getManager().recreateGroups(usr) + return usr + + return None + + +def authenticate(username, password, authenticator): + ''' + Given an username, password and authenticator, try to authenticate user + @param username: username to authenticate + @param password: password to authenticate this user + @param authenticator: Authenticator (database object) used to authenticate with provided credentials + @return: None if authentication fails, User object (database object) if authentication is o.k. + ''' + logger.debug('Authenticating user {0} with authenticator {1}'.format(username, authenticator)) + gm = GroupsManager(authenticator) + authInstance = authenticator.getInstance() + if authInstance.authenticate(username, password, gm) == False: + return None + + logger.debug('Groups manager: {0}'.format(gm)) + + # If do not have any valid group + if gm.hasValidGroups() is False: + return None + + return __registerUser(authenticator, authInstance, username) + + +def authenticateViaCallback(authenticator, params): + ''' + Given an username, this method will get invoked whenever the url for a callback + for an authenticator is requested. + + The idea behind this is that, with authenticators that are based on url redirections + (SSO auths), we provide a mechanism to allow the authenticator to login the user. + + This will: + * Check that the authenticator supports a callback, raise an error if it + doesn't support it. + * Invoke authenticator callback, and expects, on exit, a valid username. + If it gets None or '', it will raise an error. + * Register user inside uds if necesary, will invoke in the process + **getRealUsername** to get it, so keep it wher you can recover it. + * Update user group membership using Authenticator getGroups, so, in your + callbacks, remember to store (using provided environment storage, for example) + the groups of this user so your getGroups will work correctly. + ''' + authInstance = authenticator.getInstance() + + # If there is no callback for this authenticator... + if authInstance.authCallback == Authenticator.authCallback: + raise InvalidAuthenticatorException() + + username = authInstance.authCallback(params) + + if username is None or username == '': + raise InvalidAuthenticatorException() + + return __registerUser(authenticator, authInstance, username) + +def authCallbackUrl(authenticator): + ''' + Helper method, so we can get the auth call back url for an authenticator + ''' + from django.core.urlresolvers import reverse + return reverse('uds.web.views.authCallback', kwargs={'idAuth': authenticator.id}) + +def webLogin(request, response, user, password): + ''' + Helper function to, once the user is authenticated, store the information at the user session. + @return: Always returns True + ''' + user.updateLastAccess() + request.session.clear() + request.session[USER_KEY] = user.id + request.session[PASS_KEY] = CryptoManager.manager().xor(password.encode('utf-8'), request.COOKIES['uds']) + return True + + +def webPassword(request): + ''' + The password is stored at session using a simple scramble algorithm that keeps the password splited at + session (db) and client browser cookies. This method uses this two values to recompose the user password + so we can provide it to remote sessions. + @param request: DJango Request + @return: Unscrambled user password + ''' + return CryptoManager.manager().xor(request.session.get(PASS_KEY), request.COOKIES['uds']).decode('utf-8') + +def webLogout(request, exit_url = None): + ''' + Helper function to clear user related data from session. If this method is not used, the session we be cleaned anyway + by django in regular basis. + ''' + request.session.clear() + if exit_url is None: + exit_url = GlobalConfig.LOGIN_URL.get() + # Try to delete session + return HttpResponseRedirect(exit_url) + diff --git a/server/src/uds/core/jobs/DelayedTask.py b/server/src/uds/core/jobs/DelayedTask.py new file mode 100644 index 000000000..1e371347f --- /dev/null +++ b/server/src/uds/core/jobs/DelayedTask.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from uds.core.Environment import Environmentable +import logging + + +logger = logging.getLogger(__name__) + +class DelayedTask(Environmentable): + def __init__(self): + ''' + Remember to invoke parent init in derived clases using super(myClass,self).__init__() to let this initialize its own variables + ''' + Environmentable.__init__(self, None) + + def execute(self): + try: + self.run() + except Exception, e: + logger.error('Job {0} raised an exception: {1}'.format(self.__class__, e)) + + def run(self): + ''' + You must provide your own "run" method to do whatever you need + ''' + logging.debug("Base run of job called for class") diff --git a/server/src/uds/core/jobs/DelayedTaskRunner.py b/server/src/uds/core/jobs/DelayedTaskRunner.py new file mode 100644 index 000000000..5e1eb7878 --- /dev/null +++ b/server/src/uds/core/jobs/DelayedTaskRunner.py @@ -0,0 +1,146 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.db import transaction +from django.db.models import Q +from uds.models import DelayedTask as dbDelayedTask +from uds.core.util.Decorators import retryOnException +from ..Environment import Environment +from socket import gethostname +from pickle import loads, dumps +from datetime import datetime, timedelta +import threading, time +import logging + +logger = logging.getLogger(__name__) + +class DelayedTaskThread(threading.Thread): + def __init__(self, taskInstance): + super(DelayedTaskThread,self).__init__() + self._taskInstance = taskInstance + + def run(self): + try: + self._taskInstance.execute() + except Exception, e: + logger.debug("Exception in thread {0}: {1}".format(e.__class__, e)) + +class DelayedTaskRunner(object): + CODEC = 'base64' # Can be zip, hez, bzip, base64, uuencoded + # How often tasks r checked + granularity = 2 + + # to keep singleton DelayedTaskRunner + _runner = None + + def __init__(self): + logger.debug("Initializing delayed task runner") + self._hostname = gethostname() + self._keepRunning = True + + def notifyTermination(self): + self._keepRunning = False + + @staticmethod + def runner(): + if DelayedTaskRunner._runner == None: + DelayedTaskRunner._runner = DelayedTaskRunner() + return DelayedTaskRunner._runner + + @transaction.commit_manually + def executeOneDelayedTask(self): + now = datetime.now() + filt = Q(execution_time__lt=now) | Q(insert_date__gt=now) + # If next execution is before now or last execution is in the future (clock changed on this server, we take that task as executable) + taskInstance = None + try: + task = dbDelayedTask.objects.select_for_update().filter(filt).order_by('execution_time')[0] + task.delete() + transaction.commit() + taskInstance = loads(task.instance.decode(self.CODEC)) + except Exception: + # No task waiting, nice + transaction.rollback() + + if taskInstance != None: + env = Environment.getEnvForType(taskInstance.__class__) + taskInstance.setEnv(env) + DelayedTaskThread(taskInstance).start() + + @transaction.commit_on_success + def __insert(self, instance, delay, tag): + now = datetime.now() + exec_time = now + timedelta(seconds = delay) + cls = instance.__class__ + dbDelayedTask.objects.create(type = str(cls.__module__ + '.' + cls.__name__), instance = dumps(instance).encode(self.CODEC), + insert_date = now, execution_delay = delay, execution_time = exec_time, tag = tag) + + def insert(self, instance, delay, tag = ''): + retries = 3 + while retries > 0: + retries -= 1 + try: + self.__insert(instance, delay, tag) + break + except Exception, e: + logger.info('Exception inserting a delayed task {0}: {1}'.format(str(e.__class__), e)) + # If retries == 0, this is a big error + if retries == 0: + logger.error("Could not insert delayed task!!!! {0} {1} {2}".format(instance, delay, tag)) + return False + return True + + @transaction.commit_on_success + def remove(self, tag): + try: + dbDelayedTask.objects.select_for_update().filter(tag=tag).delete() + except Exception as e: + logger.exception('Exception removing a delayed task {0}: {1}'.format(str(e.__class__), e)) + + @transaction.commit_on_success + def checkExists(self, tag): + number = 0 + try: + number = dbDelayedTask.objects.filter(tag=tag).count() + except Exception as e: + logger.error('Exception looking for a delayed task tag {0}'.format(tag)) + return number > 0 + + def run(self): + logger.debug("At loop") + while self._keepRunning: + try: + time.sleep(self.granularity) + self.executeOneDelayedTask() + except Exception, e: + logger.error('Unexpected exception at run loop {0}: {1}'.format(e.__class__, e)) diff --git a/server/src/uds/core/jobs/Job.py b/server/src/uds/core/jobs/Job.py new file mode 100644 index 000000000..2f38a5645 --- /dev/null +++ b/server/src/uds/core/jobs/Job.py @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from uds.models import Scheduler +from uds.core.Environment import Environmentable +import logging + +logger = logging.getLogger(__name__) + +class Job(Environmentable): + # Default frecuency, once a day. Remenber that precision will be based on "granurality" of Scheduler + # If a job is used for delayed execution, this attribute is in fact ignored + frecuency = Scheduler.DAY + + def __init__(self, environment): + ''' + Remember to invoke parent init in derived clases using super(myClass,self).__init__(environmnet) if u want to use env(), cache() and storage() methods + ''' + Environmentable.__init__(self, environment) + + def execute(self): + try: + self.run() + except Exception, e: + logger.exception('Job {0} raised an exception:'.format(self.__class__)) + + def run(self): + ''' + You must provide your own "run" method to do whatever you need + ''' + logging.debug("Base run of job called for class") + pass \ No newline at end of file diff --git a/server/src/uds/core/jobs/JobsFactory.py b/server/src/uds/core/jobs/JobsFactory.py new file mode 100644 index 000000000..feca15c1a --- /dev/null +++ b/server/src/uds/core/jobs/JobsFactory.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from datetime import timedelta +import logging + +logger = logging.getLogger(__name__) + +class JobsFactory(object): + _factory = None + + def __init__(self): + self._jobs = {} + + @staticmethod + def factory(): + if JobsFactory._factory == None: + JobsFactory._factory = JobsFactory() + return JobsFactory._factory + + def jobs(self): + return self._jobs + + def insert(self, name, type): + try: + self._jobs[name] = type + except Exception, e: + logger.debug('Exception at insert in JobsFactory: {0}, {1}'.format(e.__class__, e)) + + def ensureJobsInDatabase(self): + from uds.models import Scheduler, getSqlDatetime, State + try: + logger.debug('Ensuring that jobs are registered inside database') + for name, type in self._jobs.iteritems(): + try: + # We use database server datetime + now = getSqlDatetime() + next = now + job = Scheduler.objects.create(name = name, frecuency = type.frecuency, last_execution = now, next_execution = next, state = State.FOR_EXECUTE) + except Exception: # already exists + job = Scheduler.objects.get(name=name) + job.frecuency = type.frecuency + job.save() + except Exception, e: + logger.debug('Exception at insert in JobsFactory: {0}, {1}'.format(e.__class__, e)) + + + def lookup(self, typeName): + try: + return self._jobs[typeName] + except KeyError: + return None diff --git a/server/src/uds/core/jobs/Scheduler.py b/server/src/uds/core/jobs/Scheduler.py new file mode 100644 index 000000000..50ecf5ad9 --- /dev/null +++ b/server/src/uds/core/jobs/Scheduler.py @@ -0,0 +1,143 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.db.models import Q +from django.db import transaction, DatabaseError +from uds.models import Scheduler as dbScheduler, getSqlDatetime, State +from uds.core.jobs.JobsFactory import JobsFactory +from datetime import datetime, timedelta +from socket import gethostname +import threading, time +import logging + +logger = logging.getLogger(__name__) + +class JobThread(threading.Thread): + def __init__(self, jobInstance, dbJob): + super(JobThread,self).__init__() + self._jobInstance = jobInstance + self._dbJobId = dbJob.id + + @transaction.commit_on_success + def run(self): + try: + self._jobInstance.execute() + except Exception: + logger.debug("Exception executing job {0}".format(self._dbJobId)) + try: + job = dbScheduler.objects.select_for_update().get(id=self._dbJobId) + job.state = State.FOR_EXECUTE + job.owner_server = '' + job.next_execution = getSqlDatetime() + timedelta(seconds = job.frecuency) + # Update state and last execution time at database + job.save() + except Exception as e: + # Erased from database, nothing hapens + logger.exception(e) + +class Scheduler(object): + granularity = 2 # We check for cron jobs every THIS seconds + + # to keep singleton Scheduler + _scheduler = None + + def __init__(self): + self._hostname = gethostname() + self._keepRunning = True + + @staticmethod + def scheduler(): + if Scheduler._scheduler == None: + Scheduler._scheduler = Scheduler() + return Scheduler._scheduler + + def notifyTermination(self): + self._keepRunning = False + + @transaction.commit_manually + def executeOneJob(self): + ''' + Looks for a job and executes it + ''' + jobInstance = None + try: + now = getSqlDatetime() # Datetimes are based on database server times + filter = Q(state = State.FOR_EXECUTE) & (Q(owner_server = self._hostname) | Q(owner_server = '')) & (Q(last_execution__gt = now) | Q(next_execution__lt = now)) + # If next execution is before now or last execution is in the future (clock changed on this server, we take that task as executable) + # This params are all set inside filter (look at __init__) + job = dbScheduler.objects.select_for_update().filter(filter).order_by('next_execution')[0] + jobInstance = job.getInstance() + + if jobInstance == None: + logger.error('Job instance can\'t be resolved for {0}, removing it'.format(job)) + job.delete() + transaction.commit() + return + job.state = State.RUNNING + job.owner_server = self._hostname + job.last_execution = now + job.save() + transaction.commit() + JobThread(jobInstance, job).start() # Do not instatiate thread, just run it + except IndexError: + transaction.rollback() + # Do nothing, there is no jobs for execution + return + except DatabaseError: + # Whis will happen whenever a connection error or a deadlock error happens + # This in fact means that we have to retry operation, and retry will happen on main loop + # Look at this http://dev.mysql.com/doc/refman/5.0/en/innodb-deadlocks.html + # I have got some deadlock errors, but looking at that url, i found that it is not so abnormal + logger.debug('Deadlock, no problem at all :-) (sounds hards, but really, no problem)') + transaction.rollback() # So django do not complains about this + + @transaction.commit_on_success + def releaseOwnShedules(self): + ''' + Releases all scheduleds being executed by this scheduler + ''' + dbScheduler.objects.select_for_update().filter(owner_server = self._hostname).update(owner_server = '', state = State.FOR_EXECUTE) + + + def run(self): + # We ensure that the jobs are also in database so we can + JobsFactory.factory().ensureJobsInDatabase() + self.releaseOwnShedules() + logger.debug("At loop") + while self._keepRunning: + try: + time.sleep(self.granularity) + self.executeOneJob() + except Exception, e: + logger.exception('Unexpected exception at run loop {0}: {1}'.format(e.__class__, e)) + diff --git a/server/src/uds/core/jobs/__init__.py b/server/src/uds/core/jobs/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/server/src/uds/core/managers/CryptoManager.py b/server/src/uds/core/managers/CryptoManager.py new file mode 100644 index 000000000..d666b2c2a --- /dev/null +++ b/server/src/uds/core/managers/CryptoManager.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from server.settings import RSA_KEY +from Crypto.PublicKey import RSA +from Crypto.Random import atfork +import hashlib, array + +# To generate an rsa key, first we need the crypt module +# next, we do: +# from Crypto.PublicKey import RSA +# import os +# RSA.generate(1024, os.urandom).exportKey() + +class CryptoManager(object): + CODEC = 'base64' + + instance = None + + def __init__(self): + self._rsa = RSA.importKey(RSA_KEY) + + @staticmethod + def manager(): + if CryptoManager.instance is None: + CryptoManager.instance = CryptoManager() + return CryptoManager.instance + + def encrypt(self, string): + atfork() + return self._rsa.encrypt(string, '')[0].encode(CryptoManager.CODEC) + + def decrypt(self, string): + atfork() + return self._rsa.decrypt(string.decode(CryptoManager.CODEC)) + + def xor(self, s1, s2): + mult = (len(s1)/len(s2)) + 1 + s1 = array.array('B', s1) + s2 = array.array('B', s2 * mult) + return array.array('B', (s1[i] ^ s2[i] for i in range(len(s1)))).tostring() + + def hash(self, string): + if string is '' or string is None: + return '' + return hashlib.sha1(string).hexdigest() diff --git a/server/src/uds/core/managers/DownloadsManager.py b/server/src/uds/core/managers/DownloadsManager.py new file mode 100644 index 000000000..57a11730e --- /dev/null +++ b/server/src/uds/core/managers/DownloadsManager.py @@ -0,0 +1,95 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +import os, tempfile, zipfile, uuid +from django.http import HttpResponse, Http404 +from django.core.servers.basehttp import FileWrapper +import logging + +logger = logging.getLogger(__name__) + +class DownloadsManager(object): + ''' + Manager so connectors can register their own downloadables + For registering, use at __init__.py of the conecto something like this: + from uds.core.managers.DownloadsManager import DownloadsManager + import os.path, sys + DownloadsManager.manager().registerDownloadable('test.exe', + _('comments for test'), + os.path.dirname(sys.modules[__package__].__file__) + '/files/test.exe', + 'application/x-msdos-program') + ''' + _manager = None + + def __init__(self): + self._downloadables = {} + self._namespace = uuid.UUID('627a37a5-e8db-431a-b783-73f7d20b4934') + + @staticmethod + def manager(): + if DownloadsManager._manager == None: + DownloadsManager._manager = DownloadsManager() + return DownloadsManager._manager + + + def registerDownloadable(self, name, comment, path, mime = 'application/octet-stream'): + ''' + Registers a downloadable file. + @param name: name shown + @param path: path to file + @params zip: If download as zip + ''' + id = str(uuid.uuid5(self._namespace, name)) + self._downloadables[id] = { 'name': name, 'comment' : comment, 'path' : path, 'mime' : mime } + + def getDownloadables(self): + return self._downloadables + + + def send(self, request, id): + if self._downloadables.has_key(id) is False: + return Http404() + return self.__send_file(request, self._downloadables[id]['name'], self._downloadables[id]['path'], self._downloadables[id]['mime']); + + def __send_file(self, request, name, filename, mime): + """ + Send a file through Django without loading the whole file into + memory at once. The FileWrapper will turn the file object into an + iterator for chunks of 8KB. + """ + wrapper = FileWrapper(file(filename)) + response = HttpResponse(wrapper, content_type=mime) + response['Content-Length'] = os.path.getsize(filename) + response['Content-Disposition'] = 'attachment; filename=' + name + return response + diff --git a/server/src/uds/core/managers/PublicationManager.py b/server/src/uds/core/managers/PublicationManager.py new file mode 100644 index 000000000..3e895e466 --- /dev/null +++ b/server/src/uds/core/managers/PublicationManager.py @@ -0,0 +1,193 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext as _ +from django.db import transaction +from uds.core.jobs.DelayedTask import DelayedTask +from uds.core.jobs.DelayedTaskRunner import DelayedTaskRunner +from uds.core.services.Exceptions import PublishException +from uds.models import DeployedServicePublication, getSqlDatetime, State +import logging + +logger = logging.getLogger(__name__) + +PUBTAG = 'pm-' + +class PublicationLauncher(DelayedTask): + def __init__(self, publish): + super(PublicationLauncher,self).__init__() + self._publishId = publish.id + + @transaction.commit_on_success + def run(self): + logger.debug('Publishing') + try: + dsp = DeployedServicePublication.objects.select_for_update().get(pk=self._publishId) + if dsp.state != State.LAUNCHING: # If not preparing (may has been canceled by user) just return + return + dsp.state = State.PREPARING + pi = dsp.getInstance() + state = pi.publish() + deployedService = dsp.deployed_service + deployedService.current_pub_revision += 1 + deployedService.save() + PublicationFinishChecker.checkAndUpdateState(dsp, pi, state) + except Exception as e: + logger.exception("Exception launching publication") + dsp.state = State.ERROR + dsp.save() + + +# Delayed Task that checks if a publication is done +class PublicationFinishChecker(DelayedTask): + def __init__(self, publish): + super(PublicationFinishChecker,self).__init__() + self._publishId = publish.id + self._state = publish.state + + @staticmethod + def checkAndUpdateState(dsp, pi, state): + ''' + Checks the value returned from invocation to publish or checkPublishingState, updating the dsp database object + Return True if it has to continue checking, False if finished + ''' + prevState = dsp.state + checkLater = False + if State.isFinished(state): + # Now we mark, if it exists, the previous usable publication as "Removable" + if State.isPreparing(prevState): + dsp.deployed_service.publications.filter(state=State.USABLE).update(state=State.REMOVABLE) + dsp.setState(State.USABLE) + dsp.deployed_service.markOldDeployedServicesAsRemovables(dsp) + elif State.isRemoving(prevState): + dsp.setState(State.REMOVED) + else: # State is canceling + dsp.setState(State.CANCELED) + # Mark all previous publications deployed services as removables + # and make this usable + pi.finish() + dsp.updateData(pi) + elif State.isErrored(state): + dsp.updateData(pi) + dsp.state = State.ERROR + else: + checkLater = True # The task is running + dsp.updateData(pi) + + dsp.save() + if checkLater: + PublicationFinishChecker.checkLater(dsp, pi) + + @staticmethod + def checkLater(dsp, pi): + ''' + Inserts a task in the delayedTaskRunner so we can check the state of this publication + @param dps: Database object for DeployedServicePublication + @param pi: Instance of Publication manager for the object + ''' + DelayedTaskRunner.runner().insert(PublicationFinishChecker(dsp), pi.suggestedTime, PUBTAG + str(dsp.id)) + + @transaction.commit_on_success + def run(self): + logger.debug('Checking publication finished {0}'.format(self._publishId)) + try : + dsp = DeployedServicePublication.objects.select_for_update().get(pk=self._publishId) + if dsp.state != self._state: + logger.debug('Task overrided by another task (state of item changed)') + else: + pi = dsp.getInstance() + logger.debug("publication instance class: {0}".format(pi.__class__)) + state = pi.checkState() + PublicationFinishChecker.checkAndUpdateState(dsp, pi, state) + except Exception, e: + logger.debug('Deployed service not found (erased from database) {0} : {1}'.format(e.__class__, e)) + + +class PublicationManager(object): + _manager = None + + def __init__(self): + pass + + @staticmethod + def manager(): + if PublicationManager._manager == None: + PublicationManager._manager = PublicationManager() + return PublicationManager._manager + + + @transaction.commit_on_success + def publish(self, deployedService): + if deployedService.publications.select_for_update().filter(state__in=State.PUBLISH_STATES).count() > 0: + raise PublishException(_('Already publishing. Wait for previous publication to finish and try again')) + try: + now = getSqlDatetime() + dsp = deployedService.publications.create(state = State.LAUNCHING, state_date = now, publish_date = now, revision = deployedService.current_pub_revision) + DelayedTaskRunner.runner().insert(PublicationLauncher(dsp), 4, PUBTAG + str(dsp.id)) + except Exception as e: + raise PublishException(str(e)) + + @transaction.commit_on_success + def cancel(self,dsp): + dsp = DeployedServicePublication.objects.select_for_update().get(id=dsp.id) + if dsp.state not in State.PUBLISH_STATES: + raise PublishException(_('Can\'t cancel non running publication')) + + if dsp.state == State.LAUNCHING: + dsp.state = State.CANCELED + dsp.save() + return dsp + + try: + pi = dsp.getInstance() + state = pi.cancel() + dsp.setState(State.CANCELING) + PublicationFinishChecker.checkAndUpdateState(dsp, pi, state) + return dsp + except Exception, e: + raise PublishException(str(e)) + + def unpublish(self, dsp): + if State.isUsable(dsp.state) == False and State.isRemovable(dsp.state) == False: + raise PublishException(_('Can\'t unpublish non usable publication')) + # TODO: Call assignation manager to remove removable items + if dsp.userServices.exclude(state__in=State.INFO_STATES).count() > 0: + raise PublishException(_('Can\'t unpublish publications with services in process')) + try: + pi = dsp.getInstance() + state = pi.destroy() + dsp.setState(State.REMOVING) + PublicationFinishChecker.checkAndUpdateState(dsp, pi, state) + except Exception, e: + raise PublishException(str(e)) + diff --git a/server/src/uds/core/managers/TaskManager.py b/server/src/uds/core/managers/TaskManager.py new file mode 100644 index 000000000..37cb0efb8 --- /dev/null +++ b/server/src/uds/core/managers/TaskManager.py @@ -0,0 +1,134 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' +from django.db import transaction +from uds.core.jobs.Scheduler import Scheduler +from uds.core.jobs.DelayedTaskRunner import DelayedTaskRunner +from uds.core.jobs.JobsFactory import JobsFactory +from uds.core.util.Config import GlobalConfig +import threading, time, signal +import logging, gc + +logger = logging.getLogger(__name__) + +class SchedulerThread(threading.Thread): + def run(self): + Scheduler.scheduler().run() + + def notifyTermination(self): + Scheduler.scheduler().notifyTermination() + +class DelayedTaskThread(threading.Thread): + def run(self): + DelayedTaskRunner.runner().run() + + def notifyTermination(self): + DelayedTaskRunner.runner().notifyTermination() + + +class TaskManager(object): + keepRunning = True + + @staticmethod + def sigTerm(sigNum, frame): + ''' + This method will ensure that we finish correctly current running task before exiting. + If we need to stop cause something went wrong (that should not happen), we must send sigterm, wait a while (10-20 secs) and after that send sigkill + kill task + sleep 10 + kill -9 task + Take a look at killTaskManager.sh :-) + ''' + logger.info("Caught term signal, finishing task manager") + TaskManager.keepRunning = False + + + @staticmethod + def registerScheduledTask(): + from uds.core.workers.ServiceCacheUpdater import ServiceCacheUpdater + from uds.core.workers.UserServiceCleaner import UserServiceInfoItemsCleaner, UserServiceRemover + from uds.core.workers.PublicationCleaner import PublicationInfoItemsCleaner, PublicationCleaner + from uds.core.workers.CacheCleaner import CacheCleaner + from uds.core.workers.DeployedServiceCleaner import DeployedServiceInfoItemsCleaner, DeployedServiceRemover + + logger.info("Registering sheduled tasks") + JobsFactory.factory().insert('Service Cache Updater', ServiceCacheUpdater) + JobsFactory.factory().insert('User Service Info Cleaner', UserServiceInfoItemsCleaner) + JobsFactory.factory().insert('User Service Cleaner', UserServiceRemover) + JobsFactory.factory().insert('Publications Info Cleaner', PublicationInfoItemsCleaner) + JobsFactory.factory().insert('Publication Cleaner', PublicationCleaner) + JobsFactory.factory().insert('Utility Cache Cleaner', CacheCleaner) + JobsFactory.factory().insert('User Service Info Cleaner', UserServiceInfoItemsCleaner) + JobsFactory.factory().insert('User Service Cleaner', UserServiceRemover) + JobsFactory.factory().insert('Deployed Service Info Cleaner', DeployedServiceInfoItemsCleaner) + JobsFactory.factory().insert('Deployed Service Cleaner', DeployedServiceRemover) + + + + @staticmethod + def run(): + TaskManager.keepRunning = True + # Runs Scheduler in a separate thread and DelayedTasks here + + noSchedulers = GlobalConfig.SCHEDULER_THREADS.getInt() + noDelayedTasks = GlobalConfig.DELAYED_TASKS_THREADS.getInt() + + threads = [] + for n in range(noSchedulers): + thread = SchedulerThread() + thread.start() + threads.append(thread) + time.sleep(0.5) + + for n in range(noDelayedTasks): + thread = DelayedTaskThread() + thread.start() + threads.append(thread) + time.sleep(1) + + signal.signal(signal.SIGTERM, TaskManager.sigTerm) + + + # Debugging stuff + #import guppy + #from guppy.heapy import Remote + #Remote.on() + + #gc.set_debug(gc.DEBUG_LEAK) + while( TaskManager.keepRunning ): + time.sleep(1) + + for thread in threads: + thread.notifyTermination() + + # The join of threads will happen before termination, so its fine to just return here + diff --git a/server/src/uds/core/managers/UserPrefsManager.py b/server/src/uds/core/managers/UserPrefsManager.py new file mode 100644 index 000000000..ee77b473a --- /dev/null +++ b/server/src/uds/core/managers/UserPrefsManager.py @@ -0,0 +1,268 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django import forms +from django.utils.translation import ugettext as _, ugettext_lazy +from uds.models import UserPreference +from uds.core.ui.UserInterface import gui +import logging + +logger = logging.getLogger(__name__) + +class UserPrefsManager(object): + _manager = None + + def __init__(self): + self._prefs = {} + + @staticmethod + def manager(): + if UserPrefsManager._manager == None: + UserPrefsManager._manager = UserPrefsManager() + return UserPrefsManager._manager + + def __nameFor(self, module, name): + return module + "_" + name + + def registerPrefs(self, modName, friendlyModName, prefs): + ''' + Register an array of preferences for a module + ''' + self._prefs[modName] = { 'friendlyName' : friendlyModName, 'prefs' : prefs } + + def getPreferencesForUser(self, modName, user): + ''' + Gets the preferences for an specified module for the user + ''' + prefs = {} + for up in user.preferences.filter(module=modName): + prefs[up.name] = up.value + for p in self._prefs[modName]['prefs']: + if prefs.has_key(p.getName()) is False: + prefs[p.getName()] = p.getDefValue() + return prefs + + def getHtmlForUserPreferences(self, user): + # First fill data for all preferences + data = {} + for up in user.preferences.all(): + data[self.__nameFor(up.module, up.name)] = up.value + res = '' + for mod, v in self._prefs.iteritems(): + form = forms.Form() + for p in v['prefs']: + name = self.__nameFor(mod, p.getName()) + val = data[name] if data.has_key(name) else p.getDefValue() + form.fields[ name ] = p.formField(val) + res += '
' + v['friendlyName'] + '' + form.as_p() + '
' + return res + + def getGuiForUserPreferences(self, user=None): + data = {} + if user is not None: + for up in user.preferences.all(): + data[self.__nameFor(up.module, up.name)] = up.value + res = [] + for mod, v in self._prefs.iteritems(): + grp = [] + for p in v['prefs']: + name = self.__nameFor(mod, p.getName()) + val = data[name] if data.has_key(name) else p.getDefValue() + grp.append( { 'name' : name, 'gui' : p.guiField(val).guiDescription(), 'value' : val } ) + res.append( {'moduleLabel': v['friendlyName'], 'prefs': grp} ) + return res + + + def processRequestForUserPreferences(self, user, data): + ''' + Returns a list of errors in case of error, else return None + ''' + # First, read fields form every single "section" + logger.debug('Processing {0}'.format(self._prefs)) + prefs = [] + for mod, v in self._prefs.iteritems(): + logger.debug(mod) + form = forms.Form(data) + for p in v['prefs']: + name = self.__nameFor(mod, p.getName()) + form.fields[name] = p.formField(None) + if form.is_valid() is False: + logger.debug("errors") + return form.errors + for p in v['prefs']: + name = self.__nameFor(mod, p.getName()) + logger.debug(name) + prefs.append({ 'module': mod, 'name': p.getName(), 'value': form.cleaned_data[name] } ) + user.preferences.all().delete() + for p in prefs: + user.preferences.create(module=p['module'], name=p['name'], value=p['value']) + return None + + def processGuiForUserPreferences(self, user, data): + ''' + ''' + logger.debug('Processing data {0}'.format(data)) + prefs = [] + for mod, v in self._prefs.iteritems(): + logger.debug(mod) + for p in v['prefs']: + name = self.__nameFor(mod, p.getName()) + if data.has_key(name): + prefs.append( { 'module': mod, 'name': p.getName(), 'value': data[name] } ) + user.preferences.all().delete() + for p in prefs: + user.preferences.create(module=p['module'], name=p['name'], value=p['value']) + + + +class UserPreference(object): + TYPE = 'abstract' + def __init__(self, **kwargs): + self._name = kwargs['name'] + self._label = kwargs['label'] + self._defValue = kwargs['defvalue'] if kwargs.has_key('defvalue') else None + + def getName(self): + return self._name + + def getDefValue(self): + return self._defValue + + def formField(self, value): + ''' + Returns a form field to add to the preferences form + ''' + raise NameError('Can\'t create an abstract preference!!!') + + def guiField(self): + ''' + ''' + raise NameError('Can\'t create an abstract preference!!!') + + +class UserTextPreference(UserPreference): + TYPE = 'text' + def __init__(self, **kwargs): + super(self.__class__,self).__init__(**kwargs) + self._length = kwargs['length'] if kwargs.has_key('length') else None + + def formField(self, value): + return forms.CharField(label = _(self._label), initial = value) + + +class UserNumericPreference(UserPreference): + TYPE = 'numeric' + def __init__(self, **kwargs): + super(self.__class__,self).__init__(**kwargs) + self._min = kwargs['minvalue'] if kwargs.has_key('minvalue') else None + self._max = kwargs['maxvalue'] if kwargs.has_key('maxvalue') else None + + def formField(self, value): + return forms.IntegerField(label = _(self._label), initial = value, min_value = self._min, max_value = self._max) + +class UserChoicePreference(UserPreference): + TYPE = 'choice' + def __init__(self, **kwargs): + super(self.__class__,self).__init__(**kwargs) + ''' + Values are a tuple of + ''' + self._values = kwargs['values'] + + def formField(self, value): + return forms.ChoiceField(label = _(self._label), initial = value, choices = self._values) + + def guiField(self, value): + vals = [] + for v in self._values: + vals.append( { 'id': v[0], 'text': _(v[1]) } ) + return gui.ChoiceField(label = _(self._label), rdonly = False, values = vals, defvalue=value, tooltip = _(self._label)) + +class UserCheckboxPreference(UserPreference): + TYPE = 'checkbox' + def __init__(self, **kwargs): + super(self.__class__,self).__init__(**kwargs) + + +class CommonPrefs(object): + SZ_PREF = 'screenSize' + SZ_640x480 = '1' + SZ_800x600 = '2' + SZ_1024x768 = '3' + SZ_FULLSCREEN = 'F' + + DEPTH_PREF = 'screenDepth' + DEPTH_8 = '1' + DEPTH_16 = '2' + DEPTH_24 = '3' + DEPTH_32 = '4' + + @staticmethod + def getWidthHeight(prefsDict): + ''' + Get width based on screenSizePref value + ''' + return { CommonPrefs.SZ_640x480 : (640, 480), + CommonPrefs.SZ_800x600 : (800, 600), + CommonPrefs.SZ_1024x768 : (1024, 768), + CommonPrefs.SZ_FULLSCREEN : (-1, -1) + }[prefsDict[CommonPrefs.SZ_PREF]] + + @staticmethod + def getDepth(prefsDict): + ''' + Get depth based on depthPref value + ''' + return { CommonPrefs.DEPTH_8 : 8, + CommonPrefs.DEPTH_16 : 16, + CommonPrefs.DEPTH_24 : 24, + CommonPrefs.DEPTH_32 : 32 }[ prefsDict[CommonPrefs.DEPTH_PREF] ] + + + + + screenSizePref = UserChoicePreference(name = SZ_PREF, label = ugettext_lazy('Screen Size'), defvalue = SZ_FULLSCREEN, values = ( + (SZ_640x480, '640x480'), + (SZ_800x600, '800x600'), + (SZ_1024x768, '1024x768'), + (SZ_FULLSCREEN, ugettext_lazy('Full Screen')) + ) + ) + depthPref = UserChoicePreference(name = DEPTH_PREF, label = ugettext_lazy('Screen colors'), defvalue = DEPTH_24, values = ( + (DEPTH_8, ugettext_lazy('8 bits')), + (DEPTH_16, ugettext_lazy('16 bits')), + (DEPTH_24, ugettext_lazy('24 bits')), + (DEPTH_32, ugettext_lazy('32 bits')), + ) + ) + \ No newline at end of file diff --git a/server/src/uds/core/managers/UserServiceManager.py b/server/src/uds/core/managers/UserServiceManager.py new file mode 100644 index 000000000..aa2ddb430 --- /dev/null +++ b/server/src/uds/core/managers/UserServiceManager.py @@ -0,0 +1,451 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext as _ +from django.db.models import Q +from django.db import transaction +from uds.core.jobs.DelayedTask import DelayedTask +from uds.core.jobs.DelayedTaskRunner import DelayedTaskRunner +from uds.core.services.Exceptions import OperationException +from uds.core.util.State import State +from uds.core.util.Config import GlobalConfig +from uds.core.services.Exceptions import MaxServicesReachedException +from uds.models import UserService, getSqlDatetime +from uds.core import services +from uds.core.services import Service +import logging + +logger = logging.getLogger(__name__) + +USERSERVICE_TAG = 'cm-' + +class UserServiceOpChecker(DelayedTask): + def __init__(self, cache): + super(UserServiceOpChecker,self).__init__() + self._svrId = cache.id + self._state = cache.state + + @staticmethod + def makeUnique(userService, userServiceInstance, state): + ''' + This method makes sure that there will be only one delayedtask related to the userService indicated + ''' + DelayedTaskRunner.runner().remove(USERSERVICE_TAG + str(userService.id)) + UserServiceOpChecker.checkAndUpdateState(userService, userServiceInstance, state) + + @staticmethod + def checkAndUpdateState(userService, userServiceInstance, state): + ''' + Checks the value returned from invocation to publish or checkPublishingState, updating the dsp database object + Return True if it has to continue checking, False if finished + ''' + prevState = userService.state + userService.unique_id = userServiceInstance.getUniqueId() # Updates uniqueId + userService.friendly_name = userServiceInstance.getName() # And name, both methods can modify serviceInstance, so we save it later + if State.isFinished(state): + checkLater = False + userServiceInstance.finish() + if State.isPreparing(prevState): + if userServiceInstance.service().publicationType is None or userService.publication == userService.deployed_service.activePublication(): + userService.setState(State.USABLE) + # and make this usable if os manager says that it is usable, else it pass to configuring state + if userServiceInstance.osmanager() is not None and userService.os_state == State.PREPARING: # If state is already "Usable", do not recheck it + stateOs = userServiceInstance.osmanager().checkState(userService) + # If state is finish, we need to notify the userService again that os has finished + if State.isFinished(stateOs): + state = userServiceInstance.notifyReadyFromOsManager('') + userService.updateData(userServiceInstance) + else: + stateOs = State.FINISHED + + if State.isRuning(stateOs): + userService.setOsState(State.PREPARING) + else: + userService.setOsState(State.USABLE) + else: + # We ignore OsManager info and if userService don't belong to "current" publication, mark it as removable + userService.setState(State.REMOVABLE) + elif State.isRemoving(prevState): + if userServiceInstance.osmanager() is not None: + userServiceInstance.osmanager().release(userService) + userService.setState(State.REMOVED) + else: + # Canceled, + userService.setState(State.CANCELED) + userService.updateData(userServiceInstance) + elif State.isErrored(state): + checkLater = False + userService.updateData(userServiceInstance) + userService.setState(State.ERROR) + else: + checkLater = True # The task is running + userService.updateData(userServiceInstance) + userService.save() + if checkLater: + UserServiceOpChecker.checkLater(userService, userServiceInstance) + + @staticmethod + def checkLater(userService, ci): + ''' + Inserts a task in the delayedTaskRunner so we can check the state of this publication + @param dps: Database object for DeployedServicePublication + @param pi: Instance of Publication manager for the object + ''' + # Do not add task if already exists one that updates this service + if DelayedTaskRunner.runner().checkExists(USERSERVICE_TAG + str(userService.id)): + return + DelayedTaskRunner.runner().insert(UserServiceOpChecker(userService), ci.suggestedTime, USERSERVICE_TAG + str(userService.id)) + + + @transaction.commit_manually + def run(self): + logger.debug('Checking user service finished {0}'.format(self._svrId)) + try: + uService = UserService.objects.select_for_update().get(pk=self._svrId) + if uService.state != self._state: + logger.debug('Task overrided by another task (state of item changed)') + # This item is no longer valid, returning will not check it again (no checkLater called) + transaction.rollback() + return + + ci = uService.getInstance() + logger.debug("uService instance class: {0}".format(ci.__class__)) + state = ci.checkState() + UserServiceOpChecker.checkAndUpdateState(uService, ci, state) + except UserService.DoesNotExist, e: + logger.error('User service not found (erased from database?) {0} : {1}'.format(e.__class__, e)) + except Exception, e: + # Exception caught, mark service as errored + logger.exception("Error {0}, {1} :".format(e.__class__, e)) + try: + uService.setState(State.ERROR) + uService.save() + except Exception: + logger.error('Can\'t update state of uService object') + transaction.commit() + + +class UserServiceManager(object): + _manager = None + + def __init__(self): + pass + + @staticmethod + def manager(): + if UserServiceManager._manager == None: + UserServiceManager._manager = UserServiceManager() + return UserServiceManager._manager + + @staticmethod + def getCacheStateFilter(level): + return Q(cache_level=level) & UserServiceManager.getStateFilter() + + @staticmethod + def getStateFilter(): + return Q(state__in=[State.PREPARING, State.USABLE]) + + + @transaction.commit_on_success + def __checkMaxdeployedReached(self, deployedService): + ''' + Checks if maxDeployed for the service has been reached, and, if so, + raises an exception that no more services of this kind can be reached + ''' + serviceInstance = deployedService.service.getInstance() + # Early return, so no database count is needed + if serviceInstance.maxDeployed == Service.UNLIMITED: + return + + numberOfServices = deployedService.userServices.select_for_update().filter( + state__in=[State.PREPARING, State.USABLE]).count() + if serviceInstance.maxDeployed <= numberOfServices: + raise MaxServicesReachedException( + 'Max number of allowed deployments for service reached' + ) + + + def __createCacheAtDb(self, deployedService, cacheLevel): + ''' + Private method to instatiate a cache element at database with default states + ''' + # Checks if maxDeployed has been reached and if so, raises an exception + self.__checkMaxDeployedReached(deployedService) + now = getSqlDatetime() + return deployedService.userServices.create(cache_level = cacheLevel, state = State.PREPARING, os_state = State.PREPARING, + state_date=now, creation_date=now, data = '', deployed_service = deployedService.deployed_service, + user = None, in_use = False ) + + def __createAssignedAtDb(self, deployedService, user): + ''' + Private method to instatiate an assigned element at database with default state + ''' + self.__checkMaxDeployedReached(deployedService) + now = getSqlDatetime() + return deployedService.userServices.create(cache_level=0, state=State.PREPARING, os_state=State.PREPARING, + state_date=now, creation_date=now, data='', deployed_service=deployedService.deployed_service, user=user, in_use=False) + + def __createAssignedAtDbForNoPublication(self, deployedService, user): + self.__checkMaxDeployedReached(deployedService) + now = getSqlDatetime() + return deployedService.userServices.create(cache_level=0, state=State.PREPARING, os_state=State.PREPARING, + state_date=now, creation_date=now, data='', publication=None, user=user, in_use=False) + + + @transaction.commit_on_success + def createCacheFor(self, deployedService, cacheLevel): + ''' + Creates a new cache for the deployed service publication at level indicated + ''' + logger.debug('Creating a new cache element at level {0} for publication {1}'.format(cacheLevel, deployedService)) + cache = self.__createCacheAtDb(deployedService, cacheLevel) + ci = cache.getInstance() + state = ci.deployForCache(cacheLevel) + + UserServiceOpChecker.checkAndUpdateState(cache, ci, state) + return cache + + @transaction.commit_on_success + def createAssignedFor(self, ds, user): + ''' + Creates a new assigned deployed service for the publication and user indicated + ''' + if ds.service.getType().publicationType is not None: + dsp = ds.activePublication() + logger.debug('Creating a new assigned element for user {0} por publication {1}'.format(user, dsp)) + assigned = self.__createAssignedAtDb(dsp, user) + else: + logger.debug('Creating a new assigned element for user {0}'.format(user)) + assigned = self.__createAssignedAtDbForNoPublication(ds, user) + + ai = assigned.getInstance() + state = ai.deployForUser(user) + + UserServiceOpChecker.makeUnique(assigned, ai, state) + + return assigned + + @transaction.commit_on_success + def createAssignable(self, ds, deployed, user): + ''' + Creates an assignable service + ''' + now = getSqlDatetime() + assignable = ds.userServices.create(cache_level=0, state=State.PREPARING, os_state=State.PREPARING, + state_date=now, creation_date=now, data='', user=user, in_use=False) + state = deployed.deployForUser(user) + try: + UserServiceOpChecker.makeUnique(assignable, deployed, state) + except Exception, e: + logger.exception("Exception {0}".format(e)) + logger.debug("Assignable: {0}".format(assignable)) + return assignable + + + + @transaction.commit_on_success + def moveToLevel(self, cache, cacheLevel): + ''' + Moves a cache element from one level to another + @return: cache element + ''' + cache = UserService.objects.select_for_update().get(id=cache.id) + logger.debug('Moving cache {0} to level {1}'.format(cache, cacheLevel)) + ci = cache.getInstance() + state = ci.moveToCache(cacheLevel) + cache.cache_level = cacheLevel + if State.isRuning(state) and cache.isUsable(): + cache.setState(State.PREPARING) + + UserServiceOpChecker.makeUnique(cache, ci, state) + transaction.commit() + + @transaction.commit_on_success + def cancel(self, uService): + ''' + Cancels a user service creation + @return: the Uservice canceling + ''' + uService = UserService.objects.select_for_update().get(id=uService.id) + logger.debug('Canceling uService {0} creation'.format(uService)) + if uService.isPreparing() == False: + raise OperationException(_('Can\'t cancel non running operation')) + ui = uService.getInstance() + # We simply notify service that it should cancel operation + state = ui.cancel() + uService.updateData(ui) + uService.setState(State.CANCELING) + UserServiceOpChecker.makeUnique(uService, ui, state) + return uService + + + @transaction.commit_on_success + def remove(self, uService): + ''' + Removes a uService element + @return: the uService removed (marked for removal) + ''' + uService = UserService.objects.select_for_update().get(id=uService.id) + logger.debug('Removing uService {0}'.format(uService)) + if uService.isUsable() == False and State.isRemovable(uService.state) == False: + raise OperationException(_('Can\'t remove a non active element')) + + ci = uService.getInstance() + state = ci.destroy() + uService.setState(State.REMOVING) + UserServiceOpChecker.makeUnique(uService, ci, state) + + def removeOrCancel(self, uService): + if uService.isUsable() or State.isRemovable(uService.state): + return self.remove(uService) + elif uService.isPreparing(): + return self.cancel(uService) + else: + raise OperationException(_('Can\'t remove nor cancel {0} cause its states doesn\'t allows it')) + + @transaction.commit_on_success + def removeInfoItems(self, dsp): + dsp.cachedDeployedService.select_for_update().filter(state__in=State.INFO_STATES).delete() + + + @transaction.commit_on_success + def getAssignationForUser(self, ds, user): + # First, we try to locate an already assigned service + existing = ds.assignedUserServices().filter(user=user,state__in=State.VALID_STATES) + lenExisting = existing.count() + if lenExisting > 0: # Already has 1 assigned + logger.debug('Found assigned service from {0} to user {1}'.format(ds, user.name)) + if existing[0].state == State.ERROR: + if lenExisting > 1: + return existing[1] + else: + return existing[0] + + # Now try to locate 1 from cache already "ready" (must be usable and at level 1) + cache = ds.cachedUserServices().select_for_update().filter(cache_level = services.UserDeployment.L1_CACHE, state = State.USABLE)[:1] + if len(cache) > 0: + cache = cache[0] # Database object + cache.assignToUser(user) + cache.save() # Store assigned ASAP, we do not know how long assignToUser method of instance will take + logger.debug('Found a cached-ready service from {0} for user {1}, item {2}'.format(ds, user, cache)) + ci = cache.getInstance() # User Deployment instance + ci.assignToUser(user) + cache.updateData(ci) + cache.save() + return cache + # Now find if there is a preparing one + cache = ds.cachedUserServices().select_for_update().filter(cache_level = services.UserDeployment.L1_CACHE, state = State.PREPARING)[:1] + if len(cache) > 0: + cache = cache[0] + cache.assignToUser(user) + cache.save() + logger.debug('Found a cached-preparing service from {0} for user {1}, item {2}'.format(ds, user, cache)) + cache.getInstance().assignToUser(user) + return cache + # Can't assign directly from L2 cache... so we check if we can create e new service in the limits requested + ty = ds.service.getType() + if ty.usesCache is True: + inCacheL1 = ds.cachedUserServices().filter(UserServiceManager.getCacheStateFilter(services.UserDeployment.L1_CACHE)).count() + inAssigned = ds.assignedUserServices().filter(UserServiceManager.getStateFilter()).count() + totalL1Assigned = inCacheL1 + inAssigned + if totalL1Assigned >= ds.max_srvs: + raise MaxServicesReachedException() + # Can create new service, create it + return self.createAssignedFor(ds, user) + + def getServicesInStateForProvider(self, provider_id, state): + ''' + Returns the number of services of a service provider in the state indicated + ''' + return UserService.objects.filter(deployed_service__service__provider__id=provider_id, state=state).count() + + def canRemoveServiceFromDeployedService(self, ds): + ''' + checks if we can do a "remove" from a deployed service + ''' + removing = self.getServicesInStateForProvider(ds.service.provider_id, State.REMOVING) + if removing >= GlobalConfig.MAX_REMOVING_SERVICES.getInt() and GlobalConfig.IGNORE_LIMITS.getBool() == False: + return False + return True + + def canInitiateServiceFromDeployedService(self, ds): + ''' + Checks if we can start a new service + ''' + preparing = self.getServicesInStateForProvider(ds.service.provider_id, State.PREPARING) + if preparing >= GlobalConfig.MAX_PREPARING_SERVICES.getInt() and GlobalConfig.IGNORE_LIMITS.getBool() == False: + return False + return True + + @transaction.commit_on_success + def isReady(self, uService): + UserService.objects.update() + uService = UserService.objects.select_for_update().get(id=uService.id) + logger.debug('Checking ready of {0}'.format(uService)) + if uService.state != State.USABLE or uService.os_state != State.USABLE: + logger.debug('State is not usable for {0}'.format(uService)) + return False + logger.debug('Service {0} is usable, checking it via setReady'.format(uService)) + ui = uService.getInstance() + state = ui.setReady() + logger.debug('State: {0}'.format(state)) + uService.updateData(ui) + if state == State.FINISHED: + uService.save() + return True + uService.setState(State.PREPARING) + UserServiceOpChecker.makeUnique(uService, ui, state) + return False + + @transaction.commit_on_success + def checkForRemoval(self, uService): + uService = UserService.objects.select_for_update().get(id=uService.id) + if uService.publication == None: + return + if uService.publication.id != uService.deployed_service.activePublication().id: + logger.debug('Old revision of user service, marking as removable: {0}'.format(uService)) + uService.setState(State.REMOVABLE) + + + def notifyReadyFromOsManager(self, uService, data): + ui = uService.getInstance() + logger.debug('Notifying user service ready state') + state = ui.notifyReadyFromOsManager(data) + logger.debug('State: {0}'.format(state)) + uService.updateData(ui) + if state == State.FINISHED: + uService.save() + elif uService.state in (State.USABLE, State.PREPARING): # We don't want to get active deleting or deleted machines... + uService.setState(State.PREPARING) + UserServiceOpChecker.makeUnique(uService, ui, state) + diff --git a/server/src/uds/core/managers/__init__.py b/server/src/uds/core/managers/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/server/src/uds/core/osmanagers/BaseOsManager.py b/server/src/uds/core/osmanagers/BaseOsManager.py new file mode 100644 index 000000000..f6dc56166 --- /dev/null +++ b/server/src/uds/core/osmanagers/BaseOsManager.py @@ -0,0 +1,128 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext_noop as _ +from uds.core.util.State import State +from uds.core.BaseModule import BaseModule +from uds.core.managers.UserServiceManager import UserServiceManager + +STORAGE_KEY = 'osmk' + +class BaseOSManager(BaseModule): + ''' + An OS Manager is responsible for communication the service the different actions to take (i.e. adding a windows machine to a domain) + The Service (i.e. virtual machine) communicates with the OSManager via a published web method, that must include the unique ID. + In order to make easier to agents identify themselfs, the Unique ID can be a list with various Ids (i.e. the macs of the virtual machine). + Server will iterate thought them and look for an identifier associated with the service. This list is a comma separated values (i.e. AA:BB:CC:DD:EE:FF,00:11:22:...) + Remember also that we inherit the test and check methods from BaseModule + ''' + # Service informational related data + typeName = _('Base OS Manager') + typeType = 'BaseOSManager' + typeDescription = _('Base Manager') + iconFile = 'osmanager.png' + + # If true, this os manager will be invoked with every user service assigned, but not used from time to time + # Time is defined as a global config + processUnusedMachines = False + + def __init__(self,environment, values): + super(BaseOSManager, self).__init__(environment, values) + self.initialize(values) + + def initialize(self, values): + ''' + This method will be invoked from __init__ constructor. + This is provided so you don't have to provide your own __init__ method, + and invoke base methods. + This will get invoked when all initialization stuff is done + + Args: + Values: If values is not none, this object is being initialized + from administration interface, and not unmarshal will be done. + If it's None, this is initialized internally, and unmarshal will + be called after this. + + Default implementation does nothing + ''' + pass + + def release(self, service): + ''' + Called by a service that is in Usable state before destroying it so osmanager can release data associated with it + Only invoked for services that reach the state "removed" + @return nothing + ''' + pass + + # These methods must be overriden + def process(self,service, message, data): + ''' + This method must be overriden so your so manager can manage requests and responses from agent. + @param service: Service that sends the request (virtual machine or whatever) + @param message: message to process (os manager dependent) + @param data: Data for this message + ''' + pass + + def checkState(self,service): + ''' + This method must be overriden so your os manager can respond to requests from system to the current state of the service + This method will be invoked when: + * After service creation has finished, with the service wanting to see if it has to wait for os manager process finalization + * After call to process method, to check if the state has changed + * Before assigning a service to an user (maybe this is not needed)? + Notice that the service could be in any state. In fact, what we want with this is return FINISHED if nothing is expected from os o RUNING else + The state will be updated by actors inside oss, so no more direct checking is needed + @return: RUNNING, FINISHED + We do not expect any exception from this method + ''' + return State.FINISHED + + + def processUnused(self, userService): + ''' + This will be invoked for every assigned and unused user service that has been in this state at least 1/2 of Globalconfig.CHECK_UNUSED_TIME + This function can update userService values. Normal operation will be remove machines if this state is not valid + ''' + pass + + def destroy(self): + ''' + Invoked when OS Manager is deleted + ''' + pass + + def __str__(self): + return "Base OS Manager" + \ No newline at end of file diff --git a/server/src/uds/core/osmanagers/OSManagersFactory.py b/server/src/uds/core/osmanagers/OSManagersFactory.py new file mode 100644 index 000000000..2a9067d2c --- /dev/null +++ b/server/src/uds/core/osmanagers/OSManagersFactory.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +import logging + +logger = logging.getLogger(__name__) + +class OSManagersFactory(object): + _factory = None + + def __init__(self): + self._jobs = {} + + @staticmethod + def factory(): + if OSManagersFactory._factory == None: + OSManagersFactory._factory = OSManagersFactory() + return OSManagersFactory._factory + + def providers(self): + return self._jobs + + def insert(self, type): + self._jobs[type.type()] = type + + def lookup(self, typeName): + try: + return self._jobs[typeName] + except KeyError: + return None diff --git a/server/src/uds/core/osmanagers/__init__.py b/server/src/uds/core/osmanagers/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/server/src/uds/core/osmanagers/osmanager.png b/server/src/uds/core/osmanagers/osmanager.png new file mode 100644 index 000000000..a11c034db Binary files /dev/null and b/server/src/uds/core/osmanagers/osmanager.png differ diff --git a/server/src/uds/core/services/BaseDeployed.py b/server/src/uds/core/services/BaseDeployed.py new file mode 100644 index 000000000..7df1850ee --- /dev/null +++ b/server/src/uds/core/services/BaseDeployed.py @@ -0,0 +1,572 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' +from uds.core.Environment import Environmentable +from uds.core.Serializable import Serializable +from uds.core.util.State import State + +class UserDeployment(Environmentable, Serializable): + ''' + Interface for deployed services. + + This class provides the needed logic for implementing an "consumable user service", + that are the elements that the user will interact with. + + A good way to understand this class is to look at the sample services provided + with the documentation. + + As with all modules interfaces, if you override __init__ method, + do not forget to invoke this class __init__ method as this:: + + super(self.__class__, self).__init__(environment, **kwargs) + + This is a MUST (if you override __init___), so internal structured gets filled correctly, so don't forget it!. + + The preferred way of initializing, is to provide :py:meth:`.initialize`, that + will be invoked just after all initialization stuff is done at __init__. + + Normally objects of classes deriving from this one, will be serialized, called, + deserialized. This means that all that you want to ensure that is keeped inside + the class must be serialized and unserialized, because there is no warantee that + the object will get two methods invoked without haven't been remoded from memory + and loaded again, this means, IMPLEMENT marshal and unmarshal with all attributes + that you want to keep. + + + Things to know about this class: + + * Once a deployment is done, it will never be called again for same instance + object + * The method getUniqueId will be invoked after call to deploys and check. + You can change it on the fly, but remember that uniqueId is the "keyword" + used inside services to communicate with os managers (os manager will + receive an instance of UserDeployment, and this will be located via that + uniqueId) + + Uniques ids can be repeated at database level, to let it come at a later + deployment stage, but if two services has same uniqueid at a time, + os manager will simply not work. + * suggestedTime is always accessed through instance objects, and used after + deployForCache, deployForUser and moveToCache it these methods returns + RUNNING + * Checks (if a deployment has finished, or the cache movement is finished) + are always done using checkState(). It is secuential, i mean, will only + be called when a deployment,a cache movement or a cancel operation is + running + * If the service that supports this deployeds do not use L2 cache, the + moveCache method will never be invoked + * The L1 cache should be a fast access cache (i.e. running service but + not assigned to an user), while L2 cache should be non consuming or + almost-non-consuming service. This means that if we cannont make an + slower an less resources consumable form for a service, this should + not have an L2 cache (slower is not a must, + but probably it will be slower to recover from L2 cache than from L1, + but faster than creating a new service) + Ofc, if a service has an "Instant" creation, it don't needs cache... + * We do not expect any exception from these methods, but if there is an + error, the method can return "ERROR". To show the reason of error, the + method reasonOfError can be called multiple times, including + serializations in middle, so remember to include reason of error in serializations + ''' + L1_CACHE = 1 #: Constant for Cache of level 1 + L2_CACHE = 2 #: Constant for Cache of level 2 + + #: Suggested time for deployment finishing, in seconds + #: This allows the manager to, if deployment is no done in 1 step, re-check + #: the deployment once this time has passed, i.e. KVM COW deployment takes + #: low time, so we suggest to check at short intervals, but full copys takes + #: a bit more so we can use longer interval checks + #: This attribute is accessed always through an instance object, + #: so u can modify it at your own implementation. + suggestedTime = 10 + + def __init__(self, environment, **kwargs): + ''' + Do not forget to invoke this in your derived class using "super(self.__class__, self).__init__(environment, **kwargs)" + We want to use the env, cache and storage methods outside class. If not called, you must implement your own methods + cache and storage are "convenient" methods to access _env.cache() and _env.storage() + + Invoking this from derived classes is a MUST, again, do not forget it or your + module will probable never work. + + Args: + + environment: Environment assigned to this publication + kwargs: List of arguments that will receive: + service: Parent service (derived from Service) of this deployment (this is an instance, not database object) + publication: Parent publication (derived from Publication) of this deployment (optional)(this is an instance, not database object) + osmanager: Parent osmanager (derived from BaseOsManager) of this deployment (optional)(this is an instance, not database object) + dbservice: Database object for this service + ''' + Environmentable.__init__(self, environment) + Serializable.__init__(self) + self._service = kwargs['service'] # Raises an exception if service is not included. Parent + if kwargs.has_key('publication'): + self._publication = kwargs['publication'] + else: + self._publication = None + if kwargs.has_key('osmanager'): + self._osmanager = kwargs['osmanager'] + else: + self._osmanager = None + if kwargs.has_key('dbservice'): # Reference to database service, will be there most time :-) + self._dbService = kwargs['dbservice'] + else: + self._dbService = None + + self.initialize() + + def initialize(self): + ''' + This method will be invoked from __init__ constructor. + This is provided so you don't have to provide your own __init__ method, + and invoke base class __init__. + This will get invoked when all initialization stuff is done, so + you can here access publication, service, osManager, ... + ''' + pass + + + def getName(self): + ''' + Override this to return a name to display under some circustances + + Returns: + + name, default implementation returns unique id + ''' + return self.getUniqueId() + + def service(self): + ''' + Utility method to access parent service. This doesn't need to be override. + + Normaly user deployments will need parent service to provide the + consumable to the user. + + Returns: + + Parent service of this User Deployment + ''' + return self._service + + def publication(self): + ''' + Utility method to access publication. This doesn't need to be overriden. + + Returns: + + publication for this user deployment, or None if this deployment has + no publication at all. + ''' + return self._publication + + def osmanager(self): + ''' + Utility method to access os manager. This doesn't need to be overriden. + + Returns: + + os manager for this user deployment, or None if this deployment has + no os manager. + ''' + return self._osmanager + + def dbservice(self): + ''' + Utility method to access database object for the object this represents. + + Returns: + + Database object that got unserialized to obtain this object. + ''' + return self._dbService + + def macGenerator(self): + ''' + Utility method to access provided macs generator (inside environment) + + Returns the environment unique mac addresses generator + ''' + return self.idGenerators('mac') + + def nameGenerator(self): + ''' + Utility method to access provided names generator (inside environment) + + Returns the environment unique name generator + ''' + return self.idGenerators('name') + + def getUniqueId(self): + ''' + Obtains an unique id for this deployed service, you MUST override this + + Returns: + + An unique identifier for this object, that is an string and must be + unique. + ''' + raise Exception('Base getUniqueId for User Deployment called!!!') + + def notifyReadyFromOsManager(self, data): + ''' + This is a task method. As that, the excepted return values are + State values RUNNING, FINISHED or ERROR. + + This method provides a mechanism to let os managers notify readyness + to deployed services. + + Args: + + Data: Data sent by os manager. + Data is os manager dependant, so check if this data is known by you + (normally, it will be None, but is os manager dependad as i say) + + This is a task-initiating method, so if there is something to do, + just return State.RUNNING. If not, return State.FINISHED. In case of + error, return State.ERROR and be ready to provide error message when + + if State.RUNNING is returned, the :py:meth:.checkState method will be + used to check when this process has finished. + + :note: All task methods, like this one, are expected to handle + all exceptions, and never raise an exception from these methods + to the core. Take that into account and handle exceptions inside + this method. + ''' + return State.FINISHED + + def getIp(self): + ''' + All services are "IP" services, so this method is a MUST + + Returns: + + The needed ip to let the user connect to the his deployed service. + This ip will be managed by transports, without IP there is no connection + ''' + raise Exception('Base getIp for User Deployment got called!!!') + + def setIp(self, ip): + ''' + This is an utility method, invoked by some os manager to notify what they thinks is the ip for this service. + If you assign the service IP by your own methods, do not override this + ''' + pass + + def setReady(self): + ''' + This is a task method. As that, the excepted return values are + State values RUNNING, FINISHED or ERROR. + + The method is invoked whenever a machine is provided to an user, right + before presenting it (via transport rendering) to the user. + + This method exist for this kind of situations (i will explain it with a + sample) + + Imagine a Service tree (Provider, Service, ...) for virtual machines. + This machines will get created by the UserDeployment implementation, but, + at some time, the machine can be put at in an state (suspend, shut down) + that will make the transport impossible to connect with it. + + This method, in this case, will check the state of the machine, and if + it is "ready", that is, powered on and accessible, it will return + "State.FINISHED". If the machine is not accessible (has been erased, for + example), it will return "State.ERROR" and store a reason of error so UDS + can ask for it and present this information to the Administrator. + + If the machine powered off, or suspended, or any other state that is not + directly usable but can be put in an usable state, it will return + "State.RUNNING", and core will use checkState to see when the operation + has finished. + + :note: All task methods, like this one, are expected to handle + all exceptions, and never raise an exception from these methods + to the core. Take that into account and handle exceptions inside + this method. + ''' + return State.FINISHED + + def deployForCache(self, cacheLevel): + ''' + Deploys a user deployment as cache. + + This is a task method. As that, the expected return values are + State values RUNNING, FINISHED or ERROR. + + The objective of this method is providing a cache copy of an user consumable, + and will be invoked whenever the core need to create a new copy for cache + of the service this UserDeployment manages. + + Things to take care with this method are: + + * cacheLevel can be L1 or L2 (class constants) + * If a deploy for cache is asked for a L1 cache, the generated + element is expected to be all-done for user consume. L1 cache items + will get directly assigned to users whenever needed, and are expected + to be fast. (You always have setReady method to do anything else needed + to assign the cache element to an user, but generally L1 cached items + must be ready to use. + * An L2 cache is expected to be an cached element that is "almost ready". + The main idea behind L2 is to keep some elements almost usable by users + but in an state that they do not consume (or consumes much less) resources. + If your L2 cache consumes the same that L1 cache, L2 cache is in fact not + needed. + * This works as :py:meth:.deployForUser, meaning that you can take a look + also to that method for more info + + :note: If your service uses caching, this method MUST be provided. If it + do not uses cache, this method will never get called, so you can + skip it implementation + + :note: All task methods, like this one, are expected to handle + all exceptions, and never raise an exception from these methods + to the core. Take that into account and handle exceptions inside + this method. + ''' + raise Exception('Base deploy for cache invoked! for class {0}'.format(self.__class__.__name__)) + + def deployForUser(self, user): + ''' + Deploys an service instance for an user. + + This is a task method. As that, the excepted return values are + State values RUNNING, FINISHED or ERROR. + + The user parameter is not realy neded, but provided. It indicates the + Database User Object (see py:mod:`uds.modules`) to which this deployed + user service will be assigned to. + + This method will get called whenever a new deployed service for an user + is needed. This will give this class the oportunity to create + a service that is assigned to an user. + + The way of using this method is as follows: + + If the service gets created in "one step", that is, before the return + of this method, the consumable service for the user gets created, it + will return "State.FINISH". + If the service needs more steps (as in this case), we will return + "State.RUNNING", and if it has an error, it wil return "State.ERROR" and + store an error string so administration interface can show it. + + We do not use user for anything, as in most cases will be. + + :note: override ALWAYS this method, or an exception will be raised + + :note: All task methods, like this one, are expected to handle + all exceptions, and never raise an exception from these methods + to the core. Take that into account and handle exceptions inside + this method. + ''' + raise Exception('Base deploy for user invoked! for class {0}'.format(self.__class__.__name__)) + + + def checkState(self): + ''' + This is a task method. As that, the expected return values are + State values RUNNING, FINISHED or ERROR. + + + If some of the initiating action tasks returns State.RUNNING. this method + will get called until it returns State.FINISH or State.ERROR. + + In other words, whenever a multi step operation is initiated, this method + will get the responsability to check that the operation has finished or + failed. If the operation continues, but haven't finished yet, it must + return State.RUNNING. If has finished must return State.FINISH and if it + has some kind of error, State.ERROR and also store somewhere the info + that will be requested using :py:meth:.reasonOfError + + :note: override ALWAYS this method, or an exception will be raised + + :note: All task methods, like this one, are expected to handle + all exceptions, and never raise an exception from these methods + to the core. Take that into account and handle exceptions inside + this method. + ''' + raise Exception('Base check state invoked! for class {0}'.format(self.__class__.__name__)) + + def finish(self): + ''' + Invoked when the core notices that the deployment of a service has finished. + (No matter whether it is for cache or for an user) + + This gives the opportunity to make something at that moment. + + Default implementation does nothing at all. + + :note: You can also make these operations at checkState, this is really + not needed, but can be provided (default implementation of base class does + nothing) + ''' + pass + + def assignToUser(self, user): + ''' + This method is invoked whenever a cache item gets assigned to an user. + This is not a task method right now, simply a notification. This means + that L1 cache items must be directly usable (except for the readyness part) + by users in a single step operation. + + Note that there will be an setReady call before letting the user consume + this user deployment, so this is more informational (so, if you keep at + what cache level is this instance, you can update it) than anything else. + + This is not a task method. All level 1 cache items can be dircetly + assigned to an user with no more work needed, but, if something is needed, + here you can do whatever you need. + + user is a Database user object. + ''' + pass + + def moveToCache(self, newLevel): + ''' + This method is invoked whenever the core needs to move from the current + cache level to a new cache level an user deployment. + + This is a task method. As that, the expected return values are + State values RUNNING, FINISHED or ERROR. + + We only provide newLevel, because there is only two cache levels, so if + newLevel is L1, the actual is L2, and if it is L2, the actual is L1. + + Actually there is no possibility to move assigned services again back to + cache. If some service needs that kind of functionallity, this must be + provided at service level (for example, when doing publishing creating + a number of services that will be used, released and reused by users). + + Also, user deployments that are at cache level 2 will never get directly + assigned to user. First, it will pass to L1 and then it will get assigned. + + A good sample of a real implementation of this is moving a virtual machine + from a "suspended" state to "running" state to assign it to an user. + + :note: All task methods, like this one, are expected to handle + all exceptions, and never raise an exception from these methods + to the core. Take that into account and handle exceptions inside + this method. + ''' + return State.FINISHED + + def userLoggedIn(self, username): + ''' + This method must be available so os managers can invoke it whenever + an user get logged into a service. + + Default implementation does nothing, so if you are going to do nothing, + you don't need to implement it. + + The responsibility of notifying it is of os manager actor, and it's + directly invoked by os managers (right now, linux os manager and windows + os manager) + + The user provided is just an string, that is provided by actors. + ''' + pass + + def userLoggedOut(self, username): + ''' + This method must be available so os managers can invoke it whenever + an user get logged out if a service. + + Default implementation does nothing, so if you are going to do nothing, + you don't need to implement it. + + The responability of notifying it is of os manager actor, and it's + directly invoked by os managers (right now, linux os manager and windows + os manager) + + The user provided is just an string, that is provided by actor. + ''' + pass + + def reasonOfError(self): + ''' + Returns the reason of the error. + + Remember that the class is responsible of returning this whenever asked + for it, and it will be asked everytime it's needed to be shown to the + user (when the administation asks for it). + + :note: Remember that you can use ugettext to translate this error to + user language whenever it is possible. (This one will get invoked + directly from admin interface and, as so, will have translation + environment correctly set up. + ''' + return 'unknown' + + def destroy(self): + ''' + This is a task method. As that, the excepted return values are + State values RUNNING, FINISHED or ERROR. + + This method gives the oportunity to remove associated data (virtual machine, + ...) for the user consumable this instance represents. + + If return value is State.RUNNING, :py:meth:.checkState will be used to + check if the destroy operation has finished. + + :note: All task methods, like this one, are expected to handle + all exceptions, and never raise an exception from these methods + to the core. Take that into account and handle exceptions inside + this method. + ''' + raise Exception('destroy method for class {0} not provided!'.format(self.__class__.__name__)) + + def cancel(self): + ''' + This is a task method. As that, the excepted return values are + State values RUNNING, FINISHED or ERROR. + + Cancel represents a canceling of the current running operation, and + can be invoked directly by an administration or by the clean up + of the deployed service (indirectly). + + When administrator requests it, the cancel is "delayed" and not + invoked directly. + + :note: All task methods, like this one, are expected to handle + all exceptions, and never raise an exception from these methods + to the core. Take that into account and handle exceptions inside + this method. + ''' + raise Exception('cancel method for class {0} not provided!'.format(self.__class__.__name__)) + + def __str__(self): + ''' + Mainly used for debugging purposses + ''' + return "Base Deployed Service" diff --git a/server/src/uds/core/services/BasePublication.py b/server/src/uds/core/services/BasePublication.py new file mode 100644 index 000000000..da5db54f0 --- /dev/null +++ b/server/src/uds/core/services/BasePublication.py @@ -0,0 +1,269 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' +from uds.core.Environment import Environmentable +from uds.core.Serializable import Serializable + +class Publication(Environmentable, Serializable): + ''' + This class is in fact an interface, and defines the logic of a publication + for a Service. + + A publication is the preparation of the needs of a service before it can + be provided to users. One good sample of this is, in case of virtual machines, + to copy a machine to provide COWS of this copy to users. + + As always, do not forget to invoke base class __init__ if you override it as this:: + + super(self.__class__, self).__init__(environment, **kwargs) + + This is a MUST, so internal structured gets filled correctly, so don't forget it!. + + The preferred method is not to override init, but provide the :py:meth:`.initialize`, + that will be invoked just after all internal initialization is completed. + + Normally objects of classes deriving from this one, will be serialized, called, + deserialized. This means that all that you want to ensure that is keeped inside + the class must be serialized and unserialized, because there is no warantee that + the object will get two methods invoked without haven't been remoded from memory + and loaded again, this means, IMPLEMENT marshal and unmarshal with all attributes + that you want to keep. + ''' + + # Constants for publications + + # Description of the publication + + #:Suggested time for publication finishing, in seconds + #: This allows the manager to, if publication is no done in 1 step, + #: re-check the publication once this time has passed, i.e. KVM COW publication + #: takes low time, so we suggest to check at short intervals, + #: but full clone takes a lot, so we suggest that checks are done more steady. + #: This attribute is always accessed using an instance object, so you can + #: change suggestedTime in your implementation. + suggestedTime = 10 + + def __init__(self, environment, **kwargs): + ''' + Do not forget to invoke this in your derived class using "super(self.__class__, self).__init__(environment, values)" + We want to use the env, cache and storage methods outside class. If not called, you must implement your own methods + cache and storage are "convenient" methods to access _env.cache() and _env.storage() + @param environment: Environment assigned to this publication + ''' + Environmentable.__init__(self, environment) + Serializable.__init__(self) + self._osManager = kwargs.get('osManager', None) + self._service = kwargs['service'] # Raises an exception if service is not included + self._revision = kwargs.get('revision', -1) + self._dsName = kwargs.get('dsName', 'Unknown') + + self.initialize() + + def initialize(self): + ''' + This method will be invoked from __init__ constructor. + This is provided so you don't have to provide your own __init__ method, + and invoke base class __init__. + This will get invoked when all initialization stuff is done, so + you can here access service, osManager, ... + ''' + pass + + def service(self): + ''' + Utility method to access parent service of this publication + + Returns + + Parent service instance object (not database object) + ''' + return self._service + + def osManager(self): + ''' + Utility method to access os manager for this publication. + + Returns + + Parent service instance object (not database object) + The returned value can be None if no Os manager is needed by + the service owner of this publication. + ''' + return self._osManager + + def revision(self): + ''' + Utility method to access the revision of this publication + This is a numeric value, and is set by core + ''' + return self._revision + + def dsName(self): + ''' + Utility method to access the declared deployed service name. + + This name is set by core, using the administrator provided data + at administration interface. + ''' + return self._dsName + + def publish(self): + ''' + This method is invoked whenever the administrator requests a new publication. + + The method is not invoked directly (i mean, that the administration request + do no makes a call to this method), but a DelayedTask is saved witch will + initiate all publication stuff (and, of course, call this method). + + You MUST implement it, so the publication do really something. + All publications can be synchronous or asynchronous. + + The main difference between both is that first do whatever needed, (the + action must be fast enough to do not block core), returning State.FINISHED. + + The second (asynchronous) are publications that could block the core, so + it have to be done in more than one step. + + An example publication could be a copy of a virtual machine, where: + * First we invoke the copy operation to virtualization provider + * Second, we kept needed values inside instance so we can serialize + them whenever requested + * Returns an State.RUNNING, indicating the core that the publication + has started but has to finish sometime later. (We do no check + again the state and keep waiting here, because we will block the + core untill this operation is finished). + + :note: This method MUST be provided, an exception is raised if not. + + :note: All task methods, like this one, are expected to handle + all exceptions, and never raise an exception from these methods + to the core. Take that into account and handle exceptions inside + this method. + ''' + raise Exception('publish method for class {0} not provided! '.format(self.__class__.__name__)) + + def checkState(self): + ''' + This is a task method. As that, the expected return values are + State values RUNNING, FINISHED or ERROR. + + This method will be invoked whenever a publication is started, but it + do not finish in 1 step. + + The idea behind this is simple, we can initiate an operation of publishing, + that will be done at :py:meth:.publish method. + + If this method returns that the operation has been initiated, but not finished + (State.RUNNING), the core will keep calling this method until checkState + returns State.FINISHED (or State.error). + + You MUST always provide this method if you expect the publication no to be + done in 1 step (meaning this that if publish can return State.RUNNING, this + will get called) + + :note: All task methods, like this one, are expected to handle + all exceptions, and never raise an exception from these methods + to the core. Take that into account and handle exceptions inside + this method. + ''' + raise Exception('checkState method for class {0} not provided!!!'.format(self.__class__.__name__)) + + def finish(self): + ''' + Invoked when Publication manager noticed that the publication has finished. + This give us the opportunity of cleaning up things (as stored vars, etc..) + Returned value, if any, is ignored + + Default implementation does nothing. You can leave default method if you + are going to do nothing. + ''' + pass + + def reasonOfError(self): + ''' + If a publication produces an error, here we must return the reason why + it happened. This will be called just after publish or checkPublishingState + if they return State.ERROR + + The returned value, an string, will be used always by administration interface, + meaning this that the translation environment will be ready, and that you + can use ugettext to return a version that can be translated to administration + interface language. + ''' + return 'unknown' + + def destroy(self): + ''' + This is a task method. As that, the expected return values are + State values RUNNING, FINISHED or ERROR. + + Invoked for destroying a deployed service + Do whatever needed here, as deleting associated data if needed + (i.e. a copy of the machine, snapshots, etc...) + + This method MUST be provided, even if you do nothing here (in that case, + simply return State.FINISHED). Default implementation will raise an + exception if it gets called + + :note: All task methods, like this one, are expected to handle + all exceptions, and never raise an exception from these methods + to the core. Take that into account and handle exceptions inside + this method. + ''' + raise Exception('destroy method for class {0} not provided!'.format(self.__class__.__name__)) + + def cancel(self): + ''' + This is a task method. As that, the expected return values are + State values RUNNING, FINISHED or ERROR. + + This method is invoked whenever the core needs a cancelation of current + operation. This will happen if we are, for example, preparing the + service for users, but the administration request to stop doing this. + + This method MUST be provided, even if you do nothing here (in that case, + simply return State.FINISHED). Default implementation will raise an + exception if it gets called + + :note: All task methods, like this one, are expected to handle + all exceptions, and never raise an exception from these methods + to the core. Take that into account and handle exceptions inside + this method. + ''' + raise Exception('cancel method for class {0} not provided!'.format(self.__class__.__name__)) + + def __str__(self): + ''' + String method, mainly used for debugging purposes + ''' + return "Base Publication" + diff --git a/server/src/uds/core/services/BaseService.py b/server/src/uds/core/services/BaseService.py new file mode 100644 index 000000000..29a1536fa --- /dev/null +++ b/server/src/uds/core/services/BaseService.py @@ -0,0 +1,206 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' +from django.utils.translation import ugettext_noop as translatable +from uds.core.BaseModule import BaseModule + +class Service(BaseModule): + ''' + This class is in fact an interface, and represents a service, that is the + definition of an offering for consumers (users). + + Class derived from this one declares the behavior of the service, as well + as custom parameter that will be needed to provide final consumable elements + to users. + + The behavior attributes must be declared always, although they have default + values, this can change in a future and declaring all needed is a good way + to avoid future problems. Of course, if you declare that do no do something + (i.e. do not uses cache), you will not have to declare related attributes + (i.e. cacheTooltip, usesCache_L2 and cacheTooltip_L2) + + As you derive from this class, if you provide __init__ in your own class, + remember to call ALWAYS at base class __init__ as this: + + super(self.__class__, self).__init__(dbAuth, environment, values) + + This is a MUST (if you override __init__), so internal structured gets + filled correctly, so don't forget it!. + + The preferred method of provide initialization is to provide the :py:meth:`.initialize`, + and do not override __init__ method. This (initialize) will be invoked after + all internal initialization, so there will be available parent, environment and storage. + + Normally objects of classes deriving from this one, will be serialized, called, + deserialized. This means that all that you want to ensure that is kept inside + the class must be serialized and unserialized, because there is no warrantee that + the object will get two methods invoked without haven't been removed from memory + and loaded again. One thing to have into account on this are Form Fields, that + default implementation marshals and unmashals them, so if your case is that you + only need data that is keeped at form fields, marshal and unmarshal and in fact + not needed. + + ''' + + #: Constant for indicating that max elements this service can deploy is unlimited. + UNLIMITED = -1 + + #: Name of type, used at administration interface to identify this + #: service (i.e. Xen server, oVirt Server, ...) + #: This string will be translated when provided to admin interface + #: using ugettext, so you can mark it as "translatable" at derived classes (using ugettext_noop) + #: if you want so it can be translated. + typeName = translatable('Base Service') + + #: Name of type used by Managers to identify this type of service + #: We could have used here the Class name, but we decided that the + #: module implementator will be the one that will provide a name that + #: will relation the class (type) and that name. + typeType = 'BaseService' + + #: Description shown at administration level for this service. + #: This string will be translated when provided to admin interface + #: using ugettext, so you can mark it as "translatable" at derived classes (using ugettext_noop) + #: if you want so it can be translated. + typeDescription = translatable('Base Service') + + #: Icon file, used to represent this service at administration interface + #: This file should be at same folder as this class is, except if you provide + #: your own :py:meth:uds.core.BaseModule.BaseModule.icon method. + iconFile = 'service.png' + + # Functional related data + + #: Normally set to UNLIMITED. This attribute indicates if the service has some "limitation" + #: for providing deployed services to users. This attribute can be set here or + #: modified at instance level, core will access always to it using an instance object. + maxDeployed = UNLIMITED #: If the service provides more than 1 "provided service" (-1 = no limit, 0 = ???? (do not use it!!!), N = max number to deploy + + #: If this class uses cache or not. If uses cache is true, means that the + #: service can "prepare" some user deployments to allow quicker user access + #: to services if he already do not have one. + #: If you set this to True, please, provide a translatable :py:attr:.cacheToolTip + usesCache = False + + #: Tooltip to be used if services uses cache at administration interface, indicated by :py:attr:.usesCache + cacheTooltip = translatable('None') #: Tooltip shown to user when this item is pointed at admin interface + + #: If user deployments can be cached (see :py:attr:.usesCache), may he also can provide a secondary cache, + #: that is no more that user deployments that are "almost ready" to be used, but preperably consumes less + #: resources than L1 cache. This can give a boost to cache L1 recovering in case of peaks + #: in demand. If you set this to True, please, provide also a translatable :py:attr:.cacheTooltip_L2 + usesCache_L2 = False #: If we need to generate a "Level 2" cache for this service (i.e., L1 could be running machines and L2 suspended machines) + + #: Tooltip to be used if services uses L2 cache at administration interface, indicated by :py:attr:.usesCache_L2 + cacheTooltip_L2 = translatable('None') #: Tooltip shown to user when this item is pointed at admin interface + + #: If the service needs a o.s. manager (see os managers section) + needsManager = False + + #: If the service can be autoassigned or needs to be assigned by administrator + #: Not all services are for assigning it. Thing, i.e., a Service that manages + #: a number of Server. The desired behavior will be to let administrator + #: the service to a user in the administration interface, an not the system + #: to assign the service automatically. If this is true, the core will not + #: assign the service automatically, so if the user do not have a consumable + #: assigned, the user will never get one (of this kind, of course) + mustAssignManually = False + + #: Types of publications (preparated data for deploys) + #: If you provide this, UDS will assume that the service needs a preparation. + #: If not provided (it is None), UDS will assume that service do not needs + #: preparation. Take care, if you mark a service as it uses cache, you MUST + #: provide a publication type + #: This refers to class that provides the logic for publication, you can see + #: :py:class:uds.core.services.Publication + publicationType = None + + #: Types of deploys (services in cache and/or assigned to users) + #: This is ALWAYS a MUST. You mast indicate the class responsible + #: for managing the user deployments (user consumable services generated + #: from this one). If this attribute is not set, the service will never work + #: (core will not know how to handle the user deployments) + deployedType = None + + def __init__(self, environment, parent, values = None): + ''' + Do not forget to invoke this in your derived class using "super(self.__class__, self).__init__(environment, parent, values)". + We want to use the env, parent methods outside class. If not called, you must implement your own methods + cache and storage are "convenient" methods to access _env.cache() and _env.storage() + ''' + super(Service, self).__init__(environment, values) + self._provider = parent + self.initialize(values) + + def initialize(self, values): + ''' + This method will be invoked from __init__ constructor. + This is provided so you don't have to provide your own __init__ method, + and invoke base methods. + This will get invoked when all initialization stuff is done + + Args: + Values: If values is not none, this object is being initialized + from administration interface, and not unmarshal will be done. + If it's None, this is initialized internally, and unmarshal will + be called after this. + + Default implementation does nothing + ''' + pass + + def parent(self): + ''' + Utility method to access parent provider for this service + + Returns + + Parent provider instance object (not database object) + ''' + return self._provider + + def requestServicesForAssignation(self, **kwargs): + ''' + override this if mustAssignManualy is True + @params kwargs: Named arguments + @return an array with the services that we can assign (they must be of type deployedType) + We will access the returned array in "name" basis. This means that the service will be assigned by "name", so be care that every single service + returned are not repeated... :-) + ''' + raise Exception('The class {0} has been marked as manually asignable but no requestServicesForAssignetion provided!!!'.format(self.__class__.__name__)) + + def __str__(self): + ''' + String method, mainly used for debugging purposes + ''' + return "Base Service Provider" + diff --git a/server/src/uds/core/services/BaseServiceProvider.py b/server/src/uds/core/services/BaseServiceProvider.py new file mode 100644 index 000000000..d4fd93c87 --- /dev/null +++ b/server/src/uds/core/services/BaseServiceProvider.py @@ -0,0 +1,162 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' +from uds.core.BaseModule import BaseModule +import logging + +logger = logging.getLogger(__name__) + + +class ServiceProvider(BaseModule): + ''' + Base Service Provider Class. + + All classes that will represent a service provider will need to be derived + from this class. + + The preferred way of using this class is by its alias name, provided + at uds.core.services module, ServiceProvider. + + This is a very basic class, intended to be the root class of services. + This means that services are childs of this class, declared at "offers" attribute. + + As you derive from this class, if you provide __init__ in your own class, + remember to call ALWAYS at base class __init__ as this: + + super(...., self).__init__(environment, values) + + The preferred method of provide initialization is to provide the :py:meth:`.initialize`, + and do not overrie __init__ method. This (initialize) will be invoked after + all internal initialization. + + This is a MUST, so internal structured gets filled correctly, so don't forget it!. + + Normally objects of classes deriving from this one, will be serialized, called, + deserialized. This means that all that you want to ensure that is keeped inside + the class must be serialized and unserialized, because there is no warantee that + the object will get two methods invoked without haven't been removed from memory + and loaded again. One thing to have into account on this are Form Fields, that + default implementation marshals and unmashals them, so if your case is that you + only need data that is keeped at form fields, marshal and unmarshal and in fact + not needed. + ''' + + #: Services that we offers. Here is a list of service types (python types) that + #: this class will provide. This types are the python clases, derived from + #: Service, that are childs of this provider + offers = [] + + #: Name of type, used at administration interface to identify this + #: provider (i.e. Xen server, oVirt Server, ...) + #: This string will be translated when provided to admin interface + #: using ugettext, so you can mark it as "translatable" at derived classes (using ugettext_noop) + #: if you want so it can be translated. + typeName = 'Base Provider' + + #: Name of type used by Managers to identify this tipe of service + #: We could have used here the Class name, but we decided that the + #: module implementator will be the one that will provide a name that + #: will relation the class (type) and that name. + typeType = 'BaseServiceProvider' + + #: Description shown at administration level for this provider. + #: This string will be translated when provided to admin interface + #: using ugettext, so you can mark it as "translatable" at derived classes (using ugettext_noop) + #: if you want so it can be translated. + typeDescription = 'Base Service Provider' + + #: Icon file, used to represent this provider at administration interface + #: This file should be at same folder as this class is, except if you provide + #: your own py:meth:`uds.core.BaseModule.BaseModule.icon` method. + iconFile = 'provider.png' + + @classmethod + def getServicesTypes(cls): + ''' + Returns what type of services this provider offers + ''' + return cls.offers + + @classmethod + def getServiceByType(cls, typeName): + ''' + Tries to locate a child service which type corresponds with the + one provided. + Returns None if can't find one. + + :note: The type that this method looks for is not the class, but + the typeType that Service has. + ''' + res = None + for _type in cls.offers: + if _type.type() == typeName: + res = _type + break + return res + + + def __init__(self, environment, values = None): + ''' + Do not forget to invoke this in your derived class using "super(self.__class__, self).__init__(environment, values)" + if you override this method. Better is to provide an "__initialize__" method, that will be invoked + by __init__ + Values parameter is provided (are not None) when creating or modifying the service provider, so params check should ocur here and, if not + valid, raise an "ValidationException" message + ''' + super(ServiceProvider, self).__init__(environment, values) + self.initialize(values) + + + def initialize(self, values): + ''' + This method will be invoked from __init__ constructor. + This is provided so you don't have to provide your own __init__ method, + and invoke base methods. + This will get invoked when all initialization stuff is done + + Args: + Values: If values is not none, this object is being initialized + from administration interface, and not unmarshal will be done. + If it's None, this is initialized internally, and unmarshal will + be called after this. + + Default implementation does nothing + ''' + pass + + def __str__(self): + ''' + Basic implementation, mostly used for debuging and testing, never used + at user or admin interfaces. + ''' + return "Base Service Provider" + diff --git a/server/src/uds/core/services/Exceptions.py b/server/src/uds/core/services/Exceptions.py new file mode 100644 index 000000000..f7c03975c --- /dev/null +++ b/server/src/uds/core/services/Exceptions.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' + +class UnsupportedException(Exception): + ''' + Reflects that we request an operation that is not supported, i.e. Cancel a publication with snapshots + ''' + pass + +class OperationException(Exception): + ''' + Reflects that the operation requested can't be acomplished, i.e. remove an snapshot without snapshot reference, cancel non running operation, etc... + ''' + pass + +class PublishException(Exception): + ''' + Reflects thate the publication can't be done for causes we don't know in advance + ''' + pass + +class DeploymentException(Exception): + ''' + Reflects that a deployment of a service (at cache, or assigned to user) can't be done for causes we don't know in advance + ''' + pass + +class CancelException(Exception): + ''' + Reflects that a "cancel" operation can't be done for some reason + ''' + +class InvalidServiceException(Exception): + ''' + Invalid service specified. The service is not ready + ''' + pass + +class MaxServicesReachedException(Exception): + ''' + Number of maximum services has been reached, and no more services + can be created for users. + ''' + pass \ No newline at end of file diff --git a/server/src/uds/core/services/ServiceProviderFactory.py b/server/src/uds/core/services/ServiceProviderFactory.py new file mode 100644 index 000000000..5936ca2cb --- /dev/null +++ b/server/src/uds/core/services/ServiceProviderFactory.py @@ -0,0 +1,109 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' +import logging + +logger = logging.getLogger(__name__) + +class ServiceProviderFactory(object): + ''' + This class holds the register of all known service provider modules + inside UDS. + + It provides a way to register and recover providers providers. + ''' + _factory = None + + def __init__(self): + ''' + Initializes internal dictionary for service providers registration + ''' + self._providers = {} + + @staticmethod + def factory(): + ''' + Returns the factory that keeps the register of service providers. + ''' + if ServiceProviderFactory._factory == None: + ServiceProviderFactory._factory = ServiceProviderFactory() + return ServiceProviderFactory._factory + + def providers(self): + ''' + Returns the list of service providers already registered. + ''' + return self._providers + + def insert(self, type_): + ''' + Inserts type_ as a service provider + ''' + # Before inserting type, we will make a couple of sanity checks + # We could also check if it provides at least a service, but + # for debugging purposes, it's better to not check that + # We will check that if service provided by "provider" needs + # cache, but service do not provides publicationType, + # that service will not be registered and it will be informed + offers = [] + for s in type_.offers: + if s.usesCache_L2 is True: + s.usesCache = True + if s.usesCache is True and s.publicationType is None: + logger.error('Provider {0} offers {1}, but {1} needs cache and do not have publicationType defined'.format( + type_, s)) + continue + offers.append(s) + + # Only offers valid services + type_.offers = offers + logger.debug('Adding provider {0} as {1}'.format(type_.type(), type_)) + self._providers[type_.type()] = type_ + + def lookup(self, typeName): + ''' + Tries to locate a server provider and by its name, and, if + not found, returns None + ''' + return self._providers.get(typeName, None) + + def servicesThatDoNotNeedPublication(self): + ''' + Returns a list of all service providers registered that do not need + to be published + ''' + res = [] + for p in self._providers.values(): + for s in p.offers: + if s.publicationType is None and s.mustAssignManually is False: + res.append(s) + return res diff --git a/server/src/uds/core/services/__init__.py b/server/src/uds/core/services/__init__.py new file mode 100644 index 000000000..509185af5 --- /dev/null +++ b/server/src/uds/core/services/__init__.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +UDS Service modules interfaces and classes. + +From 1.0 onwards, the refactoring of UDS has started. + +We can access the base service interfaces the old method, or recommended +and easier use the new one, that is "from uds.core.services import ..." + +The new valid names for classes are: + * **factory** for old ServiceProviderFactory.ServiceProviderFactory.factory() + +I think this is an easier to use and understand way of accessing this classes + +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from BaseServiceProvider import ServiceProvider +from BaseService import Service +from BasePublication import Publication +from BaseDeployed import UserDeployment +import Exceptions + +def factory(): + ''' + Returns factory for register/access to service providers + ''' + from ServiceProviderFactory import ServiceProviderFactory + return ServiceProviderFactory.factory() diff --git a/server/src/uds/core/services/provider.png b/server/src/uds/core/services/provider.png new file mode 100644 index 000000000..d2a954d44 Binary files /dev/null and b/server/src/uds/core/services/provider.png differ diff --git a/server/src/uds/core/services/service.png b/server/src/uds/core/services/service.png new file mode 100644 index 000000000..c7b626c40 Binary files /dev/null and b/server/src/uds/core/services/service.png differ diff --git a/server/src/uds/core/transports/BaseTransport.py b/server/src/uds/core/transports/BaseTransport.py new file mode 100644 index 000000000..8a31d7ed5 --- /dev/null +++ b/server/src/uds/core/transports/BaseTransport.py @@ -0,0 +1,125 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext as _ +from uds.core.util import OsDetector +from uds.core.BaseModule import BaseModule + +class BaseTransport(BaseModule): + ''' + An OS Manager is responsible for communication the service the different actions to take (i.e. adding a windows machine to a domain) + The Service (i.e. virtual machine) communicates with the OSManager via a published web method, that must include the unique ID. + In order to make easier to agents identify themselfs, the Unique ID can be a list with various Ids (i.e. the macs of the virtual machine). + Server will iterate thought them and look for an identifier associated with the service. This list is a comma separated values (i.e. AA:BB:CC:DD:EE:FF,00:11:22:...) + Remember also that we inherit the test and check methods from BaseModule + ''' + # Transport informational related data, inherited from BaseModule + typeName = 'Base Transport Manager' + typeType = 'BaseTransport' + typeDescription = 'Base Transport' + iconFile = 'transport.png' + needsJava = False # If this transport needs java for rendering + # Supported names for OS (used right now, but lots of more names for sure) + # Windows + # Macintosh + # Linux + supportedOss = [OsDetector.Linux, OsDetector.Windows, OsDetector.Macintosh] # Supported operating systems + + # If this transport is visible via Web, via Thick Client or both + webTransport = False + tcTransport = False + + def __init__(self,environment, values): + super(BaseTransport, self).__init__(environment, values) + self.initialize(values) + + def initialize(self, values): + ''' + This method will be invoked from __init__ constructor. + This is provided so you don't have to provide your own __init__ method, + and invoke base methods. + This will get invoked when all initialization stuff is done + + Args: + Values: If values is not none, this object is being initialized + from administration interface, and not unmarshal will be done. + If it's None, this is initialized internally, and unmarshal will + be called after this. + + Default implementation does nothing + ''' + pass + + def destroy(self): + ''' + Invoked when Transport is deleted + ''' + pass + + def isAvailableFor(self, ip): + ''' + Checks if the transport is available for the requested destination ip + Override this in yours transports + ''' + return False + + @classmethod + def supportsOs(cls, osName): + ''' + Helper method to check if transport supports requested operating system. + Class method + ''' + return cls.supportedOss.count(osName) > 0 + + def renderForHtml(self, id, ip, os, user, password): + ''' + Requests the html rendering of connector for the destination ip, (dbUser) and password + @param id: id of the transport + @param ip: ip of the destination + @param user: user (dbUser) logged in + @param pass: password used in authentication + ''' + return _('Transport empty') + + def getHtmlComponent(self, id, os, componentId): + ''' + This is a method to let the transport add own components (images, applets, or whatever) to the rendered html + The reference to object will be the access to the uds.web.views.transcomp, with parameters transportId = ourTransportId and + componentId = one id recognized by this method + We expect an return array, with first parameter as mime/type and second the content to return + ''' + return ['text/plain', ''] + + def __str__(self): + return "Base OS Manager" + \ No newline at end of file diff --git a/server/src/uds/core/transports/TransportsFactory.py b/server/src/uds/core/transports/TransportsFactory.py new file mode 100644 index 000000000..27532c8b8 --- /dev/null +++ b/server/src/uds/core/transports/TransportsFactory.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' +import logging + +logger = logging.getLogger(__name__) + +class TransportsFactory(object): + _factory = None + + def __init__(self): + self._jobs = {} + + @staticmethod + def factory(): + if TransportsFactory._factory == None: + TransportsFactory._factory = TransportsFactory() + return TransportsFactory._factory + + def providers(self): + return self._jobs + + def insert(self, type): + logger.debug('Adding transport {0} as {1}'.format(type.type(), type)) + self._jobs[type.type()] = type + + def lookup(self, typeName): + try: + return self._jobs[typeName] + except KeyError: + return None diff --git a/server/src/uds/core/transports/__init__.py b/server/src/uds/core/transports/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/server/src/uds/core/transports/transport.png b/server/src/uds/core/transports/transport.png new file mode 100644 index 000000000..e572c72f9 Binary files /dev/null and b/server/src/uds/core/transports/transport.png differ diff --git a/server/src/uds/core/ui/UserInterface.py b/server/src/uds/core/ui/UserInterface.py new file mode 100644 index 000000000..bb019d7a3 --- /dev/null +++ b/server/src/uds/core/ui/UserInterface.py @@ -0,0 +1,779 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext as _ +import cPickle +import logging + +logger = logging.getLogger(__name__) + +class gui(object): + ''' + This class contains the representations of fields needed by UDS modules and + administation interface. + + This contains fields types, that modules uses to make a form and interact + with users. + + The use of this provided fields are as follows: + + The Module is descendant of "BaseModule", which also is inherited from this + class. + + At class level, we declare the fields needed to interact with the user, as + this example: + + .. code-block:: python + + class AuthModule(Authenticator): + # ... + # Other initializations + # ... + users = gui.EditableList(label = 'Users', tooltip = 'Select users', + order = 1, values = ['user1', 'user2', 'user3', 'user4']) + passw = gui.Password(label='Pass', length=32, tooltip='Password', + order = 2, required = True, defValue = '12345') + # ... + # more fields + # ... + + At class instantiation, this data is extracted and processed, so the admin + can access this form to let users + create new instances of this module. + ''' + + #: True string value + TRUE = 'true' + #: False string value + FALSE = 'false' + + #: Static Callbacks simple registry + callbacks = {} + + # Helpers + @staticmethod + def convertToChoices(vals): + ''' + Helper to convert from array of strings to the same dict used in choice, + multichoice, .. + The id is set to values in the array (strings), while text is left empty. + ''' + res = [] + for v in vals: + res.append( { 'id' : v, 'text' : '' } ) + return res + + @staticmethod + def choiceItem(id_, text): + ''' + Helper method to create a single choice item. + + Args: + id: Id of the choice to create + + text: Text to assign to the choice to create + + Returns: + An dictionary, that is the representation of a single choice item, + with 2 keys, 'id' and 'text' + + :note: Text can be anything, the method converts it first to text before + assigning to dictionary + ''' + return { 'id' : str(id_), 'text' : str(text) } + + @staticmethod + def strToBool(str_): + ''' + Converts the string "true" (case insensitive) to True (boolean). + Anything else is converted to false + + Args: + str: Str to convert to boolean + + Returns: + True if the string is "true" (case insensitive), False else. + ''' + if str_.lower() == gui.TRUE: + return True + return False + + @staticmethod + def boolToStr(bol): + ''' + Converts a boolean to the string representation. True is converted to + "true", False to "false". + + Args: + bol: Boolean value (True or false) to convert + + Returns: + "true" if bol evals to True, "false" if don't. + ''' + if bol: + return gui.TRUE + return gui.FALSE + + # Classes + + class InputField(object): + ''' + Class representing an simple input field. + This class is not directly usable, must be used by any inherited class + (fields all of them) + All fields are inherited from this one + + The data managed for an input field, and their default values are: + * length: Max length of the field. Defaults to DEFAULT_LENGTH + * required: If this field is a MUST. defaults to false + * label: Label used with this field. Defaults to '' + * defvalue: Default value for the field. Defaults to '' (this is + always an string) + * rdonly: If the field is read only on modification. On creation, + all fields are "writable". Defaults to False + * order: order inside the form, defaults to 0 (if two or more fields + has same order, the output order may be anything) + * tooltip: Tooltip used in the form, defaults to '' + * type: type of the input field, defaults to "text box" (TextField) + + In every single field, you must at least indicate: + * if required or not + * order + * label + * tooltip + * defvalue + * rdonly if can't be modified once it's created + + Any other paremeter needed is indicated in the corresponding field class. + + Also a value field is available, so you can get/set the form field value. + This property expects always an string, no matter what kind of field it is. + + Take into account also that "value" has precedence over "defValue", + so if you use both, the used one will be "value". This is valid for + all form fields. + ''' + TEXT_TYPE = 'text' + TEXTBOX_TYPE = 'textbox' + NUMERIC_TYPE = 'numeric' + PASSWORD_TYPE = 'password' + HIDDEN_TYPE = 'hidden' + CHOICE_TYPE = 'choice' + MULTI_CHOICE_TYPE = 'multichoice' + EDITABLE_LIST = 'editlist' + CHECKBOX_TYPE = 'checkbox' + + DEFAULT_LENTGH = 32 #: If length of some fields are not especified, this value is used as default + + + + def __init__(self, **options): + self._data = { + 'length' : options.get('length', gui.InputField.DEFAULT_LENTGH), + 'required' : options['required'] if options.has_key('required') else False, + 'label': options['label'] if options.has_key('label') else '', + 'defvalue' : str(options['defvalue']) if options.has_key('defvalue') else '', + 'rdonly' : options['rdonly'] if options.has_key('rdonly') else False, # This property only affects in "modify" operations + 'order' : options['order'] if options.has_key('order') else 0, + 'tooltip' : options['tooltip'] if options.has_key('tooltip') else '', + 'type' : gui.InputField.TEXT_TYPE, + 'value' : options['value'] if options.has_key('value') else '', + } + + def _type(self, type_): + ''' + Sets the type of this field. + + Args: + type: Type to set (from constants of this class) + ''' + self._data['type'] = type_ + + def isType(self, type_): + ''' + Returns true if this field is of specified type + ''' + return self._data['type'] == type_ + + @property + def value(self): + ''' + Obtains the stored value + ''' + return self._data['value'] + + @value.setter + def value(self, value): + ''' + Stores new value (not the default one) + ''' + self._setValue(value) + + def _setValue(self, value): + ''' + So we can override value setting at descendants + ''' + self._data['value'] = value + + + def guiDescription(self): + ''' + Returns the dictionary with the description of this item. + We copy it, cause we need to translate the label and tooltip fields + and don't want to + alter original values. + ''' + data = self._data.copy() + data['label'] = _(data['label']) + data['tooltip'] = _(data['tooltip']) + return data + + def setDefValue(self, defValue): + ''' + Sets the default value of the field· + + Args: + defValue: Default value (string) + ''' + self._data['defvalue'] = defValue + + class TextField(InputField): + ''' + This represents a text field. + + The values of parameters are inherited from :py:class:`InputField` + + Additionally to standard parameters, the length parameter is a + recommended one for this kind of field. + + You can specify that this is a multiline text box with **multiline** + parameter. If it exists, and is greater than 1, indicates how much + lines will be used to display field. (Max number is 8) + + Example usage: + + .. code-block:: python + + # Declares an text form field, with label "Host", tooltip + # "Host name for this module", that is required, + # with max length of 64 chars and order = 1, and is editable + # after creation. + host = gui.TextField(length=64, label = _('Host'), order = 1, + tooltip = _('Host name for this module'), required = True) + + # Declares an text form field, with label "Other", + # tooltip "Other info", that is not required, that is not + # required and that is not editable after creation. + other = gui.TextField(length=64, label = _('Other'), order = 1, + tooltip = _('Other info'), rdonly = True) + + ''' + def __init__(self, **options): + super(self.__class__, self).__init__(**options) + self._type(gui.InputField.TEXT_TYPE) + multiline = int(options.get('multiline', 0)) + if multiline > 8: + multiline = 8 + self._data['multiline'] = multiline + + + class NumericField(InputField): + ''' + This represents a numeric field. It apears with an spin up/down button. + + The values of parameres are inherited from :py:class:`InputField` + + Additionally to standard parameters, the length parameter indicates the + max number of digits (0-9 values). + + Example usage: + + .. code-block:: python + + # Declares an numeric form field, with max value of 99999, label + # "Port", that is required, + # with tooltip "Port (usually 443)" and order 1 + num = gui.NumericField(length=5, label = _('Port'), + defvalue = '443', order = 1, tooltip = _('Port (usually 443)'), + required = True) + ''' + def __init__(self, **options): + super(self.__class__, self).__init__(**options) + self._type(gui.InputField.NUMERIC_TYPE) + + def num(self): + ''' + Return value as integer + ''' + return int(self.value) + + class PasswordField(InputField): + ''' + This represents a password field. It appears with "*" at input, so the contents is not displayed + + The values of parameres are inherited from :py:class:`InputField` + + Additionally to standard parameters, the length parameter is a recommended one for this kind of field. + + Example usage: + + .. code-block:: python + + # Declares an text form field, with label "Password", + # tooltip "Password of the user", that is required, + # with max length of 32 chars and order = 2, and is + # editable after creation. + passw = gui.PasswordField(lenth=32, label = _('Password'), + order = 4, tooltip = _('Password of the user'), + required = True) + + ''' + def __init__(self, **options): + super(self.__class__, self).__init__(**options) + self._type(gui.InputField.PASSWORD_TYPE) + + class HiddenField(InputField): + ''' + This represents a hidden field. It is not displayed to the user. It use + is for keeping info at form needed + by module, but not editable by user (i.e., one service can keep info + about the parent provider in hiddens) + + The values of parameres are inherited from :py:class:`InputField` + + These are almost the same as TextFields, but they do not get displayed + for user interaction. + + Example usage: + + .. code-block:: python + + # Declares an empty hidden field + hidden = gui.HiddenField() + + + After that, at initGui method of module, we can store a value inside + using setDefValue as shown here: + + .. code-block:: python + + def initGui(self): + # always set defValue using self, cause we only want to store + # value for current instance + self.hidden.setDefValue(self.parent().serialize()) + + ''' + def __init__(self, **options): + super(self.__class__, self).__init__(**options) + self._type(gui.InputField.HIDDEN_TYPE) + + class CheckBoxField(InputField): + ''' + This represents a check box field, with values "true" and "false" + + The values of parameters are inherited from :py:class:`InputField` + + The valid values for this defvalue are: "true" and "false" (as strings) + + Example usage: + + .. code-block:: python + + # Declares an check box field, with label "Use SSL", order 3, + # tooltip "If checked, will use a ssl connection", default value + # unchecked (not included, so it's empty, so it's not true :-)) + ssl = gui.CheckBoxField(label = _('Use SSL'), order = 3, + tooltip = _('If checked, will use a ssl connection')) + + ''' + def __init__(self, **options): + super(self.__class__, self).__init__(**options) + self._type(gui.InputField.CHECKBOX_TYPE) + + def isTrue(self): + ''' + Checks that the value is true + ''' + return self.value == 'true' + + class ChoiceField(InputField): + ''' + This represents a simple combo box with single selection. + + The values of parameters are inherited from :py:class:`InputField` + + ChoiceField needs a function to provide values inside it. + + * We specify the values via "values" option this way: + + Example: + + .. code-block:: python + + choices = gui.ChoiceField(label="choices", values = [ {'id':'1', + 'text':'Text 1'}, {'id':'xxx', 'text':'Text 2'}]) + + You can specify a multi valuated field via id-values, or a + single-valued field via id-value + + * We can override choice values at UserInterface derived class + constructor or initGui using setValues + + There is an extra option available for this kind of field: + + fills: This options is a dictionary that contains this fields: + * 'callbackName' : Callback name for invocation via the specific + method xml-rpc. This name is a name we assign to this callback, + and is used to locate the method when callback is invoked from + admin interface. + * 'function' : Function to execute. + + This funtion receives one parameter, that is a dictionary with + all parameters (that, in time, are fields names) that we have + requested. + + The expected return value for this callback is an array of + dictionaries with fields and values to set, as + example show below shows. + * 'parameters' : Array of field names to pass back to server so + it can obtain the results. + + Of course, this fields must be part of the module. + + Example: + + .. code-block:: python + + choice1 = gui.ChoiceField(label="Choice 1", values = ...., + fills = { 'target': 'choice2', 'callback': fncValues, + 'parameters': ['choice1', 'name']} + ) + choice2 = ghui.ChoiceField(label="Choice 2") + + Here is a more detailed explanation, using the VC service module as + sample. + + .. code-block:: python + + class VCHelpers(object): + # ... + # other stuff + # ... + @staticmethod + def getMachines(parameters): + # ...initialization and other stuff... + if parameters['resourcePool'] != '': + # ... do stuff ... + data = [ { 'name' : 'machine', 'values' : 'xxxxxx' } ] + return data + + class ModuleVC(services.Service) + # ... + # stuff + # ... + resourcePool = gui.ChoiceField( + label=_("Resource Pool"), rdonly = False, order = 5, + fills = { + 'callbackName' : 'vcFillMachinesFromResource', + 'function' : VCHelpers.getMachines, + 'parameters' : ['vc', 'ev', 'resourcePool'] + }, + tooltip = _('Resource Pool containing base machine'), + required = True + ) + + machine = gui.ChoiceField(label = _("Base Machine"), order = 6, + tooltip = _('Base machine for this service'), required = True ) + + vc = gui.HiddenField() + ev = gui.HiddenField() # .... + + ''' + def __init__(self, **options): + super(self.__class__, self).__init__(**options) + self._data['values'] = options['values'] if options.has_key('values') else [] + if options.has_key('fills'): + # Save fnc to register as callback + fills = options['fills'] + fnc = fills['function'] + fills.pop('function') + self._data['fills'] = fills + gui.callbacks[fills['callbackName']] = fnc + self._type(gui.InputField.CHOICE_TYPE) + + def setValues(self, values): + ''' + Set the values for this choice field + ''' + self._data['values'] = values + + class MultiChoiceField(InputField): + ''' + Multichoices are list of items that are multi-selectable. + + There is a new parameter here, not covered by InputField: + * 'rows' to tell gui how many rows to display (the length of the + displayable list) + + "defvalue" is expresed as a comma separated list of ids + + This class do not have callback support, as ChoiceField does. + + The values is an array of dictionaries, in the form [ { 'id' : 'a', + 'text': b }, ... ] + + Example usage: + + .. code-block:: python + + # Declares a multiple choices field, with label "Datastores", that + is editable, with 5 rows for displaying + # data at most in user interface, 8th in order, that is required + and has tooltip "Datastores where to put incrementals", + # this field is required and has 2 selectable items: "datastore0" + with id "0" and "datastore1" with id "1" + datastores = gui.MultiChoiceField(label = _("Datastores"), + rdonly = False, rows = 5, order = 8, + tooltip = _('Datastores where to put incrementals'), + required = True, + values = [ {'id': '0', 'text': 'datastore0' }, + {'id': '1', 'text': 'datastore1' } ] + ) + ''' + def __init__(self, **options): + super(self.__class__, self).__init__(**options) + self._data['values'] = options['values'] if options.has_key('values') else [] + self._data['rows'] = options['rows'] if options.has_key('rows') else -1 + self._type(gui.InputField.MULTI_CHOICE_TYPE) + + def setValues(self, values): + ''' + Set the values for this multi choice field + ''' + self._data['values'] = values + + class EditableList(InputField): + ''' + Editables list are lists of editable elements (i.e., a list of IPs, macs, + names, etcc) treated as simple strings with no id + + The struct used to pass values is an array of strings, i.e. ['1', '2', + 'test', 'bebito', ...] + + This list don't have "selected" items, so its defvalue field is simply + ignored. + + We only nee to pass in "label" and, maybe, "values" to set default + content for the list. + + Keep in mind that this is an user editable list, so the user can insert + values and/or import values from files, so + by default it will probably have no content at all. + + Example usage: + + .. code-block:: python + + # + ipList = gui.EditableList(label=_('List of IPS')) + + ''' + + #: Constant for separating values at "value" method + SEPARATOR = '\001' + + def __init__(self, **options): + super(self.__class__, self).__init__(**options) + self._data['values'] = gui.convertToChoices(options['values']) if options.has_key('values') else [] + self._type(gui.InputField.EDITABLE_LIST) + + def _setValue(self, values): + ''' + So we can override value setting at descendants + ''' + super(self.__class__, self)._setValue(values) + self._data['values'] = gui.convertToChoices(values) + + + +class UserInterfaceType(type): + ''' + Metaclass definition for moving the user interface descriptions to a usable + better place + ''' + def __new__(cls, classname, bases, classDict): + newClassDict = { } + _gui = {} + # We will keep a reference to gui elements also at _gui so we can access them easily + for attrName, attr in classDict.items(): + if isinstance(attr, gui.InputField): + _gui[attrName] = attr + newClassDict[attrName] = attr + newClassDict['_gui'] = _gui + return type.__new__(cls, classname, bases, newClassDict) + +class UserInterface(object): + ''' + This class provides the management for gui descriptions (user forms) + + Once a class is derived from this one, that class can contain Field + Descriptions, + that will be managed correctly. + + By default, the values passed to this class constructor are used to fill + the gui form fields values. + ''' + __metaclass__ = UserInterfaceType + + def __init__(self, values = None): + #: If there is an array of elements to initialize, simply try to store values on form fields + if values is not None: + for k, v in self._gui.iteritems(): + if values.has_key(k): + v.value = values[k] + + + def initGui(self): + ''' + This method gives the oportunity to initialize gui fields before they + are send to administartion client. + We need this because at initialization time we probably don't have the + data for gui. + + :note: This method is used as a "trick" to allow to modify default form + data for services. Services are child of Service Providers, and + will probably need data from Provider to fill initial form data. + The rest of modules will not use this, and this only will be used + when the user requests a new service or wants to modify existing + one. + :note: There is a drawback of this, and it is that there is that this + method will modify service default data. It will run fast (probably), + but may happen that two services of same type are requested at same + time, and returned data will be probable a nonsense. We will take care + of this posibility in a near version... + ''' + pass + + def valuesDict(self): + ''' + Returns own data needed for user interaction as a dict of key-names -> + values. The values returned must be strings. + + Example: + we have 2 text field, first named "host" and second named "port", + we can do something like this: + + .. code-block:: python + + return { 'host' : self.host, 'port' : self.port } + + (Just the reverse of :py:meth:`.__init__`, __init__ receives this + dict, valuesDict must return the dict) + + Names must coincide with fields declared. + + Returns: + Dictionary, associated with declared fields. + Default implementation returns the values stored at the gui form + fields declared. + + :note: By default, the provided method returns the correct values + extracted from form fields + + ''' + dic = {} + for k, v in self._gui.iteritems(): + if v.isType(gui.InputField.EDITABLE_LIST): + dic[k] = gui.convertToChoices(v.value) + else: + dic[k] = v.value + return dic + + + def serializeForm(self): + ''' + All values stored at form fields are serialized and returned as a single + string + Separating char is + + The returned string is zipped and then converted to base 64 + + Note: Hidens are not serialized, they are ignored + + ''' + arr = [] + for k, v in self._gui.iteritems(): + if v.isType(gui.InputField.HIDDEN_TYPE): + pass + if v.isType(gui.InputField.EDITABLE_LIST): + val = '\001' + cPickle.dumps(v.value) + else: + val = v.value + arr.append(k + '\003' + val) + return '\002'.join(arr).encode('zip') + + def unserializeForm(self, values): + ''' + This method unserializes the values previously obtained using + :py:meth:`serializeForm`, and stores + the valid values form form fileds inside its corresponding field + ''' + if values == '': # Has nothing + return + for txt in values.decode('zip').split('\002'): + k, v = txt.split('\003') + if self._gui.has_key(k): + if v[0] == '\001': + val = cPickle.loads(v[1:]) + else: + val = v + self._gui[k].value = val + + @classmethod + def guiDescription(cls, obj = None): + ''' + This simple method generates the gui description needed by the + administration client, so it can + represent it at user interface and manage it. + + Args: + object: If not none, object that will get its "initGui" invoked + This will only happen (not to be None) in Services. + ''' + if obj is not None: + obj.initGui() # We give the "oportunity" to fill necesary gui data before providing it to client + + res = [] + for key, val in cls._gui.iteritems(): + res.append( { 'name' : key, 'gui' : val.guiDescription(), 'value' : '' }, ) + return res diff --git a/server/src/uds/core/ui/__init__.py b/server/src/uds/core/ui/__init__.py new file mode 100644 index 000000000..fd7539037 --- /dev/null +++ b/server/src/uds/core/ui/__init__.py @@ -0,0 +1,8 @@ +''' +User interface part of UDS modules. + +This module contains the definition of UserInterface, needed to describe the interaction +between an UDS module and the administration interface +''' + +from UserInterface import gui diff --git a/server/src/uds/core/util/AutoAttributes.py b/server/src/uds/core/util/AutoAttributes.py new file mode 100644 index 000000000..357ca38e3 --- /dev/null +++ b/server/src/uds/core/util/AutoAttributes.py @@ -0,0 +1,108 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from uds.core.Serializable import Serializable +import cPickle +import timeit + +class Attribute(object): + + def __init__(self, theType, value = None): + self._type = theType + self.setValue(value) + + def getType(self): + return self._type + + def getValue(self): + return self._value + + def getStrValue(self): + return str(self._value) + + def setValue(self, value): + if value is None: + self._value = self._type() + else: + self._value = self._type(value) + +class AutoAttributes(Serializable): + ''' + Easy creation of attributes to marshal & unmarshal at modules + usage as base class (First class so yours inherits this "marshal" and "unmarshal" + initialize at init with super(myclass,self).__init__(attr1=type, attr2=type, ...) + or with declare(attr1=type,attr2=type,..) + Access attrs as "self._attr1, self._attr2" + ''' + + #: This codec is not intended to override Serializable codec + #: Serializable codec is for encoding marshaled data, + #: while this codec is for encoding pickled data from autoattributes + ACODEC = 'zip' + + def __init__(self, **kwargs): + self.declare(**kwargs) + + def __getattribute__(self, name): + if name.startswith('_') and self.dict.has_key(name[1:]): + return self.dict[name[1:]].getValue() + return object.__getattribute__(self, name) + + def __setattr__(self, name, value): + if name.startswith('_') and self.dict.has_key(name[1:]): + self.dict[name[1:]].setValue(value) + else: + object.__setattr__(self, name, value) + + def declare(self, **kwargs): + d = {} + for key,typ in kwargs.iteritems(): + d[key] = Attribute(typ) + self.dict = d + + def marshal(self): + return '\2'.join( [ '%s\1%s' % (k, cPickle.dumps(v)) for k, v in self.dict.iteritems() ] ).encode(AutoAttributes.ACODEC) + + def unmarshal(self, data): + if data == '': # Can be empty + return + # We keep original data (maybe incomplete) + for pair in data.decode(AutoAttributes.ACODEC).split('\2'): + k, v = pair.split('\1') + self.dict[k] = cPickle.loads(v) + + def __str__(self): + str = '' diff --git a/server/src/uds/core/util/Cache.py b/server/src/uds/core/util/Cache.py new file mode 100644 index 000000000..39872155b --- /dev/null +++ b/server/src/uds/core/util/Cache.py @@ -0,0 +1,127 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.db import transaction +from uds.models import Cache as dbCache, getSqlDatetime +from datetime import datetime, timedelta +import hashlib +import logging +import cPickle + +logger = logging.getLogger(__name__) + +class Cache(object): + DEFAULT_VALIDITY = 60 + CODEC = 'base64' # Can be zip, hez, bzip, base64, uuencoded + + def __init__(self, owner): + self._owner = owner + + + def __getKey(self, key): + h = hashlib.md5() + h.update(self._owner + key) + return h.hexdigest() + + def get(self,skey): + now = getSqlDatetime() + #logger.debug('Requesting key "%s" for cache "%s"' % (skey, self._owner,)) + try: + key = self.__getKey(skey) + c = dbCache.objects.get(pk=key) + expired = now > c.created + timedelta(seconds = c.validity) + if expired: + return None + val = cPickle.loads(c.value.decode(Cache.CODEC)) + return val + except dbCache.DoesNotExist: + logger.debug('key not found') + return None + + def remove(self,skey): + #logger.debug('Removing key "%s" for uService "%s"' % (skey, self._owner)) + try: + key = self.__getKey(skey) + dbCache.objects.get(pk=key).delete() + except dbCache.DoesNotExist: + logger.debug('key not found') + + @transaction.autocommit + def put(self, skey, value, validity = None): + #logger.debug('Saving key "%s" for cache "%s"' % (skey, self._owner,)) + if validity == None: + validity = Cache.DEFAULT_VALIDITY + key = self.__getKey(skey) + value = cPickle.dumps(value).encode(Cache.CODEC) + now = getSqlDatetime() + try: + dbCache.objects.create( owner = self._owner, key = key, value = value, created = now, validity = validity ) + except Exception: + # Already exists, modify it + c = dbCache.objects.get(pk=key) + c.owner = self._owner + c.key = key + c.value = value + c.created = datetime.now() + c.validity = validity + c.save() + + @transaction.autocommit + def refresh(self, skey): + #logger.debug('Refreshing key "%s" for cache "%s"' % (skey, self._owner,)) + try: + key = self.__getKey(skey) + c = dbCache.objects.get(pk=key) + c.created = getSqlDatetime() + c.save() + except dbCache.DoesNotExist: + logger.debug('Can\'t refresh cache key %s because it don\'t exists' % skey) + return + + @staticmethod + def purge(): + dbCache.objects.all().delete() + + @staticmethod + def cleanUp(): + dbCache.cleanUp() + + @staticmethod + def delete(owner = None): + #logger.info("Deleting cache items") + if owner == None: + objects = dbCache.objects.all() + else: + objects = dbCache.objects.filter(owner=owner) + objects.delete() + diff --git a/server/src/uds/core/util/Config.py b/server/src/uds/core/util/Config.py new file mode 100644 index 000000000..d89720c90 --- /dev/null +++ b/server/src/uds/core/util/Config.py @@ -0,0 +1,249 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.conf import settings +from uds.models import Config as dbConfig +from uds.core.managers.CryptoManager import CryptoManager +import logging + +logger = logging.getLogger(__name__) + +GLOBAL_SECTION = 'UDS' + + +class Config: + ''' + Keeps persistend configuration data + ''' + + class _Value: + def __init__(self, section, key, default = '', crypt = False): + self._section = section + self._key = key + self._crypt = crypt + if crypt is False: + self._default = default + else: + self._default = CryptoManager.manager().encrypt(default) + self._data = None + + def get(self, force = False): + try: + if force or self._data is None: + #logger.debug('Accessing db config {0}.{1}'.format(self._section.name(), self._key)) + readed = dbConfig.objects.filter(section=self._section.name(), key=self._key)[0] + self._data = readed.value + self._crypt = [self._crypt, True][readed.crypt] # True has "higher" precedende than False + except Exception: + # Not found + if self._default != '': + if self._crypt: + self.set( CryptoManager.manager().decrypt(self._default) ) + else: + self.set(self._default) + self._data = self._default + if self._crypt is True: + return CryptoManager.manager().decrypt(self._data) + else: + return self._data + + def getInt(self): + try: + return int(self.get()) + except Exception: + return self._default + + def getBool(self): + if self.get() == '0': + return False + return True + + def key(self): + return self._key + + def section(self): + return self._section.name() + + def isCrypted(self): + return self._crypt + + def set(self, value): + if self._crypt is True: + value = CryptoManager.manager().encrypt(value) + ''' + Editable here means that this configuration value can be edited by admin directly (generally, that this is a "clean text" value) + ''' + logger.debug('Saving config {0}.{1} as {2}'.format(self._section.name(), self._key, value)) + try: + if dbConfig.objects.filter(section=self._section.name(), key=self._key).update(value=value, crypt=self._crypt) == 0: + raise Exception() # Do not exists, create a new one + except Exception: + try: + dbConfig.objects.create(section=self._section.name(), key=self._key, value=value, crypt=self._crypt) + except Exception: + # Probably a migration issue, just ignore it + logger.info("Could not save configuration key {0}.{1}".format(self._section.name(), self._key)) + + class _Section: + def __init__(self, sectionName): + self._sectionName = sectionName + + def value(self, key, default = ''): + return Config._Value(self, key, default) + + def valueCrypt(self, key, default = ''): + return Config._Value(self, key, default, True) + + def name(self): + return self._sectionName + + + + @staticmethod + def section(sectionName): + return Config._Section(sectionName) + + @staticmethod + def enumerate(): + for cfg in dbConfig.objects.all(): + if cfg.crypt is True: + val = Config.section(cfg.section).valueCrypt(cfg.key, CryptoManager.manager().decrypt(cfg.value)) + else: + val = Config.section(cfg.section).value(cfg.key, cfg.value) + yield val + + @staticmethod + def update(section, key, value): + # If cfg value does not exists, simply ignore request + try: + cfg = dbConfig.objects.filter(section=section, key=key)[0] + if cfg.crypt is True: + value = CryptoManager.manager().encrypt(value) + cfg.value = value + cfg.save() + logger.debug('Updated value for {0}.{1} to {2}'.format(section, key, value)) + except Exception: + pass + +class GlobalConfig: + ''' + Simple helper to keep track of global configuration + ''' + SESSION_EXPIRE_TIME = Config.section(GLOBAL_SECTION).value('sessionExpireTime', '24') # Max session duration (in use) after a new publishment has been made + # Delay between cache checks. reducing this number will increase cache generation speed but also will load service providers + CACHE_CHECK_DELAY = Config.section(GLOBAL_SECTION).value('cacheCheckDelay', '20') + # Delayed task number of threads PER SERVER, with higher number of threads, deplayed task will complete sooner, but it will give more load to overall system + DELAYED_TASKS_THREADS = Config.section(GLOBAL_SECTION).value('delayedTasksThreads', '2') + # Number of scheduler threads running PER SERVER, with higher number of threads, deplayed task will complete sooner, but it will give more load to overall system + SCHEDULER_THREADS = Config.section(GLOBAL_SECTION).value('schedulerThreads', '2') + # Waiting time before removing "errored" and "removed" publications, cache, and user assigned machines. Time is in seconds + CLEANUP_CHECK = Config.section(GLOBAL_SECTION).value('cleanupCheck', '3600') + # Time to maintaing "info state" items before removing it, in seconds + KEEP_INFO_TIME = Config.section(GLOBAL_SECTION).value('keepInfoTime', '14400') # Defaults to 2 days 172800?? better 4 hours xd + # Max number of services to be "preparing" at same time + MAX_PREPARING_SERVICES = Config.section(GLOBAL_SECTION).value('maxPreparingServices', '15') # Defaults to 15 services at once (per service provider) + # Max number of service to be at "removal" state at same time + MAX_REMOVING_SERVICES = Config.section(GLOBAL_SECTION).value('maxRemovinggServices', '15') # Defaults to 15 services at once (per service provider) + # If we ignore limits (max....) + IGNORE_LIMITS = Config.section(GLOBAL_SECTION).value('ignoreLimits', '0') + # Number of services to initiate removal per run of CacheCleaner + USER_SERVICE_CLEAN_NUMBER = Config.section(GLOBAL_SECTION).value('userServiceCleanNumber', '3') # Defaults to 3 per wun + # Removal Check time for cache, publications and deployed services + REMOVAL_CHECK = Config.section(GLOBAL_SECTION).value('removalCheck', '30') # Defaults to 30 seconds + # Login URL + LOGIN_URL = Config.section(GLOBAL_SECTION).value('loginUrl', '/login') # Defaults to /login + # Session duration + USER_SESSION_LENGTH = Config.section(GLOBAL_SECTION).value('userSessionLength', '14400') # Defaults to 4 hours + # Superuser (do not need to be at database!!!) + SUPER_USER_LOGIN = Config.section(GLOBAL_SECTION).value('superUser', 'root') # Defaults to 4 hours + # Superuser password (do not need to be at database!!!) + SUPER_USER_PASS = Config.section(GLOBAL_SECTION).valueCrypt('rootPass', 'udsmam0') + # Idle time before closing session on admin + ADMIN_IDLE_TIME = Config.section(GLOBAL_SECTION).value('adminIdleTime', '14400') # Defaults to 4 hous + # Time betwen checks of unused services by os managers + # Unused services will be invoked for every machine assigned but not in use AND that has been assigned at least 1/2 of this time + CHECK_UNUSED_TIME = Config.section(GLOBAL_SECTION).value('checkUnusedTime', '600') # Defaults to 10 minutes + # Default CSS Used + CSS = Config.section(GLOBAL_SECTION).value('css', settings.STATIC_URL + 'css/uds.css') + # Max logins before blocking an account + MAX_LOGIN_TRIES = Config.section(GLOBAL_SECTION).value('maxLoginTries', '3') + # Block time in second for an user that makes too many mistakes, 5 minutes default + LOGIN_BLOCK = Config.section(GLOBAL_SECTION).value('loginBlockTime', '300') + # Do autorun of service if just one service. + # 0 = No autorun, 1 = Autorun at login + # In a future, maybe necessary another value "2" that means that autorun always + AUTORUN_SERVICE = Config.section(GLOBAL_SECTION).value('autorunService', '0') + # Redirect HTTP to HTTPS + REDIRECT_TO_HTTPS = Config.section(GLOBAL_SECTION).value('redirectToHttps', '0') + # Max time needed to get a service "fully functional" before it's considered "failed" and removed + # The time is in seconds + MAX_INITIALIZING_TIME = Config.section(GLOBAL_SECTION).value('maxInitTime', '3600') + + + initDone = False + + @staticmethod + def initialize(): + try: + # Tries to initialize database data for global config so it is stored asap and get cached for use + GlobalConfig.SESSION_EXPIRE_TIME.get() + GlobalConfig.CACHE_CHECK_DELAY.get() + GlobalConfig.DELAYED_TASKS_THREADS.get() + GlobalConfig.SCHEDULER_THREADS.get() + GlobalConfig.CLEANUP_CHECK.get() + GlobalConfig.KEEP_INFO_TIME.get() + GlobalConfig.MAX_PREPARING_SERVICES.get() + GlobalConfig.MAX_REMOVING_SERVICES.get() + GlobalConfig.USER_SERVICE_CLEAN_NUMBER.get() + GlobalConfig.REMOVAL_CHECK.get() + GlobalConfig.LOGIN_URL.get() + GlobalConfig.USER_SESSION_LENGTH.get() + GlobalConfig.SUPER_USER_LOGIN.get() + GlobalConfig.SUPER_USER_PASS.get() + GlobalConfig.ADMIN_IDLE_TIME.get() + GlobalConfig.CHECK_UNUSED_TIME.get() + GlobalConfig.CSS.get() + GlobalConfig.MAX_LOGIN_TRIES.get() + GlobalConfig.LOGIN_BLOCK.get() + GlobalConfig.AUTORUN_SERVICE.get() + GlobalConfig.REDIRECT_TO_HTTPS.get() + GlobalConfig.MAX_INITIALIZING_TIME.get() + except Exception, e: + logger.debug('Config table do not exists!!!, maybe we are installing? :-)') + +# Context processor +def context_processor(request): + return { 'css_path' : GlobalConfig.CSS.get() } + +# Initialization of global configurations +GlobalConfig.initialize() \ No newline at end of file diff --git a/server/src/uds/core/util/Decorators.py b/server/src/uds/core/util/Decorators.py new file mode 100644 index 000000000..dc1dc6c7d --- /dev/null +++ b/server/src/uds/core/util/Decorators.py @@ -0,0 +1,28 @@ +''' +Created on Feb 6, 2012 + +@author: dkmaster +''' + +from time import sleep +from functools import wraps + +# Have to test these decorators before using them +def retryOnException(retries=3, delay = 0): + ''' + Decorator to retry + ''' + def decorator(func): + @wraps(func) + def _wrapped_func(*args, **kwargs): + while retries > 0: + retries -= 1 + try: + return func(*args, **kwargs) + except Exception: + if retries == 0: + raise + if delay > 0: + sleep(delay) + return _wrapped_func + return decorator diff --git a/server/src/uds/core/util/Log.py b/server/src/uds/core/util/Log.py new file mode 100644 index 000000000..8454fe3a2 --- /dev/null +++ b/server/src/uds/core/util/Log.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' +from uds.models import UserService, State +import logging + +logger = logging.getLogger(__name__) +useLogger = logging.getLogger('useLog') + + +def useLog(type_, serviceUniqueId, serviceIp, username): + useLogger.info('|'.join([type_, serviceUniqueId, serviceIp, username])) + \ No newline at end of file diff --git a/server/src/uds/core/util/OsDetector.py b/server/src/uds/core/util/OsDetector.py new file mode 100644 index 000000000..3105a8862 --- /dev/null +++ b/server/src/uds/core/util/OsDetector.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' +import re +import logging + +logger = logging.getLogger(__name__) + +Linux = 'Linux' +Windows = 'Windows' +Macintosh = 'Macintosh' + + +knownOss = { 'Linux' : Linux, 'Windows' : Windows, 'Macintosh' : Macintosh } + +def getOsFromUA(ua): + ''' + Basic OS Client detector (very basic indeed :-)) + ''' + res = {'OS' : 'Unknown', 'Version' : 'unused' } + for k, v in knownOss.iteritems(): + try: + ua.index(v) + res['OS'] = k + break + except Exception: + pass + logger.debug(res) + return res + \ No newline at end of file diff --git a/server/src/uds/core/util/State.py b/server/src/uds/core/util/State.py new file mode 100644 index 000000000..a52018794 --- /dev/null +++ b/server/src/uds/core/util/State.py @@ -0,0 +1,135 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + + +from django.utils.translation import ugettext_noop as _, ugettext + +# States for different objects. Not all objects supports all States +class State(object): + ''' + This class represents possible states for objects at database. + Take in consideration that objects do not have to support all states, they are here for commodity + ''' + ACTIVE = 'A' + INACTIVE = 'I' + BLOCKED = 'B' + LAUNCHING = 'L' + PREPARING = 'P' + USABLE = 'U' + REMOVABLE = 'R' + REMOVING = 'M' + REMOVED = 'S' + CANCELED = 'C' + CANCELING = 'K' + ERROR = 'E' + RUNNING = 'W' + FINISHED = 'F' + FOR_EXECUTE = 'X' + + string = { ACTIVE: _('Active'), INACTIVE: _('Inactive'), BLOCKED: _('Blocked'), LAUNCHING: _('Waiting publication'), + PREPARING: _('In preparation'), USABLE: _('Valid'), + REMOVABLE: _('Waiting for removal'), REMOVING: _('Removing'), REMOVED: _('Removed'), CANCELED: _('Canceled'), + CANCELING: _('Canceling'), ERROR: _('Error'), RUNNING: _('Running'), FINISHED: _('Finished'), FOR_EXECUTE: _('Waiting execution') } + + # States that are merely for "information" to the user. They don't contain any usable instance + INFO_STATES = [REMOVED, CANCELED, ERROR] + + # States that indicates that the service is "Valid" for a user + VALID_STATES = [USABLE,PREPARING] + + # Publication States + PUBLISH_STATES = [LAUNCHING, PREPARING] + + @staticmethod + def isActive(state): + return state == State.ACTIVE + + @staticmethod + def isInactive(state): + return state == State.INACTIVE + + @staticmethod + def isBlocked(state): + return state == State.BLOCKED + + @staticmethod + def isPreparing(state): + return state == State.PREPARING + + @staticmethod + def isUsable(state): + return state == State.USABLE + + @staticmethod + def isRemovable(state): + return state == State.REMOVABLE + + @staticmethod + def isRemoving(state): + return state == State.REMOVING + + @staticmethod + def isRemoved(state): + return state == State.REMOVED + + @staticmethod + def isCanceling(state): + return state == State.CANCELING + + @staticmethod + def isCanceled(state): + return state == State.CANCELED + + @staticmethod + def isErrored(state): + return state == State.ERROR + + @staticmethod + def isFinished(state): + return state == State.FINISHED + + @staticmethod + def isRuning(state): + return state == State.RUNNING + + @staticmethod + def isForExecute(state): + return state == State.FOR_EXECUTE + + @staticmethod + def toString(state): + try: + return State.string[state] + except Exception: + return '' + diff --git a/server/src/uds/core/util/StateQueue.py b/server/src/uds/core/util/StateQueue.py new file mode 100644 index 000000000..72a7ad76f --- /dev/null +++ b/server/src/uds/core/util/StateQueue.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +class StateQueue(object): + + def __init__(self): + self.reset() + + def __str__(self): + res = '' % (self._current , ','.join( state for state in self._queue )) + return res + + def clearQueue(self): + self._queue = [] + + def reset(self): + self._queue = [] + self._current = None + + def getCurrent(self): + return self._current + + def setCurrent(self, newState): + self._current = newState + return self._current + + def contains(self, state): + #if self._queue.co + for s in self._queue: + if s == state: + return True + return False + + def push_back(self, state): + self._queue.append(state) + + def pop_front(self): + if len(self._queue) > 0: + return self._queue.pop(0) + return None + + def remove(self, state): + try: + self._queue.remove(state) + except Exception: + pass # If state not in queue, nothing happens diff --git a/server/src/uds/core/util/Storage.py b/server/src/uds/core/util/Storage.py new file mode 100644 index 000000000..d6ba9298e --- /dev/null +++ b/server/src/uds/core/util/Storage.py @@ -0,0 +1,109 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from uds.models import Storage as dbStorage +import hashlib +import logging + +logger = logging.getLogger(__name__) + +class Storage(object): + CODEC = 'base64' # Can be zip, hez, bzip, base64, uuencoded + + def __init__(self, owner): + self._owner = owner + + def __getKey(self, key): + h = hashlib.md5() + h.update(self._owner) + h.update(str(key)) + return h.hexdigest() + + + def saveData(self, skey, data, attr1 = None): + logger.debug('Saving key {0}, data {1} and attr1 {2}'.format(skey, data, attr1)) + key = self.__getKey(skey) + data = data.encode(Storage.CODEC) + attr1 = '' if attr1 == None else attr1 + try: + dbStorage.objects.create(owner = self._owner, key = key, data = data, attr1 = attr1 ) + except Exception: + dbStorage.objects.filter(key=key).update(owner = self._owner, data = data, attr1 = attr1) + logger.debug('Key saved') + + def updateData(self, skey, data, attr1 = None): + self.saveData(skey, data, attr1) + + def readData(self, skey): + try: + key = self.__getKey(skey) + logger.debug('Accesing to {0} {1}'.format(skey, key)) + c = dbStorage.objects.get(pk=key) + return c.data.decode(Storage.CODEC) + except dbStorage.DoesNotExist: + logger.debug('key not found') + return None + + def remove(self, skey): + try: + key = self.__getKey(skey) + dbStorage.objects.filter(key=key).delete() + except Exception: + pass + + def lock(self): + ''' + Use with care. If locked, it must be unlocked before returning + ''' + dbStorage.objects.lock() + + def unlock(self): + ''' + Must be used to unlock table + ''' + dbStorage.objects.unlock() + + @staticmethod + def delete(owner = None): + logger.info("Deleting storage items") + if owner == None: + objects = dbStorage.objects.all() + else: + objects = dbStorage.objects.filter(owner=owner) + objects.delete() + + def locateByAttr1(self, attr1): + res = [] + for v in dbStorage.objects.filter( attr1 = attr1 ): + res.append( v.data.decode(Storage.CODEC) ) + return res diff --git a/server/src/uds/core/util/UniqueIDGenerator.py b/server/src/uds/core/util/UniqueIDGenerator.py new file mode 100644 index 000000000..139669d5e --- /dev/null +++ b/server/src/uds/core/util/UniqueIDGenerator.py @@ -0,0 +1,108 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from uds.models import UniqueId as dbUniqueId +import logging + +logger = logging.getLogger(__name__) + +class UniqueIDGenerator(object): + + def __init__(self, typeName, owner, baseName = 'uds'): + self._owner = owner + typeName + self._baseName = baseName + + def setBaseName(self, newBaseName): + self._baseName = newBaseName + + def __filter(self, rangeStart): + return dbUniqueId.objects.filter( basename = self._baseName, seq__gte=rangeStart ) + + def get(self, rangeStart=0, rangeEnd=1000000000): + ''' + Tries to generate a new unique id in the range provided. This unique id + is global to "unique ids' database + ''' + # First look for a name in the range defined + try: + dbUniqueId.objects.lock() + flt = self.__filter(rangeStart) + try: + item = flt.filter(assigned=False)[0] + dbUniqueId.objects.filter(id=item.id).update( owner = self._owner, assigned = True ) + seq = item.seq + except Exception, e: # No free element found + try: + last = flt.filter(assigned = True)[0] # DB Returns correct order so the 0 item is the last + seq = last.seq + 1 + except Exception: # If there is no assigned at database + seq = rangeStart + logger.debug('Found seq {0}'.format(seq)) + if seq > rangeEnd: + return None # No ids free in range + dbUniqueId.objects.create( owner = self._owner, basename = self._baseName, seq = seq, assigned = True) + return seq + except Exception: + logger.exception('Generating unique id sequence') + return None + finally: + dbUniqueId.objects.unlock() + + def free(self, seq): + try: + logger.debug('Freeing seq {0} from {1} ({2})'.format(seq, self._owner, self._baseName)) + dbUniqueId.objects.lock() + flt = self.__filter(0).filter(owner = self._owner, seq=seq).update(owner='', assigned=False) + if flt > 0: + self.__purge() + finally: + dbUniqueId.objects.unlock() + + + def __purge(self): + try: + last = self.__filter(0).filter(assigned=True)[0] + seq = last.seq+1 + except: + seq = 0 + self.__filter(seq).delete() # Clean ups all unassigned after last assigned in this range + + + def release(self): + try: + dbUniqueId.objects.lock() + dbUniqueId.objects.filter(owner=self._owner).update(assigned=False, owner='') + self.__purge() + finally: + dbUniqueId.objects.unlock() + \ No newline at end of file diff --git a/server/src/uds/core/util/UniqueMacGenerator.py b/server/src/uds/core/util/UniqueMacGenerator.py new file mode 100644 index 000000000..4f97bfb7b --- /dev/null +++ b/server/src/uds/core/util/UniqueMacGenerator.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from UniqueIDGenerator import UniqueIDGenerator +import logging, re + +logger = logging.getLogger(__name__) + +class UniqueMacGenerator(UniqueIDGenerator): + + def __init__(self, owner): + super(UniqueMacGenerator, self).__init__('mac', owner, '\tmac') + + def __toInt(self, mac): + return int(mac.replace(':', ''), 16) + + def __toMac(self, seq): + return re.sub(r"(..)", r"\1:", "%0*X" % (12, seq))[:-1] + + def get(self, macRange): + firstMac, lastMac = macRange.split('-') + firstMac = self.__toInt(firstMac) + lastMac = self.__toInt(lastMac) + return self.__toMac(super(UniqueMacGenerator, self).get(firstMac, lastMac)) + + def free(self, mac): + super(UniqueMacGenerator, self).free( self.__toInt(mac) ) + + # Release is inherited, no mod needed \ No newline at end of file diff --git a/server/src/uds/core/util/UniqueNameGenerator.py b/server/src/uds/core/util/UniqueNameGenerator.py new file mode 100644 index 000000000..ec9ab20c2 --- /dev/null +++ b/server/src/uds/core/util/UniqueNameGenerator.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from UniqueIDGenerator import UniqueIDGenerator +import logging + +logger = logging.getLogger(__name__) + +class UniqueNameGenerator(UniqueIDGenerator): + + def __init__(self, owner): + super(UniqueNameGenerator, self).__init__('name', owner, ) + + def __toName(self, seq, length): + return "%s%0*d" % (self._baseName, length, seq) + + def get(self, baseName, length=5): + self.setBaseName(baseName) + minVal = 0 + maxVal = 10**length - 1 + return self.__toName(super(UniqueNameGenerator, self).get(minVal, maxVal), length) + + + def free(self, baseName, name): + self.setBaseName(baseName) + super(UniqueNameGenerator, self).free(int(name[len(self._baseName):])) \ No newline at end of file diff --git a/server/src/uds/core/util/__init__.py b/server/src/uds/core/util/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/server/src/uds/core/util/connection.py b/server/src/uds/core/util/connection.py new file mode 100644 index 000000000..436049c4e --- /dev/null +++ b/server/src/uds/core/util/connection.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +import logging +import socket + +logger = logging.getLogger(__name__) + +def testServer(host, port, timeOut = 4): + try: + logger.debug('Checking connection to {0}:{1} with {2} seconds timeout'.format(host, port, timeOut)) + sock = socket.create_connection((host, port), timeOut) + sock.close() + except Exception, e: + logger.debug('Exception checking {0}:{1} with {2} timeout: {3}'.format(host, port, timeOut, e)) + return False + return True + + \ No newline at end of file diff --git a/server/src/uds/core/util/db/LockingManager.py b/server/src/uds/core/util/db/LockingManager.py new file mode 100644 index 000000000..ea3bb3448 --- /dev/null +++ b/server/src/uds/core/util/db/LockingManager.py @@ -0,0 +1,73 @@ +''' +From django locking manager snippet at http://djangosnippets.org/snippets/833/ +Author: + miohtama +''' + +from django.db import models, connection +import logging + +logger = logging.getLogger(__name__) + +# Table locking in mysql at least is based on thread requesting it, so we should not have problems with a bit of care +class LockingManager(models.Manager): + """ Add lock/unlock functionality to manager. + + Example:: + + class Job(models.Model): + + manager = LockingManager() + + counter = models.IntegerField(null=True, default=0) + + @staticmethod + def do_atomic_update(job_id) + ''' Updates job integer, keeping it below 5 ''' + try: + # Ensure only one HTTP request can do this update at once. + Job.objects.lock() + + job = Job.object.get(id=job_id) + # If we don't lock the tables two simultanous + # requests might both increase the counter + # going over 5 + if job.counter < 5: + job.counter += 1 + job.save() + + finally: + Job.objects.unlock() + + + """ + + def lock(self): + """ Lock table. + + Locks the object model table so that atomic update is possible. + Simulatenous database access request pend until the lock is unlock()'ed. + + Note: If you need to lock multiple tables, you need to do lock them + all in one SQL clause and this function is not enough. To avoid + dead lock, all tables must be locked in the same order. + + See http://dev.mysql.com/doc/refman/5.0/en/lock-tables.html + """ + con = connection + cursor = con.cursor() + table = self.model._meta.db_table + #logger.debug("Locking table %s" % table) + cursor.execute("LOCK TABLES %s WRITE" % table) + row = cursor.fetchone() + return row + + def unlock(self): + """ Unlock the table. """ + #logger.debug("Unlocked tables") + con = connection + cursor = con.cursor() + #table = self.model._meta.db_table + cursor.execute("UNLOCK TABLES") + row = cursor.fetchone() + return row \ No newline at end of file diff --git a/server/src/uds/core/util/db/__init__.py b/server/src/uds/core/util/db/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/server/src/uds/core/util/modfinder.py b/server/src/uds/core/util/modfinder.py new file mode 100644 index 000000000..c6b02b1d6 --- /dev/null +++ b/server/src/uds/core/util/modfinder.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +import os.path, pkgutil +import sys, imp +import logging +import uds.dispatchers + +logger = logging.getLogger(__name__) + + +def loadModulesUrls(): + patterns = [] + try: + modName = 'uds.dispatchers' + pkgpath = os.path.dirname(sys.modules[modName].__file__) + for _, name, _ in pkgutil.iter_modules([pkgpath]): + fullModName = '%s.%s.urls' % (modName, name) + mod = __import__(fullModName, globals(), locals(), ['urlpatterns'], -1) + patterns += mod.urlpatterns + except Exception, e: + logger.debug(e) + pass + return patterns \ No newline at end of file diff --git a/server/src/uds/core/workers/AssignedAndUnused.py b/server/src/uds/core/workers/AssignedAndUnused.py new file mode 100644 index 000000000..5be83d6c9 --- /dev/null +++ b/server/src/uds/core/workers/AssignedAndUnused.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from uds.core.util.Config import GlobalConfig +from uds.models import DeployedService, getSqlDatetime +from uds.core.util.State import State +from uds.core.jobs.Job import Job +from datetime import timedelta +import logging + +logger = logging.getLogger(__name__) + +class AssignedAndUnused(Job): + frecuency = GlobalConfig.CHECK_UNUSED_TIME.getInt() + + def __init__(self, environment): + super(AssignedAndUnused,self).__init__(environment) + + def run(self): + for ds in DeployedService.objects.all(): + osm = ds.osmanager.getInstance() + if osm.processUnusedMachines is True: + logger.debug('Processing unused machines for {0}'.format(osm)) + since_state = getSqlDatetime() - timedelta( seconds = GlobalConfig.CHECK_UNUSED_TIME.getInt() / 2 ) + for us in ds.assignedUserServices().select_for_update().filter(in_use=False,since_state__lt=since_state): + logger.debug('Found unused assigned service {0}'.format(us)) + osm.processUnused(us) \ No newline at end of file diff --git a/server/src/uds/core/workers/CacheCleaner.py b/server/src/uds/core/workers/CacheCleaner.py new file mode 100644 index 000000000..fc6fb90f4 --- /dev/null +++ b/server/src/uds/core/workers/CacheCleaner.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from uds.core.util.Cache import Cache +from uds.core.jobs.Job import Job +import logging + +logger = logging.getLogger(__name__) + + +class CacheCleaner(Job): + + frecuency = 3600*24 # Once a day + + def __init__(self, environment): + super(CacheCleaner,self).__init__(environment) + + def run(self): + logger.debug('Starting cache cleanup') + Cache.cleanUp() + logger.debug('Done cache cleanup') + \ No newline at end of file diff --git a/server/src/uds/core/workers/DeployedServiceCleaner.py b/server/src/uds/core/workers/DeployedServiceCleaner.py new file mode 100644 index 000000000..2e26ac483 --- /dev/null +++ b/server/src/uds/core/workers/DeployedServiceCleaner.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.db import transaction +from uds.core.util.Config import GlobalConfig +from uds.models import DeployedService, getSqlDatetime +from uds.core.util.State import State +from uds.core.jobs.Job import Job +from datetime import timedelta +import logging + +logger = logging.getLogger(__name__) + +class DeployedServiceInfoItemsCleaner(Job): + frecuency = GlobalConfig.CLEANUP_CHECK.getInt() # Request run cache "info" cleaner every configured seconds. If config value is changed, it will be used at next reload + + def __init__(self, environment): + super(DeployedServiceInfoItemsCleaner,self).__init__(environment) + + def run(self): + removeFrom = getSqlDatetime() - timedelta(seconds = GlobalConfig.KEEP_INFO_TIME.getInt()) + DeployedService.objects.filter(state__in=State.INFO_STATES, state_date__lt=removeFrom).delete() + + +class DeployedServiceRemover(Job): + frecuency = GlobalConfig.REMOVAL_CHECK.getInt() # Request run publication "removal" every configued seconds. If config value is changed, it will be used at next reload + + def __init__(self, environment): + super(DeployedServiceRemover,self).__init__(environment) + + @transaction.commit_on_success + def startRemovalOf(self, ds): + # Get publications in course...., can be at most 1!!! + + publishing = ds.publications.filter(state=State.PREPARING) + for p in publishing: + p.cancel() + # Now all publishments are canceling, let's try to cancel cache and assigned + uServices = ds.userServices.filter(state=State.PREPARING) + for u in uServices: + u.cancel() + # Nice start of removal, maybe we need to do some limitation later, but there should not be too much services nor publications cancelable at once + ds.state = State.REMOVING + ds.name = ds.name + ' (removed)' + ds.save() + + + @transaction.commit_on_success + def continueRemovalOf(self, ds): + # First, we remove all publications and user services in "info_state" + ds.userServices.select_for_update().filter(state__in=State.INFO_STATES).delete() + # Mark usable user services as removable + ds.userServices.select_for_update().filter(state=State.USABLE).update(state=State.REMOVABLE) + + # When no service is at database, we start with publications + if ds.userServices.all().count() == 0: + try: + logger.debug('All services removed, checking active publication') + if ds.activePublication() is not None: + logger.debug('Active publication found, unpublishing it') + ds.unpublish() + else: + logger.debug('No active publication found, removing info states and checking if removal is done') + ds.publications.filter(state__in=State.INFO_STATES).delete() + if ds.publications.count() is 0: + ds.removed() # Mark it as removed, clean later from database + except Exception as e: + logger.exception('Cought unexpected exception at continueRemovalOf: ') + + def run(self): + # First check if there is someone in "removable" estate + rems = DeployedService.objects.filter(state=State.REMOVABLE)[:10] + if len(rems) > 0: + logger.debug('Found a deployed service marked for removal. Starting removal of {0}'.format(rems)) + for rem in rems: + self.startRemovalOf(rem) + rems = DeployedService.objects.filter(state=State.REMOVING)[:10] + if len(rems) > 0: + logger.debug('Found a deployed service in removing state, continuing removal of {0}'.format(rems)) + for rem in rems: + self.continueRemovalOf(rem) + + diff --git a/server/src/uds/core/workers/PublicationCleaner.py b/server/src/uds/core/workers/PublicationCleaner.py new file mode 100644 index 000000000..a3e123b97 --- /dev/null +++ b/server/src/uds/core/workers/PublicationCleaner.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from uds.core.managers.PublicationManager import PublicationManager +from uds.core.util.Config import GlobalConfig +from uds.models import DeployedServicePublication, DeployedService, getSqlDatetime +from uds.core.services.Exceptions import PublishException +from uds.core.util.State import State +from uds.core.jobs.Job import Job +from datetime import timedelta +import logging + +logger = logging.getLogger(__name__) + + +class PublicationInfoItemsCleaner(Job): + frecuency = GlobalConfig.CLEANUP_CHECK.getInt() # Request run cache "info" cleaner every configured seconds. If config value is changed, it will be used at next reload + + def __init__(self, environment): + super(PublicationInfoItemsCleaner,self).__init__(environment) + + def run(self): + removeFrom = getSqlDatetime() - timedelta(seconds = GlobalConfig.KEEP_INFO_TIME.getInt()) + DeployedServicePublication.objects.filter(state__in=State.INFO_STATES, state_date__lt=removeFrom).delete() + +class PublicationCleaner(Job): + frecuency = GlobalConfig.REMOVAL_CHECK.getInt() # Request run publication "removal" every configued seconds. If config value is changed, it will be used at next reload + + def __init__(self, environment): + super(PublicationCleaner,self).__init__(environment) + + def run(self): + removables = DeployedServicePublication.objects.filter(state=State.REMOVABLE)[0:3] + for removable in removables: + try: + PublicationManager.manager().unpublish(removable) + except PublishException: # Can say that it cant be removed right now + logger.debug('Delaying removal') + pass + + + \ No newline at end of file diff --git a/server/src/uds/core/workers/ServiceCacheUpdater.py b/server/src/uds/core/workers/ServiceCacheUpdater.py new file mode 100644 index 000000000..b35394c87 --- /dev/null +++ b/server/src/uds/core/workers/ServiceCacheUpdater.py @@ -0,0 +1,245 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.db import transaction +from django.db.models import Q +from uds.core.util.Config import GlobalConfig +from uds.core.util.State import State +from uds.core.managers.UserServiceManager import UserServiceManager +from uds.core.services.Exceptions import MaxServicesReachedException +from uds.models import DeployedService +from uds.core import services +from uds.core.jobs.Job import Job +import logging + +logger = logging.getLogger(__name__) + + +class ServiceCacheUpdater(Job): + ''' + Cache updater is responsible of keeping up to date the cache for different deployed services configurations requested + We only process items that are "cacheables", to speed up process we will use the fact that initialServices = preparedServices = maxServices = 0 + if cache is not needed. + This is included as a scheduled task that will run every X seconds, and scheduler will keep it so it will be only executed by one backend at a time + ''' + frecuency = GlobalConfig.CACHE_CHECK_DELAY.getInt() # Request run cache manager every configured seconds. If config value is changed, it will be used at next reload + + def __init__(self, environment): + super(ServiceCacheUpdater,self).__init__(environment) + + @staticmethod + def calcProportion(max, actual): + return actual * 10000 / max + + def bestDeployedServiceNeedingCacheUpdate(self): + # State filter for cached and inAssigned objects + # First we get all deployed services that could need cache generation + DeployedService.objects.update() + # We start filtering out the deployed services that do not need caching at all. + whichNeedsCaching = DeployedService.objects.filter(Q(initial_srvs__gt=0) | Q(cache_l1_srvs__gt=0)).filter(max_srvs__gt=0,state=State.ACTIVE) + + # We will get the one that proportionally needs more cache + selected = None + cachedL1, cachedL2, assigned = 0,0,0 + toCacheL1 = False # Mark for prefering update L1 cache before L2 cache + prop = ServiceCacheUpdater.calcProportion(1,1) + for ds in whichNeedsCaching: + ds.userServices.update() # Cleans cached queries + # If this deployedService don't have a publication active and needs it, ignore it + if ds.activePublication() == None and ds.service.getInstance().publicationType is not None: + logger.debug('Needs publication but do not have one, cache test ignored') + continue + # If it has any running publication, do not generate cache anymore + if ds.publications.filter(state=State.PREPARING).count() > 0: + logger.debug('Stopped cache generation for deployed service with publication running: {0}'.format(ds)) + continue + + # Get data related to actual state of cache + inCacheL1 = ds.cachedUserServices().filter(UserServiceManager.getCacheStateFilter(services.UserDeployment.L1_CACHE)).count() + inCacheL2 = ds.cachedUserServices().filter(UserServiceManager.getCacheStateFilter(services.UserDeployment.L2_CACHE)).count() + inAssigned = ds.assignedUserServices().filter(UserServiceManager.getStateFilter()).count() + # if we bypasses max cache, we will reduce it in first place. This is so because this will free resources on service provider + logger.debug("Examining {0} with {1} in cache L1 and {2} in cache L2, {3} inAssigned".format( + ds, inCacheL1, inCacheL2, inAssigned)) + totalL1Assigned = inCacheL1 + inAssigned + # We have more than we want + if totalL1Assigned > ds.max_srvs: + logger.debug('We have more services than max configured') + cachedL1, cachedL2, assigned = inCacheL1, inCacheL2, inAssigned + selected = ds + break + # We have more in L1 cache than needed + if totalL1Assigned > ds.initial_srvs and inCacheL1 > ds.cache_l1_srvs: + logger.debug('We have more services in cache L1 than configured') + cachedL1, cachedL2, assigned = inCacheL1, inCacheL2, inAssigned + selected = ds + break + + # If we have more in L2 cache than needed, decrease L2 cache, but int this case, we continue checking cause L2 cache removal + # has less priority than l1 creations or removals, but higher. In this case, we will simply take last l2 oversized found and reduce it + if inCacheL2 > ds.cache_l2_srvs: + if toCacheL1 == False: + logger.debug('We have more services in L2 cache than configured, decreasing it') + cachedL1, cachedL2, assigned = inCacheL1, inCacheL2, inAssigned + selected = ds + prop = ServiceCacheUpdater.calcProportion(1,0) + + # If this service don't allows more starting user services, continue + if UserServiceManager.manager().canInitiateServiceFromDeployedService(ds) is False: + logger.debug('This provider has the max allowed starting services running: {0}'.format(ds)) + continue + + # If wee need to grow l2 cache, annotate it + # Whe check this before checking the total, because the l2 cache is independent of max services or l1 cache. + # It reflects a value that must be keeped in cache for futre fast use. + if inCacheL2 < ds.cache_l2_srvs: + p = ServiceCacheUpdater.calcProportion(ds.cache_l2_srvs, inCacheL2) + if p < prop and toCacheL1 == False: + logger.debug("Found best for cache until now comparing cache L2: {0}, {1} < {2}".format(ds, p, prop)) + cachedL1, cachedL2, assigned = inCacheL1, inCacheL2, inAssigned + selected = ds + prop = p + + # We skip it if already at max + if totalL1Assigned == ds.max_srvs: + continue; + + if totalL1Assigned < ds.initial_srvs: + p = ServiceCacheUpdater.calcProportion(ds.initial_srvs, totalL1Assigned) + if p < prop or toCacheL1 == False: + logger.debug("Found best for cache until now comparing initial: {0}, {1} < {2}".format(ds, p, prop)) + toCacheL1 = True + cachedL1, cachedL2, assigned = inCacheL1, inCacheL2, inAssigned + selected = ds + prop = p + if inCacheL1 < ds.cache_l1_srvs: + p = ServiceCacheUpdater.calcProportion(ds.cache_l1_srvs, inCacheL1) + if p < prop or toCacheL1 == False: + logger.debug("Found best for cache until now comparing prepared: {0}, {1} < {2}".format(ds, p, prop)) + toCacheL1 = True + selected = ds + cachedL1, cachedL2, assigned = inCacheL1, inCacheL2, inAssigned + prop = p + + # We also return calculated values so we can reuse then + return selected, cachedL1, cachedL2, assigned + + @transaction.autocommit + def growL1Cache(self, ds, cacheL1, cacheL2, assigned): + ''' + This method tries to enlarge L1 cache. + + If for some reason the number of deployed services (Counting all, ACTIVE + and PREPARING, assigned, L1 and L2) is over max allowed service deployments, + this method will not grow the L1 cache + ''' + logger.debug("Growing L1 cache creating a new service for {0}".format(ds)) + # First, we try to assign from L2 cache + if cacheL2 > 0: + cache = ds.cachedUserServices().select_for_update().filter(UserServiceManager.getCacheStateFilter(services.UserDeployment.L2_CACHE)).order_by('creation_date')[0] + cache.moveToLevel(services.UserDeployment.L1_CACHE) + else: + try: + UserServiceManager.manager().createCacheFor(ds.activePublication(), services.UserDeployment.L1_CACHE) + except MaxServicesReachedException as e: + logger.error(str(e)) + # TODO: When alerts are ready, notify this + + @transaction.autocommit + def growL2Cache(self, ds, cacheL1, cacheL2, assigned): + ''' + Tries to grow L2 cache of service. + + If for some reason the number of deployed services (Counting all, ACTIVE + and PREPARING, assigned, L1 and L2) is over max allowed service deployments, + this method will not grow the L1 cache + ''' + logger.debug("Growing L2 cache creating a new service for {0}".format(ds)) + try: + UserServiceManager.manager().createCacheFor(ds.activePublication(), services.UserDeployment.L2_CACHE) + except MaxServicesReachedException as e: + logger.error(str(e)) + # TODO: When alerts are ready, notify this + + def reduceL1Cache(self, ds, cacheL1, cacheL2, assigned): + logger.debug("Reducing L1 cache erasing a service in cache for {0}".format(ds)) + # We will try to destroy the newest cacheL1 element that is USABLE if the deployer can't cancel a new service creation + cacheItems = ds.cachedUserServices().filter(UserServiceManager.getCacheStateFilter(services.UserDeployment.L1_CACHE)).order_by('-creation_date') + if len(cacheItems) == 0: + logger.debug('There is more services than configured, but could not reduce cache cause its already empty') + return + + if cacheL2 < ds.cache_l2_srvs: + cacheItems[0].moveToLevel(services.UserDeployment.L2_CACHE) + else: + # TODO: Look first for non finished cache items and cancel them + cache = cacheItems[0] + cache.removeOrCancel() + + def reduceL2Cache(self, ds, cacheL1, cacheL2, assigned): + logger.debug("Reducing L2 cache erasing a service in cache for {0}".format(ds)) + if cacheL2 > 0: + cacheItems = ds.cachedUserServices().filter(UserServiceManager.getCacheStateFilter(services.UserDeployment.L2_CACHE)).order_by('creation_date') + # TODO: Look first for non finished cache items and cancel them + cache = cacheItems[0] + cache.removeOrCancel() + + def run(self): + logger.debug('Starting cache checking') + # We need to get + ds, cacheL1, cacheL2, assigned = self.bestDeployedServiceNeedingCacheUpdate() + # We have cache to update?? + if ds == None: + logger.debug('Cache up to date') + return + logger.debug("Updating cache for {0}".format(ds)) + totalL1Assigned = cacheL1 + assigned + + # We try first to reduce cache before tring to increase it. + # This means that if there is excesive number of user deployments + # for L1 or L2 cache, this will be reduced untill they have good numbers. + # This is so because service can have limited the number of services and, + # if we try to increase cache before having reduced whatever needed + # first, the service will get lock until someone removes something. + if totalL1Assigned > ds.max_srvs: + self.reduceL1Cache(ds, cacheL1, cacheL2, assigned) + elif totalL1Assigned > ds.initial_srvs and cacheL1 > ds.cache_l1_srvs: + self.reduceL1Cache(ds, cacheL1, cacheL2, assigned) + elif cacheL2 > ds.cache_l2_srvs: # We have excesives L2 items + self.reduceL2Cache(ds, cacheL1, cacheL2, assigned) + elif totalL1Assigned < ds.max_srvs and (totalL1Assigned < ds.initial_srvs or cacheL1 < ds.cache_l1_srvs): # We need more services + self.growL1Cache(ds, cacheL1, cacheL2, assigned) + elif cacheL2 < ds.cache_l2_srvs: # We need more L2 items + self.growL2Cache(ds, cacheL1, cacheL2, assigned) + else: + logger.info("We have more services than max requested for {0}, but can't erase any of then cause all of them are already assigned".format(ds)) diff --git a/server/src/uds/core/workers/UserServiceCleaner.py b/server/src/uds/core/workers/UserServiceCleaner.py new file mode 100644 index 000000000..161ab1dc2 --- /dev/null +++ b/server/src/uds/core/workers/UserServiceCleaner.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.db import transaction +from uds.core.managers.UserServiceManager import UserServiceManager +from uds.core.util.Config import GlobalConfig +from uds.models import UserService, getSqlDatetime, State +from uds.core.jobs.Job import Job +from datetime import timedelta +import logging + +logger = logging.getLogger(__name__) + +# Notas: +# Clean cache info items. DONE +# Initiate removal of "removable" cached items, with a limit (at most X per run). DONE +# Look for non current cache items and mark them as removables. + + + +class UserServiceInfoItemsCleaner(Job): + frecuency = GlobalConfig.CLEANUP_CHECK.getInt() # Request run cache "info" cleaner every configured seconds. If config value is changed, it will be used at next reload + + def __init__(self, environment): + super(UserServiceInfoItemsCleaner,self).__init__(environment) + + @transaction.commit_on_success + def run(self): + removeFrom = getSqlDatetime() - timedelta(seconds = GlobalConfig.KEEP_INFO_TIME.getInt()) + UserService.objects.select_for_update().filter(state__in=State.INFO_STATES, state_date__lt=removeFrom).delete() + + +class UserServiceRemover(Job): + frecuency = GlobalConfig.REMOVAL_CHECK.getInt() # Request run cache "info" cleaner every configued seconds. If config value is changed, it will be used at next reload + removeAtOnce = GlobalConfig.USER_SERVICE_CLEAN_NUMBER.getInt() # Same, it will work at reload + + def __init__(self, environment): + super(UserServiceRemover,self).__init__(environment) + + @transaction.commit_on_success + def run(self): + removables = UserService.objects.filter(state=State.REMOVABLE)[0:UserServiceRemover.removeAtOnce] + for us in removables: + UserServiceManager.manager().remove(us) diff --git a/server/src/uds/core/workers/__init__.py b/server/src/uds/core/workers/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/server/src/uds/dispatchers/__init__.py b/server/src/uds/dispatchers/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/server/src/uds/dispatchers/pam/__init__.py b/server/src/uds/dispatchers/pam/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/server/src/uds/dispatchers/pam/urls.py b/server/src/uds/dispatchers/pam/urls.py new file mode 100644 index 000000000..3933d1a8a --- /dev/null +++ b/server/src/uds/dispatchers/pam/urls.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.conf.urls.defaults import patterns, include + +urlpatterns = patterns('uds.dispatchers.pam.views', + (r'^pam$', 'pam'), + ) + \ No newline at end of file diff --git a/server/src/uds/dispatchers/pam/views.py b/server/src/uds/dispatchers/pam/views.py new file mode 100644 index 000000000..8992b65e8 --- /dev/null +++ b/server/src/uds/dispatchers/pam/views.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.http import HttpResponseNotAllowed, HttpResponse +from uds.core.util.Cache import Cache +import logging + +logger = logging.getLogger(__name__) + +# We will use the cache to "hold" the tickets valid for users + +# Create your views here. +def pam(request): + response = '' + cache = Cache('pam') + if request.method == 'POST': + return HttpResponseNotAllowed(['GET']) + if request.GET.has_key('id') & request.GET.has_key('pass'): + # This is an "auth" request + logger.debug("Auth request for user [{0}] and pass [{1}]".format(request.GET['id'], request.GET['pass'])) + password = cache.get(request.GET['id']) + response = '0' + if password == request.GET['pass']: + response = '1' + cache.remove(request.GET['id']) # Ticket valid for just 1 login + + elif request.GET.has_key('uid'): + # This is an "get name for id" call + logger.debug("NSS Request for id [{0}]".format(request.GET['uid'])) + response = '10000 udstmp' + elif request.GET.has_key('name'): + logger.debug("NSS Request for username [{0}]".format(request.GET['name'])) + response = '10000 udstmp' + + return HttpResponse(response, content_type='text/plain') diff --git a/server/src/uds/locale/de/LC_MESSAGES/django.mo b/server/src/uds/locale/de/LC_MESSAGES/django.mo new file mode 100644 index 000000000..de2fa8276 Binary files /dev/null and b/server/src/uds/locale/de/LC_MESSAGES/django.mo differ diff --git a/server/src/uds/locale/de/LC_MESSAGES/django.po b/server/src/uds/locale/de/LC_MESSAGES/django.po new file mode 100644 index 000000000..95e7c3841 --- /dev/null +++ b/server/src/uds/locale/de/LC_MESSAGES/django.po @@ -0,0 +1,1543 @@ +# Translations for german +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# Adolfo Gómez , 2012. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-07-12 21:26+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" + +#: auths/ActiveDirectory/Authenticator.py:29 +#: auths/EDirectory/Authenticator.py:60 auths/RegexLdap/Authenticator.py:51 +#: auths/SimpleLDAP/Authenticator.py:49 +#: services/Vmware/ServiceProviderVC.py:28 +msgid "Host" +msgstr "Host" + +#: auths/ActiveDirectory/Authenticator.py:29 +#: auths/EDirectory/Authenticator.py:60 auths/RegexLdap/Authenticator.py:51 +#: auths/SimpleLDAP/Authenticator.py:49 +#: services/Vmware/ServiceProviderVC.py:28 +msgid "VMWare VC Server IP or Hostname" +msgstr "VMWare VC Server IP oder Hostname" + +#: auths/ActiveDirectory/Authenticator.py:30 +#: auths/EDirectory/Authenticator.py:62 auths/RegexLdap/Authenticator.py:53 +#: auths/SimpleLDAP/Authenticator.py:51 +msgid "Use SSL" +msgstr "Verwendung SSL" + +#: auths/ActiveDirectory/Authenticator.py:30 +msgid "If checked, will use a ssl connection to Active Directory" +msgstr "" +"Wenn diese Option aktiviert ist, verwendet eine Ssl-Verbindung zum Ldap " +"(Wenn Port 389 ist, wird in Tatsache Port 636)" + +#: auths/ActiveDirectory/Authenticator.py:31 +#: auths/RegexLdap/Authenticator.py:54 auths/SimpleLDAP/Authenticator.py:52 +msgid "Ldap User" +msgstr "LDAP-Benutzer" + +#: auths/ActiveDirectory/Authenticator.py:31 +msgid "" +"Username with read privileges on the base selected (use USER@DOMAIN.DOM form " +"for this)" +msgstr "Benutzernamen mit lesen Berechtigungen auf der Basis ausgewählt" + +#: auths/ActiveDirectory/Authenticator.py:32 +#: auths/ActiveDirectory/Authenticator.py:50 +#: auths/EDirectory/Authenticator.py:64 auths/RegexLdap/Authenticator.py:55 +#: auths/RegexLdap/Authenticator.py:78 auths/SimpleLDAP/Authenticator.py:53 +#: auths/SimpleLDAP/Authenticator.py:77 +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:31 +#: services/Vmware/ServiceProviderVC.py:31 transports/NX/NXTransport.py:62 +#: transports/RDP/RDPTransport.py:38 transports/RDP/TSRDPTransport.py:42 +#: transports/RGS/RGSTransport.py:43 transports/RGS/TRGSTransport.py:48 +#: transports/TSNX/TSNXTransport.py:67 web/forms/LoginForm.py:60 +msgid "Password" +msgstr "Passwort" + +#: auths/ActiveDirectory/Authenticator.py:32 +#: auths/EDirectory/Authenticator.py:64 auths/RegexLdap/Authenticator.py:55 +#: auths/SimpleLDAP/Authenticator.py:53 +msgid "Password of the ldap user" +msgstr "Kennwort für den Ldap-Benutzer" + +#: auths/ActiveDirectory/Authenticator.py:33 +#: auths/EDirectory/Authenticator.py:65 auths/RegexLdap/Authenticator.py:56 +#: auths/SimpleLDAP/Authenticator.py:54 +#: services/Vmware/ServiceProviderVC.py:32 +msgid "Timeout" +msgstr "Timeout" + +#: auths/ActiveDirectory/Authenticator.py:33 +#: auths/EDirectory/Authenticator.py:65 auths/RegexLdap/Authenticator.py:56 +#: auths/SimpleLDAP/Authenticator.py:54 +msgid "Timeout in seconds of connection to LDAP" +msgstr "Timeout in Sekunden über LDAP-Verbindung" + +#: auths/ActiveDirectory/Authenticator.py:35 +msgid "Active Directory Authenticator" +msgstr "Active Directory-Authenticator" + +#: auths/ActiveDirectory/Authenticator.py:37 +#, fuzzy +msgid "Authenticate against Active Directory" +msgstr "Authentifikator mit Active Directory" + +#: auths/ActiveDirectory/Authenticator.py:46 +#: auths/EDirectory/Authenticator.py:77 auths/RegexLdap/Authenticator.py:74 +#: auths/SimpleLDAP/Authenticator.py:73 +#: services/Vmware/ServiceProviderVC.py:30 transports/NX/NXTransport.py:61 +#: transports/RDP/RDPTransport.py:37 transports/RDP/TSRDPTransport.py:41 +#: transports/RGS/RGSTransport.py:42 transports/RGS/TRGSTransport.py:47 +#: transports/TSNX/TSNXTransport.py:66 web/forms/LoginForm.py:59 +msgid "Username" +msgstr "Benutzername" + +#: auths/ActiveDirectory/Authenticator.py:48 +#: auths/EDirectory/Authenticator.py:79 auths/RegexLdap/Authenticator.py:76 +#: auths/SimpleLDAP/Authenticator.py:75 +msgid "Group" +msgstr "Gruppe" + +#: auths/ActiveDirectory/Authenticator.py:61 +#: auths/ActiveDirectory/Authenticator.py:395 +msgid "Must specify the username in the form USERNAME@DOMAIN.DOM" +msgstr "Müssen den Benutzernamen in der Form Benutzername@Domäne angeben.DOM" + +#: auths/ActiveDirectory/Authenticator.py:127 +#: auths/EDirectory/Authenticator.py:123 auths/RegexLdap/Authenticator.py:157 +#: auths/SimpleLDAP/Authenticator.py:158 +msgid "Ldap connection error: " +msgstr "LDAP-Verbindungsfehler: " + +#: auths/ActiveDirectory/Authenticator.py:299 +#: auths/ActiveDirectory/Authenticator.py:345 +#: auths/EDirectory/Authenticator.py:243 auths/EDirectory/Authenticator.py:286 +#: auths/RegexLdap/Authenticator.py:244 auths/RegexLdap/Authenticator.py:287 +#: auths/SimpleLDAP/Authenticator.py:268 auths/SimpleLDAP/Authenticator.py:312 +msgid "Username not found" +msgstr "Benutzername wurde nicht gefunden" + +#: auths/ActiveDirectory/Authenticator.py:332 +#: auths/SimpleLDAP/Authenticator.py:301 +msgid "Group not found" +msgstr "Gruppe nicht gefunden" + +#: auths/ActiveDirectory/Authenticator.py:364 +#: auths/ActiveDirectory/Authenticator.py:381 +#: auths/EDirectory/Authenticator.py:303 auths/RegexLdap/Authenticator.py:305 +#: auths/SimpleLDAP/Authenticator.py:327 auths/SimpleLDAP/Authenticator.py:341 +msgid "Too many results, be more specific" +msgstr "Zu viele Ergebnisse, sein mehr spezifisch" + +#: auths/ActiveDirectory/Authenticator.py:404 +msgid "Domain seems to be incorrect, please check it" +msgstr "Domäne scheint falsch sein, bitte überprüfen es" + +#: auths/ActiveDirectory/Authenticator.py:409 +msgid "Ldap does not seem an Active Directory (do not have user objects)" +msgstr "LDAP scheint nicht Active Directory (keine Benutzerobjekte)" + +#: auths/ActiveDirectory/Authenticator.py:417 +msgid "Ldap does not seem an Active Directory (no not have group objects)" +msgstr "LDAP scheint nicht Active Directory (Nein, nicht haben Gruppenobjekte)" + +#: auths/ActiveDirectory/Authenticator.py:425 +msgid "" +"Ldap does not seem an Active Directory (do not have any user nor groups)" +msgstr "" +"LDAP scheint nicht Active Directory (nicht haben keine Benutzer oder Gruppen)" + +#: auths/ActiveDirectory/Authenticator.py:430 +#: auths/EDirectory/Authenticator.py:358 auths/RegexLdap/Authenticator.py:380 +#: auths/SimpleLDAP/Authenticator.py:422 +msgid "Connection params seem correct, test was succesfully executed" +msgstr "Verbindung Params scheinen korrekt, Test wurde erfolgreich ausgeführt" + +#: auths/EDirectory/Authenticator.py:61 auths/RegexLdap/Authenticator.py:52 +#: auths/SimpleLDAP/Authenticator.py:50 +#: services/Vmware/ServiceProviderVC.py:29 +msgid "Port" +msgstr "Port" + +#: auths/EDirectory/Authenticator.py:61 auths/RegexLdap/Authenticator.py:52 +#: auths/SimpleLDAP/Authenticator.py:50 +msgid "Ldap port (389 for non ssl, 636 for ssl normally" +msgstr "LDAP-Port (389 für nicht Ssl, 636 für Ssl normalerweise" + +#: auths/EDirectory/Authenticator.py:62 auths/RegexLdap/Authenticator.py:53 +#: auths/SimpleLDAP/Authenticator.py:51 +msgid "" +"If checked, will use a ssl connection to ldap (if port is 389, will use in " +"fact port 636)" +msgstr "" +"Wenn diese Option aktiviert ist, verwendet eine Ssl-Verbindung zum Ldap " +"(Wenn Port 389 ist, wird in Tatsache Port 636)" + +#: auths/EDirectory/Authenticator.py:63 +#, fuzzy +msgid "Admin user" +msgstr "Admin" + +#: auths/EDirectory/Authenticator.py:63 +#, fuzzy +msgid "Username with read privileges on the eDirectory" +msgstr "Benutzernamen mit lesen Berechtigungen auf der Basis ausgewählt" + +#: auths/EDirectory/Authenticator.py:67 +#, fuzzy +msgid "eDirectory Authenticator" +msgstr "Active Directory-Authenticator" + +#: auths/EDirectory/Authenticator.py:69 +#, fuzzy +msgid "Authenticate against eDirectory" +msgstr "Authentifikator mit Active Directory" + +#: auths/EDirectory/Authenticator.py:323 auths/RegexLdap/Authenticator.py:325 +#: auths/SimpleLDAP/Authenticator.py:362 +msgid "Ldap search base is incorrect" +msgstr "LDAP-Suche base ist falsch" + +#: auths/EDirectory/Authenticator.py:328 auths/RegexLdap/Authenticator.py:330 +#: auths/SimpleLDAP/Authenticator.py:367 +msgid "Ldap user class seems to be incorrect (no user found by that class)" +msgstr "" +"LDAP-Benutzerklasse scheint nicht korrekt (kein Benutzer gefunden durch " +"diese Klasse)" + +#: auths/EDirectory/Authenticator.py:336 auths/RegexLdap/Authenticator.py:346 +#: auths/SimpleLDAP/Authenticator.py:383 +msgid "" +"Ldap user id attribute seems to be incorrect (no user found by that " +"attribute)" +msgstr "" +"LDAP-Benutzer-Id-Attribut scheint falsch (kein Benutzer gefunden damit -" +"Attribut)" + +#: auths/EDirectory/Authenticator.py:344 +msgid "Expected group attribute " +msgstr "Erwartete Group-Attribut " + +#: auths/EDirectory/Authenticator.py:353 +#, fuzzy +msgid "" +"Ldap user class or user id attr is probably wrong (Ldap is an eDirectory?)" +msgstr "" +"LDAP Benutzer Klasse oder Benutzer-Id Attr ist wahrscheinlich falsch (keiner " +"Benutzer mit finden beide Bedingungen)" + +#: auths/IP/Authenticator.py:45 auths/IP/Authenticator.py:47 +msgid "IP Authenticator" +msgstr "IP-Authenticator" + +#: auths/IP/Authenticator.py:51 +msgid "IP" +msgstr "IP " + +#: auths/IP/Authenticator.py:52 +msgid "IP Range" +msgstr "IP-Bereich" + +#: auths/IP/Authenticator.py:99 auths/InternalDB/Authenticator.py:94 +msgid "All seems fine in the authenticator." +msgstr "Alles scheint in Ordnung in der Authentifikator." + +#: auths/InternalDB/Authenticator.py:46 +msgid "Internal Database" +msgstr "Interne Datenbank" + +#: auths/InternalDB/Authenticator.py:48 +msgid "Internal dabasase authenticator. Doesn't uses external sources" +msgstr "Interne Dabasase Authentifikator. Keine verwendet externe Quellen" + +#: auths/InternalDB/Authenticator.py:91 +msgid "Internal structures seems ok" +msgstr "Interne Strukturen scheint in Ordnung" + +#: auths/RegexLdap/Authenticator.py:54 auths/SimpleLDAP/Authenticator.py:52 +msgid "Username with read privileges on the base selected" +msgstr "Benutzernamen mit lesen Berechtigungen auf der Basis ausgewählt" + +#: auths/RegexLdap/Authenticator.py:57 auths/SimpleLDAP/Authenticator.py:55 +msgid "Base" +msgstr "Base" + +#: auths/RegexLdap/Authenticator.py:57 auths/SimpleLDAP/Authenticator.py:55 +msgid "Common search base (used for \"users\" and \"groups\"" +msgstr "Gemeinsame Suchbeginn (verwendet für \"Users\" und \"Gruppen\"" + +#: auths/RegexLdap/Authenticator.py:58 auths/SimpleLDAP/Authenticator.py:56 +msgid "User class" +msgstr "User-Klasse" + +#: auths/RegexLdap/Authenticator.py:58 auths/SimpleLDAP/Authenticator.py:56 +msgid "Class for LDAP users (normally posixAccount)" +msgstr "Klasse für LDAP-Benutzer (normalerweise \"posixAccount\")" + +#: auths/RegexLdap/Authenticator.py:59 auths/SimpleLDAP/Authenticator.py:57 +msgid "User Id Attr" +msgstr "Benutzer-Id Attr" + +#: auths/RegexLdap/Authenticator.py:59 auths/SimpleLDAP/Authenticator.py:57 +msgid "Attribute that contains the user id" +msgstr "Attribut, das die Benutzer-Id enthält" + +#: auths/RegexLdap/Authenticator.py:60 auths/SimpleLDAP/Authenticator.py:58 +msgid "User Name Attr" +msgstr "Benutzer Name Attr" + +#: auths/RegexLdap/Authenticator.py:60 auths/SimpleLDAP/Authenticator.py:58 +msgid "Attributes that contains the user name (list of comma separated values)" +msgstr "" +"Attribute, die dem Benutzernamen (Liste der durch Kommas getrennte Werte)" + +#: auths/RegexLdap/Authenticator.py:61 +msgid "Group Name Attr" +msgstr "Gruppe Name Attr" + +#: auths/RegexLdap/Authenticator.py:61 +msgid "Attribute that contains the group name" +msgstr "Attribut, das den Namen den Gruppe enthält" + +#: auths/RegexLdap/Authenticator.py:62 +msgid "Regular Exp. for groups" +msgstr "Regelmäßige EXP für Gruppen." + +#: auths/RegexLdap/Authenticator.py:62 +msgid "Regular Expression to extract the group name" +msgstr "Reguläre Ausdruck, der den Namen den Gruppe zu extrahieren" + +#: auths/RegexLdap/Authenticator.py:64 +msgid "Regex LDAP Authenticator" +msgstr "Regex LDAP-Authenticator" + +#: auths/RegexLdap/Authenticator.py:66 +msgid "Regular Expressions LDAP authenticator" +msgstr "Reguläre Ausdrücke LDAP-Authentifizierungsserver" + +#: auths/RegexLdap/Authenticator.py:338 auths/SimpleLDAP/Authenticator.py:375 +msgid "Ldap group class seems to be incorrect (no group found by that class)" +msgstr "" +"LDAP Gruppe Klasse scheint nicht korrekt (keine Gruppe gefunden durch diese " +"Klasse)" + +#: auths/RegexLdap/Authenticator.py:356 auths/SimpleLDAP/Authenticator.py:391 +msgid "" +"Ldap group id attribute seems to be incorrect (no group found by that " +"attribute)" +msgstr "" +"LDAP Gruppe Id-Attribut scheint nicht korrekt (keine Gruppe gefunden, die -" +"Attribut)" + +#: auths/RegexLdap/Authenticator.py:365 auths/SimpleLDAP/Authenticator.py:400 +msgid "" +"Ldap user class or user id attr is probably wrong (can't find any user with " +"both conditions)" +msgstr "" +"LDAP Benutzer Klasse oder Benutzer-Id Attr ist wahrscheinlich falsch (keiner " +"Benutzer mit finden beide Bedingungen)" + +#: auths/SimpleLDAP/Authenticator.py:59 +msgid "Group class" +msgstr "Group-Klasse" + +#: auths/SimpleLDAP/Authenticator.py:59 +msgid "Class for LDAP groups (normally poxisGroup)" +msgstr "Klasse für LDAP-Gruppen (normalerweise PoxisGroup)" + +#: auths/SimpleLDAP/Authenticator.py:60 +msgid "Group Id Attr" +msgstr "Gruppe Id Attr" + +#: auths/SimpleLDAP/Authenticator.py:60 +msgid "Attribute that contains the group id" +msgstr "Attribut, das die Gruppen-Id enthält" + +#: auths/SimpleLDAP/Authenticator.py:61 +msgid "Group membership attr" +msgstr "Gruppe Mitgliedschaft attr" + +#: auths/SimpleLDAP/Authenticator.py:61 +msgid "Attribute of the group that contains the users belonging to it" +msgstr "Attribut der Gruppe mit die Benutzern gehören es" + +#: auths/SimpleLDAP/Authenticator.py:63 +msgid "SimpleLDAP Authenticator" +msgstr "SimpleLDAP Authenticator" + +#: auths/SimpleLDAP/Authenticator.py:65 +msgid "Simple LDAP authenticator" +msgstr "Einfache LDAP-Authentifizierungsserver" + +#: auths/SimpleLDAP/Authenticator.py:409 +msgid "" +"Ldap group class or group id attr is probably wrong (can't find any group " +"with both conditions)" +msgstr "" +"LDAP Gruppe Klasse oder Gruppe Id Attr ist wahrscheinlich falsch (kann nicht " +"finden jede Gruppe beide Bedingungen)" + +#: auths/SimpleLDAP/Authenticator.py:416 +msgid "Can't locate any group with the membership attribute specified" +msgstr "" +"Jede Gruppe kann nicht mit das angegebene Mitgliedschaft-Attribut gefunden " +"werden" + +#: core/BaseModule.py:196 +msgid "No connection checking method is implemented." +msgstr "Keine Verbindung überprüfen Methode ist implementiert." + +#: core/BaseModule.py:248 +msgid "No check method provided." +msgstr "Keine Prüfmethode zur Verfügung gestellt." + +#: core/managers/PublicationManager.py:156 +msgid "" +"Already publishing. Wait for previous publication to finish and try again" +msgstr "" +"Bereits veröffentlicht. Warten Sie auf vorherige Veröffentlichung zu beenden " +"und versuchen Sie es erneut" + +#: core/managers/PublicationManager.py:168 +msgid "Can't cancel non running publication" +msgstr "Nicht ausgeführte Veröffentlichung kann nicht abgebrochen werden." + +#: core/managers/PublicationManager.py:186 +msgid "Can't unpublish non usable publication" +msgstr "Kann nicht nicht nutzbare Veröffentlichung aufheben" + +#: core/managers/PublicationManager.py:189 +msgid "Can't unpublish publications with services in process" +msgstr "" +"Publikationen mit Dienstleistungen im Prozess kann nicht Veröffentlichung " +"rückgängig machen" + +#: core/managers/UserPrefsManager.py:254 +msgid "Screen Size" +msgstr "Bildschirmgröße" + +#: core/managers/UserPrefsManager.py:258 +msgid "Full Screen" +msgstr "Vollbild" + +#: core/managers/UserPrefsManager.py:261 +msgid "Screen colors" +msgstr "Bildschirmfarben" + +#: core/managers/UserPrefsManager.py:262 +msgid "8 bits" +msgstr "8 Bit" + +#: core/managers/UserPrefsManager.py:263 +msgid "16 bits" +msgstr "16 bits" + +#: core/managers/UserPrefsManager.py:264 +msgid "24 bits" +msgstr "24 Bit" + +#: core/managers/UserPrefsManager.py:265 +msgid "32 bits" +msgstr "32 bits" + +#: core/managers/UserServiceManager.py:302 +msgid "Can't cancel non running operation" +msgstr "Kann nicht nicht ausgeführten Vorgang abbrechen" + +#: core/managers/UserServiceManager.py:321 +msgid "Can't remove a non active element" +msgstr "Ein nicht aktive Element kann nicht entfernt werden." + +#: core/managers/UserServiceManager.py:334 +msgid "Can't remove nor cancel {0} cause its states doesn't allows it" +msgstr "" +"Kann weder entfernen noch Abbrechen {0} Ursache ihrer Staaten nicht erlaubt " +"es" + +#: core/osmanagers/BaseOsManager.py:50 +msgid "Base OS Manager" +msgstr "Base OS Manager" + +#: core/osmanagers/BaseOsManager.py:52 +msgid "Base Manager" +msgstr "Base Manager" + +#: core/transports/BaseTransport.py:94 +msgid "Transport empty" +msgstr "Transport leer" + +#: core/util/State.py:59 +msgid "Active" +msgstr "Aktive" + +#: core/util/State.py:59 +msgid "Inactive" +msgstr "Inaktiv" + +#: core/util/State.py:59 +msgid "Blocked" +msgstr "Blockiert" + +#: core/util/State.py:59 +msgid "Waiting publication" +msgstr "Wartet auf Veröffentlichung" + +#: core/util/State.py:60 +msgid "In preparation" +msgstr "In Vorbereitung" + +#: core/util/State.py:60 +msgid "Valid" +msgstr "Gültig" + +#: core/util/State.py:61 +msgid "Waiting for removal" +msgstr "Warten auf Entfernung" + +#: core/util/State.py:61 +msgid "Removing" +msgstr "Entfernen" + +#: core/util/State.py:61 +msgid "Removed" +msgstr "Entfernt" + +#: core/util/State.py:61 +msgid "Canceled" +msgstr "Abgebrochen" + +#: core/util/State.py:62 +msgid "Canceling" +msgstr "Abbrechen" + +#: core/util/State.py:62 templates/uds/error.html:6 +#: templates/uds/error.html.py:11 +msgid "Error" +msgstr "Fehler" + +#: core/util/State.py:62 +msgid "Running" +msgstr "Ausführen" + +#: core/util/State.py:62 +msgid "Finished" +msgstr "Fertig" + +#: core/util/State.py:62 +msgid "Waiting execution" +msgstr "Personen, die auf Ausführung" + +#: osmanagers/LinuxOsManager/LinuxOsManager.py:44 +msgid "Linux OS Manager" +msgstr "Linux OS Manager" + +#: osmanagers/LinuxOsManager/LinuxOsManager.py:46 +msgid "" +"Os Manager to control linux virtual machines (basically renames machine and " +"notify state)" +msgstr "" +"OS-Manager, um die Kontrolle von Linux virtuellen Maschinen (im Grunde " +"benennt Maschine und Benachrichtigen Sie Zustand)" + +#: osmanagers/LinuxOsManager/LinuxOsManager.py:49 +#: osmanagers/WindowsOsManager/WindowsOsManager.py:40 +msgid "On Logout" +msgstr "Beim Abmelden" + +#: osmanagers/LinuxOsManager/LinuxOsManager.py:49 +#: osmanagers/WindowsOsManager/WindowsOsManager.py:40 +msgid "What to do when user logout from service" +msgstr "Was tun, wenn Benutzer abmelden vom Dienst" + +#: osmanagers/LinuxOsManager/LinuxOsManager.py:50 +#: osmanagers/WindowsOsManager/WindowsOsManager.py:41 +msgid "Keep service assigned" +msgstr "Halten Sie Dienst zugewiesen" + +#: osmanagers/LinuxOsManager/LinuxOsManager.py:51 +#: osmanagers/WindowsOsManager/WindowsOsManager.py:42 +msgid "Remove service" +msgstr "Basisdienst" + +#: osmanagers/LinuxOsManager/__init__.py:43 +msgid "UDS Actor for linux machines (Requires python 2.6 or greater)" +msgstr "" +"UDS Schauspieler für Linux Maschinen (Python 2.6 oder höher erforderlich)" + +#: osmanagers/NoneOsManager/Manager.py:43 +msgid "None OS Manager" +msgstr "Keine OS Manager" + +#: osmanagers/NoneOsManager/Manager.py:45 +msgid "Os Manager with no actions" +msgstr "OS-Manager keine Aktionen" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:23 +msgid "Windows Domain OS Manager" +msgstr "Windows OS Gebietsmanager" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:25 +msgid "" +"Os Manager to control windows machines with domain. (Basically renames " +"machine)" +msgstr "" +"OS-Manager, um Windows-Maschinen mit Domäne steuern. (Im Grunde benennt " +"Maschine)" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:29 +#: transports/RDP/RDPTransport.py:39 transports/RDP/TSRDPTransport.py:43 +#: transports/RGS/RGSTransport.py:44 transports/RGS/TRGSTransport.py:49 +msgid "Domain" +msgstr "Domäne" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:29 +msgid "Domain to join machines to (better use dns form of domain)" +msgstr "Domäne beitreten Maschinen (bessere DNS-Form der Domäne verwenden)" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:30 +msgid "Account" +msgstr "Konto" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:30 +msgid "Account with rights to add machines to domain" +msgstr "Konto mit der Berechtigung zum Computer zur Domäne hinzufügen" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:31 +msgid "Password of the account" +msgstr "Kennwort für das Konto" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:32 +msgid "OU" +msgstr "OU" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:32 +msgid "" +"Organizational unit where to add machines in domain (check it before using " +"it)" +msgstr "" +"Organisationseinheit, an Maschinen in Domäne hinzugefügt (überprüfen sie vor " +"der Verwendung es)" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:40 +msgid "Must provide a domain!!!" +msgstr "Müssen eine Domäne zur Verfügung stellen!" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:42 +msgid "Must provide an account to add machines to domain!!!" +msgstr "Muss ein Konto Domäne Maschinen hinzu bieten!!!" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:44 +msgid "Must provide a password for the account!!!" +msgstr "Muss ein Kennwort für das Konto angeben!" + +#: osmanagers/WindowsOsManager/WindowsOsManager.py:35 +msgid "Windows Basic OS Manager" +msgstr "Grundlegende Windows-OS-Manager" + +#: osmanagers/WindowsOsManager/WindowsOsManager.py:37 +msgid "" +"Os Manager to control windows machines without domain. (Basically renames " +"machine)" +msgstr "" +"OS-Manager, um Windows-Rechner ohne Domäne steuern. (Im Grunde benennt " +"Maschine)" + +#: osmanagers/WindowsOsManager/WindowsOsManager.py:51 +msgid "Length must be numeric!!" +msgstr "Länge muss numerisch sein!" + +#: osmanagers/WindowsOsManager/WindowsOsManager.py:53 +msgid "Length must be betwen 1 and six" +msgstr "Länge muss zwischen 1 und 6" + +#: osmanagers/WindowsOsManager/__init__.py:23 +msgid "" +"UDS Actor for windows machines (Important!! Requires .net framework 3.5 " +"sp1)" +msgstr "" +"UDS Schauspieler für Windows-Rechner (wichtig! .Net Framework 3.5 " +"erfordert SP1)" + +#: services/PhysicalMachines/IPMachineDeployed.py:56 +msgid "IP " +msgstr "IP " + +#: services/PhysicalMachines/IPMachinesService.py:46 +msgid "List of IPS" +msgstr "Liste der IPS" + +#: services/PhysicalMachines/IPMachinesService.py:49 +msgid "Physical machines accesed by ip" +msgstr "Physische Computer Zugang von ip" + +#: services/PhysicalMachines/IPMachinesService.py:51 +msgid "This service provides access to POWERED-ON Machines by ip" +msgstr "" +"Dieser Service ermöglicht den Zugriff auf verknüpfte Clones Maschinen auf " +"einen Virtual Center" + +#: services/Sample/SampleProvider.py:142 +msgid "Methuselah is not alive!!! :-)" +msgstr "Methusalem ist nicht lebendig!!! :-)" + +#: services/Sample/SampleProvider.py:182 +msgid "Nothing tested, but all went fine.." +msgstr "Nichts getestet, aber alles ging gut..." + +#: services/Sample/SamplePublication.py:199 +msgid "Random integer was 9!!! :-)" +msgstr "Zufällige ganze war 9!!! :-)" + +#: services/Vmware/Helpers.py:72 +msgid "Local" +msgstr "Lokale" + +#: services/Vmware/Helpers.py:74 +msgid "Remote" +msgstr "Entfernte" + +#: services/Vmware/PublicationVC.py:36 +msgid "Publication" +msgstr "Veröffentlichung" + +#: services/Vmware/PublicationVC.py:37 +msgid "UDS Publication for {0} created at {1}" +msgstr "UDS-Veröffentlichung erstellt am {1} {0}" + +#: services/Vmware/ServiceProviderVC.py:29 +msgid "VMWare VC Server Port (usually 443)" +msgstr "VMWare VC Server Port (in der Regel 443)" + +#: services/Vmware/ServiceProviderVC.py:30 +msgid "User with valid privileges on VC" +msgstr "Benutzer mit gültigen Berechtigungen für VC" + +#: services/Vmware/ServiceProviderVC.py:31 +msgid "Password of the user of the VC" +msgstr "Kennwort des Benutzers des VC" + +#: services/Vmware/ServiceProviderVC.py:32 +msgid "Timeout in seconds of connection to VC" +msgstr "Timeout in Sekunden der Verbindung zum VC" + +#: services/Vmware/ServiceProviderVC.py:33 +msgid "Macs range" +msgstr "Mac-Bereich" + +#: services/Vmware/ServiceProviderVC.py:34 +msgid "Range of valids macs for created machines" +msgstr "Bereich von gilt Macs für erstellte Maschinen" + +#: services/Vmware/ServiceProviderVC.py:39 +msgid "VMWare Virtual Center Provider" +msgstr "VMWare Virtual Center-Provider" + +#: services/Vmware/ServiceProviderVC.py:41 +msgid "Provides connection to Virtual Center Services" +msgstr "Stellt Verbindung zu Virtual Center Services" + +#: services/Vmware/ServiceProviderVC.py:111 +msgid "Error testing connection" +msgstr "Fehler testen Verbindung" + +#: services/Vmware/ServiceProviderVC.py:114 +msgid "VmwareVC Provider: " +msgstr "VmwareVC Provider: " + +#: services/Vmware/ServiceProviderVC.py:120 +msgid "Connection params ok" +msgstr "Verbindung Params ok" + +#: services/Vmware/ServiceProviderVC.py:121 +msgid "Connection failed. Check connection params" +msgstr "Verbindung ist fehlgeschlagen. Kontrollkästchen Verbindung params" + +#: services/Vmware/VCLinkedCloneService.py:28 +msgid "Datacenter" +msgstr "Datacenter" + +#: services/Vmware/VCLinkedCloneService.py:34 +msgid "Datacenter containing base machine" +msgstr "Datacenter mit Basismaschine" + +#: services/Vmware/VCLinkedCloneService.py:36 +msgid "Network" +msgstr "Netzwerk" + +#: services/Vmware/VCLinkedCloneService.py:37 +msgid "" +"If more than 1 interface is found in machine, use one on this network as main" +msgstr "" +"Wenn mehr als 1 Schnittstelle in Maschine gefunden wird, verwenden Sie eine " +"in diesem Netzwerk als wichtigsten" + +#: services/Vmware/VCLinkedCloneService.py:38 +msgid "Pub. Resource Pool" +msgstr "Kneipe. Ressourcenpool" + +#: services/Vmware/VCLinkedCloneService.py:38 +msgid "Resource Pool where deploy clones" +msgstr "Ressourcen-Pool in der Klone bereitgestellt" + +#: services/Vmware/VCLinkedCloneService.py:39 +msgid "Clones Folder" +msgstr "Klone Ordner" + +#: services/Vmware/VCLinkedCloneService.py:39 +msgid "Folder where deploy clones" +msgstr "Ordner wo bereitstellen Klone" + +#: services/Vmware/VCLinkedCloneService.py:40 +msgid "Resource Pool" +msgstr "Ressourcenpool" + +#: services/Vmware/VCLinkedCloneService.py:46 +msgid "Resource Pool containing base machine" +msgstr "Ressource Pool mit Basismaschine" + +#: services/Vmware/VCLinkedCloneService.py:48 +msgid "Base Machine" +msgstr "Grundmaschine" + +#: services/Vmware/VCLinkedCloneService.py:48 +msgid "Base machine for this service" +msgstr "Grundmaschine für diesen Dienst" + +#: services/Vmware/VCLinkedCloneService.py:49 +msgid "Memory (Mb)" +msgstr "Speicher (Mb)" + +#: services/Vmware/VCLinkedCloneService.py:50 +msgid "Memory for machines deployed from this service" +msgstr "Speicher für Maschinen, die von diesem Dienst bereitgestellt" + +#: services/Vmware/VCLinkedCloneService.py:51 +msgid "Datastores" +msgstr "Datastores" + +#: services/Vmware/VCLinkedCloneService.py:52 +msgid "Datastores where to put incrementals" +msgstr "Datastores wo inkrementelle Backups" + +#: services/Vmware/VCLinkedCloneService.py:53 +msgid "Machine Names" +msgstr "Computernamen" + +#: services/Vmware/VCLinkedCloneService.py:53 +msgid "Base name for clones from this machine" +msgstr "Basisname für Clones von diesem Computer" + +#: services/Vmware/VCLinkedCloneService.py:54 +msgid "Name Length" +msgstr "Länge des Dateinamens" + +#: services/Vmware/VCLinkedCloneService.py:55 +msgid "Length of numeric part for the names of this machines (betwen 3 and 6" +msgstr "" +"Länge der numerische Teil für die Namen dieser Maschinen (zwischen 3 und 6" + +#: services/Vmware/VCLinkedCloneService.py:62 +msgid "VMWare Linked clone base" +msgstr "VMWare Linked Clone-base" + +#: services/Vmware/VCLinkedCloneService.py:64 +msgid "" +"This service provides access to Linked Clones machines on a Virtual Center" +msgstr "" +"Dieser Service ermöglicht den Zugriff auf verknüpfte Clones Maschinen auf " +"einen Virtual Center" + +#: services/Vmware/VCLinkedCloneService.py:70 +msgid "Number of desired machines to keep running waiting for a user" +msgstr "" +"Anzahl der gewünschten Maschinen warten für einen Benutzer ausgeführt wird" + +#: services/Vmware/VCLinkedCloneService.py:72 +msgid "Number of desired machines to keep suspended waiting for use" +msgstr "" +"Anzahl der gewünschten Maschinen zu ausgesetzten Personen, die für die " +"Verwendung auf" + +#: services/Vmware/VCLinkedCloneService.py:93 +msgid "The length of basename plus length must not be greater than 15" +msgstr "Die Länge der Basename plus Länge darf nicht größer als 15 sein." + +#: services/Vmware/VCLinkedCloneService.py:95 +msgid "The machine name can't be only numbers" +msgstr "Der Computername kann nicht nur Zahlen sein." + +#: templates/404.html:4 templates/404.html.py:7 +msgid "Page not found" +msgstr "Seite nicht gefunden" + +#: templates/404.html:9 +msgid "Sorry, but the requested page could not be found." +msgstr "" +"Tut mir leid, aber die angeforderte Seite konnte nicht gefunden werden." + +#: templates/uds/base.html:7 +msgid "UDS" +msgstr "UDS" + +#: templates/uds/downloads.html:8 templates/uds/snippets/admin_user.html:7 +msgid "Downloads" +msgstr "Downloads" + +#: templates/uds/downloads.html:11 +msgid "" +"This page contains a list of downloadables provided by different modules" +msgstr "" +"Diese Seite enthält eine Liste der Downloads von verschiedenen Modulen " +"bereitgestellt" + +#: templates/uds/index.html:51 +msgid "Services" +msgstr "Dienstleistungen" + +#: templates/uds/index.html:70 +msgid "Java not found" +msgstr "Java nicht gefunden" + +#: templates/uds/index.html:71 +msgid "" +"Java is not available on your browser, and the selected transport needs it." +msgstr "" +"Java ist nicht verfügbar in Ihrem Browser, und der ausgewählte Transport " +"muss es." + +#: templates/uds/index.html:72 +msgid "Please, install latest version from" +msgstr "Bitte installieren Sie neueste Version von" + +#: templates/uds/index.html:72 +msgid "Java website" +msgstr "Java-website" + +#: templates/uds/index.html:72 +msgid "and restart browser" +msgstr "und Browser neu starten" + +#: templates/uds/index.html:78 +msgid "Ip" +msgstr "IP" + +#: templates/uds/index.html:79 +msgid "Networks" +msgstr "Netzwerke" + +#: templates/uds/index.html:80 +msgid "Transports" +msgstr "Transporte" + +#: templates/uds/internal_page.html:28 +msgid "User" +msgstr "Benutzer" + +#: templates/uds/internal_page.html:34 templates/uds/prefs.html:12 +msgid "Preferences" +msgstr "Einstellungen" + +#: templates/uds/internal_page.html:40 +msgid "Log out" +msgstr "Melden Sie sich ab" + +#: templates/uds/login.html:6 +msgid "Login to UDS" +msgstr "Anmeldung für UDS" + +#: templates/uds/login.html:78 +msgid "Login" +msgstr "Anmeldung" + +#: templates/uds/login.html:83 +msgid "Login data" +msgstr "Login-Daten" + +#: templates/uds/login.html:86 +msgid "Enter" +msgstr "Geben Sie" + +#: templates/uds/login.html:93 +msgid "Back to login" +msgstr "Zurück zur Anmeldung" + +#: templates/uds/prefs.html:6 +msgid "UDS User Preferences" +msgstr "UDS-Benutzereinstellungen" + +#: templates/uds/prefs.html:16 +msgid "Save Preferences" +msgstr "Speichern Sie Einstellungen" + +#: templates/uds/service_not_ready.html:6 +msgid "Service not ready at this moment. Please, try again in a while." +msgstr "" +"Service im Moment nicht bereit. Bitte, versuchen Sie es noch einmal in eine " +"Weile." + +#: templates/uds/snippets/admin_user.html:4 +msgid "Admin" +msgstr "Admin" + +#: templates/uds/snippets/back_to_list.html:3 +msgid "Back to services list" +msgstr "Zurück zur Liste" + +#: templates/uds/snippets/lang.html:9 +msgid "Language" +msgstr "Sprache" + +#: transports/NX/NXTransport.py:54 +msgid "NX Transport (direct)" +msgstr "NX Transport (direkt)" + +#: transports/NX/NXTransport.py:56 +msgid "NX Transport for direct connection" +msgstr "NX-Transport für den direkten Anschluss" + +#: transports/NX/NXTransport.py:60 transports/RDP/RDPTransport.py:36 +#: transports/RDP/TSRDPTransport.py:40 transports/RGS/RGSTransport.py:41 +#: transports/RGS/TRGSTransport.py:46 transports/TSNX/TSNXTransport.py:65 +msgid "Empty creds" +msgstr "Leere creds" + +#: transports/NX/NXTransport.py:60 transports/RDP/RDPTransport.py:36 +#: transports/RDP/TSRDPTransport.py:40 transports/RGS/RGSTransport.py:41 +#: transports/RGS/TRGSTransport.py:46 transports/TSNX/TSNXTransport.py:65 +msgid "If checked, the credentials used to connect will be emtpy" +msgstr "" +"Wenn diese Option aktiviert, werden die Anmeldeinformationen zum Herstellen " +"einer leer sein." + +#: transports/NX/NXTransport.py:61 transports/RDP/RDPTransport.py:37 +#: transports/RDP/TSRDPTransport.py:41 transports/RGS/RGSTransport.py:42 +#: transports/RGS/TRGSTransport.py:47 transports/TSNX/TSNXTransport.py:66 +msgid "If not empty, this username will be always used as credential" +msgstr "" +"Wenn nicht leer ist, dieser Benutzername wird immer als verwendet " +"Anmeldeinformationen" + +#: transports/NX/NXTransport.py:62 transports/RDP/RDPTransport.py:38 +#: transports/RDP/TSRDPTransport.py:42 transports/RGS/RGSTransport.py:43 +#: transports/RGS/TRGSTransport.py:48 transports/TSNX/TSNXTransport.py:67 +msgid "If not empty, this password will be always used as credential" +msgstr "" +"Wenn nicht leer ist, dieses Kennwort immer verwendet werden als " +"Anmeldeinformationen" + +#: transports/NX/NXTransport.py:63 transports/TSNX/TSNXTransport.py:68 +msgid "Listen port" +msgstr "-Listenanschluss" + +#: transports/NX/NXTransport.py:63 transports/TSNX/TSNXTransport.py:68 +msgid "Listening port of NX (ssh) at client machine" +msgstr "Hören Port des NX (ssh) bei Client-Rechner" + +#: transports/NX/NXTransport.py:64 transports/TSNX/TSNXTransport.py:69 +msgid "Connection" +msgstr "Verbindung" + +#: transports/NX/NXTransport.py:64 transports/TSNX/TSNXTransport.py:69 +msgid "Connection speed for this transport (quality)" +msgstr "Verbindungsgeschwindigkeit für diesen Transport (Qualität)" + +#: transports/NX/NXTransport.py:71 transports/TSNX/TSNXTransport.py:76 +msgid "Session" +msgstr "Sitzung" + +#: transports/NX/NXTransport.py:71 transports/TSNX/TSNXTransport.py:76 +msgid "Desktop session" +msgstr "Desktop-Sitzung" + +#: transports/NX/NXTransport.py:76 transports/TSNX/TSNXTransport.py:81 +msgid "Disk Cache" +msgstr "Festplatten-Cache" + +#: transports/NX/NXTransport.py:76 transports/TSNX/TSNXTransport.py:81 +msgid "Cache size en Mb stored at disk" +msgstr "Cache-Größe de Mb auf der Festplatte gespeichert" + +#: transports/NX/NXTransport.py:84 transports/TSNX/TSNXTransport.py:89 +msgid "Memory Cache" +msgstr "Memory-Caches" + +#: transports/NX/NXTransport.py:84 transports/TSNX/TSNXTransport.py:89 +msgid "Cache size en Mb keept at memory" +msgstr "Cache Größe de Mb Keept auf Speicher" + +#: transports/NX/__init__.py:42 transports/TSNX/__init__.py:42 +msgid "NX Protocol" +msgstr "NX-Protokoll" + +#: transports/NX/__init__.py:48 +msgid "UDS Actor connector for NX (requires nomachine packages)" +msgstr "UDS Schauspieler Connector für NX (erfordert Nomachine Pakete)" + +#: transports/NX/web.py:74 +msgid "" +"In order to use this transport, you need to install first Nomachine Nx " +"Client version 3.5.x" +msgstr "" +"Um diesen Transport verwenden, müssen Sie installieren ersten Nomachine Nx " +"Client Version 3.5.x" + +#: transports/NX/web.py:75 +msgid "you can obtain it for your platform from" +msgstr "Sie können es für Ihre Plattform von abrufen" + +#: transports/NX/web.py:75 +msgid "nochamine web site" +msgstr "Nochamine-Website" + +#: transports/RDP/RDPTransport.py:30 +msgid "RDP Transport (direct)" +msgstr "RDP Transport (direkt)" + +#: transports/RDP/RDPTransport.py:32 +msgid "RDP Transport for direct connection" +msgstr "RDP-Transport für den direkten Anschluss" + +#: transports/RDP/RDPTransport.py:39 transports/RDP/TSRDPTransport.py:43 +#: transports/RGS/RGSTransport.py:44 transports/RGS/TRGSTransport.py:49 +msgid "" +"If not empty, this domain will be always used as credential (used as DOMAIN" +"\\user)" +msgstr "" +"Wenn nicht leer ist, dieser Domäne immer verwendet werden als " +"Anmeldeinformationen (als DOMAIN verwendet\\Benutzer)" + +#: transports/RDP/RDPTransport.py:40 transports/RDP/TSRDPTransport.py:44 +msgid "Allow Smartcards" +msgstr "Ermöglichen Smartcards" + +#: transports/RDP/RDPTransport.py:40 transports/RDP/TSRDPTransport.py:44 +msgid "If checked, this transport will allow the use of smartcards" +msgstr "" +"Wenn aktiviert, wird dieser Transport ermöglichen die Verwendung von " +"smartcards" + +#: transports/RDP/RDPTransport.py:41 transports/RDP/TSRDPTransport.py:45 +msgid "Allow Printers" +msgstr "Druckerveröffentlichung zulassen" + +#: transports/RDP/RDPTransport.py:41 transports/RDP/TSRDPTransport.py:45 +msgid "If checked, this transport will allow the use of user printers" +msgstr "" +"Wenn diese Option aktiviert, wird dieser Transport die Verwendung von " +"Benutzer Drucker ermöglichen." + +#: transports/RDP/RDPTransport.py:42 transports/RDP/TSRDPTransport.py:46 +msgid "Allow Drives" +msgstr "Laufwerke ermöglichen" + +#: transports/RDP/RDPTransport.py:42 transports/RDP/TSRDPTransport.py:46 +msgid "If checked, this transport will allow the use of user drives" +msgstr "" +"Wenn aktiviert, wird dieser Transport die Verwendung von Benutzer-Laufwerke " +"erlauben." + +#: transports/RDP/RDPTransport.py:43 transports/RDP/TSRDPTransport.py:47 +msgid "Allow Serials" +msgstr "Ermöglichen Serien" + +#: transports/RDP/RDPTransport.py:43 transports/RDP/TSRDPTransport.py:47 +msgid "If checked, this transport will allow the use of user serial ports" +msgstr "" +"Wenn aktiviert, wird dieser Transport die Verwendung des Benutzers erlauben " +"serielle ports" + +#: transports/RDP/TSRDPTransport.py:31 +msgid "RDP Transport (tunneled)" +msgstr "RDP-Verkehr (Tunneling)" + +#: transports/RDP/TSRDPTransport.py:33 +msgid "RDP Transport for tunneled connection" +msgstr "RDP-Verkehr für getunnelte Verbindung" + +#: transports/RDP/TSRDPTransport.py:37 transports/RGS/TRGSTransport.py:43 +#: transports/TSNX/TSNXTransport.py:62 +msgid "Tunnel server" +msgstr "Tunnel-server" + +#: transports/RDP/TSRDPTransport.py:37 transports/RGS/TRGSTransport.py:43 +#: transports/TSNX/TSNXTransport.py:62 +msgid "" +"IP or Hostname of tunnel server send to client device (\"public\" ip) and " +"port. (use HOST:PORT format)" +msgstr "" +"IP-Adresse oder Hostname des Tunnel-Server senden an Client-Gerät " +"(\"öffentliche\" IP-Adresse) und Port. (verwenden Sie HOST: PORT-Format)" + +#: transports/RDP/TSRDPTransport.py:38 transports/RGS/TRGSTransport.py:44 +#: transports/TSNX/TSNXTransport.py:63 +msgid "Tunnel host check" +msgstr "Tunnel Host-Prüfung" + +#: transports/RDP/TSRDPTransport.py:38 transports/RGS/TRGSTransport.py:44 +#: transports/TSNX/TSNXTransport.py:63 +msgid "" +"If not empty, this server will be used to check if service is running before " +"assigning it to user. (use HOST:PORT format)" +msgstr "" +"Wenn nicht leer ist, wird dieser Server zu überprüfen, ob der Dienst " +"ausgeführt wird, bevor Sie verwendet werden Benutzer zuweisen. (verwenden " +"Sie HOST: PORT-Format)" + +#: transports/RDP/__init__.py:20 +msgid "Remote Desktop Protocol" +msgstr "Remote Desktop-Protokoll" + +#: transports/RDP/web.py:83 +msgid "In order to use this service, you should first install CoRD." +msgstr "Um diesen Dienst zu nutzen, sollten Sie zunächst Kabel installieren." + +#: transports/RDP/web.py:84 transports/RGS/web.py:82 +msgid "You can obtain it from" +msgstr "Erhalten Sie es aus" + +#: transports/RDP/web.py:84 +msgid "CoRD Website" +msgstr "CoRD-Website" + +#: transports/RGS/RGSTransport.py:34 +#, fuzzy +msgid "RGS Transport (direct)" +msgstr "RDP Transport (direkt)" + +#: transports/RGS/RGSTransport.py:36 +#, fuzzy +msgid "RGS Transport for direct connection" +msgstr "RDP-Transport für den direkten Anschluss" + +#: transports/RGS/RGSTransport.py:45 transports/RGS/TRGSTransport.py:50 +msgid "Image quality" +msgstr "Bildqualität" + +#: transports/RGS/RGSTransport.py:46 transports/RGS/TRGSTransport.py:51 +msgid "Quality of image codec (0-100)" +msgstr "Qualität der Image-Codec (0-100)" + +#: transports/RGS/RGSTransport.py:47 transports/RGS/TRGSTransport.py:52 +msgid "Adjustable Quality" +msgstr "Einstellbare Qualität" + +#: transports/RGS/RGSTransport.py:48 transports/RGS/TRGSTransport.py:53 +msgid "If checked, the image quality will be adjustable with bandwidth" +msgstr "" +"Wenn diese Option aktiviert, wird die Bildqualität mit Bandbreite " +"einstellbar sein" + +#: transports/RGS/RGSTransport.py:49 transports/RGS/TRGSTransport.py:54 +msgid "Min. Adjustable Quality" +msgstr "Min. einstellbare Qualität" + +#: transports/RGS/RGSTransport.py:50 transports/RGS/TRGSTransport.py:55 +msgid "" +"The lowest image quality applied to images to maintain the minimum update " +"rate." +msgstr "" +"Die niedrigsten Bildqualität auf Bilder beibehalten das minimale Update " +"angewendet Preise." + +#: transports/RGS/RGSTransport.py:51 transports/RGS/TRGSTransport.py:56 +msgid "Adjustable Frame Rate" +msgstr "Einstellbare Framerate" + +#: transports/RGS/RGSTransport.py:52 transports/RGS/TRGSTransport.py:57 +msgid "Update rate threshold to begin adjusting image quality" +msgstr "Update-Rate Schwellenwert beginnen, Anpassen der Bildqualität" + +#: transports/RGS/RGSTransport.py:53 transports/RGS/TRGSTransport.py:58 +msgid "Match Local Resolution" +msgstr "Spiel Ortsauflösung" + +#: transports/RGS/RGSTransport.py:54 transports/RGS/TRGSTransport.py:59 +msgid "" +"Change the Sender's resolution to match the Receiver's resolution when " +"connecting" +msgstr "" +"Ändern des Absenders Auflösung Auflösung des Empfängers übereinstimmen wenn " +"verbinden" + +#: transports/RGS/RGSTransport.py:55 transports/RGS/TRGSTransport.py:60 +msgid "Redirect USB" +msgstr "Umleitung USB" + +#: transports/RGS/RGSTransport.py:56 transports/RGS/TRGSTransport.py:61 +msgid "If checked, the USB will be redirected." +msgstr "Wenn diese Option aktiviert, wird die USB umgeleitet werden." + +#: transports/RGS/RGSTransport.py:57 transports/RGS/TRGSTransport.py:62 +msgid "Redirect Audio" +msgstr "Audio umleiten" + +#: transports/RGS/RGSTransport.py:58 transports/RGS/TRGSTransport.py:63 +#, fuzzy +msgid "If checked, the Audio will be redirected." +msgstr "" +"Wenn diese Option aktiviert, werden die Anmeldeinformationen zum Herstellen " +"einer leer sein." + +#: transports/RGS/RGSTransport.py:59 transports/RGS/TRGSTransport.py:64 +msgid "Redirect Mic" +msgstr "Umleitung Mic" + +#: transports/RGS/RGSTransport.py:60 transports/RGS/TRGSTransport.py:65 +#, fuzzy +msgid "If checked, the Mic will be redirected." +msgstr "" +"Wenn diese Option aktiviert, werden die Anmeldeinformationen zum Herstellen " +"einer leer sein." + +#: transports/RGS/TRGSTransport.py:36 +#, fuzzy +msgid "RGS Transport (tunneled)" +msgstr "RDP-Verkehr (Tunneling)" + +#: transports/RGS/TRGSTransport.py:38 +#, fuzzy +msgid "RGS Transport for tunneled connection" +msgstr "RDP-Verkehr für getunnelte Verbindung" + +#: transports/RGS/web.py:81 +#, fuzzy +msgid "In order to use this service, you should first install RGS Receiver." +msgstr "Um diesen Dienst zu nutzen, sollten Sie zunächst Kabel installieren." + +#: transports/RGS/web.py:82 +#, fuzzy +msgid "HP Website" +msgstr "CoRD-Website" + +#: transports/TSNX/TSNXTransport.py:55 +msgid "NX Transport (tunneled)" +msgstr "NX-Transport (Tunneling)" + +#: transports/TSNX/TSNXTransport.py:57 +msgid "NX Transport for tunneled connection" +msgstr "NX-Transport für getunnelte Verbindung" + +#: web/errors.py:53 +msgid "Unknown error" +msgstr "Unbekannter Fehler" + +#: web/errors.py:54 +msgid "Transport not found" +msgstr "Verkehr nicht gefunden" + +#: web/errors.py:55 +msgid "Service not found" +msgstr "-Dienst nicht gefunden" + +#: web/errors.py:56 xmlrpc/auths/AdminAuth.py:147 +msgid "Access denied" +msgstr "Zugriff verweigert" + +#: web/errors.py:57 +msgid "" +"Invalid service. The service is not available at this moment. Please, try " +"later" +msgstr "" +"Ungültiger Service. Der Dienst ist nicht verfügbar im Moment. Bitte, " +"versuchen Sie später" + +#: web/errors.py:58 +msgid "Maximum services limit reached. Please, contact administrator" +msgstr "Maximale Service Limit erreicht. Bitte kontaktieren Sie administrator" + +#: web/errors.py:59 +msgid "You need to enable cookies to let this application work" +msgstr "Sie müssen Cookies, diese Anwendung arbeiten lassen aktivieren" + +#: web/errors.py:60 +msgid "User service not found" +msgstr "Benutzer-Dienst nicht gefunden" + +#: web/forms/LoginForm.py:61 +msgid "Authenticator" +msgstr "Authentifikator" + +#: xmlrpc/auths/AdminAuth.py:91 +msgid "Credentials no longer valid" +msgstr "Anmeldeinformationen nicht mehr gültig" + +#: xmlrpc/auths/AdminAuth.py:125 +msgid "Administration" +msgstr "Verwaltung" + +#: xmlrpc/auths/AdminAuth.py:140 +msgid "Invalid credentials" +msgstr "Ungültiger Anmeldeinformationen" + +#: xmlrpc/auths/AdminAuth.py:145 +msgid "Invalid authenticator" +msgstr "Ungültige Echtheitsbestätigung" + +#: xmlrpc/auths/Authenticators.py:104 +msgid "Authenticator does not exists" +msgstr "Authentifikator ist nicht vorhanden" + +#: xmlrpc/auths/Authenticators.py:158 xmlrpc/osmanagers/OSManagers.py:115 +#: xmlrpc/services/ServiceProviders.py:115 xmlrpc/services/Services.py:159 +#: xmlrpc/transports/Networks.py:86 xmlrpc/transports/Networks.py:97 +#, python-format +msgid "Name %s already exists" +msgstr "Name %s existiert bereits" + +#: xmlrpc/auths/Authenticators.py:229 +msgid "Authenticator do not supports search" +msgstr "Authentifikator ist nicht vorhanden" + +#: xmlrpc/auths/Authenticators.py:235 +msgid "Specified authenticator do not exists anymore. Please, reload gui" +msgstr "" +"Angegebenen Authentifikator tun ist nicht mehr vorhanden. Bitte laden gui" + +#: xmlrpc/auths/Authenticators.py:239 +msgid "BUG: Reached a point that should never have been reached!!!" +msgstr "BUG: Erreicht einen Punkt, der nie zustande gekommen sind, sollten!!!" + +#: xmlrpc/osmanagers/OSManagers.py:129 +msgid "This os mnager is being used by deployed services" +msgstr "Diese os Mnager ist von bereitgestellten Dienste verwendet wird" + +#: xmlrpc/osmanagers/OSManagers.py:145 +msgid "There is deployed services using this os manager" +msgstr "Es gibt bereitgestellten Dienste mit dieser os-manager" + +#: xmlrpc/osmanagers/OSManagers.py:147 +msgid "Can't find os manager" +msgstr "Nicht os Manager gefunden" + +#: xmlrpc/services/DeployedServices.py:52 +msgid "Unknown" +msgstr "Unbekannt" + +#: xmlrpc/services/DeployedServices.py:112 +#: xmlrpc/services/DeployedServices.py:176 +#: xmlrpc/services/DeployedServices.py:195 +#: xmlrpc/services/DeployedServices.py:211 +#: xmlrpc/services/DeployedServices.py:225 +#: xmlrpc/services/DeployedServices.py:252 +#: xmlrpc/services/DeployedServices.py:266 +msgid "Deployed Service does not exists" +msgstr "Bereitgestellten Diensts ist nicht vorhanden" + +#: xmlrpc/services/DeployedServices.py:209 +msgid "Group does not exists" +msgstr "Gruppe existiert nicht" + +#: xmlrpc/services/DeployedServices.py:237 +msgid "Can't find deployed service" +msgstr "Bereitgestellte Dienst nicht gefunden werden." + +#: xmlrpc/services/DeployedServices.py:250 +msgid "Transport does not exists" +msgstr "Verkehr ist nicht vorhanden" + +#: xmlrpc/services/DeployedServices.py:281 +msgid "Deployed service does not exists" +msgstr "Bereitgestellten Diensts ist nicht vorhanden" + +#: xmlrpc/services/ServiceProviders.py:142 +msgid "Can't delete service provider with services associated" +msgstr "Service-Provider kann nicht mit verbundenen Services gelöscht werden" + +#: xmlrpc/services/ServiceProviders.py:145 +msgid "Can't locate the service provider" +msgstr "Der Diensteanbieter kann nicht gefunden werden." + +#: xmlrpc/services/ServiceProviders.py:145 xmlrpc/services/Services.py:189 +#: xmlrpc/transports/Networks.py:70 xmlrpc/transports/Networks.py:78 +#: xmlrpc/transports/Networks.py:95 +msgid "Please, refresh interface" +msgstr "Bitte aktualisieren Sie Schnittstelle" + +#: xmlrpc/services/Services.py:186 +msgid "Can't delete services with deployed services associated" +msgstr "" +"Dienstleistungen mit bereitgestellten Leistungen können nicht gelöscht " +"werden." + +#: xmlrpc/services/Services.py:189 +msgid "Can't locate the service" +msgstr "Der Dienst kann nicht gesucht werden." + +#: xmlrpc/services/UserDeployedServices.py:94 +#: xmlrpc/services/UserDeployedServices.py:110 +msgid "The deployed service is not active" +msgstr "Der bereitgestellte Dienst ist nicht aktiv" + +#: xmlrpc/services/UserDeployedServices.py:97 +#: xmlrpc/services/UserDeployedServices.py:113 +msgid "This service don't allows assignations" +msgstr "Dieser Dienst nicht ermöglicht Forderungsabtretungen" + +#: xmlrpc/services/UserDeployedServices.py:102 +#: xmlrpc/services/UserDeployedServices.py:120 +msgid "Deployed service not found!!! (refresh interface)" +msgstr "Bereitgestellte Dienst nicht gefunden!!! (Aktualisieren Schnittstelle)" + +#: xmlrpc/services/UserDeployedServices.py:122 +msgid "User not found!!! (refresh interface)" +msgstr "Benutzer nicht gefunden!!! (Aktualisieren Schnittstelle)" + +#: xmlrpc/services/UserDeployedServices.py:141 +msgid "No error" +msgstr "Unbekannter Fehler" + +#: xmlrpc/services/UserDeployedServices.py:147 +msgid "User deployed service not found!!!" +msgstr "Benutzer-Dienst nicht gefunden" + +#: xmlrpc/transports/Networks.py:70 +msgid "Can't locate the transport" +msgstr "Den Transport kann nicht gefunden werden." + +#: xmlrpc/transports/Networks.py:78 xmlrpc/transports/Networks.py:95 +msgid "Can't locate the network" +msgstr "Das Netzwerk kann nicht gefunden werden." + +#~ msgid "Base Service" +#~ msgstr "Basisdienst" + +#~ msgid "None" +#~ msgstr "Keine" diff --git a/server/src/uds/locale/es/LC_MESSAGES/django.po b/server/src/uds/locale/es/LC_MESSAGES/django.po new file mode 100644 index 000000000..1e17ea7d3 --- /dev/null +++ b/server/src/uds/locale/es/LC_MESSAGES/django.po @@ -0,0 +1,1531 @@ +# Translations for spanish +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# Adolfo Gómez , 2012. +# +# , 2011. +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-07-12 21:26+0200\n" +"PO-Revision-Date: 2011-12-21 01:56+0100\n" +"Last-Translator: \n" +"Language-Team: Spanish \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"X-Generator: Lokalize 1.2\n" + +#: auths/ActiveDirectory/Authenticator.py:29 +#: auths/EDirectory/Authenticator.py:60 auths/RegexLdap/Authenticator.py:51 +#: auths/SimpleLDAP/Authenticator.py:49 +#: services/Vmware/ServiceProviderVC.py:28 +msgid "Host" +msgstr "Servidor " + +#: auths/ActiveDirectory/Authenticator.py:29 +#: auths/EDirectory/Authenticator.py:60 auths/RegexLdap/Authenticator.py:51 +#: auths/SimpleLDAP/Authenticator.py:49 +#: services/Vmware/ServiceProviderVC.py:28 +msgid "VMWare VC Server IP or Hostname" +msgstr "IP o nombre DNS del servidor VMWare VC" + +#: auths/ActiveDirectory/Authenticator.py:30 +#: auths/EDirectory/Authenticator.py:62 auths/RegexLdap/Authenticator.py:53 +#: auths/SimpleLDAP/Authenticator.py:51 +msgid "Use SSL" +msgstr "Usar SSL" + +#: auths/ActiveDirectory/Authenticator.py:30 +msgid "If checked, will use a ssl connection to Active Directory" +msgstr "Si está activada, utilizará una conexión ssl con Active Directory" + +#: auths/ActiveDirectory/Authenticator.py:31 +#: auths/RegexLdap/Authenticator.py:54 auths/SimpleLDAP/Authenticator.py:52 +msgid "Ldap User" +msgstr "Usuario LDAP" + +#: auths/ActiveDirectory/Authenticator.py:31 +msgid "" +"Username with read privileges on the base selected (use USER@DOMAIN.DOM form " +"for this)" +msgstr "" +"Usuario con derechos de lectura en la base seleccionada (utilice la forma " +"USUARIO@DOMINIO.DOM para este elemento)" + +#: auths/ActiveDirectory/Authenticator.py:32 +#: auths/ActiveDirectory/Authenticator.py:50 +#: auths/EDirectory/Authenticator.py:64 auths/RegexLdap/Authenticator.py:55 +#: auths/RegexLdap/Authenticator.py:78 auths/SimpleLDAP/Authenticator.py:53 +#: auths/SimpleLDAP/Authenticator.py:77 +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:31 +#: services/Vmware/ServiceProviderVC.py:31 transports/NX/NXTransport.py:62 +#: transports/RDP/RDPTransport.py:38 transports/RDP/TSRDPTransport.py:42 +#: transports/RGS/RGSTransport.py:43 transports/RGS/TRGSTransport.py:48 +#: transports/TSNX/TSNXTransport.py:67 web/forms/LoginForm.py:60 +msgid "Password" +msgstr "Contraseña" + +#: auths/ActiveDirectory/Authenticator.py:32 +#: auths/EDirectory/Authenticator.py:64 auths/RegexLdap/Authenticator.py:55 +#: auths/SimpleLDAP/Authenticator.py:53 +msgid "Password of the ldap user" +msgstr "Contraseña del usuario del ldap" + +#: auths/ActiveDirectory/Authenticator.py:33 +#: auths/EDirectory/Authenticator.py:65 auths/RegexLdap/Authenticator.py:56 +#: auths/SimpleLDAP/Authenticator.py:54 +#: services/Vmware/ServiceProviderVC.py:32 +msgid "Timeout" +msgstr "Espera " + +#: auths/ActiveDirectory/Authenticator.py:33 +#: auths/EDirectory/Authenticator.py:65 auths/RegexLdap/Authenticator.py:56 +#: auths/SimpleLDAP/Authenticator.py:54 +msgid "Timeout in seconds of connection to LDAP" +msgstr "Tiempo de espera en segundos" + +#: auths/ActiveDirectory/Authenticator.py:35 +msgid "Active Directory Authenticator" +msgstr "Autenticador Active Directory" + +#: auths/ActiveDirectory/Authenticator.py:37 +#, fuzzy +msgid "Authenticate against Active Directory" +msgstr "Autenticador Active Directory" + +#: auths/ActiveDirectory/Authenticator.py:46 +#: auths/EDirectory/Authenticator.py:77 auths/RegexLdap/Authenticator.py:74 +#: auths/SimpleLDAP/Authenticator.py:73 +#: services/Vmware/ServiceProviderVC.py:30 transports/NX/NXTransport.py:61 +#: transports/RDP/RDPTransport.py:37 transports/RDP/TSRDPTransport.py:41 +#: transports/RGS/RGSTransport.py:42 transports/RGS/TRGSTransport.py:47 +#: transports/TSNX/TSNXTransport.py:66 web/forms/LoginForm.py:59 +msgid "Username" +msgstr "Usuario" + +#: auths/ActiveDirectory/Authenticator.py:48 +#: auths/EDirectory/Authenticator.py:79 auths/RegexLdap/Authenticator.py:76 +#: auths/SimpleLDAP/Authenticator.py:75 +msgid "Group" +msgstr "Grupo" + +#: auths/ActiveDirectory/Authenticator.py:61 +#: auths/ActiveDirectory/Authenticator.py:395 +msgid "Must specify the username in the form USERNAME@DOMAIN.DOM" +msgstr "" +"Debe especificar el nombre de usuario en la forma NOMBREUSUARIO@DOMINIO.DOM" + +#: auths/ActiveDirectory/Authenticator.py:127 +#: auths/EDirectory/Authenticator.py:123 auths/RegexLdap/Authenticator.py:157 +#: auths/SimpleLDAP/Authenticator.py:158 +msgid "Ldap connection error: " +msgstr "Error de conexión al ldap: " + +#: auths/ActiveDirectory/Authenticator.py:299 +#: auths/ActiveDirectory/Authenticator.py:345 +#: auths/EDirectory/Authenticator.py:243 auths/EDirectory/Authenticator.py:286 +#: auths/RegexLdap/Authenticator.py:244 auths/RegexLdap/Authenticator.py:287 +#: auths/SimpleLDAP/Authenticator.py:268 auths/SimpleLDAP/Authenticator.py:312 +msgid "Username not found" +msgstr "Nombre de usuario no hallado" + +#: auths/ActiveDirectory/Authenticator.py:332 +#: auths/SimpleLDAP/Authenticator.py:301 +msgid "Group not found" +msgstr "Grupo no hallado" + +#: auths/ActiveDirectory/Authenticator.py:364 +#: auths/ActiveDirectory/Authenticator.py:381 +#: auths/EDirectory/Authenticator.py:303 auths/RegexLdap/Authenticator.py:305 +#: auths/SimpleLDAP/Authenticator.py:327 auths/SimpleLDAP/Authenticator.py:341 +msgid "Too many results, be more specific" +msgstr "Demasiados resultados, sea más específico" + +#: auths/ActiveDirectory/Authenticator.py:404 +msgid "Domain seems to be incorrect, please check it" +msgstr "El dominio parece ser incorrecto, por favor, compruebelo" + +#: auths/ActiveDirectory/Authenticator.py:409 +msgid "Ldap does not seem an Active Directory (do not have user objects)" +msgstr "" +"El ldap indicado no parece un Active Directory (no tiene objetos de usuario)" + +#: auths/ActiveDirectory/Authenticator.py:417 +msgid "Ldap does not seem an Active Directory (no not have group objects)" +msgstr "" +"El ldap indicado no parece un Active Directory (no no tienen objetos de " +"grupo)" + +#: auths/ActiveDirectory/Authenticator.py:425 +msgid "" +"Ldap does not seem an Active Directory (do not have any user nor groups)" +msgstr "" +"El ldap indicado no parece un Active Directory (no tiene ningún usuario ni " +"grupo)" + +#: auths/ActiveDirectory/Authenticator.py:430 +#: auths/EDirectory/Authenticator.py:358 auths/RegexLdap/Authenticator.py:380 +#: auths/SimpleLDAP/Authenticator.py:422 +msgid "Connection params seem correct, test was succesfully executed" +msgstr "" +"Los parámetros de conexión parecen correctos, la prueba fue ejecutado con " +"exito" + +#: auths/EDirectory/Authenticator.py:61 auths/RegexLdap/Authenticator.py:52 +#: auths/SimpleLDAP/Authenticator.py:50 +#: services/Vmware/ServiceProviderVC.py:29 +msgid "Port" +msgstr "Puerto" + +#: auths/EDirectory/Authenticator.py:61 auths/RegexLdap/Authenticator.py:52 +#: auths/SimpleLDAP/Authenticator.py:50 +msgid "Ldap port (389 for non ssl, 636 for ssl normally" +msgstr "Puerto LDAP (389 para no SSL, 636 para ssl normalmente)" + +#: auths/EDirectory/Authenticator.py:62 auths/RegexLdap/Authenticator.py:53 +#: auths/SimpleLDAP/Authenticator.py:51 +msgid "" +"If checked, will use a ssl connection to ldap (if port is 389, will use in " +"fact port 636)" +msgstr "" +"Si está activada, utilizará una conexión ssl con ldap (si el puerto es 389, " +"utilizará de hecho el Puerto 636)" + +#: auths/EDirectory/Authenticator.py:63 +#, fuzzy +msgid "Admin user" +msgstr "Admin" + +#: auths/EDirectory/Authenticator.py:63 +#, fuzzy +msgid "Username with read privileges on the eDirectory" +msgstr "Usuario con privilegios de lectura en la base elegida" + +#: auths/EDirectory/Authenticator.py:67 +#, fuzzy +msgid "eDirectory Authenticator" +msgstr "Autenticador Active Directory" + +#: auths/EDirectory/Authenticator.py:69 +#, fuzzy +msgid "Authenticate against eDirectory" +msgstr "Autenticador Active Directory" + +#: auths/EDirectory/Authenticator.py:323 auths/RegexLdap/Authenticator.py:325 +#: auths/SimpleLDAP/Authenticator.py:362 +msgid "Ldap search base is incorrect" +msgstr "La base de búsqueda ldap es incorrecta" + +#: auths/EDirectory/Authenticator.py:328 auths/RegexLdap/Authenticator.py:330 +#: auths/SimpleLDAP/Authenticator.py:367 +msgid "Ldap user class seems to be incorrect (no user found by that class)" +msgstr "" +"La clase de usuario de LDAP parece ser incorrecta (ningún usuario encontrado " +"por esa clase)" + +#: auths/EDirectory/Authenticator.py:336 auths/RegexLdap/Authenticator.py:346 +#: auths/SimpleLDAP/Authenticator.py:383 +msgid "" +"Ldap user id attribute seems to be incorrect (no user found by that " +"attribute)" +msgstr "" +"El atributo de id de usuario de ldap parece ser incorrecto (ningún usuario " +"encontrado por atributo)" + +#: auths/EDirectory/Authenticator.py:344 +msgid "Expected group attribute " +msgstr "Atributo de grupo esperado " + +#: auths/EDirectory/Authenticator.py:353 +#, fuzzy +msgid "" +"Ldap user class or user id attr is probably wrong (Ldap is an eDirectory?)" +msgstr "" +"El atributo del id de usuario o la clase de usuario LDAP son probablemente " +"incorrectos(no se puede encontrar ningún usuario con ambas condiciones)" + +#: auths/IP/Authenticator.py:45 auths/IP/Authenticator.py:47 +msgid "IP Authenticator" +msgstr "Autenticador por IP" + +#: auths/IP/Authenticator.py:51 +msgid "IP" +msgstr "IP " + +#: auths/IP/Authenticator.py:52 +msgid "IP Range" +msgstr "Intervalo IP" + +#: auths/IP/Authenticator.py:99 auths/InternalDB/Authenticator.py:94 +msgid "All seems fine in the authenticator." +msgstr "Parace que todo funciona correctamente en el autenticador. " + +#: auths/InternalDB/Authenticator.py:46 +msgid "Internal Database" +msgstr "Base de datos interna" + +#: auths/InternalDB/Authenticator.py:48 +msgid "Internal dabasase authenticator. Doesn't uses external sources" +msgstr "Dabasase interna autenticador. No utiliza fuentes externas" + +#: auths/InternalDB/Authenticator.py:91 +msgid "Internal structures seems ok" +msgstr "Las estructuras internas parecen correctas" + +#: auths/RegexLdap/Authenticator.py:54 auths/SimpleLDAP/Authenticator.py:52 +msgid "Username with read privileges on the base selected" +msgstr "Usuario con privilegios de lectura en la base elegida" + +#: auths/RegexLdap/Authenticator.py:57 auths/SimpleLDAP/Authenticator.py:55 +msgid "Base" +msgstr "Base" + +#: auths/RegexLdap/Authenticator.py:57 auths/SimpleLDAP/Authenticator.py:55 +msgid "Common search base (used for \"users\" and \"groups\"" +msgstr "Base de búsqueda común (utilizado para \"los usuarios\" y \"grupos\"" + +#: auths/RegexLdap/Authenticator.py:58 auths/SimpleLDAP/Authenticator.py:56 +msgid "User class" +msgstr "Clase de usuario" + +#: auths/RegexLdap/Authenticator.py:58 auths/SimpleLDAP/Authenticator.py:56 +msgid "Class for LDAP users (normally posixAccount)" +msgstr "Clase para los usuarios de LDAP (normalmente posixAccount)" + +#: auths/RegexLdap/Authenticator.py:59 auths/SimpleLDAP/Authenticator.py:57 +msgid "User Id Attr" +msgstr "Attr. de Id de usuario" + +#: auths/RegexLdap/Authenticator.py:59 auths/SimpleLDAP/Authenticator.py:57 +msgid "Attribute that contains the user id" +msgstr "Atributo que contiene el identificador de usuario" + +#: auths/RegexLdap/Authenticator.py:60 auths/SimpleLDAP/Authenticator.py:58 +msgid "User Name Attr" +msgstr "Attr. de nombre usu." + +#: auths/RegexLdap/Authenticator.py:60 auths/SimpleLDAP/Authenticator.py:58 +msgid "Attributes that contains the user name (list of comma separated values)" +msgstr "" +"Atributos que contienen el nombre de usuario (lista de valores separados por " +"comas)" + +#: auths/RegexLdap/Authenticator.py:61 +msgid "Group Name Attr" +msgstr "Atr. de nombre de Grupo" + +#: auths/RegexLdap/Authenticator.py:61 +msgid "Attribute that contains the group name" +msgstr "Atributo que contiene el nombre del grupo" + +#: auths/RegexLdap/Authenticator.py:62 +msgid "Regular Exp. for groups" +msgstr "EXP. regular para grupos" + +#: auths/RegexLdap/Authenticator.py:62 +msgid "Regular Expression to extract the group name" +msgstr "Expresión regular para extraer el nombre del grupo" + +#: auths/RegexLdap/Authenticator.py:64 +msgid "Regex LDAP Authenticator" +msgstr "Autenticador Regex LDAP" + +#: auths/RegexLdap/Authenticator.py:66 +msgid "Regular Expressions LDAP authenticator" +msgstr "Autenticador LDAP de expresiones regulares" + +#: auths/RegexLdap/Authenticator.py:338 auths/SimpleLDAP/Authenticator.py:375 +msgid "Ldap group class seems to be incorrect (no group found by that class)" +msgstr "" +"La clase de grupo LDAP parece ser incorrecta (ningún grupo encontrado por " +"esa clase)" + +#: auths/RegexLdap/Authenticator.py:356 auths/SimpleLDAP/Authenticator.py:391 +msgid "" +"Ldap group id attribute seems to be incorrect (no group found by that " +"attribute)" +msgstr "" +"Atributo de id de grupo ldap parece ser incorrecto (ningún grupo encontrado " +"por atributo)" + +#: auths/RegexLdap/Authenticator.py:365 auths/SimpleLDAP/Authenticator.py:400 +msgid "" +"Ldap user class or user id attr is probably wrong (can't find any user with " +"both conditions)" +msgstr "" +"El atributo del id de usuario o la clase de usuario LDAP son probablemente " +"incorrectos(no se puede encontrar ningún usuario con ambas condiciones)" + +#: auths/SimpleLDAP/Authenticator.py:59 +msgid "Group class" +msgstr "Clase de grupo" + +#: auths/SimpleLDAP/Authenticator.py:59 +msgid "Class for LDAP groups (normally poxisGroup)" +msgstr "Clase de grupos LDAP (normalmente poxisGroup)" + +#: auths/SimpleLDAP/Authenticator.py:60 +msgid "Group Id Attr" +msgstr "Atr. id de Grupo" + +#: auths/SimpleLDAP/Authenticator.py:60 +msgid "Attribute that contains the group id" +msgstr "Atributo que contiene el id de grupo" + +#: auths/SimpleLDAP/Authenticator.py:61 +msgid "Group membership attr" +msgstr "Atr. de pertenencia de grupo" + +#: auths/SimpleLDAP/Authenticator.py:61 +msgid "Attribute of the group that contains the users belonging to it" +msgstr "Atributo del grupo que contiene los usuarios pertenecientes al mismo" + +#: auths/SimpleLDAP/Authenticator.py:63 +msgid "SimpleLDAP Authenticator" +msgstr "Autenticador LDAP Simple" + +#: auths/SimpleLDAP/Authenticator.py:65 +msgid "Simple LDAP authenticator" +msgstr "Autenticador LDAP Simple" + +#: auths/SimpleLDAP/Authenticator.py:409 +msgid "" +"Ldap group class or group id attr is probably wrong (can't find any group " +"with both conditions)" +msgstr "" +"El atributo del identificador de clase o grupo de grupo LDAP son " +"probablemente incorrectos (no se encuentra ningún grupo con ambas " +"condiciones)" + +#: auths/SimpleLDAP/Authenticator.py:416 +msgid "Can't locate any group with the membership attribute specified" +msgstr "" +"No se puede localizar algún grupo con el atributo de pertenencia especificado" + +#: core/BaseModule.py:196 +msgid "No connection checking method is implemented." +msgstr "No se ha implementado ningun metodo de comprobación de conexión" + +#: core/BaseModule.py:248 +msgid "No check method provided." +msgstr "No se ha implementado ningún método de verificación." + +#: core/managers/PublicationManager.py:156 +msgid "" +"Already publishing. Wait for previous publication to finish and try again" +msgstr "" +"Ya hay una publicación en curso. Espere a la finalización de esta o " +"cancelela e intentelo de nuevo." + +#: core/managers/PublicationManager.py:168 +msgid "Can't cancel non running publication" +msgstr "No se puede cancelar una publicación que no está activa" + +#: core/managers/PublicationManager.py:186 +msgid "Can't unpublish non usable publication" +msgstr "No se puede despublicar una publicación no activa" + +#: core/managers/PublicationManager.py:189 +msgid "Can't unpublish publications with services in process" +msgstr "No se puede despublicar con servicios en proceso" + +#: core/managers/UserPrefsManager.py:254 +msgid "Screen Size" +msgstr "Tamaño de pantalla" + +#: core/managers/UserPrefsManager.py:258 +msgid "Full Screen" +msgstr "Pantalla completa" + +#: core/managers/UserPrefsManager.py:261 +msgid "Screen colors" +msgstr "Colores de pantalla" + +#: core/managers/UserPrefsManager.py:262 +msgid "8 bits" +msgstr "8 bits" + +#: core/managers/UserPrefsManager.py:263 +msgid "16 bits" +msgstr "16 bits" + +#: core/managers/UserPrefsManager.py:264 +msgid "24 bits" +msgstr "24 bits" + +#: core/managers/UserPrefsManager.py:265 +msgid "32 bits" +msgstr "32 bits" + +#: core/managers/UserServiceManager.py:302 +msgid "Can't cancel non running operation" +msgstr "No se puede cancelar una operación que no está en curso" + +#: core/managers/UserServiceManager.py:321 +msgid "Can't remove a non active element" +msgstr "No se puede eliminar un elemento que no está activo" + +#: core/managers/UserServiceManager.py:334 +msgid "Can't remove nor cancel {0} cause its states doesn't allows it" +msgstr "No se puede eliminar o cancelar {0} porque sus estados no lo permiten" + +#: core/osmanagers/BaseOsManager.py:50 +msgid "Base OS Manager" +msgstr "Gestor de OS Base" + +#: core/osmanagers/BaseOsManager.py:52 +msgid "Base Manager" +msgstr "Gestor Base" + +#: core/transports/BaseTransport.py:94 +msgid "Transport empty" +msgstr "Transporte Vacio" + +#: core/util/State.py:59 +msgid "Active" +msgstr "Activo" + +#: core/util/State.py:59 +msgid "Inactive" +msgstr "Inactivo" + +#: core/util/State.py:59 +msgid "Blocked" +msgstr "Bloqueado" + +#: core/util/State.py:59 +msgid "Waiting publication" +msgstr "En espera de publicación" + +#: core/util/State.py:60 +msgid "In preparation" +msgstr "En preparación" + +#: core/util/State.py:60 +msgid "Valid" +msgstr "Valido" + +#: core/util/State.py:61 +msgid "Waiting for removal" +msgstr "Esperando eliminación" + +#: core/util/State.py:61 +msgid "Removing" +msgstr "Eliminandose" + +#: core/util/State.py:61 +msgid "Removed" +msgstr "Eliminado " + +#: core/util/State.py:61 +msgid "Canceled" +msgstr "Cancelado" + +#: core/util/State.py:62 +msgid "Canceling" +msgstr "Cancelando" + +#: core/util/State.py:62 templates/uds/error.html:6 +#: templates/uds/error.html.py:11 +msgid "Error" +msgstr "Error" + +#: core/util/State.py:62 +msgid "Running" +msgstr "En ejecución" + +#: core/util/State.py:62 +msgid "Finished" +msgstr "Finalizado" + +#: core/util/State.py:62 +msgid "Waiting execution" +msgstr "En espera de ejecución" + +#: osmanagers/LinuxOsManager/LinuxOsManager.py:44 +msgid "Linux OS Manager" +msgstr "Gestor de S.O. Linux" + +#: osmanagers/LinuxOsManager/LinuxOsManager.py:46 +msgid "" +"Os Manager to control linux virtual machines (basically renames machine and " +"notify state)" +msgstr "" +"Gestor de s.o. para controlar maquinas virtuales con linux (basicamente " +"renombra las máquinas y notifica los estados)" + +#: osmanagers/LinuxOsManager/LinuxOsManager.py:49 +#: osmanagers/WindowsOsManager/WindowsOsManager.py:40 +msgid "On Logout" +msgstr "Al salir" + +#: osmanagers/LinuxOsManager/LinuxOsManager.py:49 +#: osmanagers/WindowsOsManager/WindowsOsManager.py:40 +msgid "What to do when user logout from service" +msgstr "Que acción realizar cuando el usuario abandone el servicio" + +#: osmanagers/LinuxOsManager/LinuxOsManager.py:50 +#: osmanagers/WindowsOsManager/WindowsOsManager.py:41 +msgid "Keep service assigned" +msgstr "Mantener el servicio asignado" + +#: osmanagers/LinuxOsManager/LinuxOsManager.py:51 +#: osmanagers/WindowsOsManager/WindowsOsManager.py:42 +msgid "Remove service" +msgstr "Eliminar servicio" + +#: osmanagers/LinuxOsManager/__init__.py:43 +msgid "UDS Actor for linux machines (Requires python 2.6 or greater)" +msgstr "Actor para las máquinas Linux (Precisa python 2.6 o mayor)" + +#: osmanagers/NoneOsManager/Manager.py:43 +msgid "None OS Manager" +msgstr "Ningún gestor de OS" + +#: osmanagers/NoneOsManager/Manager.py:45 +msgid "Os Manager with no actions" +msgstr "Gestor de OS que no realiza ninguna acción" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:23 +msgid "Windows Domain OS Manager" +msgstr "Gestor para Windows con dominio" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:25 +msgid "" +"Os Manager to control windows machines with domain. (Basically renames " +"machine)" +msgstr "Gestor de s.o. para controlar maquinas windows con dominio." + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:29 +#: transports/RDP/RDPTransport.py:39 transports/RDP/TSRDPTransport.py:43 +#: transports/RGS/RGSTransport.py:44 transports/RGS/TRGSTransport.py:49 +msgid "Domain" +msgstr "Dominio" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:29 +msgid "Domain to join machines to (better use dns form of domain)" +msgstr "" +"Dominio al que unir las máquinas (es preferible utilizar la forma DNS del " +"dominio)" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:30 +msgid "Account" +msgstr "Cuenta" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:30 +msgid "Account with rights to add machines to domain" +msgstr "Cuenta con derecho para añadir máquinas al dominio" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:31 +msgid "Password of the account" +msgstr "Contraseña de la cuenta" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:32 +msgid "OU" +msgstr "OU" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:32 +msgid "" +"Organizational unit where to add machines in domain (check it before using " +"it)" +msgstr "" +"Unidad organizativa donde crear las máquinas del dominio (compruebelo antes " +"de utilizarlo)" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:40 +msgid "Must provide a domain!!!" +msgstr "Debe indicar un dominio!!!" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:42 +msgid "Must provide an account to add machines to domain!!!" +msgstr "Debe indicar una cuenta para añadir máquinas al dominio!!!" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:44 +msgid "Must provide a password for the account!!!" +msgstr "Debe indicar una contraseña para la cuenta!!!" + +#: osmanagers/WindowsOsManager/WindowsOsManager.py:35 +msgid "Windows Basic OS Manager" +msgstr "Gestor de SO Windows Básico" + +#: osmanagers/WindowsOsManager/WindowsOsManager.py:37 +msgid "" +"Os Manager to control windows machines without domain. (Basically renames " +"machine)" +msgstr "" +"Gestor de SO para controlar máquinas windows sin dominio. (Basicamente, " +"renombra las máquinas)" + +#: osmanagers/WindowsOsManager/WindowsOsManager.py:51 +msgid "Length must be numeric!!" +msgstr "La longitud debe ser numerica!!!" + +#: osmanagers/WindowsOsManager/WindowsOsManager.py:53 +msgid "Length must be betwen 1 and six" +msgstr "La longitud debe estar entre 1 y seis" + +#: osmanagers/WindowsOsManager/__init__.py:23 +msgid "" +"UDS Actor for windows machines (Important!! Requires .net framework 3.5 " +"sp1)" +msgstr "" +"Actor para las máquinas Windows (Importante!!! Requiere tener .net " +"framework 3.5 sp1)" + +#: services/PhysicalMachines/IPMachineDeployed.py:56 +msgid "IP " +msgstr "IP " + +#: services/PhysicalMachines/IPMachinesService.py:46 +msgid "List of IPS" +msgstr "Lista de IPS" + +#: services/PhysicalMachines/IPMachinesService.py:49 +msgid "Physical machines accesed by ip" +msgstr "Máquinas físicas de acceso por ip" + +#: services/PhysicalMachines/IPMachinesService.py:51 +msgid "This service provides access to POWERED-ON Machines by ip" +msgstr "Este servicio provee acceso a máquinas ENCENDIDAS por IP" + +#: services/Sample/SampleProvider.py:142 +msgid "Methuselah is not alive!!! :-)" +msgstr "Matusalén no está vivo!!! :-)" + +#: services/Sample/SampleProvider.py:182 +msgid "Nothing tested, but all went fine.." +msgstr "Nada probado, pero todo salió bien..." + +#: services/Sample/SamplePublication.py:199 +msgid "Random integer was 9!!! :-)" +msgstr "Entero aleatorio fue 9!!!!!! :-)" + +#: services/Vmware/Helpers.py:72 +msgid "Local" +msgstr "Local" + +#: services/Vmware/Helpers.py:74 +msgid "Remote" +msgstr "Remoto" + +#: services/Vmware/PublicationVC.py:36 +msgid "Publication" +msgstr "Publicación" + +#: services/Vmware/PublicationVC.py:37 +msgid "UDS Publication for {0} created at {1}" +msgstr "Publicación de UDS para {0} creado en {1}" + +#: services/Vmware/ServiceProviderVC.py:29 +msgid "VMWare VC Server Port (usually 443)" +msgstr "Puerto del servidor VMWare VC (normalmente 443)" + +#: services/Vmware/ServiceProviderVC.py:30 +msgid "User with valid privileges on VC" +msgstr "Usuario con privilegios en VC" + +#: services/Vmware/ServiceProviderVC.py:31 +msgid "Password of the user of the VC" +msgstr "Contraseña del usuario de VC" + +#: services/Vmware/ServiceProviderVC.py:32 +msgid "Timeout in seconds of connection to VC" +msgstr "Timeout en segundos" + +#: services/Vmware/ServiceProviderVC.py:33 +msgid "Macs range" +msgstr "Rango de Macs" + +#: services/Vmware/ServiceProviderVC.py:34 +msgid "Range of valids macs for created machines" +msgstr "Rango válido de macs para las máquinas creadas" + +#: services/Vmware/ServiceProviderVC.py:39 +msgid "VMWare Virtual Center Provider" +msgstr "Proveedor para VMWare Virtual Center" + +#: services/Vmware/ServiceProviderVC.py:41 +msgid "Provides connection to Virtual Center Services" +msgstr "Provee conexión a servicios basados en VMWare Virtual Center" + +#: services/Vmware/ServiceProviderVC.py:111 +msgid "Error testing connection" +msgstr "Error comprobando la conexión" + +#: services/Vmware/ServiceProviderVC.py:114 +msgid "VmwareVC Provider: " +msgstr "Proveedor VmwareVC:" + +#: services/Vmware/ServiceProviderVC.py:120 +msgid "Connection params ok" +msgstr "Parametros de conexión correctos" + +#: services/Vmware/ServiceProviderVC.py:121 +msgid "Connection failed. Check connection params" +msgstr "La conexión ha fallado. Compruebe los parámetros." + +#: services/Vmware/VCLinkedCloneService.py:28 +msgid "Datacenter" +msgstr "Datacenter " + +#: services/Vmware/VCLinkedCloneService.py:34 +msgid "Datacenter containing base machine" +msgstr "Datacenter que contiene la máquina de base" + +#: services/Vmware/VCLinkedCloneService.py:36 +msgid "Network" +msgstr "Red" + +#: services/Vmware/VCLinkedCloneService.py:37 +msgid "" +"If more than 1 interface is found in machine, use one on this network as main" +msgstr "" +"Si hay mas de un interfaz en la máquina virtual, use el que esté en esta red " +"como principal." + +#: services/Vmware/VCLinkedCloneService.py:38 +msgid "Pub. Resource Pool" +msgstr "Pool de despliegue" + +#: services/Vmware/VCLinkedCloneService.py:38 +msgid "Resource Pool where deploy clones" +msgstr "Pool de recursos donde desplegar los clones" + +#: services/Vmware/VCLinkedCloneService.py:39 +msgid "Clones Folder" +msgstr "Carpeta de clones" + +#: services/Vmware/VCLinkedCloneService.py:39 +msgid "Folder where deploy clones" +msgstr "Carpeta donde desplegar los clones" + +#: services/Vmware/VCLinkedCloneService.py:40 +msgid "Resource Pool" +msgstr "Pool de recursos" + +#: services/Vmware/VCLinkedCloneService.py:46 +msgid "Resource Pool containing base machine" +msgstr "Pool de recursos que contiene la máquina de base" + +#: services/Vmware/VCLinkedCloneService.py:48 +msgid "Base Machine" +msgstr "Máquina de base " + +#: services/Vmware/VCLinkedCloneService.py:48 +msgid "Base machine for this service" +msgstr "Máquina de base para este servicio" + +#: services/Vmware/VCLinkedCloneService.py:49 +msgid "Memory (Mb)" +msgstr "Memoria (Mb)" + +#: services/Vmware/VCLinkedCloneService.py:50 +msgid "Memory for machines deployed from this service" +msgstr "Memoria para maquinas desplegadas desde este servicio" + +#: services/Vmware/VCLinkedCloneService.py:51 +msgid "Datastores" +msgstr "Almacenamientos" + +#: services/Vmware/VCLinkedCloneService.py:52 +msgid "Datastores where to put incrementals" +msgstr "Almacenamientos donde colocar los incrementales" + +#: services/Vmware/VCLinkedCloneService.py:53 +msgid "Machine Names" +msgstr "Nombres de máquinas" + +#: services/Vmware/VCLinkedCloneService.py:53 +msgid "Base name for clones from this machine" +msgstr "Nombre base para los clones de la máquina base" + +#: services/Vmware/VCLinkedCloneService.py:54 +msgid "Name Length" +msgstr "Longitud del nombre" + +#: services/Vmware/VCLinkedCloneService.py:55 +msgid "Length of numeric part for the names of this machines (betwen 3 and 6" +msgstr "" +"Longitud de la parte numérica de los nombres de esta maquinaria (entre 3 y 6" + +#: services/Vmware/VCLinkedCloneService.py:62 +msgid "VMWare Linked clone base" +msgstr "Servicio basado en VMWare Linked Clones" + +#: services/Vmware/VCLinkedCloneService.py:64 +msgid "" +"This service provides access to Linked Clones machines on a Virtual Center" +msgstr "Este servicio provee acceso a linked clones sobre Virtual Center" + +#: services/Vmware/VCLinkedCloneService.py:70 +msgid "Number of desired machines to keep running waiting for a user" +msgstr "Número de máquinas a manatener en ejecución esperando a un usuario" + +#: services/Vmware/VCLinkedCloneService.py:72 +msgid "Number of desired machines to keep suspended waiting for use" +msgstr "Número de maquinas a mantener suspendidas esperando asignación" + +#: services/Vmware/VCLinkedCloneService.py:93 +msgid "The length of basename plus length must not be greater than 15" +msgstr "La longitud de basename más longitud no debe ser superior a 15" + +#: services/Vmware/VCLinkedCloneService.py:95 +msgid "The machine name can't be only numbers" +msgstr "El nombre del equipo no puede ser sólo números" + +#: templates/404.html:4 templates/404.html.py:7 +msgid "Page not found" +msgstr "Página no encontrada" + +#: templates/404.html:9 +msgid "Sorry, but the requested page could not be found." +msgstr "Lo sentimos, pero no se encontró la página solicitada." + +#: templates/uds/base.html:7 +msgid "UDS" +msgstr "UDS" + +#: templates/uds/downloads.html:8 templates/uds/snippets/admin_user.html:7 +msgid "Downloads" +msgstr "Descargas" + +#: templates/uds/downloads.html:11 +msgid "" +"This page contains a list of downloadables provided by different modules" +msgstr "" +"Esta página contiene una lista de descargas proporcionadas por diferentes " +"módulos" + +#: templates/uds/index.html:51 +msgid "Services" +msgstr "Servicios" + +#: templates/uds/index.html:70 +msgid "Java not found" +msgstr "Java no encontrado" + +#: templates/uds/index.html:71 +msgid "" +"Java is not available on your browser, and the selected transport needs it." +msgstr "" +"Java no está disponible en el navegador, y el transporte seleccionado " +"precisa de el." + +#: templates/uds/index.html:72 +msgid "Please, install latest version from" +msgstr "Instale la versión mas reciente desde el" + +#: templates/uds/index.html:72 +msgid "Java website" +msgstr "Sitio Web de Java" + +#: templates/uds/index.html:72 +msgid "and restart browser" +msgstr "y reinicie el navegador" + +#: templates/uds/index.html:78 +msgid "Ip" +msgstr "IP" + +#: templates/uds/index.html:79 +msgid "Networks" +msgstr "Redes" + +#: templates/uds/index.html:80 +msgid "Transports" +msgstr "Transportes" + +#: templates/uds/internal_page.html:28 +msgid "User" +msgstr "Usuario" + +#: templates/uds/internal_page.html:34 templates/uds/prefs.html:12 +msgid "Preferences" +msgstr "Preferencias" + +#: templates/uds/internal_page.html:40 +msgid "Log out" +msgstr "Desconectar" + +#: templates/uds/login.html:6 +msgid "Login to UDS" +msgstr "Acceder a UDS" + +#: templates/uds/login.html:78 +msgid "Login" +msgstr "Acceder" + +#: templates/uds/login.html:83 +msgid "Login data" +msgstr "Datos de acceso" + +#: templates/uds/login.html:86 +msgid "Enter" +msgstr "Entrar" + +#: templates/uds/login.html:93 +msgid "Back to login" +msgstr "Volver a iniciar sesión" + +#: templates/uds/prefs.html:6 +msgid "UDS User Preferences" +msgstr "UDS Preferencias de usuario " + +#: templates/uds/prefs.html:16 +msgid "Save Preferences" +msgstr "Guardar Preferencias" + +#: templates/uds/service_not_ready.html:6 +msgid "Service not ready at this moment. Please, try again in a while." +msgstr "" +"El servicio no está disponible en estos momentos. Por favor, intentelo de " +"nuevo pasado unos instantes." + +#: templates/uds/snippets/admin_user.html:4 +msgid "Admin" +msgstr "Admin" + +#: templates/uds/snippets/back_to_list.html:3 +msgid "Back to services list" +msgstr "Volver a la lista de servicios" + +#: templates/uds/snippets/lang.html:9 +msgid "Language" +msgstr "Idioma" + +#: transports/NX/NXTransport.py:54 +msgid "NX Transport (direct)" +msgstr "Transporte NX (directo)" + +#: transports/NX/NXTransport.py:56 +msgid "NX Transport for direct connection" +msgstr "Transporte NX para conexión directa" + +#: transports/NX/NXTransport.py:60 transports/RDP/RDPTransport.py:36 +#: transports/RDP/TSRDPTransport.py:40 transports/RGS/RGSTransport.py:41 +#: transports/RGS/TRGSTransport.py:46 transports/TSNX/TSNXTransport.py:65 +msgid "Empty creds" +msgstr "Sin credenciales" + +#: transports/NX/NXTransport.py:60 transports/RDP/RDPTransport.py:36 +#: transports/RDP/TSRDPTransport.py:40 transports/RGS/RGSTransport.py:41 +#: transports/RGS/TRGSTransport.py:46 transports/TSNX/TSNXTransport.py:65 +msgid "If checked, the credentials used to connect will be emtpy" +msgstr "" +"Si está activada, las credenciales utilizadas para conectar estarán vacías" + +#: transports/NX/NXTransport.py:61 transports/RDP/RDPTransport.py:37 +#: transports/RDP/TSRDPTransport.py:41 transports/RGS/RGSTransport.py:42 +#: transports/RGS/TRGSTransport.py:47 transports/TSNX/TSNXTransport.py:66 +msgid "If not empty, this username will be always used as credential" +msgstr "" +"Si no está vacio, este nombre de usuario será utilizado como credencial fija" + +#: transports/NX/NXTransport.py:62 transports/RDP/RDPTransport.py:38 +#: transports/RDP/TSRDPTransport.py:42 transports/RGS/RGSTransport.py:43 +#: transports/RGS/TRGSTransport.py:48 transports/TSNX/TSNXTransport.py:67 +msgid "If not empty, this password will be always used as credential" +msgstr "Si no está vacio, este password será utiizado como credencial fija" + +#: transports/NX/NXTransport.py:63 transports/TSNX/TSNXTransport.py:68 +msgid "Listen port" +msgstr "Puerto de escucha" + +#: transports/NX/NXTransport.py:63 transports/TSNX/TSNXTransport.py:68 +msgid "Listening port of NX (ssh) at client machine" +msgstr "Puerto de escucha de NX (ssh) en el equipo cliente" + +#: transports/NX/NXTransport.py:64 transports/TSNX/TSNXTransport.py:69 +msgid "Connection" +msgstr "Conexión" + +#: transports/NX/NXTransport.py:64 transports/TSNX/TSNXTransport.py:69 +msgid "Connection speed for this transport (quality)" +msgstr "Velocidad de conexión de este transporte (calidad)" + +#: transports/NX/NXTransport.py:71 transports/TSNX/TSNXTransport.py:76 +msgid "Session" +msgstr "Sesiones" + +#: transports/NX/NXTransport.py:71 transports/TSNX/TSNXTransport.py:76 +msgid "Desktop session" +msgstr "Sesión de escritorio" + +#: transports/NX/NXTransport.py:76 transports/TSNX/TSNXTransport.py:81 +msgid "Disk Cache" +msgstr "Caché de disco" + +#: transports/NX/NXTransport.py:76 transports/TSNX/TSNXTransport.py:81 +msgid "Cache size en Mb stored at disk" +msgstr "Tamaño de ca Caché en MB almacenada en disco" + +#: transports/NX/NXTransport.py:84 transports/TSNX/TSNXTransport.py:89 +msgid "Memory Cache" +msgstr "Memoria Caché" + +#: transports/NX/NXTransport.py:84 transports/TSNX/TSNXTransport.py:89 +msgid "Cache size en Mb keept at memory" +msgstr "Tamaño del Caché en Mb a mantener en memoria" + +#: transports/NX/__init__.py:42 transports/TSNX/__init__.py:42 +msgid "NX Protocol" +msgstr "Protocolo NX" + +#: transports/NX/__init__.py:48 +msgid "UDS Actor connector for NX (requires nomachine packages)" +msgstr "Conector de UDS Actor para NX (requiere nomachine paquetes)" + +#: transports/NX/web.py:74 +msgid "" +"In order to use this transport, you need to install first Nomachine Nx " +"Client version 3.5.x" +msgstr "" +"Para poder utilizar este transporte, necesita instalar primera Nomachine Nx " +"Cliente versión 3.5" + +#: transports/NX/web.py:75 +msgid "you can obtain it for your platform from" +msgstr "Usted puede obtener para su plataforma de" + +#: transports/NX/web.py:75 +msgid "nochamine web site" +msgstr "Sitio Web de Nomachine" + +#: transports/RDP/RDPTransport.py:30 +msgid "RDP Transport (direct)" +msgstr "Transporte RDP (directo)" + +#: transports/RDP/RDPTransport.py:32 +msgid "RDP Transport for direct connection" +msgstr "Transporte RDP para conexión directa" + +#: transports/RDP/RDPTransport.py:39 transports/RDP/TSRDPTransport.py:43 +#: transports/RGS/RGSTransport.py:44 transports/RGS/TRGSTransport.py:49 +msgid "" +"If not empty, this domain will be always used as credential (used as DOMAIN" +"\\user)" +msgstr "" +"Si no está vacio, este domínio será usado como parte de las credenciales del " +"usuario (usado como DOMAIN\\user)" + +#: transports/RDP/RDPTransport.py:40 transports/RDP/TSRDPTransport.py:44 +msgid "Allow Smartcards" +msgstr "Permitir tarjetas inteligentes" + +#: transports/RDP/RDPTransport.py:40 transports/RDP/TSRDPTransport.py:44 +msgid "If checked, this transport will allow the use of smartcards" +msgstr "" +"Si está marcado, este transporte permitirá el uso de tarjetas inteligentes" + +#: transports/RDP/RDPTransport.py:41 transports/RDP/TSRDPTransport.py:45 +msgid "Allow Printers" +msgstr "Permitir impresoras" + +#: transports/RDP/RDPTransport.py:41 transports/RDP/TSRDPTransport.py:45 +msgid "If checked, this transport will allow the use of user printers" +msgstr "" +"Si está marcado, este transporte permitirá el uso de impresoras remotas" + +#: transports/RDP/RDPTransport.py:42 transports/RDP/TSRDPTransport.py:46 +msgid "Allow Drives" +msgstr "Permitir unidades" + +#: transports/RDP/RDPTransport.py:42 transports/RDP/TSRDPTransport.py:46 +msgid "If checked, this transport will allow the use of user drives" +msgstr "" +"Si está marcado, este transporte permitirá la redireccion de las unidades " +"locales a la máquina remota" + +#: transports/RDP/RDPTransport.py:43 transports/RDP/TSRDPTransport.py:47 +msgid "Allow Serials" +msgstr "Permitir series" + +#: transports/RDP/RDPTransport.py:43 transports/RDP/TSRDPTransport.py:47 +msgid "If checked, this transport will allow the use of user serial ports" +msgstr "" +"Si está marcado, este transporte permitirá la redirección de puertos serie" + +#: transports/RDP/TSRDPTransport.py:31 +msgid "RDP Transport (tunneled)" +msgstr "Transporte RDP (vía túnel)" + +#: transports/RDP/TSRDPTransport.py:33 +msgid "RDP Transport for tunneled connection" +msgstr "Transporte RDP para conexión vía túnel" + +#: transports/RDP/TSRDPTransport.py:37 transports/RGS/TRGSTransport.py:43 +#: transports/TSNX/TSNXTransport.py:62 +msgid "Tunnel server" +msgstr "Servidor de túnel" + +#: transports/RDP/TSRDPTransport.py:37 transports/RGS/TRGSTransport.py:43 +#: transports/TSNX/TSNXTransport.py:62 +msgid "" +"IP or Hostname of tunnel server send to client device (\"public\" ip) and " +"port. (use HOST:PORT format)" +msgstr "" +"IP o nombre de host del servidor de túnel enviar a dispositivo de cliente " +"(ip \"pública\") y puerto. (utilice el formato HOST: puerto)" + +#: transports/RDP/TSRDPTransport.py:38 transports/RGS/TRGSTransport.py:44 +#: transports/TSNX/TSNXTransport.py:63 +msgid "Tunnel host check" +msgstr "Verificación de host de túnel" + +#: transports/RDP/TSRDPTransport.py:38 transports/RGS/TRGSTransport.py:44 +#: transports/TSNX/TSNXTransport.py:63 +msgid "" +"If not empty, this server will be used to check if service is running before " +"assigning it to user. (use HOST:PORT format)" +msgstr "" +"Si no vacía, este servidor se utilizará para comprobar si el servicio se " +"ejecuta antes de asignarle al usuario. (utilice el formato HOST: puerto)" + +#: transports/RDP/__init__.py:20 +msgid "Remote Desktop Protocol" +msgstr "Protocolo de Escritorio remoto (RDP)" + +#: transports/RDP/web.py:83 +msgid "In order to use this service, you should first install CoRD." +msgstr "Para poder utilizar este servicio, primero debe instalar CoRD." + +#: transports/RDP/web.py:84 transports/RGS/web.py:82 +msgid "You can obtain it from" +msgstr "Puede obtenerlo de" + +#: transports/RDP/web.py:84 +msgid "CoRD Website" +msgstr "Sitio Web de CoRD" + +#: transports/RGS/RGSTransport.py:34 +#, fuzzy +msgid "RGS Transport (direct)" +msgstr "Transporte RDP (directo)" + +#: transports/RGS/RGSTransport.py:36 +#, fuzzy +msgid "RGS Transport for direct connection" +msgstr "Transporte RDP para conexión directa" + +#: transports/RGS/RGSTransport.py:45 transports/RGS/TRGSTransport.py:50 +msgid "Image quality" +msgstr "Calidad de imagen" + +#: transports/RGS/RGSTransport.py:46 transports/RGS/TRGSTransport.py:51 +msgid "Quality of image codec (0-100)" +msgstr "Calidad del códec de imagen (0-100)" + +#: transports/RGS/RGSTransport.py:47 transports/RGS/TRGSTransport.py:52 +msgid "Adjustable Quality" +msgstr "Calidad ajustable" + +#: transports/RGS/RGSTransport.py:48 transports/RGS/TRGSTransport.py:53 +msgid "If checked, the image quality will be adjustable with bandwidth" +msgstr "" +"Si está activada, la calidad de imagen será ajustable con ancho de banda" + +#: transports/RGS/RGSTransport.py:49 transports/RGS/TRGSTransport.py:54 +msgid "Min. Adjustable Quality" +msgstr "Mín. calidad ajustable" + +#: transports/RGS/RGSTransport.py:50 transports/RGS/TRGSTransport.py:55 +msgid "" +"The lowest image quality applied to images to maintain the minimum update " +"rate." +msgstr "" +"La menor calidad de imagen aplicada a las imágenes para mantener la " +"actualización mínima tasa." + +#: transports/RGS/RGSTransport.py:51 transports/RGS/TRGSTransport.py:56 +msgid "Adjustable Frame Rate" +msgstr "Ajustable velocidad de fotogramas" + +#: transports/RGS/RGSTransport.py:52 transports/RGS/TRGSTransport.py:57 +msgid "Update rate threshold to begin adjusting image quality" +msgstr "" +"Umbral de velocidad de actualización para comenzar el ajuste de calidad de " +"imagen" + +#: transports/RGS/RGSTransport.py:53 transports/RGS/TRGSTransport.py:58 +msgid "Match Local Resolution" +msgstr "Resolución Local de partido" + +#: transports/RGS/RGSTransport.py:54 transports/RGS/TRGSTransport.py:59 +msgid "" +"Change the Sender's resolution to match the Receiver's resolution when " +"connecting" +msgstr "" +"Cambiar la resolución del remitente para que coincida con la resolución del " +"receptor cuando conexión" + +#: transports/RGS/RGSTransport.py:55 transports/RGS/TRGSTransport.py:60 +msgid "Redirect USB" +msgstr "Redirección USB" + +#: transports/RGS/RGSTransport.py:56 transports/RGS/TRGSTransport.py:61 +msgid "If checked, the USB will be redirected." +msgstr "Si está activada, se redirigirá el USB." + +#: transports/RGS/RGSTransport.py:57 transports/RGS/TRGSTransport.py:62 +msgid "Redirect Audio" +msgstr "Redirección de Audio" + +#: transports/RGS/RGSTransport.py:58 transports/RGS/TRGSTransport.py:63 +#, fuzzy +msgid "If checked, the Audio will be redirected." +msgstr "" +"Si está activada, las credenciales utilizadas para conectar estarán vacías" + +#: transports/RGS/RGSTransport.py:59 transports/RGS/TRGSTransport.py:64 +msgid "Redirect Mic" +msgstr "Redirigir Mic" + +#: transports/RGS/RGSTransport.py:60 transports/RGS/TRGSTransport.py:65 +#, fuzzy +msgid "If checked, the Mic will be redirected." +msgstr "" +"Si está activada, las credenciales utilizadas para conectar estarán vacías" + +#: transports/RGS/TRGSTransport.py:36 +#, fuzzy +msgid "RGS Transport (tunneled)" +msgstr "Transporte RDP (vía túnel)" + +#: transports/RGS/TRGSTransport.py:38 +#, fuzzy +msgid "RGS Transport for tunneled connection" +msgstr "Transporte RDP para conexión vía túnel" + +#: transports/RGS/web.py:81 +#, fuzzy +msgid "In order to use this service, you should first install RGS Receiver." +msgstr "Para poder utilizar este servicio, primero debe instalar CoRD." + +#: transports/RGS/web.py:82 +#, fuzzy +msgid "HP Website" +msgstr "Sitio Web de CoRD" + +#: transports/TSNX/TSNXTransport.py:55 +msgid "NX Transport (tunneled)" +msgstr "Transporte NX (vía túnel)" + +#: transports/TSNX/TSNXTransport.py:57 +msgid "NX Transport for tunneled connection" +msgstr "Transporte NX para conexión vía túnel" + +#: web/errors.py:53 +msgid "Unknown error" +msgstr "Error desconocido" + +#: web/errors.py:54 +msgid "Transport not found" +msgstr "Transporte no hallado" + +#: web/errors.py:55 +msgid "Service not found" +msgstr "Servicio no hallado" + +#: web/errors.py:56 xmlrpc/auths/AdminAuth.py:147 +msgid "Access denied" +msgstr "Acceso denegado" + +#: web/errors.py:57 +msgid "" +"Invalid service. The service is not available at this moment. Please, try " +"later" +msgstr "" +"Servicio invalido. El servicio no está disponible en estos momentos. Por " +"favor, intentelo de nuevo pasado unos instantes." + +#: web/errors.py:58 +msgid "Maximum services limit reached. Please, contact administrator" +msgstr "" +"Número máximo de servicios alcanzado. Por favor, contacte con su " +"administrador." + +#: web/errors.py:59 +msgid "You need to enable cookies to let this application work" +msgstr "Necesita habilitar los cookies para permitir funcionar esta aplicación" + +#: web/errors.py:60 +msgid "User service not found" +msgstr "Servicio de usuario no hallado" + +#: web/forms/LoginForm.py:61 +msgid "Authenticator" +msgstr "Autenticador" + +#: xmlrpc/auths/AdminAuth.py:91 +msgid "Credentials no longer valid" +msgstr "Las credenciales ya no son válidas" + +#: xmlrpc/auths/AdminAuth.py:125 +msgid "Administration" +msgstr "Administración" + +#: xmlrpc/auths/AdminAuth.py:140 +msgid "Invalid credentials" +msgstr "Credenciales Invalidas" + +#: xmlrpc/auths/AdminAuth.py:145 +msgid "Invalid authenticator" +msgstr "Autenticador Invalido" + +#: xmlrpc/auths/Authenticators.py:104 +msgid "Authenticator does not exists" +msgstr "El autenticador no existe" + +#: xmlrpc/auths/Authenticators.py:158 xmlrpc/osmanagers/OSManagers.py:115 +#: xmlrpc/services/ServiceProviders.py:115 xmlrpc/services/Services.py:159 +#: xmlrpc/transports/Networks.py:86 xmlrpc/transports/Networks.py:97 +#, python-format +msgid "Name %s already exists" +msgstr "El nombre %s ya existe" + +#: xmlrpc/auths/Authenticators.py:229 +msgid "Authenticator do not supports search" +msgstr "El autenticador no soporta búsquedas" + +#: xmlrpc/auths/Authenticators.py:235 +msgid "Specified authenticator do not exists anymore. Please, reload gui" +msgstr "" +"Hacer autenticador especificado no existe ya. Por favor, vuelva a cargar la " +"interfaz gráfica de usuario" + +#: xmlrpc/auths/Authenticators.py:239 +msgid "BUG: Reached a point that should never have been reached!!!" +msgstr "BUG: Llegado a un punto que no debe nunca han alcanzado!!!" + +#: xmlrpc/osmanagers/OSManagers.py:129 +msgid "This os mnager is being used by deployed services" +msgstr "Este OS Manager está siendo utilizado por servicios desplegados" + +#: xmlrpc/osmanagers/OSManagers.py:145 +msgid "There is deployed services using this os manager" +msgstr "Existen servicios desplegados que utilizan este gestor de SO" + +#: xmlrpc/osmanagers/OSManagers.py:147 +msgid "Can't find os manager" +msgstr "No se puede hallar el gestor de SO" + +#: xmlrpc/services/DeployedServices.py:52 +msgid "Unknown" +msgstr "Desconocido" + +#: xmlrpc/services/DeployedServices.py:112 +#: xmlrpc/services/DeployedServices.py:176 +#: xmlrpc/services/DeployedServices.py:195 +#: xmlrpc/services/DeployedServices.py:211 +#: xmlrpc/services/DeployedServices.py:225 +#: xmlrpc/services/DeployedServices.py:252 +#: xmlrpc/services/DeployedServices.py:266 +msgid "Deployed Service does not exists" +msgstr "El servicio desplegado no existe" + +#: xmlrpc/services/DeployedServices.py:209 +msgid "Group does not exists" +msgstr "El grupo no existe" + +#: xmlrpc/services/DeployedServices.py:237 +msgid "Can't find deployed service" +msgstr "No puedo hallar el servicio desplegado" + +#: xmlrpc/services/DeployedServices.py:250 +msgid "Transport does not exists" +msgstr "El transporte no existe" + +#: xmlrpc/services/DeployedServices.py:281 +msgid "Deployed service does not exists" +msgstr "El servicio desplegado no existe" + +#: xmlrpc/services/ServiceProviders.py:142 +msgid "Can't delete service provider with services associated" +msgstr "No se puede borrar un proveedor de servicios con servicios asociados" + +#: xmlrpc/services/ServiceProviders.py:145 +msgid "Can't locate the service provider" +msgstr "No puedo hallar el proveedor de servicios" + +#: xmlrpc/services/ServiceProviders.py:145 xmlrpc/services/Services.py:189 +#: xmlrpc/transports/Networks.py:70 xmlrpc/transports/Networks.py:78 +#: xmlrpc/transports/Networks.py:95 +msgid "Please, refresh interface" +msgstr "Por favor, refresque la interfaz." + +#: xmlrpc/services/Services.py:186 +msgid "Can't delete services with deployed services associated" +msgstr "No se puede borrar un servicio con servicios desplegados asociados" + +#: xmlrpc/services/Services.py:189 +msgid "Can't locate the service" +msgstr "No puedo hallar el servicio" + +#: xmlrpc/services/UserDeployedServices.py:94 +#: xmlrpc/services/UserDeployedServices.py:110 +msgid "The deployed service is not active" +msgstr "El servicio desplegado no está activo" + +#: xmlrpc/services/UserDeployedServices.py:97 +#: xmlrpc/services/UserDeployedServices.py:113 +msgid "This service don't allows assignations" +msgstr "El servicio no admite asignaciones" + +#: xmlrpc/services/UserDeployedServices.py:102 +#: xmlrpc/services/UserDeployedServices.py:120 +msgid "Deployed service not found!!! (refresh interface)" +msgstr "Servicio desplegado no hallado!!! (refresque la interfaz)" + +#: xmlrpc/services/UserDeployedServices.py:122 +msgid "User not found!!! (refresh interface)" +msgstr "Usuario no hallado (refresque la interfaz)" + +#: xmlrpc/services/UserDeployedServices.py:141 +msgid "No error" +msgstr "Sin errores" + +#: xmlrpc/services/UserDeployedServices.py:147 +msgid "User deployed service not found!!!" +msgstr "Servicio de usuario no hallado!!!" + +#: xmlrpc/transports/Networks.py:70 +msgid "Can't locate the transport" +msgstr "No puedo hallar el transporte" + +#: xmlrpc/transports/Networks.py:78 xmlrpc/transports/Networks.py:95 +msgid "Can't locate the network" +msgstr "No puedo hallar la red" + +#~ msgid "Base Service" +#~ msgstr "Servicio Base" + +#~ msgid "None" +#~ msgstr "Ninguno" diff --git a/server/src/uds/locale/fr/LC_MESSAGES/django.mo b/server/src/uds/locale/fr/LC_MESSAGES/django.mo new file mode 100644 index 000000000..f091be80b Binary files /dev/null and b/server/src/uds/locale/fr/LC_MESSAGES/django.mo differ diff --git a/server/src/uds/locale/fr/LC_MESSAGES/django.po b/server/src/uds/locale/fr/LC_MESSAGES/django.po new file mode 100644 index 000000000..735e4c4e6 --- /dev/null +++ b/server/src/uds/locale/fr/LC_MESSAGES/django.po @@ -0,0 +1,1546 @@ +# Translations for french +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# Adolfo Gómez , 2012. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-07-12 21:26+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1)\n" + +#: auths/ActiveDirectory/Authenticator.py:29 +#: auths/EDirectory/Authenticator.py:60 auths/RegexLdap/Authenticator.py:51 +#: auths/SimpleLDAP/Authenticator.py:49 +#: services/Vmware/ServiceProviderVC.py:28 +msgid "Host" +msgstr "Serveur" + +#: auths/ActiveDirectory/Authenticator.py:29 +#: auths/EDirectory/Authenticator.py:60 auths/RegexLdap/Authenticator.py:51 +#: auths/SimpleLDAP/Authenticator.py:49 +#: services/Vmware/ServiceProviderVC.py:28 +msgid "VMWare VC Server IP or Hostname" +msgstr "Le nom DNS ou l'adresse IP VC VMWare Server" + +#: auths/ActiveDirectory/Authenticator.py:30 +#: auths/EDirectory/Authenticator.py:62 auths/RegexLdap/Authenticator.py:53 +#: auths/SimpleLDAP/Authenticator.py:51 +msgid "Use SSL" +msgstr "Utiliser SSL" + +#: auths/ActiveDirectory/Authenticator.py:30 +msgid "If checked, will use a ssl connection to Active Directory" +msgstr "Si elle est cochée, va utiliser une connexion SSL à Active Directory" + +#: auths/ActiveDirectory/Authenticator.py:31 +#: auths/RegexLdap/Authenticator.py:54 auths/SimpleLDAP/Authenticator.py:52 +msgid "Ldap User" +msgstr "Utilisateur LDAP" + +#: auths/ActiveDirectory/Authenticator.py:31 +msgid "" +"Username with read privileges on the base selected (use USER@DOMAIN.DOM form " +"for this)" +msgstr "" +"Nom d'utilisateur avec des privilèges lire sur la base choisie (utiliser le " +"format USER@DOMAIN.DOMpour cela)" + +#: auths/ActiveDirectory/Authenticator.py:32 +#: auths/ActiveDirectory/Authenticator.py:50 +#: auths/EDirectory/Authenticator.py:64 auths/RegexLdap/Authenticator.py:55 +#: auths/RegexLdap/Authenticator.py:78 auths/SimpleLDAP/Authenticator.py:53 +#: auths/SimpleLDAP/Authenticator.py:77 +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:31 +#: services/Vmware/ServiceProviderVC.py:31 transports/NX/NXTransport.py:62 +#: transports/RDP/RDPTransport.py:38 transports/RDP/TSRDPTransport.py:42 +#: transports/RGS/RGSTransport.py:43 transports/RGS/TRGSTransport.py:48 +#: transports/TSNX/TSNXTransport.py:67 web/forms/LoginForm.py:60 +msgid "Password" +msgstr "Mot de passe" + +#: auths/ActiveDirectory/Authenticator.py:32 +#: auths/EDirectory/Authenticator.py:64 auths/RegexLdap/Authenticator.py:55 +#: auths/SimpleLDAP/Authenticator.py:53 +msgid "Password of the ldap user" +msgstr "Mot de passe de l'utilisateur ldap" + +#: auths/ActiveDirectory/Authenticator.py:33 +#: auths/EDirectory/Authenticator.py:65 auths/RegexLdap/Authenticator.py:56 +#: auths/SimpleLDAP/Authenticator.py:54 +#: services/Vmware/ServiceProviderVC.py:32 +msgid "Timeout" +msgstr "Temporisation" + +#: auths/ActiveDirectory/Authenticator.py:33 +#: auths/EDirectory/Authenticator.py:65 auths/RegexLdap/Authenticator.py:56 +#: auths/SimpleLDAP/Authenticator.py:54 +msgid "Timeout in seconds of connection to LDAP" +msgstr "Délai en secondes de la connexion à LDAP" + +#: auths/ActiveDirectory/Authenticator.py:35 +msgid "Active Directory Authenticator" +msgstr "Active Directory authentificateur" + +#: auths/ActiveDirectory/Authenticator.py:37 +#, fuzzy +msgid "Authenticate against Active Directory" +msgstr "Authentificateur sur Active Directory" + +#: auths/ActiveDirectory/Authenticator.py:46 +#: auths/EDirectory/Authenticator.py:77 auths/RegexLdap/Authenticator.py:74 +#: auths/SimpleLDAP/Authenticator.py:73 +#: services/Vmware/ServiceProviderVC.py:30 transports/NX/NXTransport.py:61 +#: transports/RDP/RDPTransport.py:37 transports/RDP/TSRDPTransport.py:41 +#: transports/RGS/RGSTransport.py:42 transports/RGS/TRGSTransport.py:47 +#: transports/TSNX/TSNXTransport.py:66 web/forms/LoginForm.py:59 +msgid "Username" +msgstr "Nom d'utilisateur" + +#: auths/ActiveDirectory/Authenticator.py:48 +#: auths/EDirectory/Authenticator.py:79 auths/RegexLdap/Authenticator.py:76 +#: auths/SimpleLDAP/Authenticator.py:75 +msgid "Group" +msgstr "Groupe" + +#: auths/ActiveDirectory/Authenticator.py:61 +#: auths/ActiveDirectory/Authenticator.py:395 +msgid "Must specify the username in the form USERNAME@DOMAIN.DOM" +msgstr "" +"Doit spécifier le nom d'utilisateur sous la forme NOMDEUTILISEUR@DOMAINE.DOM" + +#: auths/ActiveDirectory/Authenticator.py:127 +#: auths/EDirectory/Authenticator.py:123 auths/RegexLdap/Authenticator.py:157 +#: auths/SimpleLDAP/Authenticator.py:158 +msgid "Ldap connection error: " +msgstr "Erreur de connexion LDAP : " + +#: auths/ActiveDirectory/Authenticator.py:299 +#: auths/ActiveDirectory/Authenticator.py:345 +#: auths/EDirectory/Authenticator.py:243 auths/EDirectory/Authenticator.py:286 +#: auths/RegexLdap/Authenticator.py:244 auths/RegexLdap/Authenticator.py:287 +#: auths/SimpleLDAP/Authenticator.py:268 auths/SimpleLDAP/Authenticator.py:312 +msgid "Username not found" +msgstr "Nom d'utilisateur introuvable" + +#: auths/ActiveDirectory/Authenticator.py:332 +#: auths/SimpleLDAP/Authenticator.py:301 +msgid "Group not found" +msgstr "Groupe introuvable" + +#: auths/ActiveDirectory/Authenticator.py:364 +#: auths/ActiveDirectory/Authenticator.py:381 +#: auths/EDirectory/Authenticator.py:303 auths/RegexLdap/Authenticator.py:305 +#: auths/SimpleLDAP/Authenticator.py:327 auths/SimpleLDAP/Authenticator.py:341 +msgid "Too many results, be more specific" +msgstr "Trop de résultats, être plus spécifique" + +#: auths/ActiveDirectory/Authenticator.py:404 +msgid "Domain seems to be incorrect, please check it" +msgstr "Domaine semble incorrect, veuillez vérifier" + +#: auths/ActiveDirectory/Authenticator.py:409 +msgid "Ldap does not seem an Active Directory (do not have user objects)" +msgstr "" +"LDAP ne semble pas un serveur Active Directory (n'ont pas les objets " +"utilisateur)" + +#: auths/ActiveDirectory/Authenticator.py:417 +msgid "Ldap does not seem an Active Directory (no not have group objects)" +msgstr "" +"LDAP ne semble pas un serveur Active Directory (ne pas ont les objets de " +"groupe)" + +#: auths/ActiveDirectory/Authenticator.py:425 +msgid "" +"Ldap does not seem an Active Directory (do not have any user nor groups)" +msgstr "" +"LDAP ne semble pas un serveur Active Directory (n'ont pas tout utilisateur " +"ni les groupes)" + +#: auths/ActiveDirectory/Authenticator.py:430 +#: auths/EDirectory/Authenticator.py:358 auths/RegexLdap/Authenticator.py:380 +#: auths/SimpleLDAP/Authenticator.py:422 +msgid "Connection params seem correct, test was succesfully executed" +msgstr "" +"Connexion params semblent correctes, le test a été correctement exécutée" + +#: auths/EDirectory/Authenticator.py:61 auths/RegexLdap/Authenticator.py:52 +#: auths/SimpleLDAP/Authenticator.py:50 +#: services/Vmware/ServiceProviderVC.py:29 +msgid "Port" +msgstr "Port" + +#: auths/EDirectory/Authenticator.py:61 auths/RegexLdap/Authenticator.py:52 +#: auths/SimpleLDAP/Authenticator.py:50 +msgid "Ldap port (389 for non ssl, 636 for ssl normally" +msgstr "Port LDAP (389 non SSL, 636 pour ssl normalement" + +#: auths/EDirectory/Authenticator.py:62 auths/RegexLdap/Authenticator.py:53 +#: auths/SimpleLDAP/Authenticator.py:51 +msgid "" +"If checked, will use a ssl connection to ldap (if port is 389, will use in " +"fact port 636)" +msgstr "" +"Si cochée, utilise une connexion ssl à ldap (si le port est 389, utilisera " +"dans port de fait 636)" + +#: auths/EDirectory/Authenticator.py:63 +#, fuzzy +msgid "Admin user" +msgstr "Admin" + +#: auths/EDirectory/Authenticator.py:63 +#, fuzzy +msgid "Username with read privileges on the eDirectory" +msgstr "" +"Nom d'utilisateur avec des privilèges de lecture sur la base sélectionnée" + +#: auths/EDirectory/Authenticator.py:67 +#, fuzzy +msgid "eDirectory Authenticator" +msgstr "Active Directory authentificateur" + +#: auths/EDirectory/Authenticator.py:69 +#, fuzzy +msgid "Authenticate against eDirectory" +msgstr "Authentificateur sur Active Directory" + +#: auths/EDirectory/Authenticator.py:323 auths/RegexLdap/Authenticator.py:325 +#: auths/SimpleLDAP/Authenticator.py:362 +msgid "Ldap search base is incorrect" +msgstr "Base de recherche LDAP est incorrect" + +#: auths/EDirectory/Authenticator.py:328 auths/RegexLdap/Authenticator.py:330 +#: auths/SimpleLDAP/Authenticator.py:367 +msgid "Ldap user class seems to be incorrect (no user found by that class)" +msgstr "" +"Classe d'utilisateur LDAP semble incorrect (aucun utilisateur ne trouvé par " +"cette classe)" + +#: auths/EDirectory/Authenticator.py:336 auths/RegexLdap/Authenticator.py:346 +#: auths/SimpleLDAP/Authenticator.py:383 +msgid "" +"Ldap user id attribute seems to be incorrect (no user found by that " +"attribute)" +msgstr "" +"Attribut d'id utilisateur LDAP semble incorrect (aucun utilisateur ne " +"trouvée par qui attribut)" + +#: auths/EDirectory/Authenticator.py:344 +msgid "Expected group attribute " +msgstr "Attribut du groupe prévu " + +#: auths/EDirectory/Authenticator.py:353 +#, fuzzy +msgid "" +"Ldap user class or user id attr is probably wrong (Ldap is an eDirectory?)" +msgstr "" +"LDAP user utilisateur ou la classe id attr est probablement erroné (ne peut " +"pas trouver n'importe quel utilisateur avec les deux conditions)" + +#: auths/IP/Authenticator.py:45 auths/IP/Authenticator.py:47 +msgid "IP Authenticator" +msgstr "Authentificateur IP" + +#: auths/IP/Authenticator.py:51 +msgid "IP" +msgstr "IP " + +#: auths/IP/Authenticator.py:52 +msgid "IP Range" +msgstr "Plage d'adresses IP" + +#: auths/IP/Authenticator.py:99 auths/InternalDB/Authenticator.py:94 +msgid "All seems fine in the authenticator." +msgstr "Tout semble fine dans l'authentificateur." + +#: auths/InternalDB/Authenticator.py:46 +msgid "Internal Database" +msgstr "Base de données interne" + +#: auths/InternalDB/Authenticator.py:48 +msgid "Internal dabasase authenticator. Doesn't uses external sources" +msgstr "Dabasase interne authentificateur. N'utilise des sources externes" + +#: auths/InternalDB/Authenticator.py:91 +msgid "Internal structures seems ok" +msgstr "Les structures internes semble ok" + +#: auths/RegexLdap/Authenticator.py:54 auths/SimpleLDAP/Authenticator.py:52 +msgid "Username with read privileges on the base selected" +msgstr "" +"Nom d'utilisateur avec des privilèges de lecture sur la base sélectionnée" + +#: auths/RegexLdap/Authenticator.py:57 auths/SimpleLDAP/Authenticator.py:55 +msgid "Base" +msgstr "Base" + +#: auths/RegexLdap/Authenticator.py:57 auths/SimpleLDAP/Authenticator.py:55 +msgid "Common search base (used for \"users\" and \"groups\"" +msgstr "" +"Recherche commune base (utilisé pour les « utilisateurs » et « groupes »" + +#: auths/RegexLdap/Authenticator.py:58 auths/SimpleLDAP/Authenticator.py:56 +msgid "User class" +msgstr "Classe utilisateur" + +#: auths/RegexLdap/Authenticator.py:58 auths/SimpleLDAP/Authenticator.py:56 +msgid "Class for LDAP users (normally posixAccount)" +msgstr "Classe pour les utilisateurs de LDAP (normalement posixAccount)" + +#: auths/RegexLdap/Authenticator.py:59 auths/SimpleLDAP/Authenticator.py:57 +msgid "User Id Attr" +msgstr "Utilisateur Id Attr" + +#: auths/RegexLdap/Authenticator.py:59 auths/SimpleLDAP/Authenticator.py:57 +msgid "Attribute that contains the user id" +msgstr "Attribut qui contient l'id utilisateur" + +#: auths/RegexLdap/Authenticator.py:60 auths/SimpleLDAP/Authenticator.py:58 +msgid "User Name Attr" +msgstr "Utilisateur nom Attr" + +#: auths/RegexLdap/Authenticator.py:60 auths/SimpleLDAP/Authenticator.py:58 +msgid "Attributes that contains the user name (list of comma separated values)" +msgstr "" +"Attributs qui contient le nom d'utilisateur (liste de valeurs séparées par " +"des virgules)" + +#: auths/RegexLdap/Authenticator.py:61 +msgid "Group Name Attr" +msgstr "Groupe nom Attr" + +#: auths/RegexLdap/Authenticator.py:61 +msgid "Attribute that contains the group name" +msgstr "Attribut qui contient le nom du groupe" + +#: auths/RegexLdap/Authenticator.py:62 +msgid "Regular Exp. for groups" +msgstr "Exp régulière pour les groupes" + +#: auths/RegexLdap/Authenticator.py:62 +msgid "Regular Expression to extract the group name" +msgstr "Expression régulière pour extraire le nom du groupe" + +#: auths/RegexLdap/Authenticator.py:64 +msgid "Regex LDAP Authenticator" +msgstr "Authentificateur LDAP Regex" + +#: auths/RegexLdap/Authenticator.py:66 +msgid "Regular Expressions LDAP authenticator" +msgstr "Authentificateur de LDAP d'Expressions régulière" + +#: auths/RegexLdap/Authenticator.py:338 auths/SimpleLDAP/Authenticator.py:375 +msgid "Ldap group class seems to be incorrect (no group found by that class)" +msgstr "" +"Classe de groupe LDAP semble incorrect (aucun groupe ne trouvée par cette " +"classe)" + +#: auths/RegexLdap/Authenticator.py:356 auths/SimpleLDAP/Authenticator.py:391 +msgid "" +"Ldap group id attribute seems to be incorrect (no group found by that " +"attribute)" +msgstr "" +"Attribut d'id groupe LDAP semble incorrect (aucun groupe ne trouvée par qui " +"attribut)" + +#: auths/RegexLdap/Authenticator.py:365 auths/SimpleLDAP/Authenticator.py:400 +msgid "" +"Ldap user class or user id attr is probably wrong (can't find any user with " +"both conditions)" +msgstr "" +"LDAP user utilisateur ou la classe id attr est probablement erroné (ne peut " +"pas trouver n'importe quel utilisateur avec les deux conditions)" + +#: auths/SimpleLDAP/Authenticator.py:59 +msgid "Group class" +msgstr "Groupe classe" + +#: auths/SimpleLDAP/Authenticator.py:59 +msgid "Class for LDAP groups (normally poxisGroup)" +msgstr "Classe pour les groupes LDAP (normalement poxisGroup)" + +#: auths/SimpleLDAP/Authenticator.py:60 +msgid "Group Id Attr" +msgstr "Groupe Id Attr" + +#: auths/SimpleLDAP/Authenticator.py:60 +msgid "Attribute that contains the group id" +msgstr "Attribut qui contient l'id de groupe" + +#: auths/SimpleLDAP/Authenticator.py:61 +msgid "Group membership attr" +msgstr "Groupe adhésion attr" + +#: auths/SimpleLDAP/Authenticator.py:61 +msgid "Attribute of the group that contains the users belonging to it" +msgstr "Attribut du groupe qui contient les utilisateurs appartenant à elle" + +#: auths/SimpleLDAP/Authenticator.py:63 +msgid "SimpleLDAP Authenticator" +msgstr "Authentificateur SimpleLDAP" + +#: auths/SimpleLDAP/Authenticator.py:65 +msgid "Simple LDAP authenticator" +msgstr "Simple authentificateur LDAP" + +#: auths/SimpleLDAP/Authenticator.py:409 +msgid "" +"Ldap group class or group id attr is probably wrong (can't find any group " +"with both conditions)" +msgstr "" +"LDAP groupe classe ou groupe id attr est probablement erroné (ne peut pas " +"trouver n'importe quel groupe avec les deux conditions)" + +#: auths/SimpleLDAP/Authenticator.py:416 +msgid "Can't locate any group with the membership attribute specified" +msgstr "" +"Ne peut pas localiser n'importe quel groupe avec l'attribut d'appartenance " +"spécifié" + +#: core/BaseModule.py:196 +msgid "No connection checking method is implemented." +msgstr "Aucun lien vérifier la méthode n'est implémentée." + +#: core/BaseModule.py:248 +msgid "No check method provided." +msgstr "Aucune méthode de vérification fournie." + +#: core/managers/PublicationManager.py:156 +msgid "" +"Already publishing. Wait for previous publication to finish and try again" +msgstr "" +"Déjà la publication. Attendez une publication antérieure de terminer et " +"réessayez" + +#: core/managers/PublicationManager.py:168 +msgid "Can't cancel non running publication" +msgstr "Ne peut annuler la publication non courante" + +#: core/managers/PublicationManager.py:186 +msgid "Can't unpublish non usable publication" +msgstr "Ne peut annuler la publication publication non utilisable" + +#: core/managers/PublicationManager.py:189 +msgid "Can't unpublish publications with services in process" +msgstr "" +"Ne peut annuler la publication des publications avec services de processus" + +#: core/managers/UserPrefsManager.py:254 +msgid "Screen Size" +msgstr "Taille de l'écran" + +#: core/managers/UserPrefsManager.py:258 +msgid "Full Screen" +msgstr "Plein écran" + +#: core/managers/UserPrefsManager.py:261 +msgid "Screen colors" +msgstr "Couleurs de l'écran" + +#: core/managers/UserPrefsManager.py:262 +msgid "8 bits" +msgstr "8 bits" + +#: core/managers/UserPrefsManager.py:263 +msgid "16 bits" +msgstr "16 bits" + +#: core/managers/UserPrefsManager.py:264 +msgid "24 bits" +msgstr "24 bits" + +#: core/managers/UserPrefsManager.py:265 +msgid "32 bits" +msgstr "32 bits" + +#: core/managers/UserServiceManager.py:302 +msgid "Can't cancel non running operation" +msgstr "Ne peut annuler une opération non courante" + +#: core/managers/UserServiceManager.py:321 +msgid "Can't remove a non active element" +msgstr "Impossible de supprimer un élément non actif" + +#: core/managers/UserServiceManager.py:334 +msgid "Can't remove nor cancel {0} cause its states doesn't allows it" +msgstr "Ne peut pas supprimer ni annuler {0} cause ses États ne lui permet pas" + +#: core/osmanagers/BaseOsManager.py:50 +msgid "Base OS Manager" +msgstr "Gestionnaire d'OS de base" + +#: core/osmanagers/BaseOsManager.py:52 +msgid "Base Manager" +msgstr "Gestionnaire de base de" + +#: core/transports/BaseTransport.py:94 +msgid "Transport empty" +msgstr "Transport vide" + +#: core/util/State.py:59 +msgid "Active" +msgstr "Active" + +#: core/util/State.py:59 +msgid "Inactive" +msgstr "Inactif" + +#: core/util/State.py:59 +msgid "Blocked" +msgstr "Bloqué" + +#: core/util/State.py:59 +msgid "Waiting publication" +msgstr "Attente de publication" + +#: core/util/State.py:60 +msgid "In preparation" +msgstr "En préparation" + +#: core/util/State.py:60 +msgid "Valid" +msgstr "Valide" + +#: core/util/State.py:61 +msgid "Waiting for removal" +msgstr "Attente d'enlèvement" + +#: core/util/State.py:61 +msgid "Removing" +msgstr "Suppression" + +#: core/util/State.py:61 +msgid "Removed" +msgstr "Supprimé" + +#: core/util/State.py:61 +msgid "Canceled" +msgstr "Annulée" + +#: core/util/State.py:62 +msgid "Canceling" +msgstr "Annulation" + +#: core/util/State.py:62 templates/uds/error.html:6 +#: templates/uds/error.html.py:11 +msgid "Error" +msgstr "Erreur" + +#: core/util/State.py:62 +msgid "Running" +msgstr "En cours d'exécution" + +#: core/util/State.py:62 +msgid "Finished" +msgstr "Fini" + +#: core/util/State.py:62 +msgid "Waiting execution" +msgstr "Exécution en attente" + +#: osmanagers/LinuxOsManager/LinuxOsManager.py:44 +msgid "Linux OS Manager" +msgstr "Gestionnaire de système d'exploitation Linux" + +#: osmanagers/LinuxOsManager/LinuxOsManager.py:46 +msgid "" +"Os Manager to control linux virtual machines (basically renames machine and " +"notify state)" +msgstr "" +"Gestionnaire de l'os pour contrôler les machines virtuelles de linux " +"(essentiellement renomme machine et notifier l'État)" + +#: osmanagers/LinuxOsManager/LinuxOsManager.py:49 +#: osmanagers/WindowsOsManager/WindowsOsManager.py:40 +msgid "On Logout" +msgstr "Sur Logout" + +#: osmanagers/LinuxOsManager/LinuxOsManager.py:49 +#: osmanagers/WindowsOsManager/WindowsOsManager.py:40 +msgid "What to do when user logout from service" +msgstr "Que faire quand déconnexion de l'utilisateur du service" + +#: osmanagers/LinuxOsManager/LinuxOsManager.py:50 +#: osmanagers/WindowsOsManager/WindowsOsManager.py:41 +msgid "Keep service assigned" +msgstr "Garder les services affectés" + +#: osmanagers/LinuxOsManager/LinuxOsManager.py:51 +#: osmanagers/WindowsOsManager/WindowsOsManager.py:42 +msgid "Remove service" +msgstr "Retirer du service" + +#: osmanagers/LinuxOsManager/__init__.py:43 +msgid "UDS Actor for linux machines (Requires python 2.6 or greater)" +msgstr "" +"Acteur de l'UDS pour linux machines (nécessite le python 2.6 ou plus)" + +#: osmanagers/NoneOsManager/Manager.py:43 +msgid "None OS Manager" +msgstr "Aucun gestionnaire de l'OS" + +#: osmanagers/NoneOsManager/Manager.py:45 +msgid "Os Manager with no actions" +msgstr "Gestionnaire d'os avec aucune action" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:23 +msgid "Windows Domain OS Manager" +msgstr "Gestionnaire de système d'exploitation pour le domaine Windows" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:25 +msgid "" +"Os Manager to control windows machines with domain. (Basically renames " +"machine)" +msgstr "" +"Os Manager pour contrôler les machines windows avec le domaine. " +"(Essentiellement renomme machine)" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:29 +#: transports/RDP/RDPTransport.py:39 transports/RDP/TSRDPTransport.py:43 +#: transports/RGS/RGSTransport.py:44 transports/RGS/TRGSTransport.py:49 +msgid "Domain" +msgstr "Domaine" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:29 +msgid "Domain to join machines to (better use dns form of domain)" +msgstr "" +"Domaine de rejoindre les machines (mieux utiliser le formulaire de dns du " +"domaine)" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:30 +msgid "Account" +msgstr "Compte" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:30 +msgid "Account with rights to add machines to domain" +msgstr "Compte avec droits d'ajouter des machines à domaine" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:31 +msgid "Password of the account" +msgstr "Mot de passe du compte" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:32 +msgid "OU" +msgstr "OU" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:32 +msgid "" +"Organizational unit where to add machines in domain (check it before using " +"it)" +msgstr "" +"Unité organisationnelle où ajouter des machines dans le domaine (vérifier il " +"avant d'utiliser GTG" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:40 +msgid "Must provide a domain!!!" +msgstr "Doit fournir un domaine!!!" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:42 +msgid "Must provide an account to add machines to domain!!!" +msgstr "Doit fournir un compte pour ajouter des machines à domaine!!!" + +#: osmanagers/WindowsOsManager/WinDomainOsManager.py:44 +msgid "Must provide a password for the account!!!" +msgstr "Doit fournir un mot de passe du compte!!!" + +#: osmanagers/WindowsOsManager/WindowsOsManager.py:35 +msgid "Windows Basic OS Manager" +msgstr "Gestionnaire de base de Windows OS" + +#: osmanagers/WindowsOsManager/WindowsOsManager.py:37 +msgid "" +"Os Manager to control windows machines without domain. (Basically renames " +"machine)" +msgstr "" +"Os Manager pour contrôler les machines windows sans domaine. " +"(Essentiellement renomme machine)" + +#: osmanagers/WindowsOsManager/WindowsOsManager.py:51 +msgid "Length must be numeric!!" +msgstr "La longueur doit être numérique!!" + +#: osmanagers/WindowsOsManager/WindowsOsManager.py:53 +msgid "Length must be betwen 1 and six" +msgstr "La longueur doit être images 1 et six" + +#: osmanagers/WindowsOsManager/__init__.py:23 +msgid "" +"UDS Actor for windows machines (Important!! Requires .net framework 3.5 " +"sp1)" +msgstr "" +"Acteur de l'UDS pour machines windows (Important!! Nécessite le .net " +"framework 3.5 SP1)" + +#: services/PhysicalMachines/IPMachineDeployed.py:56 +msgid "IP " +msgstr "IP " + +#: services/PhysicalMachines/IPMachinesService.py:46 +msgid "List of IPS" +msgstr "Liste des IPS" + +#: services/PhysicalMachines/IPMachinesService.py:49 +msgid "Physical machines accesed by ip" +msgstr "Accesed de machines physiques par ip" + +#: services/PhysicalMachines/IPMachinesService.py:51 +msgid "This service provides access to POWERED-ON Machines by ip" +msgstr "Ce service permet d'accéder aux machines SOUS-TENSION par ip" + +#: services/Sample/SampleProvider.py:142 +msgid "Methuselah is not alive!!! :-)" +msgstr "Mathusalem n'est pas vivant!!! :-)" + +#: services/Sample/SampleProvider.py:182 +msgid "Nothing tested, but all went fine.." +msgstr "Rien à l'épreuve, mais tout s'est bien passé..." + +#: services/Sample/SamplePublication.py:199 +msgid "Random integer was 9!!! :-)" +msgstr "Nombre entier aléatoire était 9!!! :-)" + +#: services/Vmware/Helpers.py:72 +msgid "Local" +msgstr "Local" + +#: services/Vmware/Helpers.py:74 +msgid "Remote" +msgstr "Distant" + +#: services/Vmware/PublicationVC.py:36 +msgid "Publication" +msgstr "Publication" + +#: services/Vmware/PublicationVC.py:37 +msgid "UDS Publication for {0} created at {1}" +msgstr "Publication de l'UDS pour {0} créé à {1}" + +#: services/Vmware/ServiceProviderVC.py:29 +msgid "VMWare VC Server Port (usually 443)" +msgstr "Port du serveur VMWare VC (habituellement 443)" + +#: services/Vmware/ServiceProviderVC.py:30 +msgid "User with valid privileges on VC" +msgstr "Utilisateur avec des privilèges valides sur VC" + +#: services/Vmware/ServiceProviderVC.py:31 +msgid "Password of the user of the VC" +msgstr "Mot de passe de l'utilisateur de la Croix de Victoria" + +#: services/Vmware/ServiceProviderVC.py:32 +msgid "Timeout in seconds of connection to VC" +msgstr "Délai en secondes de connexion à VC" + +#: services/Vmware/ServiceProviderVC.py:33 +msgid "Macs range" +msgstr "Gamme Mac" + +#: services/Vmware/ServiceProviderVC.py:34 +msgid "Range of valids macs for created machines" +msgstr "Gamme de Mac valides pour les machines créés" + +#: services/Vmware/ServiceProviderVC.py:39 +msgid "VMWare Virtual Center Provider" +msgstr "VMWare Virtual Center fournisseur" + +#: services/Vmware/ServiceProviderVC.py:41 +msgid "Provides connection to Virtual Center Services" +msgstr "Fournit la connexion aux Services du Centre virtuel" + +#: services/Vmware/ServiceProviderVC.py:111 +msgid "Error testing connection" +msgstr "Connexion essai erreur" + +#: services/Vmware/ServiceProviderVC.py:114 +msgid "VmwareVC Provider: " +msgstr "VmwareVC fournisseur : " + +#: services/Vmware/ServiceProviderVC.py:120 +msgid "Connection params ok" +msgstr "Connexion params ok" + +#: services/Vmware/ServiceProviderVC.py:121 +msgid "Connection failed. Check connection params" +msgstr "Échec de la connexion. Vérifiez la connexion params" + +#: services/Vmware/VCLinkedCloneService.py:28 +msgid "Datacenter" +msgstr "Datacenter" + +#: services/Vmware/VCLinkedCloneService.py:34 +msgid "Datacenter containing base machine" +msgstr "Machine de base contenant Datacenter" + +#: services/Vmware/VCLinkedCloneService.py:36 +msgid "Network" +msgstr "Réseau" + +#: services/Vmware/VCLinkedCloneService.py:37 +msgid "" +"If more than 1 interface is found in machine, use one on this network as main" +msgstr "" +"Si plus de 1 interface est trouvé dans la machine, utilisez l'une sur ce " +"réseau comme principal" + +#: services/Vmware/VCLinkedCloneService.py:38 +msgid "Pub. Resource Pool" +msgstr "Pub. Ressource Pool" + +#: services/Vmware/VCLinkedCloneService.py:38 +msgid "Resource Pool where deploy clones" +msgstr "Ressource Pool déployer où les clones" + +#: services/Vmware/VCLinkedCloneService.py:39 +msgid "Clones Folder" +msgstr "Dossier de clones" + +#: services/Vmware/VCLinkedCloneService.py:39 +msgid "Folder where deploy clones" +msgstr "Dossier où déployer clones" + +#: services/Vmware/VCLinkedCloneService.py:40 +msgid "Resource Pool" +msgstr "Ressource Pool" + +#: services/Vmware/VCLinkedCloneService.py:46 +msgid "Resource Pool containing base machine" +msgstr "Machine base contenant de ressource Pool" + +#: services/Vmware/VCLinkedCloneService.py:48 +msgid "Base Machine" +msgstr "Machine de base" + +#: services/Vmware/VCLinkedCloneService.py:48 +msgid "Base machine for this service" +msgstr "Machine de base pour ce service." + +#: services/Vmware/VCLinkedCloneService.py:49 +msgid "Memory (Mb)" +msgstr "Mémoire (Mb)" + +#: services/Vmware/VCLinkedCloneService.py:50 +msgid "Memory for machines deployed from this service" +msgstr "Mémoire pour les machines déployés à partir de ce service" + +#: services/Vmware/VCLinkedCloneService.py:51 +msgid "Datastores" +msgstr "Magasins de données" + +#: services/Vmware/VCLinkedCloneService.py:52 +msgid "Datastores where to put incrementals" +msgstr "Magasins de données où mettre des sauvegardes incrémentielles" + +#: services/Vmware/VCLinkedCloneService.py:53 +msgid "Machine Names" +msgstr "Noms de machine" + +#: services/Vmware/VCLinkedCloneService.py:53 +msgid "Base name for clones from this machine" +msgstr "Nom de base des clones de cette machine." + +#: services/Vmware/VCLinkedCloneService.py:54 +msgid "Name Length" +msgstr "Longueur du nom" + +#: services/Vmware/VCLinkedCloneService.py:55 +msgid "Length of numeric part for the names of this machines (betwen 3 and 6" +msgstr "" +"Longueur de la partie numérique pour les noms de ces machines (images 3 et 6" + +#: services/Vmware/VCLinkedCloneService.py:62 +msgid "VMWare Linked clone base" +msgstr "Base de clone lié VMWare" + +#: services/Vmware/VCLinkedCloneService.py:64 +msgid "" +"This service provides access to Linked Clones machines on a Virtual Center" +msgstr "" +"Ce service donne accès aux machines de Clones liés sur un centre virtuel" + +#: services/Vmware/VCLinkedCloneService.py:70 +msgid "Number of desired machines to keep running waiting for a user" +msgstr "Nombre de machines désirés de courir d'attente pour un utilisateur." + +#: services/Vmware/VCLinkedCloneService.py:72 +msgid "Number of desired machines to keep suspended waiting for use" +msgstr "" +"Nombre de machines désirés pour garder suspendu en attente pour utilisation" + +#: services/Vmware/VCLinkedCloneService.py:93 +msgid "The length of basename plus length must not be greater than 15" +msgstr "" +"La longueur du nom de base plus la longueur ne doit pas être supérieure à 15" + +#: services/Vmware/VCLinkedCloneService.py:95 +msgid "The machine name can't be only numbers" +msgstr "Nom de l'ordinateur ne peut pas être uniquement des nombres" + +#: templates/404.html:4 templates/404.html.py:7 +msgid "Page not found" +msgstr "Page non trouvée" + +#: templates/404.html:9 +msgid "Sorry, but the requested page could not be found." +msgstr "Désolé, mais la page demandée n'a pas pu être trouvée." + +#: templates/uds/base.html:7 +msgid "UDS" +msgstr "UDS" + +#: templates/uds/downloads.html:8 templates/uds/snippets/admin_user.html:7 +msgid "Downloads" +msgstr "Téléchargements" + +#: templates/uds/downloads.html:11 +msgid "" +"This page contains a list of downloadables provided by different modules" +msgstr "" +"Cette page contient une liste de téléchargeables fournis par différents " +"modules" + +#: templates/uds/index.html:51 +msgid "Services" +msgstr "Services" + +#: templates/uds/index.html:70 +msgid "Java not found" +msgstr "Java non trouvé" + +#: templates/uds/index.html:71 +msgid "" +"Java is not available on your browser, and the selected transport needs it." +msgstr "" +"Java n'est pas disponible sur votre navigateur, et le transport sélectionné " +"en a besoin." + +#: templates/uds/index.html:72 +msgid "Please, install latest version from" +msgstr "Veuillez installer une version plus récente de" + +#: templates/uds/index.html:72 +msgid "Java website" +msgstr "Site Web Java" + +#: templates/uds/index.html:72 +msgid "and restart browser" +msgstr "Redémarrez le navigateur" + +#: templates/uds/index.html:78 +msgid "Ip" +msgstr "IP" + +#: templates/uds/index.html:79 +msgid "Networks" +msgstr "Réseaux" + +#: templates/uds/index.html:80 +msgid "Transports" +msgstr "Transports" + +#: templates/uds/internal_page.html:28 +msgid "User" +msgstr "Utilisateur" + +#: templates/uds/internal_page.html:34 templates/uds/prefs.html:12 +msgid "Preferences" +msgstr "Préférences" + +#: templates/uds/internal_page.html:40 +msgid "Log out" +msgstr "Déconnexion" + +#: templates/uds/login.html:6 +msgid "Login to UDS" +msgstr "Connexion à UDS" + +#: templates/uds/login.html:78 +msgid "Login" +msgstr "Login" + +#: templates/uds/login.html:83 +msgid "Login data" +msgstr "Données de connexion" + +#: templates/uds/login.html:86 +msgid "Enter" +msgstr "Entrez" + +#: templates/uds/login.html:93 +msgid "Back to login" +msgstr "Retour à la connexion" + +#: templates/uds/prefs.html:6 +msgid "UDS User Preferences" +msgstr "Préférences de l'utilisateur UDS" + +#: templates/uds/prefs.html:16 +msgid "Save Preferences" +msgstr "Enregistrer les préférences" + +#: templates/uds/service_not_ready.html:6 +msgid "Service not ready at this moment. Please, try again in a while." +msgstr "" +"Le service n'est pas prêt à ce moment. S'il vous plaît, essayez à nouveau de " +"temps en temps." + +#: templates/uds/snippets/admin_user.html:4 +msgid "Admin" +msgstr "Admin" + +#: templates/uds/snippets/back_to_list.html:3 +msgid "Back to services list" +msgstr "Retour à la liste de services" + +#: templates/uds/snippets/lang.html:9 +msgid "Language" +msgstr "Langue" + +#: transports/NX/NXTransport.py:54 +msgid "NX Transport (direct)" +msgstr "NX Transport (direct)" + +#: transports/NX/NXTransport.py:56 +msgid "NX Transport for direct connection" +msgstr "NX Transport pour une connexion directe" + +#: transports/NX/NXTransport.py:60 transports/RDP/RDPTransport.py:36 +#: transports/RDP/TSRDPTransport.py:40 transports/RGS/RGSTransport.py:41 +#: transports/RGS/TRGSTransport.py:46 transports/TSNX/TSNXTransport.py:65 +msgid "Empty creds" +msgstr "Références vide" + +#: transports/NX/NXTransport.py:60 transports/RDP/RDPTransport.py:36 +#: transports/RDP/TSRDPTransport.py:40 transports/RGS/RGSTransport.py:41 +#: transports/RGS/TRGSTransport.py:46 transports/TSNX/TSNXTransport.py:65 +msgid "If checked, the credentials used to connect will be emtpy" +msgstr "" +"Si coché, les informations d'identification utilisées pour se connecter sera " +"vide" + +#: transports/NX/NXTransport.py:61 transports/RDP/RDPTransport.py:37 +#: transports/RDP/TSRDPTransport.py:41 transports/RGS/RGSTransport.py:42 +#: transports/RGS/TRGSTransport.py:47 transports/TSNX/TSNXTransport.py:66 +msgid "If not empty, this username will be always used as credential" +msgstr "" +"Si ce n'est vide, ce nom d'utilisateur sera toujours utilisé comme des " +"titres de compétences" + +#: transports/NX/NXTransport.py:62 transports/RDP/RDPTransport.py:38 +#: transports/RDP/TSRDPTransport.py:42 transports/RGS/RGSTransport.py:43 +#: transports/RGS/TRGSTransport.py:48 transports/TSNX/TSNXTransport.py:67 +msgid "If not empty, this password will be always used as credential" +msgstr "" +"Si ce n'est vide, ce mot de passe sera toujours utilisé comme des titres de " +"compétences" + +#: transports/NX/NXTransport.py:63 transports/TSNX/TSNXTransport.py:68 +msgid "Listen port" +msgstr "Écouter le port" + +#: transports/NX/NXTransport.py:63 transports/TSNX/TSNXTransport.py:68 +msgid "Listening port of NX (ssh) at client machine" +msgstr "Écoute le port de NX (ssh) à la machine client" + +#: transports/NX/NXTransport.py:64 transports/TSNX/TSNXTransport.py:69 +msgid "Connection" +msgstr "Connexion" + +#: transports/NX/NXTransport.py:64 transports/TSNX/TSNXTransport.py:69 +msgid "Connection speed for this transport (quality)" +msgstr "Vitesse de connexion pour ce transport (qualité)" + +#: transports/NX/NXTransport.py:71 transports/TSNX/TSNXTransport.py:76 +msgid "Session" +msgstr "Session" + +#: transports/NX/NXTransport.py:71 transports/TSNX/TSNXTransport.py:76 +msgid "Desktop session" +msgstr "Session de bureau" + +#: transports/NX/NXTransport.py:76 transports/TSNX/TSNXTransport.py:81 +msgid "Disk Cache" +msgstr "Cache disque" + +#: transports/NX/NXTransport.py:76 transports/TSNX/TSNXTransport.py:81 +msgid "Cache size en Mb stored at disk" +msgstr "Cache en taille que Mo stocké à disque" + +#: transports/NX/NXTransport.py:84 transports/TSNX/TSNXTransport.py:89 +msgid "Memory Cache" +msgstr "Mémoire Cache" + +#: transports/NX/NXTransport.py:84 transports/TSNX/TSNXTransport.py:89 +msgid "Cache size en Mb keept at memory" +msgstr "Taille en Mb montagne à la mémoire de cache." + +#: transports/NX/__init__.py:42 transports/TSNX/__init__.py:42 +msgid "NX Protocol" +msgstr "Protocole de NX" + +#: transports/NX/__init__.py:48 +msgid "UDS Actor connector for NX (requires nomachine packages)" +msgstr "Connecteur UDS acteur pour NX (nécessite nomachine packages)" + +#: transports/NX/web.py:74 +msgid "" +"In order to use this transport, you need to install first Nomachine Nx " +"Client version 3.5.x" +msgstr "" +"Afin d'utiliser ce transport, vous devez installer le premier Nomachine Nx " +"Client version 3.5.x" + +#: transports/NX/web.py:75 +msgid "you can obtain it for your platform from" +msgstr "vous pouvez l'obtenir pour votre plate-forme de" + +#: transports/NX/web.py:75 +msgid "nochamine web site" +msgstr "site web de nochamine" + +#: transports/RDP/RDPTransport.py:30 +msgid "RDP Transport (direct)" +msgstr "Transport de RDP (direct)" + +#: transports/RDP/RDPTransport.py:32 +msgid "RDP Transport for direct connection" +msgstr "Transport de RDP pour une connexion directe" + +#: transports/RDP/RDPTransport.py:39 transports/RDP/TSRDPTransport.py:43 +#: transports/RGS/RGSTransport.py:44 transports/RGS/TRGSTransport.py:49 +msgid "" +"If not empty, this domain will be always used as credential (used as DOMAIN" +"\\user)" +msgstr "" +"Si ce n'est vide, ce domaine sera toujours utilisé comme des titres de " +"compétences (utilisé comme domaine\\User)" + +#: transports/RDP/RDPTransport.py:40 transports/RDP/TSRDPTransport.py:44 +msgid "Allow Smartcards" +msgstr "Permettre aux cartes à puce" + +#: transports/RDP/RDPTransport.py:40 transports/RDP/TSRDPTransport.py:44 +msgid "If checked, this transport will allow the use of smartcards" +msgstr "Si cochée, ce transport permettra l'utilisation de cartes à puce" + +#: transports/RDP/RDPTransport.py:41 transports/RDP/TSRDPTransport.py:45 +msgid "Allow Printers" +msgstr "Permettre aux imprimantes" + +#: transports/RDP/RDPTransport.py:41 transports/RDP/TSRDPTransport.py:45 +msgid "If checked, this transport will allow the use of user printers" +msgstr "" +"Si cochée, ce transport permettra l'utilisation des imprimantes utilisateur" + +#: transports/RDP/RDPTransport.py:42 transports/RDP/TSRDPTransport.py:46 +msgid "Allow Drives" +msgstr "Permettre aux lecteurs" + +#: transports/RDP/RDPTransport.py:42 transports/RDP/TSRDPTransport.py:46 +msgid "If checked, this transport will allow the use of user drives" +msgstr "" +"Si cochée, ce transport permettra l'utilisation des lecteurs de l'utilisateur" + +#: transports/RDP/RDPTransport.py:43 transports/RDP/TSRDPTransport.py:47 +msgid "Allow Serials" +msgstr "Permettre aux publications en série" + +#: transports/RDP/RDPTransport.py:43 transports/RDP/TSRDPTransport.py:47 +msgid "If checked, this transport will allow the use of user serial ports" +msgstr "" +"Si cochée, ce transport permettra l'utilisation de l'utilisateur ports série" + +#: transports/RDP/TSRDPTransport.py:31 +msgid "RDP Transport (tunneled)" +msgstr "Transport de RDP (tunnel)" + +#: transports/RDP/TSRDPTransport.py:33 +msgid "RDP Transport for tunneled connection" +msgstr "Transport de RDP de connexion tunnelée" + +#: transports/RDP/TSRDPTransport.py:37 transports/RGS/TRGSTransport.py:43 +#: transports/TSNX/TSNXTransport.py:62 +msgid "Tunnel server" +msgstr "Serveur de tunnel" + +#: transports/RDP/TSRDPTransport.py:37 transports/RGS/TRGSTransport.py:43 +#: transports/TSNX/TSNXTransport.py:62 +msgid "" +"IP or Hostname of tunnel server send to client device (\"public\" ip) and " +"port. (use HOST:PORT format)" +msgstr "" +"IP ou nom d'hôte du serveur de tunnel envoyer à la machine cliente (« public " +"» ip) et port. (utilisez le format de l'hôte : PORT)" + +#: transports/RDP/TSRDPTransport.py:38 transports/RGS/TRGSTransport.py:44 +#: transports/TSNX/TSNXTransport.py:63 +msgid "Tunnel host check" +msgstr "Tunnel hôte cocher" + +#: transports/RDP/TSRDPTransport.py:38 transports/RGS/TRGSTransport.py:44 +#: transports/TSNX/TSNXTransport.py:63 +msgid "" +"If not empty, this server will be used to check if service is running before " +"assigning it to user. (use HOST:PORT format)" +msgstr "" +"Si ce n'est vide, ce serveur sera utilisé pour vérifier si le service " +"s'exécute avant assignant à l'utilisateur. (utilisez le format de l'hôte : " +"PORT)" + +#: transports/RDP/__init__.py:20 +msgid "Remote Desktop Protocol" +msgstr "Protocole Bureau distant" + +#: transports/RDP/web.py:83 +msgid "In order to use this service, you should first install CoRD." +msgstr "Afin d'utiliser ce service, vous devez d'abord installer cordon." + +#: transports/RDP/web.py:84 transports/RGS/web.py:82 +msgid "You can obtain it from" +msgstr "Vous pouvez l'obtenir de" + +#: transports/RDP/web.py:84 +msgid "CoRD Website" +msgstr "Site Web du cordon" + +#: transports/RGS/RGSTransport.py:34 +#, fuzzy +msgid "RGS Transport (direct)" +msgstr "Transport de RDP (direct)" + +#: transports/RGS/RGSTransport.py:36 +#, fuzzy +msgid "RGS Transport for direct connection" +msgstr "Transport de RDP pour une connexion directe" + +#: transports/RGS/RGSTransport.py:45 transports/RGS/TRGSTransport.py:50 +msgid "Image quality" +msgstr "Qualité de l'image" + +#: transports/RGS/RGSTransport.py:46 transports/RGS/TRGSTransport.py:51 +msgid "Quality of image codec (0-100)" +msgstr "Qualité du codec d'image (0-100)" + +#: transports/RGS/RGSTransport.py:47 transports/RGS/TRGSTransport.py:52 +msgid "Adjustable Quality" +msgstr "Qualité réglable" + +#: transports/RGS/RGSTransport.py:48 transports/RGS/TRGSTransport.py:53 +msgid "If checked, the image quality will be adjustable with bandwidth" +msgstr "Si cochée, la qualité de l'image sera réglable avec bande passante" + +#: transports/RGS/RGSTransport.py:49 transports/RGS/TRGSTransport.py:54 +msgid "Min. Adjustable Quality" +msgstr "Min. qualité réglable" + +#: transports/RGS/RGSTransport.py:50 transports/RGS/TRGSTransport.py:55 +msgid "" +"The lowest image quality applied to images to maintain the minimum update " +"rate." +msgstr "" +"La qualité de l'image plus bas appliquée aux images afin de maintenir la " +"mise à jour minimum taux." + +#: transports/RGS/RGSTransport.py:51 transports/RGS/TRGSTransport.py:56 +msgid "Adjustable Frame Rate" +msgstr "Cadence réglable" + +#: transports/RGS/RGSTransport.py:52 transports/RGS/TRGSTransport.py:57 +msgid "Update rate threshold to begin adjusting image quality" +msgstr "" +"Seuil de vitesse de mise à jour pour commencer à ajuster la qualité de " +"l'image" + +#: transports/RGS/RGSTransport.py:53 transports/RGS/TRGSTransport.py:58 +msgid "Match Local Resolution" +msgstr "Résolution locale de match" + +#: transports/RGS/RGSTransport.py:54 transports/RGS/TRGSTransport.py:59 +msgid "" +"Change the Sender's resolution to match the Receiver's resolution when " +"connecting" +msgstr "" +"Modifier la résolution de l'expéditeur pour faire correspondre la résolution " +"du séquestre lors de la connexion" + +#: transports/RGS/RGSTransport.py:55 transports/RGS/TRGSTransport.py:60 +msgid "Redirect USB" +msgstr "Redirection USB" + +#: transports/RGS/RGSTransport.py:56 transports/RGS/TRGSTransport.py:61 +msgid "If checked, the USB will be redirected." +msgstr "Si cochée, la clé USB est redirigée." + +#: transports/RGS/RGSTransport.py:57 transports/RGS/TRGSTransport.py:62 +msgid "Redirect Audio" +msgstr "Redirection Audio" + +#: transports/RGS/RGSTransport.py:58 transports/RGS/TRGSTransport.py:63 +#, fuzzy +msgid "If checked, the Audio will be redirected." +msgstr "" +"Si coché, les informations d'identification utilisées pour se connecter sera " +"vide" + +#: transports/RGS/RGSTransport.py:59 transports/RGS/TRGSTransport.py:64 +msgid "Redirect Mic" +msgstr "Redirection Mic" + +#: transports/RGS/RGSTransport.py:60 transports/RGS/TRGSTransport.py:65 +#, fuzzy +msgid "If checked, the Mic will be redirected." +msgstr "" +"Si coché, les informations d'identification utilisées pour se connecter sera " +"vide" + +#: transports/RGS/TRGSTransport.py:36 +#, fuzzy +msgid "RGS Transport (tunneled)" +msgstr "Transport de RDP (tunnel)" + +#: transports/RGS/TRGSTransport.py:38 +#, fuzzy +msgid "RGS Transport for tunneled connection" +msgstr "Transport de RDP de connexion tunnelée" + +#: transports/RGS/web.py:81 +#, fuzzy +msgid "In order to use this service, you should first install RGS Receiver." +msgstr "Afin d'utiliser ce service, vous devez d'abord installer cordon." + +#: transports/RGS/web.py:82 +#, fuzzy +msgid "HP Website" +msgstr "Site Web du cordon" + +#: transports/TSNX/TSNXTransport.py:55 +msgid "NX Transport (tunneled)" +msgstr "Transport NX (tunnel)" + +#: transports/TSNX/TSNXTransport.py:57 +msgid "NX Transport for tunneled connection" +msgstr "Transport NX pour connexion tunnelée" + +#: web/errors.py:53 +msgid "Unknown error" +msgstr "Erreur inconnue" + +#: web/errors.py:54 +msgid "Transport not found" +msgstr "Transport introuvable" + +#: web/errors.py:55 +msgid "Service not found" +msgstr "Service introuvable" + +#: web/errors.py:56 xmlrpc/auths/AdminAuth.py:147 +msgid "Access denied" +msgstr "Accès refusé" + +#: web/errors.py:57 +msgid "" +"Invalid service. The service is not available at this moment. Please, try " +"later" +msgstr "" +"Service non valide. Le service n'est pas disponible en ce moment. SVP, " +"essayez plus tard" + +#: web/errors.py:58 +msgid "Maximum services limit reached. Please, contact administrator" +msgstr "" +"Limite de services maximale atteinte. Veuillez contacter administrateur" + +#: web/errors.py:59 +msgid "You need to enable cookies to let this application work" +msgstr "Vous devez activer les cookies de laisser cette application" + +#: web/errors.py:60 +msgid "User service not found" +msgstr "Service utilisateur introuvable" + +#: web/forms/LoginForm.py:61 +msgid "Authenticator" +msgstr "Authentificateur" + +#: xmlrpc/auths/AdminAuth.py:91 +msgid "Credentials no longer valid" +msgstr "Informations d'identification n'est plus valides" + +#: xmlrpc/auths/AdminAuth.py:125 +msgid "Administration" +msgstr "Administration" + +#: xmlrpc/auths/AdminAuth.py:140 +msgid "Invalid credentials" +msgstr "Informations d'identification non valides" + +#: xmlrpc/auths/AdminAuth.py:145 +msgid "Invalid authenticator" +msgstr "Authentificateur non valide" + +#: xmlrpc/auths/Authenticators.py:104 +msgid "Authenticator does not exists" +msgstr "Authentificateur n'existe pas" + +#: xmlrpc/auths/Authenticators.py:158 xmlrpc/osmanagers/OSManagers.py:115 +#: xmlrpc/services/ServiceProviders.py:115 xmlrpc/services/Services.py:159 +#: xmlrpc/transports/Networks.py:86 xmlrpc/transports/Networks.py:97 +#, python-format +msgid "Name %s already exists" +msgstr "Nom %s existe déjà" + +#: xmlrpc/auths/Authenticators.py:229 +msgid "Authenticator do not supports search" +msgstr "Authenticateur ne soutient la recherche" + +#: xmlrpc/auths/Authenticators.py:235 +msgid "Specified authenticator do not exists anymore. Please, reload gui" +msgstr "Authentificateur spécifiée n'existe pas plus. Veuillez recharger gui" + +#: xmlrpc/auths/Authenticators.py:239 +msgid "BUG: Reached a point that should never have been reached!!!" +msgstr "BOGUE : Atteint un point qui devrait jamais été atteint!!!" + +#: xmlrpc/osmanagers/OSManagers.py:129 +msgid "This os mnager is being used by deployed services" +msgstr "" +"Ce gestionnaire de système d'exploitation est utilisé par les services de " +"déploiements" + +#: xmlrpc/osmanagers/OSManagers.py:145 +msgid "There is deployed services using this os manager" +msgstr "" +"Il y a des services déployées à l'aide de ce gestionnaire de système " +"d'exploitation" + +#: xmlrpc/osmanagers/OSManagers.py:147 +msgid "Can't find os manager" +msgstr "Impossible de trouver os gestionnaire" + +#: xmlrpc/services/DeployedServices.py:52 +msgid "Unknown" +msgstr "Inconnu" + +#: xmlrpc/services/DeployedServices.py:112 +#: xmlrpc/services/DeployedServices.py:176 +#: xmlrpc/services/DeployedServices.py:195 +#: xmlrpc/services/DeployedServices.py:211 +#: xmlrpc/services/DeployedServices.py:225 +#: xmlrpc/services/DeployedServices.py:252 +#: xmlrpc/services/DeployedServices.py:266 +msgid "Deployed Service does not exists" +msgstr "Service déployée n'existe pas" + +#: xmlrpc/services/DeployedServices.py:209 +msgid "Group does not exists" +msgstr "Groupe n'existe pas" + +#: xmlrpc/services/DeployedServices.py:237 +msgid "Can't find deployed service" +msgstr "Impossible de trouver le service déployé" + +#: xmlrpc/services/DeployedServices.py:250 +msgid "Transport does not exists" +msgstr "Transport n'existe pas" + +#: xmlrpc/services/DeployedServices.py:281 +msgid "Deployed service does not exists" +msgstr "Service déployée n'existe pas" + +#: xmlrpc/services/ServiceProviders.py:142 +msgid "Can't delete service provider with services associated" +msgstr "" +"Impossible de supprimer le fournisseur de service avec services associés" + +#: xmlrpc/services/ServiceProviders.py:145 +msgid "Can't locate the service provider" +msgstr "Impossible de trouver le fournisseur de services" + +#: xmlrpc/services/ServiceProviders.py:145 xmlrpc/services/Services.py:189 +#: xmlrpc/transports/Networks.py:70 xmlrpc/transports/Networks.py:78 +#: xmlrpc/transports/Networks.py:95 +msgid "Please, refresh interface" +msgstr "Veuillez actualiser interface" + +#: xmlrpc/services/Services.py:186 +msgid "Can't delete services with deployed services associated" +msgstr "Impossible de supprimer les services avec des services déployés liés" + +#: xmlrpc/services/Services.py:189 +msgid "Can't locate the service" +msgstr "Impossible de localiser le service" + +#: xmlrpc/services/UserDeployedServices.py:94 +#: xmlrpc/services/UserDeployedServices.py:110 +msgid "The deployed service is not active" +msgstr "Le service de déploiement n'est pas actif" + +#: xmlrpc/services/UserDeployedServices.py:97 +#: xmlrpc/services/UserDeployedServices.py:113 +msgid "This service don't allows assignations" +msgstr "Ce service ne permet l'assignation" + +#: xmlrpc/services/UserDeployedServices.py:102 +#: xmlrpc/services/UserDeployedServices.py:120 +msgid "Deployed service not found!!! (refresh interface)" +msgstr "Déployées service introuvable!!! (actualisation interface)" + +#: xmlrpc/services/UserDeployedServices.py:122 +msgid "User not found!!! (refresh interface)" +msgstr "Utilisateur introuvable!!! (actualisation interface)" + +#: xmlrpc/services/UserDeployedServices.py:141 +msgid "No error" +msgstr "Pas d'erreur" + +#: xmlrpc/services/UserDeployedServices.py:147 +msgid "User deployed service not found!!!" +msgstr "Service de l'utilisateur ne se trouve pas déployée!!!" + +#: xmlrpc/transports/Networks.py:70 +msgid "Can't locate the transport" +msgstr "Impossible de localiser le transport" + +#: xmlrpc/transports/Networks.py:78 xmlrpc/transports/Networks.py:95 +msgid "Can't locate the network" +msgstr "Impossible de localiser le réseau" + +#~ msgid "Base Service" +#~ msgstr "Service de base" + +#~ msgid "None" +#~ msgstr "Aucun" diff --git a/server/src/uds/management/__init__.py b/server/src/uds/management/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/server/src/uds/management/commands/__init__.py b/server/src/uds/management/commands/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/server/src/uds/management/commands/config.py b/server/src/uds/management/commands/config.py new file mode 100644 index 000000000..69104596e --- /dev/null +++ b/server/src/uds/management/commands/config.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.core.management.base import BaseCommand +from optparse import make_option +from uds.core.util.Config import Config, GLOBAL_SECTION +import logging + +logger = logging.getLogger(__name__) + +class Command(BaseCommand): + args = "" + help = "Updates configuration values. If mod is omitted, UDS will be used. Omit whitespaces betwen name, =, and value (they must be a single param)" + + def handle(self, *args, **options): + logger.debug("Handling settings") + try: + for config in args: + print config + first, value = config.split('=') + first = first.split('.') + if len(first) == 2: + mod, name = first + else: + mod, name = GLOBAL_SECTION, first[0] + Config.update(mod, name, value) + except Exception: + logger.exception("Error") + diff --git a/server/src/uds/management/commands/taskManager.py b/server/src/uds/management/commands/taskManager.py new file mode 100644 index 000000000..a04f38898 --- /dev/null +++ b/server/src/uds/management/commands/taskManager.py @@ -0,0 +1,101 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.core.management.base import BaseCommand, CommandError +from optparse import make_option +from server.settings import SITE_ROOT, LOGDIR +from django.utils.daemonize import become_daemon +from uds.core.managers.TaskManager import TaskManager +import logging, sys, os, signal, time + +logger = logging.getLogger(__name__) + +PID_FILE = 'taskmanager.pid' + +def getPidFile(): + return SITE_ROOT + '/' + PID_FILE + +class Command(BaseCommand): + args = "None" + help = "Executes the task manager as a daemon. No parameter show current status of task manager" + + option_list = BaseCommand.option_list + ( + make_option('--start', + action='store_true', + dest='start', + default=False, + help='Starts a new daemon'), + make_option('--stop', + action='store_true', + dest='stop', + default=False, + help='Stop any running daemon'), + ) + + def handle(self, *args, **options): + logger.info("Running task manager command") + + start = options['start'] and True or False + stop = options['stop'] and True or False + + pid = None + try: + pid = int(file(getPidFile(), 'r').readline()) + except Exception: + pid = None + + if stop is True and pid is not None: + try: + logger.info('Stopping task manager. pid: {0}'.format(pid)) + os.kill( pid, signal.SIGTERM ) + time.sleep(1) # Wait a bit before running new one + os.unlink(getPidFile()) + except Exception: + logger.error("Could not stop task manager (maybe it's not runing?)") + os.unlink(getPidFile()) + + if start is True: + logger.info('Starting task manager.') + become_daemon(SITE_ROOT, LOGDIR + '/taskManagerStdout.log', LOGDIR + '/taskManagerStderr.log') + pid = str(os.getpid()) + file(getPidFile() ,'w+').write("%s\n" % pid) + + manager = TaskManager() + manager.run() + + if start is False and stop is False: + if pid is not None: + sys.stdout.write("Task manager found running (pid file exists: {0})\n".format(pid)) + else: + sys.stdout.write("Task manager not foud (pid file do not exits)\n") + \ No newline at end of file diff --git a/server/src/uds/migrations/0001_initial.py b/server/src/uds/migrations/0001_initial.py new file mode 100644 index 000000000..8437c4eb7 --- /dev/null +++ b/server/src/uds/migrations/0001_initial.py @@ -0,0 +1,537 @@ +# encoding: utf-8 +#@PydevCodeAnalysisIgnore +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + +class Migration(SchemaMigration): + + def forwards(self, orm): + + # Adding model 'Provider' + db.create_table('uds_provider', ( + ('comments', self.gf('django.db.models.fields.CharField')(max_length=256)), + ('data', self.gf('django.db.models.fields.TextField')(default='')), + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('data_type', self.gf('django.db.models.fields.CharField')(max_length=128)), + ('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=128)), + )) + db.send_create_signal('uds', ['Provider']) + + # Adding model 'Service' + db.create_table('uds_service', ( + ('name', self.gf('django.db.models.fields.CharField')(max_length=128)), + ('data_type', self.gf('django.db.models.fields.CharField')(max_length=128)), + ('comments', self.gf('django.db.models.fields.CharField')(max_length=256)), + ('provider', self.gf('django.db.models.fields.related.ForeignKey')(related_name='services', to=orm['uds.Provider'])), + ('data', self.gf('django.db.models.fields.TextField')(default='')), + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + )) + db.send_create_signal('uds', ['Service']) + + # Adding unique constraint on 'Service', fields ['provider', 'name'] + db.create_unique('uds_service', ['provider_id', 'name']) + + # Adding model 'OSManager' + db.create_table('uds_osmanager', ( + ('comments', self.gf('django.db.models.fields.CharField')(max_length=256)), + ('data', self.gf('django.db.models.fields.TextField')(default='')), + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('data_type', self.gf('django.db.models.fields.CharField')(max_length=128)), + ('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=128)), + )) + db.send_create_signal('uds', ['OSManager']) + + # Adding model 'Transport' + db.create_table('uds_transport', ( + ('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=128)), + ('data_type', self.gf('django.db.models.fields.CharField')(max_length=128)), + ('comments', self.gf('django.db.models.fields.CharField')(max_length=256)), + ('priority', self.gf('django.db.models.fields.IntegerField')(default=0, db_index=True)), + ('nets_positive', self.gf('django.db.models.fields.BooleanField')(default=False, blank=True)), + ('data', self.gf('django.db.models.fields.TextField')(default='')), + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + )) + db.send_create_signal('uds', ['Transport']) + + # Adding model 'Authenticator' + db.create_table('uds_authenticator', ( + ('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=128)), + ('data_type', self.gf('django.db.models.fields.CharField')(max_length=128)), + ('comments', self.gf('django.db.models.fields.TextField')(default='')), + ('priority', self.gf('django.db.models.fields.IntegerField')(default=0, db_index=True)), + ('data', self.gf('django.db.models.fields.TextField')(default='')), + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + )) + db.send_create_signal('uds', ['Authenticator']) + + # Adding model 'User' + db.create_table('uds_user', ( + ('name', self.gf('django.db.models.fields.CharField')(max_length=128, db_index=True)), + ('staff_member', self.gf('django.db.models.fields.BooleanField')(default=False, blank=True)), + ('manager', self.gf('django.db.models.fields.related.ForeignKey')(related_name='users', to=orm['uds.Authenticator'])), + ('comments', self.gf('django.db.models.fields.CharField')(max_length=256)), + ('real_name', self.gf('django.db.models.fields.CharField')(max_length=128)), + ('state', self.gf('django.db.models.fields.CharField')(max_length=1, db_index=True)), + ('is_admin', self.gf('django.db.models.fields.BooleanField')(default=False, blank=True)), + ('last_access', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(1972, 7, 1, 0, 0))), + ('password', self.gf('django.db.models.fields.CharField')(default='', max_length=128)), + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + )) + db.send_create_signal('uds', ['User']) + + # Adding unique constraint on 'User', fields ['manager', 'name'] + db.create_unique('uds_user', ['manager_id', 'name']) + + # Adding model 'Group' + db.create_table('uds_group', ( + ('manager', self.gf('django.db.models.fields.related.ForeignKey')(related_name='groups', to=orm['uds.Authenticator'])), + ('state', self.gf('django.db.models.fields.CharField')(default='A', max_length=1, db_index=True)), + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('comments', self.gf('django.db.models.fields.CharField')(default='', max_length=256)), + ('name', self.gf('django.db.models.fields.CharField')(max_length=128, db_index=True)), + )) + db.send_create_signal('uds', ['Group']) + + # Adding unique constraint on 'Group', fields ['manager', 'name'] + db.create_unique('uds_group', ['manager_id', 'name']) + + # Adding M2M table for field users on 'Group' + db.create_table('uds_group_users', ( + ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), + ('group', models.ForeignKey(orm['uds.group'], null=False)), + ('user', models.ForeignKey(orm['uds.user'], null=False)) + )) + db.create_unique('uds_group_users', ['group_id', 'user_id']) + + # Adding model 'UserPreference' + db.create_table('uds_userpreference', ( + ('value', self.gf('django.db.models.fields.CharField')(max_length=128, db_index=True)), + ('user', self.gf('django.db.models.fields.related.ForeignKey')(related_name='preferences', to=orm['uds.User'])), + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('module', self.gf('django.db.models.fields.CharField')(max_length=32, db_index=True)), + ('name', self.gf('django.db.models.fields.CharField')(max_length=32, db_index=True)), + )) + db.send_create_signal('uds', ['UserPreference']) + + # Adding unique constraint on 'UserPreference', fields ['module', 'name'] + db.create_unique('uds_userpreference', ['module', 'name']) + + # Adding model 'DeployedService' + db.create_table('uds__deployed_service', ( + ('initial_srvs', self.gf('django.db.models.fields.PositiveIntegerField')(default=0)), + ('osmanager', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='deployedServices', null=True, to=orm['uds.OSManager'])), + ('name', self.gf('django.db.models.fields.CharField')(default='', max_length=128)), + ('service', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='deployedServices', null=True, to=orm['uds.Service'])), + ('current_pub_revision', self.gf('django.db.models.fields.PositiveIntegerField')(default=1)), + ('max_srvs', self.gf('django.db.models.fields.PositiveIntegerField')(default=0)), + ('comments', self.gf('django.db.models.fields.CharField')(default='', max_length=256)), + ('authenticator', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='deployedServices', null=True, to=orm['uds.Authenticator'])), + ('state', self.gf('django.db.models.fields.CharField')(default='A', max_length=1, db_index=True)), + ('cache_l2_srvs', self.gf('django.db.models.fields.PositiveIntegerField')(default=0)), + ('cache_l1_srvs', self.gf('django.db.models.fields.PositiveIntegerField')(default=0)), + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + )) + db.send_create_signal('uds', ['DeployedService']) + + # Adding M2M table for field transports on 'DeployedService' + db.create_table('uds__ds_trans', ( + ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), + ('deployedservice', models.ForeignKey(orm['uds.deployedservice'], null=False)), + ('transport', models.ForeignKey(orm['uds.transport'], null=False)) + )) + db.create_unique('uds__ds_trans', ['deployedservice_id', 'transport_id']) + + # Adding M2M table for field assignedGroups on 'DeployedService' + db.create_table('uds__ds_grps', ( + ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), + ('deployedservice', models.ForeignKey(orm['uds.deployedservice'], null=False)), + ('group', models.ForeignKey(orm['uds.group'], null=False)) + )) + db.create_unique('uds__ds_grps', ['deployedservice_id', 'group_id']) + + # Adding model 'DeployedServicePublication' + db.create_table('uds__deployed_service_pub', ( + ('deployed_service', self.gf('django.db.models.fields.related.ForeignKey')(related_name='publications', to=orm['uds.DeployedService'])), + ('state', self.gf('django.db.models.fields.CharField')(default='P', max_length=1, db_index=True)), + ('state_date', self.gf('django.db.models.fields.DateTimeField')()), + ('publish_date', self.gf('django.db.models.fields.DateTimeField')(db_index=True)), + ('data', self.gf('django.db.models.fields.TextField')(default='')), + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('revision', self.gf('django.db.models.fields.PositiveIntegerField')(default=1)), + )) + db.send_create_signal('uds', ['DeployedServicePublication']) + + # Adding model 'UserService' + db.create_table('uds__user_service', ( + ('cache_level', self.gf('django.db.models.fields.PositiveSmallIntegerField')(default=0, db_index=True)), + ('publication', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='userServices', null=True, to=orm['uds.DeployedServicePublication'])), + ('in_use', self.gf('django.db.models.fields.BooleanField')(default=False, blank=True)), + ('os_state', self.gf('django.db.models.fields.CharField')(default='P', max_length=1)), + ('friendly_name', self.gf('django.db.models.fields.CharField')(default='', max_length=128)), + ('deployed_service', self.gf('django.db.models.fields.related.ForeignKey')(related_name='userServices', to=orm['uds.DeployedService'])), + ('creation_date', self.gf('django.db.models.fields.DateTimeField')(db_index=True)), + ('state', self.gf('django.db.models.fields.CharField')(default='P', max_length=1, db_index=True)), + ('state_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), + ('user', self.gf('django.db.models.fields.related.ForeignKey')(default=None, related_name='userServices', null=True, blank=True, to=orm['uds.User'])), + ('in_use_date', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(1972, 7, 1, 0, 0))), + ('data', self.gf('django.db.models.fields.TextField')(default='')), + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('unique_id', self.gf('django.db.models.fields.CharField')(default='', max_length=128, db_index=True)), + )) + db.send_create_signal('uds', ['UserService']) + + # Adding model 'Cache' + db.create_table('uds_utility_cache', ( + ('owner', self.gf('django.db.models.fields.CharField')(max_length=128, db_index=True)), + ('validity', self.gf('django.db.models.fields.IntegerField')(default=60)), + ('value', self.gf('django.db.models.fields.TextField')(default='')), + ('key', self.gf('django.db.models.fields.CharField')(max_length=64, primary_key=True)), + ('created', self.gf('django.db.models.fields.DateTimeField')()), + )) + db.send_create_signal('uds', ['Cache']) + + # Adding model 'Config' + db.create_table('uds_configuration', ( + ('value', self.gf('django.db.models.fields.TextField')(default='')), + ('section', self.gf('django.db.models.fields.CharField')(max_length=128)), + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('key', self.gf('django.db.models.fields.CharField')(max_length=64)), + )) + db.send_create_signal('uds', ['Config']) + + # Adding unique constraint on 'Config', fields ['section', 'key'] + db.create_unique('uds_configuration', ['section', 'key']) + + # Adding model 'Storage' + db.create_table('uds_storage', ( + ('owner', self.gf('django.db.models.fields.CharField')(max_length=128, db_index=True)), + ('data', self.gf('django.db.models.fields.CharField')(default='', max_length=1024)), + ('key', self.gf('django.db.models.fields.CharField')(max_length=64, primary_key=True)), + ('attr1', self.gf('django.db.models.fields.CharField')(default=None, max_length=64, null=True, db_index=True, blank=True)), + )) + db.send_create_signal('uds', ['Storage']) + + # Adding model 'UniqueId' + db.create_table('uds_uniqueid', ( + ('owner', self.gf('django.db.models.fields.CharField')(default='', max_length=128, db_index=True)), + ('assigned', self.gf('django.db.models.fields.BooleanField')(default=True, db_index=True, blank=True)), + ('basename', self.gf('django.db.models.fields.CharField')(max_length=32, db_index=True)), + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('seq', self.gf('django.db.models.fields.BigIntegerField')(db_index=True)), + )) + db.send_create_signal('uds', ['UniqueId']) + + # Adding unique constraint on 'UniqueId', fields ['basename', 'seq'] + db.create_unique('uds_uniqueid', ['basename', 'seq']) + + # Adding model 'Scheduler' + db.create_table('uds_scheduler', ( + ('last_execution', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), + ('frecuency', self.gf('django.db.models.fields.PositiveIntegerField')(default=86400)), + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('state', self.gf('django.db.models.fields.CharField')(default='X', max_length=1, db_index=True)), + ('next_execution', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(1972, 7, 1, 0, 0), db_index=True)), + ('owner_server', self.gf('django.db.models.fields.CharField')(default='', max_length=64, db_index=True)), + ('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=64)), + )) + db.send_create_signal('uds', ['Scheduler']) + + # Adding model 'DelayedTask' + db.create_table('uds_delayedtask', ( + ('insert_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), + ('execution_delay', self.gf('django.db.models.fields.PositiveIntegerField')()), + ('execution_time', self.gf('django.db.models.fields.DateTimeField')(db_index=True)), + ('instance', self.gf('django.db.models.fields.TextField')()), + ('tag', self.gf('django.db.models.fields.CharField')(max_length=64, db_index=True)), + ('type', self.gf('django.db.models.fields.CharField')(max_length=128)), + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + )) + db.send_create_signal('uds', ['DelayedTask']) + + # Adding model 'Network' + db.create_table('uds_network', ( + ('net_start', self.gf('django.db.models.fields.BigIntegerField')(db_index=True)), + ('net_end', self.gf('django.db.models.fields.BigIntegerField')(db_index=True)), + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=64)), + )) + db.send_create_signal('uds', ['Network']) + + # Adding M2M table for field transports on 'Network' + db.create_table('uds_net_trans', ( + ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), + ('network', models.ForeignKey(orm['uds.network'], null=False)), + ('transport', models.ForeignKey(orm['uds.transport'], null=False)) + )) + db.create_unique('uds_net_trans', ['network_id', 'transport_id']) + + + def backwards(self, orm): + + # Deleting model 'Provider' + db.delete_table('uds_provider') + + # Deleting model 'Service' + db.delete_table('uds_service') + + # Removing unique constraint on 'Service', fields ['provider', 'name'] + db.delete_unique('uds_service', ['provider_id', 'name']) + + # Deleting model 'OSManager' + db.delete_table('uds_osmanager') + + # Deleting model 'Transport' + db.delete_table('uds_transport') + + # Deleting model 'Authenticator' + db.delete_table('uds_authenticator') + + # Deleting model 'User' + db.delete_table('uds_user') + + # Removing unique constraint on 'User', fields ['manager', 'name'] + db.delete_unique('uds_user', ['manager_id', 'name']) + + # Deleting model 'Group' + db.delete_table('uds_group') + + # Removing unique constraint on 'Group', fields ['manager', 'name'] + db.delete_unique('uds_group', ['manager_id', 'name']) + + # Removing M2M table for field users on 'Group' + db.delete_table('uds_group_users') + + # Deleting model 'UserPreference' + db.delete_table('uds_userpreference') + + # Removing unique constraint on 'UserPreference', fields ['module', 'name'] + db.delete_unique('uds_userpreference', ['module', 'name']) + + # Deleting model 'DeployedService' + db.delete_table('uds__deployed_service') + + # Removing M2M table for field transports on 'DeployedService' + db.delete_table('uds__ds_trans') + + # Removing M2M table for field assignedGroups on 'DeployedService' + db.delete_table('uds__ds_grps') + + # Deleting model 'DeployedServicePublication' + db.delete_table('uds__deployed_service_pub') + + # Deleting model 'UserService' + db.delete_table('uds__user_service') + + # Deleting model 'Cache' + db.delete_table('uds_utility_cache') + + # Deleting model 'Config' + db.delete_table('uds_configuration') + + # Removing unique constraint on 'Config', fields ['section', 'key'] + db.delete_unique('uds_configuration', ['section', 'key']) + + # Deleting model 'Storage' + db.delete_table('uds_storage') + + # Deleting model 'UniqueId' + db.delete_table('uds_uniqueid') + + # Removing unique constraint on 'UniqueId', fields ['basename', 'seq'] + db.delete_unique('uds_uniqueid', ['basename', 'seq']) + + # Deleting model 'Scheduler' + db.delete_table('uds_scheduler') + + # Deleting model 'DelayedTask' + db.delete_table('uds_delayedtask') + + # Deleting model 'Network' + db.delete_table('uds_network') + + # Removing M2M table for field transports on 'Network' + db.delete_table('uds_net_trans') + + + models = { + 'uds.authenticator': { + 'Meta': {'object_name': 'Authenticator'}, + 'comments': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data_type': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}), + 'priority': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}) + }, + 'uds.cache': { + 'Meta': {'object_name': 'Cache', 'db_table': "'uds_utility_cache'"}, + 'created': ('django.db.models.fields.DateTimeField', [], {}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '64', 'primary_key': 'True'}), + 'owner': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), + 'validity': ('django.db.models.fields.IntegerField', [], {'default': '60'}), + 'value': ('django.db.models.fields.TextField', [], {'default': "''"}) + }, + 'uds.config': { + 'Meta': {'unique_together': "(('section', 'key'),)", 'object_name': 'Config', 'db_table': "'uds_configuration'"}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'section': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'value': ('django.db.models.fields.TextField', [], {'default': "''"}) + }, + 'uds.delayedtask': { + 'Meta': {'object_name': 'DelayedTask'}, + 'execution_delay': ('django.db.models.fields.PositiveIntegerField', [], {}), + 'execution_time': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'insert_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'instance': ('django.db.models.fields.TextField', [], {}), + 'tag': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), + 'type': ('django.db.models.fields.CharField', [], {'max_length': '128'}) + }, + 'uds.deployedservice': { + 'Meta': {'object_name': 'DeployedService', 'db_table': "'uds__deployed_service'"}, + 'assignedGroups': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'deployedServices'", 'symmetrical': 'False', 'db_table': "'uds__ds_grps'", 'to': "orm['uds.Group']"}), + 'authenticator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deployedServices'", 'null': 'True', 'to': "orm['uds.Authenticator']"}), + 'cache_l1_srvs': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'cache_l2_srvs': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'comments': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256'}), + 'current_pub_revision': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'initial_srvs': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'max_srvs': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128'}), + 'osmanager': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deployedServices'", 'null': 'True', 'to': "orm['uds.OSManager']"}), + 'service': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deployedServices'", 'null': 'True', 'to': "orm['uds.Service']"}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'A'", 'max_length': '1', 'db_index': 'True'}), + 'transports': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'deployedServices'", 'symmetrical': 'False', 'db_table': "'uds__ds_trans'", 'to': "orm['uds.Transport']"}) + }, + 'uds.deployedservicepublication': { + 'Meta': {'object_name': 'DeployedServicePublication', 'db_table': "'uds__deployed_service_pub'"}, + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'deployed_service': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'publications'", 'to': "orm['uds.DeployedService']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'publish_date': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), + 'revision': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'P'", 'max_length': '1', 'db_index': 'True'}), + 'state_date': ('django.db.models.fields.DateTimeField', [], {}) + }, + 'uds.group': { + 'Meta': {'unique_together': "(('manager', 'name'),)", 'object_name': 'Group'}, + 'comments': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'manager': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'groups'", 'to': "orm['uds.Authenticator']"}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'A'", 'max_length': '1', 'db_index': 'True'}), + 'users': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'groups'", 'symmetrical': 'False', 'to': "orm['uds.User']"}) + }, + 'uds.network': { + 'Meta': {'object_name': 'Network'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64'}), + 'net_end': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True'}), + 'net_start': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True'}), + 'transports': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'networks'", 'symmetrical': 'False', 'db_table': "'uds_net_trans'", 'to': "orm['uds.Transport']"}) + }, + 'uds.osmanager': { + 'Meta': {'object_name': 'OSManager'}, + 'comments': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data_type': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}) + }, + 'uds.provider': { + 'Meta': {'object_name': 'Provider'}, + 'comments': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data_type': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}) + }, + 'uds.scheduler': { + 'Meta': {'object_name': 'Scheduler'}, + 'frecuency': ('django.db.models.fields.PositiveIntegerField', [], {'default': '86400'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'last_execution': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64'}), + 'next_execution': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1972, 7, 1, 0, 0)', 'db_index': 'True'}), + 'owner_server': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '64', 'db_index': 'True'}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'X'", 'max_length': '1', 'db_index': 'True'}) + }, + 'uds.service': { + 'Meta': {'unique_together': "(('provider', 'name'),)", 'object_name': 'Service'}, + 'comments': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data_type': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'provider': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'services'", 'to': "orm['uds.Provider']"}) + }, + 'uds.storage': { + 'Meta': {'object_name': 'Storage'}, + 'attr1': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '64', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), + 'data': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '1024'}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '64', 'primary_key': 'True'}), + 'owner': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}) + }, + 'uds.transport': { + 'Meta': {'object_name': 'Transport'}, + 'comments': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data_type': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}), + 'nets_positive': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'priority': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}) + }, + 'uds.uniqueid': { + 'Meta': {'unique_together': "(('basename', 'seq'),)", 'object_name': 'UniqueId'}, + 'assigned': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True', 'blank': 'True'}), + 'basename': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'owner': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'db_index': 'True'}), + 'seq': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True'}) + }, + 'uds.user': { + 'Meta': {'unique_together': "(('manager', 'name'),)", 'object_name': 'User'}, + 'comments': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_admin': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'last_access': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1972, 7, 1, 0, 0)'}), + 'manager': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'users'", 'to': "orm['uds.Authenticator']"}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128'}), + 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'staff_member': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'state': ('django.db.models.fields.CharField', [], {'max_length': '1', 'db_index': 'True'}) + }, + 'uds.userpreference': { + 'Meta': {'unique_together': "(('module', 'name'),)", 'object_name': 'UserPreference'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'module': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'preferences'", 'to': "orm['uds.User']"}), + 'value': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}) + }, + 'uds.userservice': { + 'Meta': {'object_name': 'UserService', 'db_table': "'uds__user_service'"}, + 'cache_level': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0', 'db_index': 'True'}), + 'creation_date': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'deployed_service': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'userServices'", 'to': "orm['uds.DeployedService']"}), + 'friendly_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'in_use': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'in_use_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1972, 7, 1, 0, 0)'}), + 'os_state': ('django.db.models.fields.CharField', [], {'default': "'P'", 'max_length': '1'}), + 'publication': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'userServices'", 'null': 'True', 'to': "orm['uds.DeployedServicePublication']"}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'P'", 'max_length': '1', 'db_index': 'True'}), + 'state_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'unique_id': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'db_index': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'userServices'", 'null': 'True', 'blank': 'True', 'to': "orm['uds.User']"}) + } + } + + complete_apps = ['uds'] diff --git a/server/src/uds/migrations/0002_auto__del_unique_userpreference_name_module.py b/server/src/uds/migrations/0002_auto__del_unique_userpreference_name_module.py new file mode 100644 index 000000000..6484d28be --- /dev/null +++ b/server/src/uds/migrations/0002_auto__del_unique_userpreference_name_module.py @@ -0,0 +1,200 @@ +# encoding: utf-8 +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + +class Migration(SchemaMigration): + + def forwards(self, orm): + + # Removing unique constraint on 'UserPreference', fields ['name', 'module'] + db.delete_unique('uds_userpreference', ['name', 'module']) + + + def backwards(self, orm): + + # Adding unique constraint on 'UserPreference', fields ['name', 'module'] + db.create_unique('uds_userpreference', ['name', 'module']) + + + models = { + 'uds.authenticator': { + 'Meta': {'object_name': 'Authenticator'}, + 'comments': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data_type': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}), + 'priority': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}) + }, + 'uds.cache': { + 'Meta': {'object_name': 'Cache', 'db_table': "'uds_utility_cache'"}, + 'created': ('django.db.models.fields.DateTimeField', [], {}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '64', 'primary_key': 'True'}), + 'owner': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), + 'validity': ('django.db.models.fields.IntegerField', [], {'default': '60'}), + 'value': ('django.db.models.fields.TextField', [], {'default': "''"}) + }, + 'uds.config': { + 'Meta': {'unique_together': "(('section', 'key'),)", 'object_name': 'Config', 'db_table': "'uds_configuration'"}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'section': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'value': ('django.db.models.fields.TextField', [], {'default': "''"}) + }, + 'uds.delayedtask': { + 'Meta': {'object_name': 'DelayedTask'}, + 'execution_delay': ('django.db.models.fields.PositiveIntegerField', [], {}), + 'execution_time': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'insert_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'instance': ('django.db.models.fields.TextField', [], {}), + 'tag': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), + 'type': ('django.db.models.fields.CharField', [], {'max_length': '128'}) + }, + 'uds.deployedservice': { + 'Meta': {'object_name': 'DeployedService', 'db_table': "'uds__deployed_service'"}, + 'assignedGroups': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'deployedServices'", 'symmetrical': 'False', 'db_table': "'uds__ds_grps'", 'to': "orm['uds.Group']"}), + 'authenticator': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deployedServices'", 'null': 'True', 'to': "orm['uds.Authenticator']"}), + 'cache_l1_srvs': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'cache_l2_srvs': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'comments': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256'}), + 'current_pub_revision': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'initial_srvs': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'max_srvs': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128'}), + 'osmanager': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deployedServices'", 'null': 'True', 'to': "orm['uds.OSManager']"}), + 'service': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deployedServices'", 'null': 'True', 'to': "orm['uds.Service']"}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'A'", 'max_length': '1', 'db_index': 'True'}), + 'transports': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'deployedServices'", 'symmetrical': 'False', 'db_table': "'uds__ds_trans'", 'to': "orm['uds.Transport']"}) + }, + 'uds.deployedservicepublication': { + 'Meta': {'object_name': 'DeployedServicePublication', 'db_table': "'uds__deployed_service_pub'"}, + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'deployed_service': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'publications'", 'to': "orm['uds.DeployedService']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'publish_date': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), + 'revision': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'P'", 'max_length': '1', 'db_index': 'True'}), + 'state_date': ('django.db.models.fields.DateTimeField', [], {}) + }, + 'uds.group': { + 'Meta': {'unique_together': "(('manager', 'name'),)", 'object_name': 'Group'}, + 'comments': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'manager': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'groups'", 'to': "orm['uds.Authenticator']"}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'A'", 'max_length': '1', 'db_index': 'True'}), + 'users': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'groups'", 'symmetrical': 'False', 'to': "orm['uds.User']"}) + }, + 'uds.network': { + 'Meta': {'object_name': 'Network'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64'}), + 'net_end': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True'}), + 'net_start': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True'}), + 'transports': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'networks'", 'symmetrical': 'False', 'db_table': "'uds_net_trans'", 'to': "orm['uds.Transport']"}) + }, + 'uds.osmanager': { + 'Meta': {'object_name': 'OSManager'}, + 'comments': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data_type': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}) + }, + 'uds.provider': { + 'Meta': {'object_name': 'Provider'}, + 'comments': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data_type': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}) + }, + 'uds.scheduler': { + 'Meta': {'object_name': 'Scheduler'}, + 'frecuency': ('django.db.models.fields.PositiveIntegerField', [], {'default': '86400'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'last_execution': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64'}), + 'next_execution': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1972, 7, 1, 0, 0)', 'db_index': 'True'}), + 'owner_server': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '64', 'db_index': 'True'}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'X'", 'max_length': '1', 'db_index': 'True'}) + }, + 'uds.service': { + 'Meta': {'unique_together': "(('provider', 'name'),)", 'object_name': 'Service'}, + 'comments': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data_type': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'provider': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'services'", 'to': "orm['uds.Provider']"}) + }, + 'uds.storage': { + 'Meta': {'object_name': 'Storage'}, + 'attr1': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '64', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), + 'data': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '1024'}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '64', 'primary_key': 'True'}), + 'owner': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}) + }, + 'uds.transport': { + 'Meta': {'object_name': 'Transport'}, + 'comments': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data_type': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}), + 'nets_positive': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'priority': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}) + }, + 'uds.uniqueid': { + 'Meta': {'unique_together': "(('basename', 'seq'),)", 'object_name': 'UniqueId'}, + 'assigned': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True', 'blank': 'True'}), + 'basename': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'owner': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'db_index': 'True'}), + 'seq': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True'}) + }, + 'uds.user': { + 'Meta': {'unique_together': "(('manager', 'name'),)", 'object_name': 'User'}, + 'comments': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_admin': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'last_access': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1972, 7, 1, 0, 0)'}), + 'manager': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'users'", 'to': "orm['uds.Authenticator']"}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128'}), + 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'staff_member': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'state': ('django.db.models.fields.CharField', [], {'max_length': '1', 'db_index': 'True'}) + }, + 'uds.userpreference': { + 'Meta': {'object_name': 'UserPreference'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'module': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'preferences'", 'to': "orm['uds.User']"}), + 'value': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}) + }, + 'uds.userservice': { + 'Meta': {'object_name': 'UserService', 'db_table': "'uds__user_service'"}, + 'cache_level': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0', 'db_index': 'True'}), + 'creation_date': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'deployed_service': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'userServices'", 'to': "orm['uds.DeployedService']"}), + 'friendly_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'in_use': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'in_use_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1972, 7, 1, 0, 0)'}), + 'os_state': ('django.db.models.fields.CharField', [], {'default': "'P'", 'max_length': '1'}), + 'publication': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'userServices'", 'null': 'True', 'to': "orm['uds.DeployedServicePublication']"}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'P'", 'max_length': '1', 'db_index': 'True'}), + 'state_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'unique_id': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'db_index': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'userServices'", 'null': 'True', 'blank': 'True', 'to': "orm['uds.User']"}) + } + } + + complete_apps = ['uds'] diff --git a/server/src/uds/migrations/0003_auto__del_field_deployedservice_authenticator.py b/server/src/uds/migrations/0003_auto__del_field_deployedservice_authenticator.py new file mode 100644 index 000000000..cabe40d02 --- /dev/null +++ b/server/src/uds/migrations/0003_auto__del_field_deployedservice_authenticator.py @@ -0,0 +1,199 @@ +# encoding: utf-8 +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + +class Migration(SchemaMigration): + + def forwards(self, orm): + + # Deleting field 'DeployedService.authenticator' + db.delete_column('uds__deployed_service', 'authenticator_id') + + + def backwards(self, orm): + + # Adding field 'DeployedService.authenticator' + db.add_column('uds__deployed_service', 'authenticator', self.gf('django.db.models.fields.related.ForeignKey')(related_name='deployedServices', null=True, to=orm['uds.Authenticator'], blank=True), keep_default=False) + + + models = { + 'uds.authenticator': { + 'Meta': {'object_name': 'Authenticator'}, + 'comments': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data_type': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}), + 'priority': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}) + }, + 'uds.cache': { + 'Meta': {'object_name': 'Cache', 'db_table': "'uds_utility_cache'"}, + 'created': ('django.db.models.fields.DateTimeField', [], {}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '64', 'primary_key': 'True'}), + 'owner': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), + 'validity': ('django.db.models.fields.IntegerField', [], {'default': '60'}), + 'value': ('django.db.models.fields.TextField', [], {'default': "''"}) + }, + 'uds.config': { + 'Meta': {'unique_together': "(('section', 'key'),)", 'object_name': 'Config', 'db_table': "'uds_configuration'"}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'section': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'value': ('django.db.models.fields.TextField', [], {'default': "''"}) + }, + 'uds.delayedtask': { + 'Meta': {'object_name': 'DelayedTask'}, + 'execution_delay': ('django.db.models.fields.PositiveIntegerField', [], {}), + 'execution_time': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'insert_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'instance': ('django.db.models.fields.TextField', [], {}), + 'tag': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), + 'type': ('django.db.models.fields.CharField', [], {'max_length': '128'}) + }, + 'uds.deployedservice': { + 'Meta': {'object_name': 'DeployedService', 'db_table': "'uds__deployed_service'"}, + 'assignedGroups': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'deployedServices'", 'symmetrical': 'False', 'db_table': "'uds__ds_grps'", 'to': "orm['uds.Group']"}), + 'cache_l1_srvs': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'cache_l2_srvs': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'comments': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256'}), + 'current_pub_revision': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'initial_srvs': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'max_srvs': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128'}), + 'osmanager': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deployedServices'", 'null': 'True', 'to': "orm['uds.OSManager']"}), + 'service': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deployedServices'", 'null': 'True', 'to': "orm['uds.Service']"}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'A'", 'max_length': '1', 'db_index': 'True'}), + 'transports': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'deployedServices'", 'symmetrical': 'False', 'db_table': "'uds__ds_trans'", 'to': "orm['uds.Transport']"}) + }, + 'uds.deployedservicepublication': { + 'Meta': {'object_name': 'DeployedServicePublication', 'db_table': "'uds__deployed_service_pub'"}, + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'deployed_service': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'publications'", 'to': "orm['uds.DeployedService']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'publish_date': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), + 'revision': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'P'", 'max_length': '1', 'db_index': 'True'}), + 'state_date': ('django.db.models.fields.DateTimeField', [], {}) + }, + 'uds.group': { + 'Meta': {'unique_together': "(('manager', 'name'),)", 'object_name': 'Group'}, + 'comments': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'manager': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'groups'", 'to': "orm['uds.Authenticator']"}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'A'", 'max_length': '1', 'db_index': 'True'}), + 'users': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'groups'", 'symmetrical': 'False', 'to': "orm['uds.User']"}) + }, + 'uds.network': { + 'Meta': {'object_name': 'Network'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64'}), + 'net_end': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True'}), + 'net_start': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True'}), + 'transports': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'networks'", 'symmetrical': 'False', 'db_table': "'uds_net_trans'", 'to': "orm['uds.Transport']"}) + }, + 'uds.osmanager': { + 'Meta': {'object_name': 'OSManager'}, + 'comments': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data_type': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}) + }, + 'uds.provider': { + 'Meta': {'object_name': 'Provider'}, + 'comments': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data_type': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}) + }, + 'uds.scheduler': { + 'Meta': {'object_name': 'Scheduler'}, + 'frecuency': ('django.db.models.fields.PositiveIntegerField', [], {'default': '86400'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'last_execution': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64'}), + 'next_execution': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1972, 7, 1, 0, 0)', 'db_index': 'True'}), + 'owner_server': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '64', 'db_index': 'True'}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'X'", 'max_length': '1', 'db_index': 'True'}) + }, + 'uds.service': { + 'Meta': {'unique_together': "(('provider', 'name'),)", 'object_name': 'Service'}, + 'comments': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data_type': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'provider': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'services'", 'to': "orm['uds.Provider']"}) + }, + 'uds.storage': { + 'Meta': {'object_name': 'Storage'}, + 'attr1': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '64', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), + 'data': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '1024'}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '64', 'primary_key': 'True'}), + 'owner': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}) + }, + 'uds.transport': { + 'Meta': {'object_name': 'Transport'}, + 'comments': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data_type': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}), + 'nets_positive': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'priority': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}) + }, + 'uds.uniqueid': { + 'Meta': {'unique_together': "(('basename', 'seq'),)", 'object_name': 'UniqueId'}, + 'assigned': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True', 'blank': 'True'}), + 'basename': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'owner': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'db_index': 'True'}), + 'seq': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True'}) + }, + 'uds.user': { + 'Meta': {'unique_together': "(('manager', 'name'),)", 'object_name': 'User'}, + 'comments': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_admin': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'last_access': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1972, 7, 1, 0, 0)'}), + 'manager': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'users'", 'to': "orm['uds.Authenticator']"}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128'}), + 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'staff_member': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'state': ('django.db.models.fields.CharField', [], {'max_length': '1', 'db_index': 'True'}) + }, + 'uds.userpreference': { + 'Meta': {'object_name': 'UserPreference'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'module': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'preferences'", 'to': "orm['uds.User']"}), + 'value': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}) + }, + 'uds.userservice': { + 'Meta': {'object_name': 'UserService', 'db_table': "'uds__user_service'"}, + 'cache_level': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0', 'db_index': 'True'}), + 'creation_date': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'deployed_service': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'userServices'", 'to': "orm['uds.DeployedService']"}), + 'friendly_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'in_use': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'in_use_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1972, 7, 1, 0, 0)'}), + 'os_state': ('django.db.models.fields.CharField', [], {'default': "'P'", 'max_length': '1'}), + 'publication': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'userServices'", 'null': 'True', 'to': "orm['uds.DeployedServicePublication']"}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'P'", 'max_length': '1', 'db_index': 'True'}), + 'state_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'unique_id': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'db_index': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'userServices'", 'null': 'True', 'blank': 'True', 'to': "orm['uds.User']"}) + } + } + + complete_apps = ['uds'] diff --git a/server/src/uds/migrations/0004_auto__add_field_deployedservice_state_date.py b/server/src/uds/migrations/0004_auto__add_field_deployedservice_state_date.py new file mode 100644 index 000000000..385403c1f --- /dev/null +++ b/server/src/uds/migrations/0004_auto__add_field_deployedservice_state_date.py @@ -0,0 +1,200 @@ +# encoding: utf-8 +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + +class Migration(SchemaMigration): + + def forwards(self, orm): + + # Adding field 'DeployedService.state_date' + db.add_column('uds__deployed_service', 'state_date', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime(1972, 7, 1, 0, 0)), keep_default=False) + + + def backwards(self, orm): + + # Deleting field 'DeployedService.state_date' + db.delete_column('uds__deployed_service', 'state_date') + + + models = { + 'uds.authenticator': { + 'Meta': {'object_name': 'Authenticator'}, + 'comments': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data_type': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}), + 'priority': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}) + }, + 'uds.cache': { + 'Meta': {'object_name': 'Cache', 'db_table': "'uds_utility_cache'"}, + 'created': ('django.db.models.fields.DateTimeField', [], {}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '64', 'primary_key': 'True'}), + 'owner': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), + 'validity': ('django.db.models.fields.IntegerField', [], {'default': '60'}), + 'value': ('django.db.models.fields.TextField', [], {'default': "''"}) + }, + 'uds.config': { + 'Meta': {'unique_together': "(('section', 'key'),)", 'object_name': 'Config', 'db_table': "'uds_configuration'"}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'section': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'value': ('django.db.models.fields.TextField', [], {'default': "''"}) + }, + 'uds.delayedtask': { + 'Meta': {'object_name': 'DelayedTask'}, + 'execution_delay': ('django.db.models.fields.PositiveIntegerField', [], {}), + 'execution_time': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'insert_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'instance': ('django.db.models.fields.TextField', [], {}), + 'tag': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), + 'type': ('django.db.models.fields.CharField', [], {'max_length': '128'}) + }, + 'uds.deployedservice': { + 'Meta': {'object_name': 'DeployedService', 'db_table': "'uds__deployed_service'"}, + 'assignedGroups': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'deployedServices'", 'symmetrical': 'False', 'db_table': "'uds__ds_grps'", 'to': "orm['uds.Group']"}), + 'cache_l1_srvs': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'cache_l2_srvs': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'comments': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256'}), + 'current_pub_revision': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'initial_srvs': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'max_srvs': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128'}), + 'osmanager': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deployedServices'", 'null': 'True', 'to': "orm['uds.OSManager']"}), + 'service': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deployedServices'", 'null': 'True', 'to': "orm['uds.Service']"}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'A'", 'max_length': '1', 'db_index': 'True'}), + 'state_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1972, 7, 1, 0, 0)'}), + 'transports': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'deployedServices'", 'symmetrical': 'False', 'db_table': "'uds__ds_trans'", 'to': "orm['uds.Transport']"}) + }, + 'uds.deployedservicepublication': { + 'Meta': {'object_name': 'DeployedServicePublication', 'db_table': "'uds__deployed_service_pub'"}, + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'deployed_service': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'publications'", 'to': "orm['uds.DeployedService']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'publish_date': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), + 'revision': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'P'", 'max_length': '1', 'db_index': 'True'}), + 'state_date': ('django.db.models.fields.DateTimeField', [], {}) + }, + 'uds.group': { + 'Meta': {'unique_together': "(('manager', 'name'),)", 'object_name': 'Group'}, + 'comments': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'manager': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'groups'", 'to': "orm['uds.Authenticator']"}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'A'", 'max_length': '1', 'db_index': 'True'}), + 'users': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'groups'", 'symmetrical': 'False', 'to': "orm['uds.User']"}) + }, + 'uds.network': { + 'Meta': {'object_name': 'Network'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64'}), + 'net_end': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True'}), + 'net_start': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True'}), + 'transports': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'networks'", 'symmetrical': 'False', 'db_table': "'uds_net_trans'", 'to': "orm['uds.Transport']"}) + }, + 'uds.osmanager': { + 'Meta': {'object_name': 'OSManager'}, + 'comments': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data_type': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}) + }, + 'uds.provider': { + 'Meta': {'object_name': 'Provider'}, + 'comments': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data_type': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}) + }, + 'uds.scheduler': { + 'Meta': {'object_name': 'Scheduler'}, + 'frecuency': ('django.db.models.fields.PositiveIntegerField', [], {'default': '86400'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'last_execution': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64'}), + 'next_execution': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1972, 7, 1, 0, 0)', 'db_index': 'True'}), + 'owner_server': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '64', 'db_index': 'True'}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'X'", 'max_length': '1', 'db_index': 'True'}) + }, + 'uds.service': { + 'Meta': {'unique_together': "(('provider', 'name'),)", 'object_name': 'Service'}, + 'comments': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data_type': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'provider': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'services'", 'to': "orm['uds.Provider']"}) + }, + 'uds.storage': { + 'Meta': {'object_name': 'Storage'}, + 'attr1': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '64', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), + 'data': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '1024'}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '64', 'primary_key': 'True'}), + 'owner': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}) + }, + 'uds.transport': { + 'Meta': {'object_name': 'Transport'}, + 'comments': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data_type': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}), + 'nets_positive': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'priority': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}) + }, + 'uds.uniqueid': { + 'Meta': {'unique_together': "(('basename', 'seq'),)", 'object_name': 'UniqueId'}, + 'assigned': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True', 'blank': 'True'}), + 'basename': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'owner': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'db_index': 'True'}), + 'seq': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True'}) + }, + 'uds.user': { + 'Meta': {'unique_together': "(('manager', 'name'),)", 'object_name': 'User'}, + 'comments': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_admin': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'last_access': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1972, 7, 1, 0, 0)'}), + 'manager': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'users'", 'to': "orm['uds.Authenticator']"}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128'}), + 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'staff_member': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'state': ('django.db.models.fields.CharField', [], {'max_length': '1', 'db_index': 'True'}) + }, + 'uds.userpreference': { + 'Meta': {'object_name': 'UserPreference'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'module': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'preferences'", 'to': "orm['uds.User']"}), + 'value': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}) + }, + 'uds.userservice': { + 'Meta': {'object_name': 'UserService', 'db_table': "'uds__user_service'"}, + 'cache_level': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0', 'db_index': 'True'}), + 'creation_date': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'deployed_service': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'userServices'", 'to': "orm['uds.DeployedService']"}), + 'friendly_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'in_use': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'in_use_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1972, 7, 1, 0, 0)'}), + 'os_state': ('django.db.models.fields.CharField', [], {'default': "'P'", 'max_length': '1'}), + 'publication': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'userServices'", 'null': 'True', 'to': "orm['uds.DeployedServicePublication']"}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'P'", 'max_length': '1', 'db_index': 'True'}), + 'state_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'unique_id': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'db_index': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'userServices'", 'null': 'True', 'blank': 'True', 'to': "orm['uds.User']"}) + } + } + + complete_apps = ['uds'] diff --git a/server/src/uds/migrations/0005_auto__add_field_config_crypt.py b/server/src/uds/migrations/0005_auto__add_field_config_crypt.py new file mode 100644 index 000000000..48312f695 --- /dev/null +++ b/server/src/uds/migrations/0005_auto__add_field_config_crypt.py @@ -0,0 +1,201 @@ +# encoding: utf-8 +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + +class Migration(SchemaMigration): + + def forwards(self, orm): + + # Adding field 'Config.crypt' + db.add_column('uds_configuration', 'crypt', self.gf('django.db.models.fields.BooleanField')(default=False, blank=True), keep_default=False) + + + def backwards(self, orm): + + # Deleting field 'Config.crypt' + db.delete_column('uds_configuration', 'crypt') + + + models = { + 'uds.authenticator': { + 'Meta': {'object_name': 'Authenticator'}, + 'comments': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data_type': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}), + 'priority': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}) + }, + 'uds.cache': { + 'Meta': {'object_name': 'Cache', 'db_table': "'uds_utility_cache'"}, + 'created': ('django.db.models.fields.DateTimeField', [], {}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '64', 'primary_key': 'True'}), + 'owner': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), + 'validity': ('django.db.models.fields.IntegerField', [], {'default': '60'}), + 'value': ('django.db.models.fields.TextField', [], {'default': "''"}) + }, + 'uds.config': { + 'Meta': {'unique_together': "(('section', 'key'),)", 'object_name': 'Config', 'db_table': "'uds_configuration'"}, + 'crypt': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'section': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'value': ('django.db.models.fields.TextField', [], {'default': "''"}) + }, + 'uds.delayedtask': { + 'Meta': {'object_name': 'DelayedTask'}, + 'execution_delay': ('django.db.models.fields.PositiveIntegerField', [], {}), + 'execution_time': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'insert_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'instance': ('django.db.models.fields.TextField', [], {}), + 'tag': ('django.db.models.fields.CharField', [], {'max_length': '64', 'db_index': 'True'}), + 'type': ('django.db.models.fields.CharField', [], {'max_length': '128'}) + }, + 'uds.deployedservice': { + 'Meta': {'object_name': 'DeployedService', 'db_table': "'uds__deployed_service'"}, + 'assignedGroups': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'deployedServices'", 'symmetrical': 'False', 'db_table': "'uds__ds_grps'", 'to': "orm['uds.Group']"}), + 'cache_l1_srvs': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'cache_l2_srvs': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'comments': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256'}), + 'current_pub_revision': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'initial_srvs': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'max_srvs': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}), + 'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128'}), + 'osmanager': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deployedServices'", 'null': 'True', 'to': "orm['uds.OSManager']"}), + 'service': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'deployedServices'", 'null': 'True', 'to': "orm['uds.Service']"}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'A'", 'max_length': '1', 'db_index': 'True'}), + 'state_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1972, 7, 1, 0, 0)'}), + 'transports': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'deployedServices'", 'symmetrical': 'False', 'db_table': "'uds__ds_trans'", 'to': "orm['uds.Transport']"}) + }, + 'uds.deployedservicepublication': { + 'Meta': {'object_name': 'DeployedServicePublication', 'db_table': "'uds__deployed_service_pub'"}, + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'deployed_service': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'publications'", 'to': "orm['uds.DeployedService']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'publish_date': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), + 'revision': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'P'", 'max_length': '1', 'db_index': 'True'}), + 'state_date': ('django.db.models.fields.DateTimeField', [], {}) + }, + 'uds.group': { + 'Meta': {'unique_together': "(('manager', 'name'),)", 'object_name': 'Group'}, + 'comments': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '256'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'manager': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'groups'", 'to': "orm['uds.Authenticator']"}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'A'", 'max_length': '1', 'db_index': 'True'}), + 'users': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'groups'", 'symmetrical': 'False', 'to': "orm['uds.User']"}) + }, + 'uds.network': { + 'Meta': {'object_name': 'Network'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64'}), + 'net_end': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True'}), + 'net_start': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True'}), + 'transports': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'networks'", 'symmetrical': 'False', 'db_table': "'uds_net_trans'", 'to': "orm['uds.Transport']"}) + }, + 'uds.osmanager': { + 'Meta': {'object_name': 'OSManager'}, + 'comments': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data_type': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}) + }, + 'uds.provider': { + 'Meta': {'object_name': 'Provider'}, + 'comments': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data_type': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}) + }, + 'uds.scheduler': { + 'Meta': {'object_name': 'Scheduler'}, + 'frecuency': ('django.db.models.fields.PositiveIntegerField', [], {'default': '86400'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'last_execution': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64'}), + 'next_execution': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1972, 7, 1, 0, 0)', 'db_index': 'True'}), + 'owner_server': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '64', 'db_index': 'True'}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'X'", 'max_length': '1', 'db_index': 'True'}) + }, + 'uds.service': { + 'Meta': {'unique_together': "(('provider', 'name'),)", 'object_name': 'Service'}, + 'comments': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data_type': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'provider': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'services'", 'to': "orm['uds.Provider']"}) + }, + 'uds.storage': { + 'Meta': {'object_name': 'Storage'}, + 'attr1': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '64', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), + 'data': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '1024'}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '64', 'primary_key': 'True'}), + 'owner': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}) + }, + 'uds.transport': { + 'Meta': {'object_name': 'Transport'}, + 'comments': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'data_type': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}), + 'nets_positive': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'priority': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}) + }, + 'uds.uniqueid': { + 'Meta': {'unique_together': "(('basename', 'seq'),)", 'object_name': 'UniqueId'}, + 'assigned': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True', 'blank': 'True'}), + 'basename': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'owner': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'db_index': 'True'}), + 'seq': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True'}) + }, + 'uds.user': { + 'Meta': {'unique_together': "(('manager', 'name'),)", 'object_name': 'User'}, + 'comments': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_admin': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'last_access': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1972, 7, 1, 0, 0)'}), + 'manager': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'users'", 'to': "orm['uds.Authenticator']"}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128'}), + 'real_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'staff_member': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'state': ('django.db.models.fields.CharField', [], {'max_length': '1', 'db_index': 'True'}) + }, + 'uds.userpreference': { + 'Meta': {'object_name': 'UserPreference'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'module': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '32', 'db_index': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'preferences'", 'to': "orm['uds.User']"}), + 'value': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}) + }, + 'uds.userservice': { + 'Meta': {'object_name': 'UserService', 'db_table': "'uds__user_service'"}, + 'cache_level': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0', 'db_index': 'True'}), + 'creation_date': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True'}), + 'data': ('django.db.models.fields.TextField', [], {'default': "''"}), + 'deployed_service': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'userServices'", 'to': "orm['uds.DeployedService']"}), + 'friendly_name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'in_use': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'in_use_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(1972, 7, 1, 0, 0)'}), + 'os_state': ('django.db.models.fields.CharField', [], {'default': "'P'", 'max_length': '1'}), + 'publication': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'userServices'", 'null': 'True', 'to': "orm['uds.DeployedServicePublication']"}), + 'state': ('django.db.models.fields.CharField', [], {'default': "'P'", 'max_length': '1', 'db_index': 'True'}), + 'state_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'unique_id': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '128', 'db_index': 'True'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'related_name': "'userServices'", 'null': 'True', 'blank': 'True', 'to': "orm['uds.User']"}) + } + } + + complete_apps = ['uds'] diff --git a/server/src/uds/migrations/__init__.py b/server/src/uds/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/server/src/uds/models.py b/server/src/uds/models.py new file mode 100644 index 000000000..a3e006464 --- /dev/null +++ b/server/src/uds/models.py @@ -0,0 +1,1652 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.db import models +from django.db.models import signals +from uds.core.services.ServiceProviderFactory import ServiceProviderFactory +from uds.core.osmanagers.OSManagersFactory import OSManagersFactory +from uds.core.transports.TransportsFactory import TransportsFactory +from uds.core.jobs.JobsFactory import JobsFactory +from uds.core.Environment import Environment +from uds.core.util.db.LockingManager import LockingManager +from uds.core.util.State import State +from uds.core import auths +from uds.core.services.Exceptions import InvalidServiceException +from datetime import datetime, timedelta + +import logging + +logger = logging.getLogger(__name__) + +NEVER = datetime(1972, 7, 1) + + +def getSqlDatetime(): + ''' + Returns the current date/time of the database server. + + We use this time as method of keeping all operations betwen different servers in sync. + + We support get database datetime for: + * mysql + * sqlite + ''' + from django.db import connection + con = connection + cursor = con.cursor() + if con.vendor == 'mysql': + cursor.execute('SELECT NOW()') + return cursor.fetchone()[0] + return datetime.now() # If not know how to get database datetime, returns local datetime (this is fine for sqlite, which is local) + + + +# Services +class Provider(models.Model): + ''' + A Provider represents the Service provider itself, (i.e. a KVM Server or a Terminal Server) + ''' + name = models.CharField(max_length=128, unique = True) + data_type = models.CharField(max_length=128) + data = models.TextField(default='') + comments = models.CharField(max_length = 256) + + class Meta: + ''' + Meta class to declare default order + ''' + ordering = ('name',) + + def getEnvironment(self): + ''' + Returns an environment valid for the record this object represents + ''' + return Environment.getEnvForTableElement(self._meta.verbose_name, self.id) + + def getInstance(self, values = None): + ''' + Instantiates the object this record contains. + + Every single record of Provider model, represents an object. + + Args: + values (list): Values to pass to constructor. If no values are especified, + the object is instantiated empty and them de-serialized from stored data. + + Returns: + The instance Instance of the class this provider represents + + Raises: + ''' + spType = self.getType() + env = self.getEnvironment() + sp = spType(env, values) + + # Only unserializes if this is not initialized via user interface and + # data contains something + if values == None and self.data != None and self.data != '': + sp.unserialize(self.data) + return sp + + def getType(self): + ''' + Get the type of the object this record represents. + + The type is Python type, it obtains this type from ServiceProviderFactory and associated record field. + + Returns: + The python type for this record object + ''' + return ServiceProviderFactory.factory().lookup(self.data_type) + + def __unicode__(self): + return "{0} of type {1} (id:{2})".format(self.name, self.data_type, self.id) + + @staticmethod + def beforeDelete(sender, **kwargs): + ''' + Used to invoke the Provider class "Destroy" before deleting it from database. + + The main purpuse of this hook is to call the "destroy" method of the object to delete and + to clear related data of the object (environment data such as own storage, cache, etc... + + :note: If destroy raises an exception, the deletion is not taken. + ''' + toDelete = kwargs['instance'] + # Only tries to get instance if data is not empty + if toDelete.data != '': + s = toDelete.getInstance() + s.destroy() + s.env().clearRelatedData() + + logger.debug('Before delete service provider '.format(toDelete)) + +#: Connects a pre deletion signal to Provider +signals.pre_delete.connect(Provider.beforeDelete, sender = Provider) + +class Service(models.Model): + ''' + A Service represents an specidied type of service offered to final users, with it configuration (i.e. a KVM Base Machine for cloning + or a Terminal Server configuration). + ''' + provider = models.ForeignKey(Provider, related_name='services') + name = models.CharField(max_length=128, unique = False) + data_type = models.CharField(max_length=128) + data = models.TextField(default='') + comments = models.CharField(max_length = 256) + + class Meta: + ''' + Meta class to declare default order and unique multiple field index + ''' + ordering = ('name',) + unique_together = (("provider", "name"),) + + def getEnvironment(self): + ''' + Returns an environment valid for the record this object represents + ''' + return Environment.getEnvForTableElement(self._meta.verbose_name, self.id) + + def getInstance(self, values = None): + ''' + Instantiates the object this record contains. + + Every single record of Provider model, represents an object. + + Args: + values (list): Values to pass to constructor. If no values are especified, + the object is instantiated empty and them de-serialized from stored data. + + Returns: + The instance Instance of the class this provider represents + + Raises: + ''' + prov = self.provider.getInstance() + sType = prov.getServiceByType(self.data_type) + env = self.getEnvironment() + s = sType(env, prov, values) + # Only unserializes if this is not initialized via user interface and + # data contains something + if values == None and self.data != None and self.data != '': + s.unserialize(self.data) + return s + + def getType(self): + ''' + Get the type of the object this record represents. + + The type is Python type, it obtains this type from ServiceProviderFactory and associated record field. + + Returns: + The python type for this record object + + :note: We only need to get info from this, not access specific data (class specific info) + ''' + return self.provider.getType().getServiceByType(self.data_type) + + def __unicode__(self): + return "{0} of type {1} (id:{2})".format(self.name, self.data_type, self.id) + + @staticmethod + def beforeDelete(sender, **kwargs): + ''' + Used to invoke the Service class "Destroy" before deleting it from database. + + The main purpuse of this hook is to call the "destroy" method of the object to delete and + to clear related data of the object (environment data such as own storage, cache, etc... + + :note: If destroy raises an exception, the deletion is not taken. + ''' + toDelete = kwargs['instance'] + # Only tries to get instance if data is not empty + if toDelete.data != '': + s = toDelete.getInstance() + s.destroy() + s.env().clearRelatedData() + + logger.debug('Before delete service '.format(toDelete)) + +#: Connects a pre deletion signal to Service +signals.pre_delete.connect(Service.beforeDelete, sender = Service) + + +class OSManager(models.Model): + ''' + An OS Manager represents a manager for responding requests for agents inside services. + ''' + name = models.CharField(max_length=128, unique = True) + data_type = models.CharField(max_length=128) + data = models.TextField(default='') + comments = models.CharField(max_length = 256) + + class Meta: + ''' + Meta class to declare default order + ''' + ordering = ('name',) + + def getEnvironment(self): + ''' + Returns an environment valid for the record this object represents + ''' + return Environment.getEnvForTableElement(self._meta.verbose_name, self.id) + + def getInstance(self, values = None): + ''' + Instantiates the object this record contains. + + Every single record of Provider model, represents an object. + + Args: + values (list): Values to pass to constructor. If no values are especified, + the object is instantiated empty and them de-serialized from stored data. + + Returns: + The instance Instance of the class this provider represents + + Raises: + ''' + osType = self.getType() + env = self.getEnvironment() + os = osType(env, values) + # Only unserializes if this is not initialized via user interface and + # data contains something + if values == None and self.data != None and self.data != '': + os.unserialize(self.data) + return os + + def getType(self): + ''' + Get the type of the object this record represents. + + The type is Python type, it obtains this type from ServiceProviderFactory and associated record field. + + Returns: + The python type for this record object + + :note: We only need to get info from this, not access specific data (class specific info) + ''' + # We only need to get info from this, not access specific data (class specific info + return OSManagersFactory.factory().lookup(self.data_type) + + + def __unicode__(self): + return "{0} of type {1} (id:{2})".format(self.name, self.data_type, self.id) + + def remove(self): + ''' + Removes this OS Manager only if there is no associated deployed service using it. + + Returns: + True if the object has been removed + + False if the object can't be removed because it is being used by some DeployedService + + Raises: + ''' + if self.deployedServices.all().count() > 0: + return False + self.delete() + return True + + @staticmethod + def beforeDelete(sender, **kwargs): + ''' + Used to invoke the Service class "Destroy" before deleting it from database. + + The main purpuse of this hook is to call the "destroy" method of the object to delete and + to clear related data of the object (environment data such as own storage, cache, etc... + + :note: If destroy raises an exception, the deletion is not taken. + ''' + toDelete = kwargs['instance'] + # Only tries to get instance if data is not empty + if toDelete.data != '': + s = toDelete.getInstance() + s.destroy() + s.env().clearRelatedData() + + logger.debug('Before delete os manager '.format(toDelete)) + +#: Connects a pre deletion signal to OS Manager +signals.pre_delete.connect(OSManager.beforeDelete, sender = OSManager) + +class Transport(models.Model): + ''' + A Transport represents a way of connecting the user with the service. + + Sample of transports are RDP, Spice, Web file uploader, etc... + ''' + name = models.CharField(max_length=128, unique = True) + data_type = models.CharField(max_length=128) + data = models.TextField(default='') + comments = models.CharField(max_length = 256) + priority = models.IntegerField(default=0, db_index=True) + nets_positive = models.BooleanField(default=False) + + class Meta: + ''' + Meta class to declare default order + ''' + ordering = ('name',) + + def getEnvironment(self): + ''' + Returns an environment valid for the record this object represents + ''' + return Environment.getEnvForTableElement(self._meta.verbose_name, self.id) + + def getInstance(self, values = None): + ''' + Instantiates the object this record contains. + + Every single record of Provider model, represents an object. + + Args: + values (list): Values to pass to constructor. If no values are especified, + the object is instantiated empty and them de-serialized from stored data. + + Returns: + The instance Instance of the class this provider represents + + Raises: + ''' + tType = self.getType() + env = self.getEnvironment() + tr = tType(env, values) + # Only unserializes if this is not initialized via user interface and + # data contains something + if values == None and self.data != None and self.data != '': + tr.unserialize(self.data) + return tr + + def getType(self): + ''' + Get the type of the object this record represents. + + The type is Python type, it obtains this type from ServiceProviderFactory and associated record field. + + Returns: + The python type for this record object + + :note: We only need to get info from this, not access specific data (class specific info) + ''' + return TransportsFactory.factory().lookup(self.data_type) + + def validForIp(self, ip): + ''' + Checks if this transport is valid for the specified IP. + + Args: + ip: Numeric ip address to check validity for. (xxx.xxx.xxx.xxx). + + Returns: + True if the ip can access this Transport. + + False if the ip can't access this Transport. + + The ip check is done this way: + * If The associated network is empty, the result is always True + * If the associated network is not empty, and nets_positive (field) is True, the result will be True if + the ip is contained in any subnet associated with this transport. + * If the associated network is empty, and nets_positive (field) is False, the result will be True if + the ip is NOT contained in ANY subnet associated with this transport. + + Raises: + + :note: Ip addresses has been only tested with IPv4 addresses + ''' + if self.networks.count() == 0: + return True + ip = Network.ipToLong(ip) + if self.nets_positive: + return self.networks.filter(net_start__lte=ip, net_end__gte=ip).count() > 0 + else: + return self.networks.exclude(net_start__lte=ip, net_end__gte=ip).count() > 0 + + def __unicode__(self): + return "{0} of type {1} (id:{2})".format(self.name, self.data_type, self.id) + + @staticmethod + def beforeDelete(sender, **kwargs): + ''' + Used to invoke the Service class "Destroy" before deleting it from database. + + The main purpuse of this hook is to call the "destroy" method of the object to delete and + to clear related data of the object (environment data such as own storage, cache, etc... + + :note: If destroy raises an exception, the deletion is not taken. + ''' + toDelete = kwargs['instance'] + + # Only tries to get instance if data is not empty + if toDelete.data != '': + s = toDelete.getInstance() + s.destroy() + s.env().clearRelatedData() + + logger.debug('Before delete transport '.format(toDelete)) + +#: Connects a pre deletion signal to OS Manager +signals.pre_delete.connect(Transport.beforeDelete, sender = Transport) + +# Authenticators +class Authenticator(models.Model): + ''' + This class represents an Authenticator inside the platform. + Sample authenticators are LDAP, Active Directory, SAML, ... + ''' + name = models.CharField(max_length=128, unique = True) + data_type = models.CharField(max_length=128) + data = models.TextField(default='') + comments = models.TextField(default='') + priority = models.IntegerField(default=0, db_index = True) + + class Meta: + ''' + Meta class to declare default order + ''' + ordering = ('name',) + + def getEnvironment(self): + ''' + Returns an environment valid for the record this object represents + ''' + return Environment.getEnvForTableElement(self._meta.verbose_name, self.id) + + def getInstance(self, values = None): + ''' + Instantiates the object this record contains. + + Every single record of Provider model, represents an object. + + Args: + values (list): Values to pass to constructor. If no values are especified, + the object is instantiated empty and them de-serialized from stored data. + + Returns: + The instance Instance of the class this provider represents + + Raises: + ''' + auType = self.getType() + env = self.getEnvironment() + auth = auType(self, env, values) + # Only unserializes if this is not initialized via user interface and + # data contains something + if values == None and self.data != None and self.data != '': + auth.unserialize(self.data) + return auth + + def getType(self): + ''' + Get the type of the object this record represents. + + The type is Python type, it obtains this type from ServiceProviderFactory and associated record field. + + Returns: + The python type for this record object + + :note: We only need to get info from this, not access specific data (class specific info) + ''' + return auths.factory().lookup(self.data_type) + + def getOrCreateUser(self, username, realName = None): + ''' + Used to get or create a new user at database associated with this authenticator. + + This user has all parameter default, that are: + * 'real_name':realName + * 'last_access':NEVER + * 'state':State.ACTIVE + + Args: + username: The username to create and associate with this auhtenticator + + realName: If None, it will be the same that username. If otherwise especified, it will be the default real_name (field) + + Returns: + True if the ip can access this Transport. + + False if the ip can't access this Transport. + + The ip check is done this way: + * If The associated network is empty, the result is always True + * If the associated network is not empty, and nets_positive (field) is True, the result will be True if + the ip is contained in any subnet associated with this transport. + * If the associated network is empty, and nets_positive (field) is False, the result will be True if + the ip is NOT contained in ANY subnet associated with this transport. + + Raises: + + + ''' + if realName is None: + realName = username + user, _ = self.users.get_or_create( name = username, defaults = { 'real_name':realName, 'last_access':NEVER, 'state':State.ACTIVE } ) + return user + + def isValidUser(self, username, falseIfNotExists = True): + ''' + Checks the validity of an user + + Args: + username: Name of the user to check + + falseIfNotExists: Defaults to True. It is used so we can return a value defined by caller. + + One example of falseIfNotExists using as True is for checking that the user is active or it doesn't exists. + + Returns: + True if it exists and is active, falseIfNotExists (param) if it doesn't exists + + This is done so we can check non existing or non blocked users (state != Active, or do not exists) + ''' + try: + u = self.users.get(name=username) + return State.isActive(u.state) + except Exception: + return falseIfNotExists + + def __unicode__(self): + return "{0} of type {1} (id:{2})".format(self.name, self.data_type, self.id) + + @staticmethod + def all(): + ''' + Returns all authenticators ordered by priority + ''' + return Authenticator.objects.all().order_by('priority') + + @staticmethod + def beforeDelete(sender, **kwargs): + ''' + Used to invoke the Service class "Destroy" before deleting it from database. + + The main purpuse of this hook is to call the "destroy" method of the object to delete and + to clear related data of the object (environment data such as own storage, cache, etc... + + :note: If destroy raises an exception, the deletion is not taken. + ''' + toDelete = kwargs['instance'] + # Only tries to get instance if data is not empty + if toDelete.data != '': + s = toDelete.getInstance() + s.destroy() + s.env().clearRelatedData() + + logger.debug('Before delete auth '.format(toDelete)) + +# Connects a pre deletion signal to Authenticator +signals.pre_delete.connect(Authenticator.beforeDelete, sender = Authenticator) + +class User(models.Model): + ''' + This class represents a single user, associated with one authenticator + ''' + manager = models.ForeignKey(Authenticator, on_delete=models.CASCADE, related_name='users') + name = models.CharField(max_length = 128, db_index = True) + real_name = models.CharField(max_length = 128) + comments = models.CharField(max_length = 256) + state = models.CharField(max_length = 1, db_index = True) + password = models.CharField(max_length = 128, default = '') # Only used on "internal" sources + staff_member = models.BooleanField(default = False) # Staff members can login to admin + is_admin = models.BooleanField(default = False) # is true, this is a super-admin + last_access = models.DateTimeField(default=NEVER) + + class Meta: + ''' + Meta class to declare default order and unique multiple field index + ''' + unique_together = (("manager", "name"),) + ordering = ('name',) + + def getUsernameForAuth(self): + ''' + Return the username transformed for authentication. + This transformation is used for transports only, not for transforming + anything at login time. Transports that will need the username, will invoke + this method. + The manager (an instance of uds.core.auths.Authenticator), can transform the database stored username + so we can, for example, add @domain in some cases. + ''' + return self.getManager().getForAuth(self.name) + + def getManager(self): + ''' + Returns the authenticator object that owns this user. + + :note: The returned value is an instance of the authenticator class used to manage this user, not a db record. + ''' + return self.manager.getInstance() + + def isStaff(self): + ''' + Return true if this user is admin or staff member + ''' + return self.staff_member or self.is_admin + + def prefs(self, modName): + ''' + Returns the preferences for this user for the provided module name. + + Usually preferences will be associated with transports, but can be preferences registered by ANY module. + + Args: + modName: name of the module to get preferences for + + + Returns: + + The preferences for the module specified as a dictionary (can be empty if module is not found). + + If the module exists, the preferences will always contain something, but may be the values are the default ones. + + ''' + from uds.core.managers.UserPrefsManager import UserPrefsManager + return UserPrefsManager.manager().getPreferencesForUser(modName, self) + + def updateLastAccess(self): + ''' + Updates the last access for this user with the current time of the sql server + ''' + self.last_access = getSqlDatetime() + self.save() + + + def __unicode__(self): + return "User {0} from auth {1}".format(self.name, self.manager.name) + + + @staticmethod + def beforeDelete(sender, **kwargs): + ''' + Used to invoke the Service class "Destroy" before deleting it from database. + + In this case, this method ensures that the user has no userServices assigned and, if it has, + mark those services for removal + + :note: If destroy raises an exception, the deletion is not taken. + ''' + toDelete = kwargs['instance'] + + # first, we invoke removeUser. If this raises an exception, user will not + # be removed + toDelete.getManager().removeUser(toDelete.name) + + # Removes all user services assigned to this user (unassign it and mark for removal) + for us in toDelete.userServices.all(): + us.assignToUser(None) + us.remove() + + + logger.debug('Deleted user {0}'.format(toDelete)) + +signals.pre_delete.connect(User.beforeDelete, sender = User) + +class Group(models.Model): + ''' + This class represents a group, associated with one authenticator + ''' + manager = models.ForeignKey(Authenticator, on_delete=models.CASCADE, related_name='groups') + name = models.CharField(max_length = 128, db_index = True) + state = models.CharField(max_length = 1, default = State.ACTIVE, db_index = True) + comments = models.CharField(max_length = 256, default = '') + users = models.ManyToManyField(User, related_name='groups') + + class Meta: + ''' + Meta class to declare default order and unique multiple field index + ''' + unique_together = (("manager", "name"),) + ordering = ('name',) + + def getManager(self): + ''' + Returns the authenticator object that owns this user. + + :note: The returned value is an instance of the authenticator class used to manage this user, not a db record. + ''' + return self.manager.getInstance() + + def __unicode__(self): + return "Group {0} from auth {1}".format(self.name, self.manager.name) + + @staticmethod + def beforeDelete(sender, **kwargs): + ''' + Used to invoke the Service class "Destroy" before deleting it from database. + + In this case, this is a dummy method, waiting for something useful to do :-) + + :note: If destroy raises an exception, the deletion is not taken. + ''' + toDelete = kwargs['instance'] + # Todelete is a group + + # We invoke removeGroup. If this raises an exception, group will not + # be removed + toDelete.getManager().removeGroup(toDelete.name) + + + logger.debug('Deleted group {0}'.format(toDelete)) + +signals.pre_delete.connect(Group.beforeDelete, sender = Group) + +class UserPreference(models.Model): + ''' + This class represents a single user preference for an user and a module + ''' + module = models.CharField(max_length=32, db_index = True) + name = models.CharField(max_length=32, db_index = True) + value = models.CharField(max_length=128, db_index = True) + user = models.ForeignKey(User, on_delete=models.CASCADE, related_name = 'preferences') + +# Provisioned services +class DeployedService(models.Model): + ''' + A deployed service is the Service produced element that is assigned finally to an user (i.e. a Virtual Machine, etc..) + ''' + name = models.CharField(max_length=128, default = '') + comments = models.CharField(max_length = 256, default = '') + service = models.ForeignKey(Service, null=True, blank=True, related_name = 'deployedServices') + osmanager = models.ForeignKey(OSManager, null=True, blank=True, related_name = 'deployedServices') + transports = models.ManyToManyField(Transport, related_name='deployedServices', db_table = 'uds__ds_trans') + assignedGroups = models.ManyToManyField(Group, related_name='deployedServices', db_table = 'uds__ds_grps') + state = models.CharField(max_length = 1, default = State.ACTIVE, db_index = True) + state_date = models.DateTimeField(default=NEVER) + initial_srvs = models.PositiveIntegerField(default = 0) + cache_l1_srvs = models.PositiveIntegerField(default = 0) + cache_l2_srvs = models.PositiveIntegerField(default = 0) + max_srvs = models.PositiveIntegerField(default = 0) + current_pub_revision = models.PositiveIntegerField(default = 1) + + class Meta: + ''' + Meta class to declare the name of the table at database + ''' + db_table = 'uds__deployed_service' + + def getEnvironment(self): + ''' + Returns an environment valid for the record this object represents + ''' + return Environment.getEnvForTableElement(self._meta.verbose_name, self.id) + + def activePublication(self): + ''' + Returns the current valid publication for this deployed service. + + Returns: + Publication db record if this deployed service has an valid active publication. + + None if there is no valid publication for this deployed service. + ''' + try: + return self.publications.filter(state=State.USABLE)[0] + except Exception: + return None + + def setState(self, state, save = True): + ''' + Updates the state of this object and, optionally, saves it + + Args: + state: new State to store at record + + save: Defaults to true. If false, record will not be saved to db, just modified + + ''' + self.state = state + self.state_date = getSqlDatetime() + if save is True: + self.save() + + def remove(self): + ''' + Marks the deployed service for removing. + + The background worker will be the responsible for removing the deployed service + ''' + self.setState(State.REMOVABLE) + + def removed(self): + ''' + Mark the deployed service as removed. + + A background worker will check for removed deloyed services and clean database of them. + ''' + self.transports.clear() + self.assignedGroups.clear() + self.osmanager = None + self.service = None + self.setState(State.REMOVED) + + + def markOldDeployedServicesAsRemovables(self, activePub): + ''' + Used when a new publication is finished. + + Marks all user deployed services that belongs to this deployed service, that do not belongs + to "activePub" and are not in use as removable. + + Also cancels all preparing user services + + Better see the code, it's easier to understand :-) + + Args: + activePub: Active publication used as "current" publication to make checks + ''' + now = getSqlDatetime() + if activePub == None: + logger.error('No active publication, don\'t know what to erase!!! (ds = {0})'.format(self)) + return + for ap in self.publications.exclude(id=activePub.id): + for u in ap.userServices.filter(state=State.PREPARING): + u.cancel() + ap.userServices.exclude(cache_level=0).filter(state=State.USABLE).update(state=State.REMOVABLE, state_date = now) + ap.userServices.filter(cache_level=0, state=State.USABLE, in_use=False).update(state=State.REMOVABLE, state_date = now) + + def validateUser(self, user): + ''' + Validates that the user has access to this deployed service + + Args: + user: User (db record) to check if has access to this deployed service + + Returns: + True if has access + + Raises: + InvalidUserException() if user do not has access to this deployed service + + InvalidServiceException() if user has rights to access, but the deployed service is not ready (no active publication) + + ''' + # We have to check if at least one group from this user is valid for this deployed service + logger.debug('User: {0}'.format(user.id)) + logger.debug('DeployedService: {0}'.format(self.id)) + if len( set(user.groups.all()) & set(self.assignedGroups.all()) ) == 0: + raise auths.Exceptions.InvalidUserException() + if self.activePublication() is None and self.service.getType().publicationType is not None: + raise InvalidServiceException() + return True + + @staticmethod + def getDeployedServicesForGroups(groups): + ''' + Return deployed services with publications for the groups requested. + + Args: + groups: List of groups to check + + Returns: + List of accesible deployed services + ''' + list1 = DeployedService.objects.filter(assignedGroups__in=groups, assignedGroups__state__exact=State.ACTIVE, state = State.ACTIVE).distinct().annotate(cuenta=models.Count('publications')).exclude(cuenta__eq=0) + # Now get deployed services that DO NOT NEED publication + doNotNeedPublishing = [ t.type() for t in ServiceProviderFactory.factory().servicesThatDoNotNeedPublication() ] + list2 = DeployedService.objects.filter(assignedGroups__in=groups, assignedGroups__state__exact=State.ACTIVE, service__data_type__in=doNotNeedPublishing, state = State.ACTIVE) + return [ r for r in list1 ] + [ r for r in list2 ] + + + def publish(self): + ''' + Launches the publication of this deployed service. + + No check is done, it simply redirects the request to PublicationManager, where checks are done. + ''' + from uds.core.managers.PublicationManager import PublicationManager + PublicationManager.manager().publish(self) + + def unpublish(self): + ''' + Unpublish (removes) current active publcation. + + It checks that there is an active publication, and then redirects the request to the publication itself + ''' + pub = self.activePublication() + if pub is not None: + pub.unpublish() + + def cachedUserServices(self): + ''' + Utility method to access the cached user services (level 1 and 2) + + Returns: + A list of db records (userService) with cached user services + ''' + return self.userServices.exclude(cache_level=0) + + def assignedUserServices(self): + ''' + Utility method to access the assigned user services + + Returns: + A list of db records (userService) with assinged user services + ''' + return self.userServices.filter(cache_level=0) + + def erroneousUserServices(self): + ''' + Utility method to locate invalid assigned user services. + + If an user deployed service is assigned, it MUST have an user associated. + + If it don't has an user associated, the user deployed service is wrong. + ''' + return self.userServices.filter(cache_level=0, user=None) + + @staticmethod + def beforeDelete(sender, **kwargs): + ''' + Used to invoke the Service class "Destroy" before deleting it from database. + + The main purpuse of this hook is to call the "destroy" method of the object to delete and + to clear related data of the object (environment data such as own storage, cache, etc... + + :note: If destroy raises an exception, the deletion is not taken. + ''' + toDelete = kwargs['instance'] + toDelete.getEnvironment().clearRelatedData() + + logger.debug('Deleting Deployed Service {0}'.format(toDelete)) + + def __unicode__(self): + return "Deployed service {0}({1}) with {2} as initial, {3} as L1 cache, {4} as L2 cache, {5} as max".format( + self.name, self.id, self.initial_srvs, self.cache_l1_srvs, self.cache_l2_srvs, self.max_srvs) + + +# Connects a pre deletion signal to Authenticator +signals.pre_delete.connect(DeployedService.beforeDelete, sender = DeployedService) + +class DeployedServicePublication(models.Model): + ''' + A deployed service publication keep track of data needed by services that needs "preparation". (i.e. Virtual machine --> base machine --> children of base machines) + ''' + deployed_service = models.ForeignKey(DeployedService, on_delete=models.CASCADE, related_name = 'publications') + publish_date = models.DateTimeField(db_index = True) + # data_type = models.CharField(max_length=128) # The data type is specified by the service itself + data = models.TextField(default='') + # Preparation state. The preparation of a service is a task that runs over time, we need to: + # * Prepare it + # * Use it + # * Remove it + # * Mark as failed + # The responsible class will notify when we have to change state, and a deployed service will only be usable id it has at least + # a prepared service "Usable" or it doesn't need to prepare anything (needsDeployment = False) + state = models.CharField(max_length = 1, default = State.PREPARING, db_index = True) + state_date = models.DateTimeField() + revision = models.PositiveIntegerField(default = 1) + + class Meta: + ''' + Meta class to declare default order and unique multiple field index + ''' + db_table = 'uds__deployed_service_pub' + ordering = ('publish_date',) + + def getEnvironment(self): + ''' + Returns an environment valid for the record this object represents + ''' + return Environment.getEnvForTableElement(self._meta.verbose_name, self.id) + + def getInstance(self): + ''' + Instantiates the object this record contains. + + Every single record of Provider model, represents an object. + + Args: + values (list): Values to pass to constructor. If no values are especified, + the object is instantiated empty and them de-serialized from stored data. + + Returns: + The instance Instance of the class this provider represents + + Raises: + ''' + serviceInstance = self.deployed_service.service.getInstance() + osManagerInstance = self.deployed_service.osmanager + if osManagerInstance is not None: + osManagerInstance = osManagerInstance.getInstance() + # Sanity check, so it's easier to find when we have created + # a service that needs publication but do not have + + if serviceInstance.publicationType is None: + raise Exception('Tried to get a publication instance for a service that do not needs it') + + if serviceInstance.publicationType is None: + raise Exception('Class {0} do not have defined publicationType but needs to be published!!!'.format(serviceInstance.__class__.__name)) + + dpl = serviceInstance.publicationType(self.getEnvironment(), service = serviceInstance, osManager = osManagerInstance, revision = self.revision, dsName = self.deployed_service.name ) + # Only invokes deserialization if data has something. '' is nothing + if self.data != '' and self.data is not None: + dpl.unserialize(self.data) + return dpl + + def updateData(self, dsp): + ''' + Updates the data field with the serialized uds.core.services.Publication + + Args: + dsp: uds.core.services.Publication to serialize + + :note: This method do not saves the updated record, just updates the field + ''' + self.data = dsp.serialize() + + def setState(self, state): + ''' + Updates the state of this object and, optionally, saves it + + Args: + state: new State to store at record + + save: Defaults to true. If false, record will not be saved to db, just modified + + ''' + self.state_date = getSqlDatetime() + self.state = state + + def unpublish(self): + ''' + Tries to remove the publication + + No check is done, it simply redirects the request to PublicationManager, where checks are done. + ''' + from uds.core.managers.PublicationManager import PublicationManager + PublicationManager.manager().unpublish(self) + + def cancel(self): + ''' + Invoques the cancelation of this publication + ''' + from uds.core.managers.PublicationManager import PublicationManager + PublicationManager.manager().cancel(self) + + + @staticmethod + def beforeDelete(sender, **kwargs): + ''' + Used to invoke the Service class "Destroy" before deleting it from database. + + The main purpuse of this hook is to call the "destroy" method of the object to delete and + to clear related data of the object (environment data such as own storage, cache, etc... + + :note: If destroy raises an exception, the deletion is not taken. + ''' + toDelete = kwargs['instance'] + toDelete.getEnvironment().clearRelatedData() + + # Destroy method is invoked directly by PublicationManager, + # Destroying a publication is not obligatory an 1 step action. + # It's handled as "publish", and as so, it + + logger.debug('Deleted publication {0}'.format(toDelete)) + + + +# Connects a pre deletion signal to Authenticator +signals.pre_delete.connect(DeployedServicePublication.beforeDelete, sender = DeployedServicePublication) + +class UserService(models.Model): + ''' + This is the base model for assigned user service and cached user services. + This are the real assigned services to users. DeployedService is the container (the group) of this elements. + ''' + # The reference to deployed service is used to accelerate the queries for different methods, in fact its redundant cause we can access to the deployed service + # through publication, but queries are much more simple + deployed_service = models.ForeignKey(DeployedService, on_delete=models.CASCADE, related_name = 'userServices') + publication = models.ForeignKey(DeployedServicePublication, on_delete=models.CASCADE, null=True, blank=True, related_name = 'userServices') + + unique_id = models.CharField(max_length=128, default ='', db_index = True) # User by agents to locate machine + friendly_name = models.CharField(max_length=128, default = '') + # We need to keep separated two differents os states so service operations (move beween caches, recover service) do not affects os manager state + state = models.CharField(max_length=1, default=State.PREPARING, db_index = True) # We set index so filters at cache level executes faster + os_state = models.CharField(max_length=1, default=State.PREPARING) # The valid values for this field are PREPARE and USABLE + state_date = models.DateTimeField(auto_now_add=True) + creation_date = models.DateTimeField(db_index = True) + data = models.TextField(default='') + user = models.ForeignKey(User, on_delete=models.CASCADE, related_name = 'userServices', null=True, blank=True, default = None) + in_use = models.BooleanField(default=False) + in_use_date = models.DateTimeField(default=NEVER) + cache_level = models.PositiveSmallIntegerField(db_index=True, default=0) # Cache level must be 1 for L1 or 2 for L2, 0 if it is not cached service + + objects = LockingManager() + + class Meta: + ''' + Meta class to declare default order and unique multiple field index + ''' + db_table = 'uds__user_service' + ordering = ('creation_date',) + + def getEnvironment(self): + ''' + Returns an environment valid for the record this object represents. + + In the case of the user, there is an instatiation of "generators". + Right now, there is two generators provided to child instance objects, that are + valid for generating unique names and unique macs. In a future, there could be more generators + + To access this generators, use the Envirnment class, and the keys 'name' and 'mac'. + + (see related classes uds.core.util.UniqueNameGenerator and uds.core.util.UniqueMacGenerator) + ''' + from uds.core.util.UniqueMacGenerator import UniqueMacGenerator + from uds.core.util.UniqueNameGenerator import UniqueNameGenerator + return Environment.getEnvForTableElement(self._meta.verbose_name, self.id, {'mac' : UniqueMacGenerator, 'name' : UniqueNameGenerator } ) + + def getInstance(self): + ''' + Instantiates the object this record contains. In this case, the instantiated object needs also + the os manager and the publication, so we also instantiate those here. + + Every single record of UserService model, represents an object. + + Args: + values (list): Values to pass to constructor. If no values are especified, + the object is instantiated empty and them de-serialized from stored data. + + Returns: + The instance Instance of the class this provider represents + + Raises: + ''' + # We get the service instance, publication instance and osmanager instance + ds = self.deployed_service + serviceInstance = ds.service.getInstance() + if serviceInstance.needsManager is False: + osmanagerInstance = None + else: + osmanagerInstance = ds.osmanager.getInstance() + # We get active publication + publicationInstance = None + try: # We may have deleted publication... + if self.publication != None: + publicationInstance = self.publication.getInstance() + except Exception, e: + # The publication to witch this item points to, does not exists + self.publication = None + logger.error("Got exception at getInstance of an userService {0} : {1}".format(e.__class__, e)) + if serviceInstance.deployedType is None: + raise Exception('Class {0} needs deployedType but it is not defined!!!'.format(serviceInstance.__class__.__name__)) + us = serviceInstance.deployedType(self.getEnvironment(), service = serviceInstance, publication = publicationInstance, osmanager = osmanagerInstance, dbservice = self) + if self.data != '' and self.data is not None: + us.unserialize(self.data) + return us + + def updateData(self, us): + ''' + Updates the data field with the serialized :py:class:uds.core.services.UserDeployment + + Args: + dsp: :py:class:uds.core.services.UserDeployment to serialize + + :note: This method do not saves the updated record, just updates the field + ''' + self.data = us.serialize() + + def setState(self, state): + ''' + Updates the state of this object and, optionally, saves it + + Args: + state: new State to store at record + + save: Defaults to true. If false, record will not be saved to db, just modified + + ''' + self.state_date = getSqlDatetime() + self.state = state + + def setOsState(self, state): + ''' + Updates the os state (state of the os) of this object and, optionally, saves it + + Args: + state: new State to store at record + + save: Defaults to true. If false, record will not be saved to db, just modified + + ''' + self.state_date = getSqlDatetime() + self.os_state = state + + def assignToUser(self, user): + ''' + Assigns this user deployed service to an user. + + Args: + user: User to assing to (db record) + ''' + self.cache_level = 0 + self.user = user + + def setInUse(self, state): + ''' + Set the "in_use" flag for this user deployed service + + Args: + state: State to set to the "in_use" flag of this record + + :note: If the state is Fase (set to not in use), a check for removal of this deployed service is launched. + ''' + from uds.core.managers.UserServiceManager import UserServiceManager + self.in_use = state + self.in_use_date = getSqlDatetime() + if state is False: # Service released, check y we should mark it for removal + # If our publication is not current, mark this for removal + UserServiceManager.manager().checkForRemoval(self) + + + def isUsable(self): + ''' + Returns if this service is usable + ''' + return State.isUsable(self.state) + + def isPreparing(self): + ''' + Returns if this service is in preparation (not ready to use, but in its way to be so...) + ''' + return State.isPreparing(self.state) + + def isReady(self): + ''' + Returns if this service is ready (not preparing or marked for removal) + ''' + # Call to isReady of the instance + from uds.core.managers.UserServiceManager import UserServiceManager + return UserServiceManager.manager().isReady(self) + + def remove(self): + ''' + Mark this user deployed service for removal + ''' + self.setState(State.REMOVABLE) + self.save() + + def cancel(self): + ''' + Asks the UserServiceManager to cancel the current operation of this user deployed service. + ''' + from uds.core.managers.UserServiceManager import UserServiceManager + UserServiceManager.manager().cancel(self) + + def removeOrCancel(self): + ''' + Marks for removal or cancels it, depending on state + ''' + if self.isUsable(): + self.remove() + else: + self.cancel() + + def moveToLevel(self, cacheLevel): + ''' + Moves cache items betwen levels, managed directly + + Args: + cacheLevel: New cache level to put object in + ''' + from uds.core.managers.UserServiceManager import UserServiceManager + UserServiceManager.manager().moveToLevel(self, cacheLevel) + + @staticmethod + def getUserAssignedServices(user): + ''' + Return DeployedUserServices (not deployed services) that this user owns and are assignable + For this to happen, we locate all user services assigned to this user, and we keep those that: + * Must assign service manually + This method is probably slow, but i don't think a user will have more than a bunch of services assigned + @returns and array of dicts with id, name and transports + ''' + logger.debug("Filtering assigned services for user {0}".format(user)) + res = [] + for us in UserService.objects.filter(user=user): + if us.deployed_service.state != State.ACTIVE: # Do not show removing or removed services + continue; + usi = us.getInstance() + if usi.service().mustAssignManually is False: + continue + res.append({ 'id' : us.id, 'name' : usi.getName(), 'transports' : us.deployed_service.transports }) + return res + + def __unicode__(self): + return "User service {0}, cache_level {1}, user {2}".format(self.id, self.cache_level, self.user) + + @staticmethod + def beforeDelete(sender, **kwargs): + ''' + Used to invoke the Service class "Destroy" before deleting it from database. + + The main purpuse of this hook is to call the "destroy" method of the object to delete and + to clear related data of the object (environment data such as own storage, cache, etc... + + :note: If destroy raises an exception, the deletion is not taken. + ''' + toDelete = kwargs['instance'] + toDelete.getEnvironment().clearRelatedData() + + # TODO: Check if this invokation goes here + #toDelete.getInstance() + + logger.debug('Deleted user service {0}'.format(toDelete)) + + + +# Connects a pre deletion signal to Authenticator +signals.pre_delete.connect(UserService.beforeDelete, sender = UserService) + + +# General utility models, such as a database cache (for caching remote content of slow connections to external services providers for example) +# We could use django cache (and maybe we do it in a near future), but we need to clean up things when objecs owning them are deleted +class Cache(models.Model): + ''' + General caching model. This model is managed via uds.core.util.Cache.Cache class + ''' + owner = models.CharField(max_length = 128, db_index = True) + key = models.CharField(max_length = 64, primary_key = True) + value = models.TextField(default = '') + created = models.DateTimeField() # Date creation or validation of this entry. Set at write time + validity = models.IntegerField(default = 60) # Validity of this entry, in seconds + + class Meta: + ''' + Meta class to declare the name of the table at database + ''' + db_table = 'uds_utility_cache' + + @staticmethod + def cleanUp(): + ''' + Purges the cache items that are no longer vaild. + ''' + from django.db import connection, transaction + con = connection + cursor = con.cursor() + logger.info("Purging cache items") + cursor.execute('DELETE FROM uds_utility_cache WHERE created + validity < now()') + transaction.commit_unless_managed() + + + def __unicode__(self): + expired = datetime.now() > self.created + timedelta(seconds = self.validity) + if expired: + expired = "Expired" + else: + expired = "Active" + return "{0} {1} = {2} ({3})".format(self.owner, self.key, self.value, expired) + +class Config(models.Model): + ''' + General configuration values model. Used to store global and specific modules configuration values. + This model is managed via uds.core.util.Config.Config class + ''' + section = models.CharField(max_length=128) + key = models.CharField(max_length=64) + value = models.TextField(default = '') + crypt = models.BooleanField(default = False) + + class Meta: + ''' + Meta class to declare default order and unique multiple field index + ''' + db_table = 'uds_configuration' + unique_together = (('section', 'key'),) + + def __unicode__(self): + return "Config {0} = {1}".format(self.key, self.value) + +class Storage(models.Model): + ''' + General storage model. Used to store specific instances (transport, service, servicemanager, ...) persinstent information + not intended to be serialized/deserialized everytime one object instance is loaded/saved. + ''' + owner = models.CharField(max_length = 128, db_index = True) + key = models.CharField(max_length = 64, primary_key = True) + data = models.CharField(max_length = 1024, default='') + attr1 = models.CharField(max_length = 64, db_index = True, null=True, blank=True, default = None) + + objects = LockingManager() + + def __unicode__(self): + return "{0} {1} = {2}, {3}".format(self.owner, self.key, self.data, str.join( '/', [self.attr1])) + +class UniqueId(models.Model): + ''' + Unique ID Database. Used to store unique names, unique macs, etc... + Managed via uds.core.util.UniqueIDGenerator.UniqueIDGenerator + ''' + owner = models.CharField(max_length = 128, db_index = True, default = '') + basename = models.CharField(max_length = 32, db_index = True) + seq = models.BigIntegerField(db_index=True) + assigned = models.BooleanField(db_index=True, default = True) + + objects = LockingManager() + + class Meta: + ''' + Meta class to declare default order and unique multiple field index + ''' + unique_together = (('basename', 'seq'),) + ordering = ('-seq',) + + + def __unicode__(self): + return "{0} {1}.{2}, assigned is {3}".format(self.owner, self.basename, self.seq, self.assigned) + + +class Scheduler(models.Model): + ''' + Class that contains scheduled tasks. + + The scheduled task are keep at database so: + * We can access them from any host + * We have a persistence for them + + The Scheduler contains jobs, that are clases that manages the job. + Jobs are not serialized/deserialized, they are just Task delegated to certain clases. + + In order for a task to work, it must first register itself for "names" that that class handles using the + JobsFactory + ''' + + DAY = 60*60*24 + HOUR = 60*60 + MIN = 60 + + name = models.CharField(max_length = 64, unique = True) + frecuency = models.PositiveIntegerField(default = DAY) + last_execution = models.DateTimeField(auto_now_add = True) + next_execution = models.DateTimeField(default = NEVER, db_index = True) + owner_server = models.CharField(max_length=64, db_index = True, default = '') + state = models.CharField(max_length = 1, default = State.FOR_EXECUTE, db_index = True) + + #objects = LockingManager() + + def getEnvironment(self): + ''' + Returns an environment valid for the record this object represents + ''' + return Environment.getEnvForTableElement(self._meta.verbose_name, self.id) + + def getInstance(self): + ''' + Returns an instance of the class that this record of the Scheduler represents. This clas is derived + of uds.core.jobs.Job.Job + ''' + jobInstance = JobsFactory.factory().lookup(self.name) + if jobInstance != None: + env = self.getEnvironment() + return jobInstance(env) + else: + return None + + @staticmethod + def beforeDelete(sender, **kwargs): + ''' + Used to remove environment for sheduled task + ''' + toDelete = kwargs['instance'] + logger.debug('Deleting sheduled task {0}'.format(toDelete)) + toDelete.getEnvironment().clearRelatedData() + + + def __unicode__(self): + return "Scheduled task {0}, every {1}, last execution at {2}, state = {3}".format(self.name, self.frecuency, self.last_execution, self.state) + +# Connects a pre deletion signal to Scheduler +signals.pre_delete.connect(Scheduler.beforeDelete, sender = Scheduler) + + +class DelayedTask(models.Model): + ''' + A delayed task is a kind of scheduled task. It's a task that has more than is executed at a delay + specified at record. This is, for example, for publications, service preparations, etc... + + The delayed task is different from scheduler in the fact that they are "one shot", meaning this that when the + specified delay is reached, the task is executed and the record is removed from the table. + + This table contains uds.core.util.jobs.DelayedTask references + ''' + type = models.CharField(max_length=128) + tag = models.CharField(max_length=64, db_index = True) # A tag for letting us locate delayed publications... + instance = models.TextField() + insert_date = models.DateTimeField(auto_now_add = True) + execution_delay = models.PositiveIntegerField() + execution_time = models.DateTimeField(db_index = True) + + #objects = LockingManager() + + def __unicode__(self): + return "Run Queue task {0} owned by {3},inserted at {1} and with {2} seconds delay".format(self.type, self.insert_date, self.execution_delay, self.owner_server) + + +class Network(models.Model): + ''' + This model is used for keeping information of networks associated with transports (right now, just transports..) + ''' + name = models.CharField(max_length = 64, unique = True) + net_start = models.BigIntegerField(db_index = True) + net_end = models.BigIntegerField(db_index = True) + transports = models.ManyToManyField(Transport, related_name='networks', db_table='uds_net_trans') + + @staticmethod + def ipToLong(ip): + ''' + convert decimal dotted quad string to long integer + ''' + + hexn = ''.join(["%02X" % long(i) for i in ip.split('.')]) + return long(hexn, 16) + + @staticmethod + def longToIp(n): + ''' + convert long int to dotted quad string + ''' + + d = 256 * 256 * 256 + q = [] + while d > 0: + m,n = divmod(n,d) + q.append(str(m)) + d = d/256 + + return '.'.join(q) + + @staticmethod + def networksFor(ip): + ''' + Returns the networks that are valid for specified ip in dotted quad (xxx.xxx.xxx.xxx) + ''' + ip = Network.ipToLong(ip) + return Network.objects.filter(net_start__lte=ip, net_end__gte=ip) + + @staticmethod + def create(name, netStart, netEnd): + ''' + Creates an network record, with the specified net start and net end (dotted quad) + + Args: + netStart: Network start + + netEnd: Network end + ''' + return Network.objects.create(name=name, net_start = Network.ipToLong(netStart), net_end = Network.ipToLong(netEnd)) + + @property + def netStart(self): + ''' + Property to access the quad dotted format of the stored network start + + Returns: + string representing the dotted quad of this network start + ''' + return Network.longToIp(self.net_start) + + @property + def netEnd(self): + ''' + Property to access the quad dotted format of the stored network end + + Returns: + string representing the dotted quad of this network end + ''' + return Network.longToIp(self.net_end) + + def update(self, name, netStart, netEnd): + ''' + Updated this network with provided values + + Args: + name: new name of the network + + netStart: new Network start (quad dotted) + + netEnd: new Network end (quad dotted) + ''' + self.name = name + self.net_start = Network.ipToLong(netStart) + self.net_end = Network.ipToLong(netEnd) + self.save() + + def __unicode__(self): + return 'Network {0} from {1} to {2}'.format(self.name, Network.longToIp(self.net_start), Network.longToIp(self.net_end)) + diff --git a/server/src/uds/osmanagers/LinuxOsManager/LinuxOsManager.py b/server/src/uds/osmanagers/LinuxOsManager/LinuxOsManager.py new file mode 100644 index 000000000..008abfa7f --- /dev/null +++ b/server/src/uds/osmanagers/LinuxOsManager/LinuxOsManager.py @@ -0,0 +1,156 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext_noop as _ +from uds.core.ui.UserInterface import gui +from uds.core.osmanagers.BaseOsManager import BaseOSManager, State + +import logging +from uds.core.managers.UserServiceManager import UserServiceManager + +logger = logging.getLogger(__name__) + +class LinuxOsManager(BaseOSManager): + typeName = _('Linux OS Manager') + typeType = 'LinuxManager' + typeDescription = _('Os Manager to control linux virtual machines (basically renames machine and notify state)') + iconFile = 'losmanager.png' + + onLogout = gui.ChoiceField( label = _('On Logout'), order = 10, rdonly = False, tooltip = _('What to do when user logout from service'), + values = [ {'id' : 'keep', 'text' : _('Keep service assigned') }, + {'id' : 'remove', 'text' : _('Remove service') } + ], defvalue = 'keep' ) + + def __init__(self,environment, values): + super(LinuxOsManager, self).__init__(environment, values) + if values is not None: + self._onLogout = values['onLogout'] + else: + self._onLogout = '' + + + def release(self, service): + pass + + def getName(self, service): + ''' + gets name from deployed + ''' + si = service.getInstance() + name = si.getName() + service.updateData(si) + return name + + def infoVal(self,service): + return 'rename:' + self.getName(service) + + def notifyIp(self, uid, si, data): + # Notifies IP to deployed + pairs = data.split(',') + for p in pairs: + key, val = p.split('=') + if key.lower() == uid.lower(): + si.setIp(val) + break + + def process(self,service,msg, data): + ''' + We understand this messages: + * msg = info, data = None. Get information about name of machine (or domain, in derived WinDomainOsManager class) + * msg = logon, data = Username, Informs that the username has logged in inside the machine + * msg = logoff, data = Username, Informs that the username has logged out of the machine + * msg = ready, data = None, Informs machine ready to be used + ''' + logger.info("Invoked LinuxOsManager for {0} with params: {1},{2}".format(service, msg, data)) + # We get from storage the name for this service. If no name, we try to assign a new one + ret = "ok" + inUse = False + notifyReady = False + doRemove = False + state = service.os_state + if msg == "info": + ret = self.infoVal(service) + state = State.PREPARING + elif msg == "login": + si = service.getInstance() + si.userLoggedIn(data) + service.updateData(si) + inUse = True + elif msg == "logout": + si = service.getInstance() + si.userLoggedOut(data) + service.updateData(si) + if self._onLogout == 'remove': + doRemove = True + elif msg == "ip": + # This ocurss on main loop inside machine, so service is usable + state = State.USABLE + si = service.getInstance() + self.notifyIp(service.unique_id, si, data) + service.updateData(si) + elif msg == "ready": + state = State.USABLE + si = service.getInstance() + notifyReady = True + self.notifyIp(service.unique_id, si, data) + service.updateData(si) + service.setInUse(inUse) + service.setOsState(state) + # If notifyReady is not true, save state, let UserServiceManager do it for us else + if doRemove is True: + service.remove() + else: + if notifyReady is False: + service.save() + else: + UserServiceManager.manager().notifyReadyFromOsManager(service, '') + logger.debug('Returning {0}'.format(ret)) + return ret + + def checkState(self,service): + logger.debug('Checking state for service {0}'.format(service)) + return State.RUNNING + + def marshal(self): + ''' + Serializes the os manager data so we can store it in database + ''' + return str.join( '\t', [ 'v1', self._onLogout ] ) + + def unmarshal(self, s): + data = s.split('\t') + if data[0] == 'v1': + self._onLogout = data[1] + + def valuesDict(self): + return { 'onLogout' : self._onLogout } diff --git a/server/src/uds/osmanagers/LinuxOsManager/__init__.py b/server/src/uds/osmanagers/LinuxOsManager/__init__.py new file mode 100644 index 000000000..e93c0d115 --- /dev/null +++ b/server/src/uds/osmanagers/LinuxOsManager/__init__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext_noop as _ +from uds.core.osmanagers.OSManagersFactory import OSManagersFactory +from uds.core.managers.DownloadsManager import DownloadsManager +from uds.osmanagers.LinuxOsManager.LinuxOsManager import LinuxOsManager +import os.path, sys + +OSManagersFactory.factory().insert(LinuxOsManager) + +DownloadsManager.manager().registerDownloadable('udsactor_1.0_all.deb', + _('UDS Actor for linux machines (Requires python 2.6 or greater)'), + os.path.dirname(sys.modules[__package__].__file__) + '/files/udsactor_1.0_all.deb', + 'application/x-debian-package') diff --git a/server/src/uds/osmanagers/LinuxOsManager/files/udsactor_1.0_all.deb b/server/src/uds/osmanagers/LinuxOsManager/files/udsactor_1.0_all.deb new file mode 100644 index 000000000..c6b5476f5 Binary files /dev/null and b/server/src/uds/osmanagers/LinuxOsManager/files/udsactor_1.0_all.deb differ diff --git a/server/src/uds/osmanagers/LinuxOsManager/losmanager.png b/server/src/uds/osmanagers/LinuxOsManager/losmanager.png new file mode 100644 index 000000000..9a8c58642 Binary files /dev/null and b/server/src/uds/osmanagers/LinuxOsManager/losmanager.png differ diff --git a/server/src/uds/osmanagers/NoneOsManager/Manager.py b/server/src/uds/osmanagers/NoneOsManager/Manager.py new file mode 100644 index 000000000..d3584c1d6 --- /dev/null +++ b/server/src/uds/osmanagers/NoneOsManager/Manager.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext_noop as _ +from uds.core.ui.UserInterface import gui +from uds.core.osmanagers.BaseOsManager import BaseOSManager, State + +import logging + +logger = logging.getLogger(__name__) + +class NoneOSManager(BaseOSManager): + typeName = _('None OS Manager') + typeType = 'NoneOSManager' + typeDescription = _('Os Manager with no actions') + iconFile = 'osmanager.png' + + def __init__(self,environment, values): + super(NoneOSManager, self).__init__(environment, values) + + def process(self,service,msg, data): + logger.info("Invoked NoneOsManager for {0} with params: {1}, {2}".format(service, msg, data)) + return "noneos" + + def checkState(self,service): + logger.debug('Checking state for service {0}'.format(service)) + return State.FINISHED + + def marshal(self): + ''' + Serializes the os manager data so we can store it in database + ''' + return str.join( '\t', [ 'v1' ] ) + + def unmarshal(self, str): + data = str.split('\t') + if data[0] == 'v1': + pass + + def valuesDict(self): + return {} + \ No newline at end of file diff --git a/server/src/uds/osmanagers/NoneOsManager/__init__.py b/server/src/uds/osmanagers/NoneOsManager/__init__.py new file mode 100644 index 000000000..0db986528 --- /dev/null +++ b/server/src/uds/osmanagers/NoneOsManager/__init__.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from uds.core.osmanagers.OSManagersFactory import OSManagersFactory +from uds.osmanagers.NoneOsManager.Manager import NoneOSManager + +# This os manager exists for testing purposes only, do not register nor use it on a production environment +#OSManagersFactory.factory().insert(NoneOSManager) diff --git a/server/src/uds/osmanagers/NoneOsManager/osmanager.png b/server/src/uds/osmanagers/NoneOsManager/osmanager.png new file mode 100644 index 000000000..4ec28db89 Binary files /dev/null and b/server/src/uds/osmanagers/NoneOsManager/osmanager.png differ diff --git a/server/src/uds/osmanagers/WindowsOsManager/WinDomainOsManager.py b/server/src/uds/osmanagers/WindowsOsManager/WinDomainOsManager.py new file mode 100644 index 000000000..3a2ecd659 --- /dev/null +++ b/server/src/uds/osmanagers/WindowsOsManager/WinDomainOsManager.py @@ -0,0 +1,85 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext_noop as _ +from uds.core.ui.UserInterface import gui +from uds.core.managers.CryptoManager import CryptoManager +from uds.core.osmanagers.BaseOsManager import BaseOSManager, State +from WindowsOsManager import WindowsOsManager, scrambleMsg + +import logging + +logger = logging.getLogger(__name__) + +class WinDomainOsManager(WindowsOsManager): + typeName = _('Windows Domain OS Manager') + typeType = 'WinDomainManager' + typeDescription = _('Os Manager to control windows machines with domain. (Basically renames machine)') + iconFile = 'wosmanager.png' + + # Apart form data from windows os manager, we need also domain and credentials + domain = gui.TextField(length=64, label = _('Domain'), order = 1, tooltip = _('Domain to join machines to (better use dns form of domain)'), required = True) + account = gui.TextField(length=64, label = _('Account'), order = 2, tooltip = _('Account with rights to add machines to domain'), required = True) + password = gui.PasswordField(length=64, label = _('Password'), order = 3, tooltip = _('Password of the account'), required = True) + ou = gui.TextField(length=64, label = _('OU'), order = 4, tooltip = _('Organizational unit where to add machines in domain (check it before using it)')) + # Inherits base "onLogout" + onLogout = WindowsOsManager.onLogout + + def __init__(self,environment, values): + super(WinDomainOsManager, self).__init__(environment, values) + if values != None: + if values['domain'] == '': + raise BaseOSManager.ValidationException(_('Must provide a domain!!!')) + if values['account'] == '': + raise BaseOSManager.ValidationException(_('Must provide an account to add machines to domain!!!')) + if values['password'] == '': + raise BaseOSManager.ValidationException(_('Must provide a password for the account!!!')) + self._domain = values['domain'] + self._ou = values['ou'] + self._account = values['account'] + self._password = values['password'] + else: + self._domain = "" + self._ou = "" + self._account = "" + self._password = "" + + def release(self, service): + super(WinDomainOsManager,self).release(service) + # TODO: remove machine from active directory os, under ou or default location if not specified + + def infoVal(self, service): + return 'domain:{0}\t{1}\t{2}\t{3}\t{4}'.format( self.getName(service), self._domain, self._ou, self._account, self._password) + + def marshal(self): + base = super(WinDomainOsManager,self).marshal() + ''' + Serializes the os manager data so we can store it in database + ''' + return str.join( '\t', [ 'v1', self._domain, self._ou, self._account, CryptoManager.manager().encrypt(self._password), base.encode('hex') ] ) + + def unmarshal(self, s): + data = s.split('\t') + if data[0] == 'v1': + self._domain = data[1] + self._ou = data[2] + self._account = data[3] + self._password = CryptoManager.manager().decrypt(data[4]) + super(WinDomainOsManager, self).unmarshal(data[5].decode('hex')) + + def valuesDict(self): + dict = super(WinDomainOsManager,self).valuesDict() + dict['domain'] = self._domain + dict['ou'] = self._ou + dict['account'] = self._account + dict['password'] = self._password + return dict + diff --git a/server/src/uds/osmanagers/WindowsOsManager/WindowsOsManager.py b/server/src/uds/osmanagers/WindowsOsManager/WindowsOsManager.py new file mode 100644 index 000000000..3893d8e4f --- /dev/null +++ b/server/src/uds/osmanagers/WindowsOsManager/WindowsOsManager.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext_noop as _ +from uds.core.ui.UserInterface import gui +from uds.core.osmanagers.BaseOsManager import BaseOSManager, State +from uds.core.managers.UserServiceManager import UserServiceManager + +import logging + +logger = logging.getLogger(__name__) + + +def scrambleMsg(data): + ''' + Simple scrambler so password are not seen at source page + ''' + res = [] + n = 0x32 + for c in data[::-1]: + res.append( chr(ord(c) ^ n) ) + n = (n + ord(c)) & 0xFF + return "".join(res).encode('hex') + + +class WindowsOsManager(BaseOSManager): + typeName = _('Windows Basic OS Manager') + typeType = 'WindowsManager' + typeDescription = _('Os Manager to control windows machines without domain. (Basically renames machine)') + iconFile = 'wosmanager.png' + + onLogout = gui.ChoiceField( label = _('On Logout'), order = 10, rdonly = False, tooltip = _('What to do when user logout from service'), + values = [ {'id' : 'keep', 'text' : _('Keep service assigned') }, + {'id' : 'remove', 'text' : _('Remove service') } + ], defvalue = 'keep' ) + + + @staticmethod + def validateLen(len): + try: + len = int(len) + except Exception: + raise BaseOSManager.ValidationException(_('Length must be numeric!!')) + if len > 6 or len < 1: + raise BaseOSManager.ValidationException(_('Length must be betwen 1 and six')) + return len + + def __init__(self,environment, values): + super(WindowsOsManager, self).__init__(environment, values) + if values is not None: + self._onLogout = values['onLogout'] + else: + self._onLogout = '' + + def release(self, service): + pass + + def getName(self, service): + ''' + gets name from deployed + ''' + si = service.getInstance() + name = si.getName() + service.updateData(si) + return name + + def infoVal(self,service): + return 'rename:' + self.getName(service) + + def notifyIp(self, uid, si, data): + # Notifies IP to deployed + pairs = data.split(',') + for p in pairs: + key, val = p.split('=') + if key.lower() == uid.lower(): + si.setIp(val) + break + + def process(self,service,msg, data): + ''' + We understand this messages: + * msg = info, data = None. Get information about name of machine (or domain, in derived WinDomainOsManager class) + * msg = logon, data = Username, Informs that the username has logged in inside the machine + * msg = logoff, data = Username, Informs that the username has logged out of the machine + * msg = ready, data = None, Informs machine ready to be used + ''' + logger.info("Invoked WindowsOsManager for {0} with params: {1},{2}".format(service, msg, data)) + # We get from storage the name for this service. If no name, we try to assign a new one + ret = "ok" + inUse = False + notifyReady = False + doRemove = False + state = service.os_state + if msg == "info": + ret = self.infoVal(service) + state = State.PREPARING + elif msg == "logon": + si = service.getInstance() + si.userLoggedIn(data) + service.updateData(si) + inUse = True + elif msg == "logoff": + si = service.getInstance() + si.userLoggedOut(data) + service.updateData(si) + if self._onLogout == 'remove': + doRemove = True + elif msg == "ip": + # This ocurss on main loop inside machine, so service is usable + state = State.USABLE + si = service.getInstance() + self.notifyIp(service.unique_id, si, data) + service.updateData(si) + elif msg == "ready": + state = State.USABLE + si = service.getInstance() + notifyReady = True + self.notifyIp(service.unique_id, si, data) + service.updateData(si) + service.setInUse(inUse) + service.setOsState(state) + # If notifyReady is not true, save state, let UserServiceManager do it for us else + if doRemove is True: + service.remove() + else: + if notifyReady is False: + service.save() + else: + UserServiceManager.manager().notifyReadyFromOsManager(service, '') + logger.debug('Returning {0}'.format(ret)) + return scrambleMsg(ret) + + def checkState(self,service): + logger.debug('Checking state for service {0}'.format(service)) + return State.RUNNING + + def marshal(self): + ''' + Serializes the os manager data so we can store it in database + ''' + return str.join( '\t', [ 'v1', self._onLogout ] ) + + def unmarshal(self, s): + data = s.split('\t') + if data[0] == 'v1': + self._onLogout = data[1] + + def valuesDict(self): + return { 'onLogout' : self._onLogout } + \ No newline at end of file diff --git a/server/src/uds/osmanagers/WindowsOsManager/__init__.py b/server/src/uds/osmanagers/WindowsOsManager/__init__.py new file mode 100644 index 000000000..b3b6bc0db --- /dev/null +++ b/server/src/uds/osmanagers/WindowsOsManager/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext_noop as _ +from uds.core.osmanagers.OSManagersFactory import OSManagersFactory +from uds.core.managers.DownloadsManager import DownloadsManager +from uds.osmanagers.WindowsOsManager.WindowsOsManager import WindowsOsManager +from uds.osmanagers.WindowsOsManager.WinDomainOsManager import WinDomainOsManager +import os.path, sys + +OSManagersFactory.factory().insert(WindowsOsManager) +OSManagersFactory.factory().insert(WinDomainOsManager) + +DownloadsManager.manager().registerDownloadable('UDSActorSetup.exe', + _('UDS Actor for windows machines (Important!! Requires .net framework 3.5 sp1)'), + os.path.dirname(sys.modules[__package__].__file__) + '/files/UDSActorSetup.exe', + 'application/x-msdos-program') diff --git a/server/src/uds/osmanagers/WindowsOsManager/files/UDSActorSetup.exe b/server/src/uds/osmanagers/WindowsOsManager/files/UDSActorSetup.exe new file mode 100644 index 000000000..4ed879190 Binary files /dev/null and b/server/src/uds/osmanagers/WindowsOsManager/files/UDSActorSetup.exe differ diff --git a/server/src/uds/osmanagers/WindowsOsManager/wosmanager.png b/server/src/uds/osmanagers/WindowsOsManager/wosmanager.png new file mode 100644 index 000000000..cefdb8071 Binary files /dev/null and b/server/src/uds/osmanagers/WindowsOsManager/wosmanager.png differ diff --git a/server/src/uds/osmanagers/__init__.py b/server/src/uds/osmanagers/__init__.py new file mode 100644 index 000000000..81f89c513 --- /dev/null +++ b/server/src/uds/osmanagers/__init__.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +import os.path, pkgutil +import sys +import uds.core + +# Dynamically import children of this package. The __init__.py files must register, if needed, inside ServiceProviderFactory +pkgpath = os.path.dirname(sys.modules[__name__].__file__) +for _, name, _ in pkgutil.iter_modules([pkgpath]): + __import__(name, globals(), locals(), [], -1) diff --git a/server/src/uds/services/PhysicalMachines/IPMachineDeployed.py b/server/src/uds/services/PhysicalMachines/IPMachineDeployed.py new file mode 100644 index 000000000..16f1fc156 --- /dev/null +++ b/server/src/uds/services/PhysicalMachines/IPMachineDeployed.py @@ -0,0 +1,100 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext_lazy as _ +from uds.core import services +from uds.core.util.State import State +from uds.core.util.AutoAttributes import AutoAttributes +import logging + +logger = logging.getLogger(__name__) + +class IPMachineDeployed(AutoAttributes, services.UserDeployment): + suggestedTime = 10 + + def __init__(self, environment, **kwargs): + AutoAttributes.__init__(self, ip=str, reason=str, state=str) + services.UserDeployment.__init__(self,environment, **kwargs) + self._state = State.FINISHED + + def setIp(self, ip): + logger.debug('Setting IP to %s (ignored)' % ip) + + def getIp(self): + return self._ip + + def getName(self): + return _("IP ") + self._ip + + def getUniqueId(self): + return self._ip + + def setReady(self): + self._state = State.FINISHED + return self._state + + def __deploy(self): + ip = self.service().getUnassignedMachine() + if ip is None: + self._reason = 'No machines left' + self._state = State.ERROR + else: + self._ip = ip + self._state = State.FINISHED + return self._state + + def deployForUser(self, user): + logger.debug("Starting deploy of {0} for user {0}".format(self._ip, user)) + return self.__deploy() + + def checkState(self): + return self._state + + def finish(self): + pass + + def reasonOfError(self): + ''' + If a publication produces an error, here we must notify the reason why it happened. This will be called just after + publish or checkPublishingState if they return State.ERROR + ''' + return self._reason + + def cancel(self): + return self.destroy() + + def destroy(self): + if self._ip != '': + self.service().unassignMachine(self._ip) + self._state = State.FINISHED + return self._state diff --git a/server/src/uds/services/PhysicalMachines/IPMachinesService.py b/server/src/uds/services/PhysicalMachines/IPMachinesService.py new file mode 100644 index 000000000..828b2865c --- /dev/null +++ b/server/src/uds/services/PhysicalMachines/IPMachinesService.py @@ -0,0 +1,106 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext_lazy as _ +from uds.core import services +from uds.core.util.AutoAttributes import AutoAttributes +from uds.core.ui.UserInterface import gui +from IPMachineDeployed import IPMachineDeployed +import logging, cPickle + +logger = logging.getLogger(__name__) + +class IPMachinesService(services.Service): + + # Gui + ipList = gui.EditableList(label=_('List of IPS')) + + # Description of service + typeName = _('Physical machines accesed by ip') + typeType = 'IPMachinesService' + typeDescription = _('This service provides access to POWERED-ON Machines by ip') + iconFile = 'machine.png' + + # Characteristics of service + maxDeployed = -1 # If the service provides more than 1 "provided service" (-1 = no limit, 0 = ???? (do not use it!!!), N = max number to deploy + usesCache = False # Cache are running machine awaiting to be assigned + usesCache_L2 = False # L2 Cache are running machines in suspended state + needsManager = False # If the service needs a s.o. manager (managers are related to agents provided by services itselfs, i.e. virtual machines with agent) + mustAssignManually = False # If true, the system can't do an automatic assignation of a deployed user service from this service + + deployedType = IPMachineDeployed + + def __init__(self, environment, parent, values = None): + super(IPMachinesService, self).__init__(environment, parent, values) + if values is None: + self._ips = [] + else: + self._ips = list(set(values['ipList'])) # Avoid duplicates :-) + self._ips.sort() + + + def valuesDict(self): + return { 'ipList' : gui.convertToChoices(self._ips) } + + def marshal(self): + self.storage().saveData('ips', cPickle.dumps(self._ips)) + return 'v1' + + def unmarshal(self, vals): + if vals == 'v1': + self._ips = cPickle.loads( self.storage().readData('ips') ) + + + def getUnassignedMachine(self): + # Search first unassigned machine + try: + self.storage().lock() + for ip in self._ips: + if self.storage().readData(ip) == None: + self.storage().saveData(ip, ip) + return ip + return None + except Exception: + logger.exception("Exception at getUnassignedMachine") + return None + finally: + self.storage().unlock() + + def unassignMachine(self, ip): + try: + self.storage().lock() + self.storage().remove(ip) + except Exception: + logger.exception("Exception at getUnassignedMachine") + finally: + self.storage().unlock() diff --git a/server/src/uds/services/PhysicalMachines/ServiceProvider.py b/server/src/uds/services/PhysicalMachines/ServiceProvider.py new file mode 100644 index 000000000..59f6506df --- /dev/null +++ b/server/src/uds/services/PhysicalMachines/ServiceProvider.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext as _ +from uds.core.ui.UserInterface import gui +from uds.core import services + + +class PhysicalMachinesProvider(services.ServiceProvider): + # No extra data needed + + # What services do we offer? + offers = [] + typeName = 'Physical Machines Provider' + typeType = 'PhysicalMachinesServiceProvider' + typeDescription = 'Provides connection to Virtual Center Services' + iconFile = 'provider.png' + + from IPMachinesService import IPMachinesService + offers = [IPMachinesService] + + def __init__(self, environment, values = None): + ''' + Initializes the Physical Machines Service Provider + @param values: a dictionary with the required values, that are the ones declared for gui + ''' + super(PhysicalMachinesProvider, self).__init__(environment, values) + + def marshal(self): + ''' + Serializes the service provider data so we can store it in database + ''' + return str.join( '\t', [ 'v1' ] ) + + def unmarshal(self, str): + data = str.split('\t') + if data[0] == 'v1': + pass + + def __str__(self): + return "Physical Machines Provider: " + self.marshal() diff --git a/server/src/uds/services/PhysicalMachines/__init__.py b/server/src/uds/services/PhysicalMachines/__init__.py new file mode 100644 index 000000000..b9de8ef6a --- /dev/null +++ b/server/src/uds/services/PhysicalMachines/__init__.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from ServiceProvider import PhysicalMachinesProvider + +# Now we use __subclasses__ method to locate Service Providers +# and register them inside factory +#ServiceProviderFactory.factory().insert(PhysicalMachinesProvider) diff --git a/server/src/uds/services/PhysicalMachines/machine.png b/server/src/uds/services/PhysicalMachines/machine.png new file mode 100644 index 000000000..4d89bea6f Binary files /dev/null and b/server/src/uds/services/PhysicalMachines/machine.png differ diff --git a/server/src/uds/services/PhysicalMachines/provider.png b/server/src/uds/services/PhysicalMachines/provider.png new file mode 100644 index 000000000..e5655f523 Binary files /dev/null and b/server/src/uds/services/PhysicalMachines/provider.png differ diff --git a/server/src/uds/services/Sample/SampleProvider.py b/server/src/uds/services/Sample/SampleProvider.py new file mode 100644 index 000000000..4f38368f3 --- /dev/null +++ b/server/src/uds/services/Sample/SampleProvider.py @@ -0,0 +1,196 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +Created on Jun 22, 2012 + +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext_noop as translatable, ugettext as _ +from uds.core.services import ServiceProvider +from SampleService import ServiceOne, ServiceTwo +from uds.core.ui import gui + +import logging + +logger = logging.getLogger(__name__) + + +class Provider(ServiceProvider): + ''' + This class represents the sample services provider + + In this class we provide: + * The Provider functionality + * The basic configuration parameters for the provider + * The form fields needed by administrators to configure this provider + + :note: At class level, the translation must be simply marked as so + using ugettext_noop. This is so cause we will translate the string when + sent to the administration client. + + For this class to get visible at administration client as a provider type, + we MUST register it at package __init__. + + ''' + #: What kind of services we offer, this are classes inherited from Service + offers = [ServiceOne, ServiceTwo] + #: Name to show the administrator. This string will be translated BEFORE + #: sending it to administration interface, so don't forget to + #: mark it as translatable (using ugettext_noop) + typeName = translatable('Sample Provider') + #: Type used internally to identify this provider + typeType = 'SampleProvider' + #: Description shown at administration interface for this provider + typeDescription = translatable('Sample (and dummy) service provider') + #: Icon file used as icon for this provider. This string will be translated + #: BEFORE sending it to administration interface, so don't forget to + #: mark it as translatable (using ugettext_noop) + iconFile = 'provider.png' + + # now comes the form fields + # There is always two fields that are requested to the admin, that are: + # Service Name, that is a name that the admin uses to name this provider + # Description, that is a short description that the admin gives to this provider + # Now we are going to add a few fields that we need to use this provider + # Remember that these are "dummy" fields, that in fact are not required + # but used for sample purposes + # If we don't indicate an order, the output order of fields will be + # "random" + + #: Remote host. Here core will translate label and tooltip, remember to + #: mark them as translatable using ugettext_noop. + remoteHost = gui.TextField(oder=1, + length = 64, + label = translatable('Remote host'), + tooltip = translatable('This fields contains a remote host'), + required = True, + ) + #: Name of your pet (sample, not really needed :-) ) + petName = gui.TextField(order=2, + length = 32, + label = translatable('Your pet\'s name'), + tooltip = translatable('If you like, write the name of your pet'), + requred = False, + defvalue = 'Tux' #: This will not get translated + ) + #: Age of Methuselah (matusalén in spanish) + #: in Spain there is a well-known to say that something is very old, + #: "Tiene mas años que matusalén"(is older than Methuselah) + methAge = gui.NumericField(order = 3, + length = 4, # That is, max allowed value is 9999 + label = translatable('Age of Methuselah'), + tooltip = translatable('If you know it, please, tell me!!!'), + required = True, #: Numeric fields have always a value, so this not really needed + defvalue = '4500' + ) + + #: Is Methuselah istill alive? + methAlive = gui.CheckBoxField(order = 4, + label = translatable('Is Methuselah still alive?'), + tooltip = translatable('If you fails, this will not get saved :-)'), + required = True, #: Also means nothing. Check boxes has always a value + defvalue = gui.TRUE #: By default, at new item, check this + ) + + # There is more fields type, but not here the best place to cover it + def initialize(self, values = None): + ''' + We will use the "autosave" feature for form fields, that is more than + enought for most providers. (We simply need to store data provided by user + and, maybe, initialize some kind of connection with this values). + + Normally provider values are rally used at sevice level, cause we never + instantiate nothing except a service from a provider. + ''' + + # If you say meth is alive, you are wrong!!! (i guess..) + # values are only passed from administration client. Internals + # instantiations are always empty. + if values is not None and self.methAlive.isTrue(): + raise ServiceProvider.ValidationException(_('Methuselah is not alive!!! :-)')) + + # Marshal and unmarshal are defaults ones, also enought + + # As we use "autosave" fields feature, dictValues is also provided by + # base class so we don't have to mess with all those things... + + @staticmethod + def test(env, data): + ''' + Create your test method here so the admin can push the "check" button + and this gets executed. + Args: + env: environment passed for testing (temporal environment passed) + + data: data passed for testing (data obtained from the form + definition) + + Returns: + Array of two elements, first is True of False, depending on test + (True is all right, false is error), + second is an String with error, preferably internacionalizated.. + + In this case, wi well do nothing more that use the provider params + + Note also that this is an static method, that will be invoked using + the admin user provided data via administration client, and a temporary + environment that will be erased after invoking this method + ''' + try: + # We instantiate the provider, but this may fail... + instance = Provider(env, data) + logger.debug('Methuselah has {0} years and is {1} :-)' + .format(instance.methAge.value, instance.methAlive.value)) + except ServiceProvider.ValidationException as e: + # If we say that meth is alive, instantiation will + return [False, str(e)] + except Exception as e: + logger.exception("Exception caugth!!!") + return [False, str(e)] + return [True, _('Nothing tested, but all went fine..')] + + # Congratulations!!!, the needed part of your first simple provider is done! + # Now you can go to administration panel, and check it + # + # From now onwards, we implement our own methods, that will be used by, + # for example, services derived from this provider + def host(self): + ''' + Sample method, in fact in this we just return + the value of host field, that is an string + ''' + return self.remoteHost.value + + + def methYears(self): + ''' + Another sample return, it will in fact return the Methuselah years + ''' diff --git a/server/src/uds/services/Sample/SamplePublication.py b/server/src/uds/services/Sample/SamplePublication.py new file mode 100644 index 000000000..f9ccfd5b8 --- /dev/null +++ b/server/src/uds/services/Sample/SamplePublication.py @@ -0,0 +1,272 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext as _ +from uds.core.services import Publication +from uds.core.util.State import State +from datetime import datetime +import logging + +logger = logging.getLogger(__name__) + +class SamplePublication(Publication): + ''' + This class shows how a publication is developed. + + In order to a publication to work correctly, we must provide at least the + following methods: + * Of course, the __init__ + * :py:meth:`.publish` + * :py:meth:`.checkState` + * :py:meth:`.finish` + + Also, of course, methods from :py:class:`uds.core.Serializable.Serializable` + + + Publication do not have an configuration interface, all data contained + inside an instance of a Publication must be serialized if you want them between + method calls. + + It's not waranteed that the class will not be serialized/deserialized + between methods calls, so, first of all, implement the marshal and umnarshal + mehods needed by all serializable classes. + + Also a thing to note is that operations requested to Publications must be + *as fast as posible*. The operations executes in a separated thread, + and so it cant take a bit more time to execute, but it's recommended that + the operations executes as fast as posible, and, if it will take a long time, + split operation so we can keep track of state. + + This means that, if we have "slow" operations, we must + + We first of all declares an estimation of how long a publication will take. + This value is instance based, so if we override it in our class, the suggested + time could change. + + The class attribute that indicates this suggested time is "suggestedTime", and + it's expressed in seconds, (i.e. "suggestedTime = 10") + ''' + + suggestedTime = 5 #: Suggested recheck time if publication is unfinished in seconds + + def initialize(self): + ''' + This method will be invoked by default __init__ of base class, so it gives + us the oportunity to initialize whataver we need here. + + In our case, we setup a few attributes.. + ''' + + # We do not check anything at marshal method, so we ensure that + # default values are correctly handled by marshal. + self._name = 'test' + self._reason = '' # No error, no reason for it + self._number = 1 + + def marshal(self): + ''' + returns data from an instance of Sample Publication serialized + ''' + return '\t'.join( [self._name, self._reason, str(self._number)] ) + + def unmarshal(self, data): + ''' + deserializes the data and loads it inside instance. + ''' + logger.debug('Data: {0}'.format(data)) + vals = data.split('\t') + logger.debug('Values: {0}'.format(vals)) + self._name = vals[0] + self._reason = vals[1] + self._number = int(vals[2]) + + + def publish(self): + ''' + This method is invoked whenever the administrator requests a new publication. + + The method is not invoked directly (i mean, that the administration request + do no makes a call to this method), but a DelayedTask is saved witch will + initiate all publication stuff (and, of course, call this method). + + You MUST implement it, so the publication do really something. + All publications can be synchronous or asynchronous. + + The main difference between both is that first do whatever needed, (the + action must be fast enough to do not block core), returning State.FINISHED. + + The second (asynchronous) are publications that could block the core, so + it have to be done in more than one step. + + An example publication could be a copy of a virtual machine, where: + * First we invoke the copy operation to virtualization provider + * Second, we kept needed values inside instance so we can serialize + them whenever requested + * Returns an State.RUNNING, indicating the core that the publication + has started but has to finish sometime later. (We do no check + again the state and keep waiting here, because we will block the + core untill this operation is finished). + + In our example wi will simple assign a name, and set number to 5. We + will use this number later, to make a "delay" at check if the publication + has finished. (see method checkState) + + We also will make this publication an "stepped one", that is, it will not + finish at publish call but a later checkState call + + Take care with instantiating threads from here. Whenever a publish returns + "State.RUNNING", the core will recheck it later, but not using this instance + and maybe that even do not use this server. + + If you want to use threadings or somethin likt it, use DelayedTasks and + do not block it. You also musht provide the mechanism to allow those + DelayedTask to communicate with the publication. + + One sample could be, for example, to copy a bunch of files, but we know + that this copy can take a long time and don't want it to take make it + all here, but in a separate task. Now, do you remember that "environment" + that is unique for every instance?, well, we can create a delayed task, + and pass that environment (owned by this intance) as a mechanism for + informing when the task is finished. (We insert at delayed tasks queue + an instance, not a class itself, so we can instantiate a class and + store it at delayed task queue. + + Also note that, in that case, this class can also acomplish that by simply + using the suggestedTime attribute and the checkState method in most cases. + ''' + self._number = 5 + self._reason = '' + return State.RUNNING + + def checkState(self): + ''' + Our publish method will initiate publication, but will not finish it. + So in our sample, wi will only check if _number reaches 0, and if so + return that we have finished, else we will return that we are working + on it. + + One publish returns State.RUNNING, this task will get called untill + checkState returns State.FINISHED. + + Also, wi will make the publication fail one of every 10 calls to this + method. + + Note: Destroying an publication also makes use of this method, so you + must keep the info of that you are checking (publishing or destroying...) + In our case, destroy is 1-step action so this will no get called while + destroying... + ''' + import random + self._number -= 1 + # Serialization will take care of storing self._number + + # One of every 10 calls + if random.randint(0, 9) == 9: + self._reason = _('Random integer was 9!!! :-)') + return State.ERROR + + if self._number <= 0: + return State.FINISHED + else: + return State.RUNNING + + + def finish(self): + ''' + Invoked when Publication manager noticed that the publication has finished. + This give us the oportunity of cleaning up things (as stored vars, etc..), + or initialize variables that will be needed in a later phase (by deployed + services) + + Returned value, if any, is ignored + ''' + import string + import random + # Make simply a random string + self._name = ''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(10)) + + def reasonOfError(self): + ''' + If a publication produces an error, here we must notify the reason why + it happened. This will be called just after publish or checkState + if they return State.ERROR + + Returns an string, in our case, set at checkState + ''' + return self._reason + + def destroy(self): + ''' + This is called once a publication is no more needed. + + This method do whatever needed to clean up things, such as + removing created "external" data (environment gets cleaned by core), + etc.. + + The retunred value is the same as when publishing, State.RUNNING, + State.FINISHED or State.ERROR. + ''' + self._name = '' + self._reason = '' # In fact, this is not needed, but cleaning up things... :-) + + # We do not do anything else to destroy this instance of publication + return State.FINISHED + + + def cancel(self): + ''' + Invoked for canceling the current operation. + This can be invoked directly by an administration or by the clean up + of the deployed service (indirectly). + When administrator requests it, the cancel is "delayed" and not + invoked directly. + + Also, take into account that cancel is the initiation of, maybe, a + multiple-step action, so it returns, as publish and destroy does. + + In our case, cancel simply invokes "destroy", that cleans up + things and returns that the action has finished in 1 step. + ''' + return self.destroy() + + # Here ends the publication needed methods. + # Methods provided below are specific for this publication + # and will be used by user deployments that uses this kind of publication + + def getBaseName(self): + ''' + This sample method (just for this sample publication), provides + the name generater for this publication. This is just a sample, and + this will do the work + ''' + return self._name diff --git a/server/src/uds/services/Sample/SampleService.py b/server/src/uds/services/Sample/SampleService.py new file mode 100644 index 000000000..e38c96f6d --- /dev/null +++ b/server/src/uds/services/Sample/SampleService.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext_noop as translatable, ugettext as _ +from uds.core.services import Service +from SamplePublication import SamplePublication +from SampleUserDeploymentOne import SampleUserDeploymentOne +from SampleUserDeploymentTwo import SampleUserDeploymentTwo + +from uds.core.ui import gui + +import logging + +logger = logging.getLogger(__name__) + +class ServiceOne(Service): + ''' + Basic service, the first part (variables) include the description of the service. + + Remember to fill all variables needed, but at least you must define: + * typeName + * typeType + * typeDescription + * iconFile (defaults to service.png) + * publicationType, type of publication in case it needs publication. + If this is not provided, core will assume that the service do not + needs publishing. + * deployedType, type of deployed user service. Do not forget this!!! + + The rest of them can be ommited, but its recommended that you fill all + declarations shown in this sample (that in fact, are all) + + This description informs the core what this service really provides, + and how this is done. Look at description of class variables for more + information. + + ''' + #: Name to show the administrator. This string will be translated BEFORE + #: sending it to administration interface, so don't forget to + #: mark it as translatable (using ugettext_noop) + typeName = translatable('Sample Service One') + #: Type used internally to identify this provider + typeType = 'SampleService1' + #: Description shown at administration interface for this provider + typeDescription = translatable('Sample (and dummy) service ONE') + #: Icon file used as icon for this provider. This string will be translated + #: BEFORE sending it to administration interface, so don't forget to + #: mark it as translatable (using ugettext_noop) + iconFile = 'service.png' + + # Functional related data + + #: If the service provides more than 1 "deployed user" (-1 = no limit, + #: 0 = ???? (do not use it!!!), N = max number to deploy + maxDeployed = -1 + #: If we need to generate "cache" for this service, so users can access the + #: provided services faster. Is usesCache is True, you will need also + #: set publicationType, do take care about that! + usesCache = False + #: Tooltip shown to user when this item is pointed at admin interface, none + #: because we don't use it + cacheTooltip = translatable('None') + #: If we need to generate a "Level 2" cache for this service (i.e., L1 + #: could be running machines and L2 suspended machines) + usesCache_L2 = False + #: Tooltip shown to user when this item is pointed at admin interface, None + #: also because we don't use it + cacheTooltip_L2 = translatable('None') + + #: If the service needs a s.o. manager (managers are related to agents + #: provided by services itselfs, i.e. virtual machines with actors) + needsManager = False + #: If true, the system can't do an automatic assignation of a deployed user + #: service from this service + mustAssignManually = False + + #: Types of publications (preparated data for deploys) + #: In our case, we do no need a publication, so this is None + publicationType = None + #: Types of deploys (services in cache and/or assigned to users) + deployedType = SampleUserDeploymentOne + + # Now the form part, this service will have only two "dummy" fields + # If we don't indicate an order, the output order of fields will be + # "random" + + colour = gui.ChoiceField(order = 1, + label = translatable('Colour'), + tooltip = translatable('Colour of the field'), + # In this case, the choice can have none value selected by default + required = True, + values = [ gui.choiceItem('red', 'Red'), + gui.choiceItem('green', 'Green'), + gui.choiceItem('blue', 'Blue'), + gui.choiceItem('nonsense', 'Blagenta') + ], + defvalue = '1' # Default value is the ID of the choicefield + ) + + passw = gui.PasswordField(order = 2, + label = translatable('Password'), + tooltip = translatable('Password for testing purposes'), + required = True, + defvalue = '1234' #: Default password are nonsense?? :-) + ) + + baseName = gui.TextField(order = 3, + label = translatable('Services names'), + tooltip = translatable('Base name for this user services'), + # In this case, the choice can have none value selected by default + required = True, + defvalue = '' # Default value is the ID of the choicefield + ) + + def initialize(self, values): + ''' + We check here form values to see if they are valid. + + Note that we check them throught FROM variables, that already has been + initialized by __init__ method of base class, before invoking this. + ''' + + # We don't need to check anything, bat because this is a sample, we do + # As in provider, we receive values only at new Service creation, + # so we only need to validate params if values is not None + if values is not None: + if self.colour.value == 'nonsense': + raise Service.ValidationException('The selected colour is invalid!!!') + + + # Services itself are non testeable right now, so we don't even have + # to provide one!!! + + + # Congratulations!!!, the needed part of your first simple service is done! + # Now you can go to administration panel, and check it + # + # From now onwards, we implement our own methods, that will be used by, + # for example, services derived from this provider + + def getColour(self): + ''' + Simply returns colour, for deployed user services. + + Remember that choiceField.value returns the id part of the ChoiceItem + ''' + return self.colour.value + + def getPassw(self): + ''' + Simply returns passwd, for deloyed user services + ''' + return self.passw.value + + def getBaseName(self): + ''' + ''' + return self.baseName.value + + + +class ServiceTwo(Service): + ''' + Just a second service, no comments here (almost same that ServiceOne + ''' + typeName = translatable('Sample Service Two') + typeType = 'SampleService2' + typeDescription = translatable('Sample (and dummy) service ONE+ONE') + iconFile = 'provider.png' #: We reuse provider icon here :-) + + # Functional related data + maxDeployed = 5 + usesCache = True + cacheTooltip = translatable('L1 cache for dummy elements') + usesCache_L2 = True + cacheTooltip_L2 = translatable('L2 cache for dummy elements') + + needsManager = False + mustAssignManually = False + + #: Types of publications. In this case, we will include a publication + #: type for this one + #: Note that this is a MUST if you indicate that needPublication + publicationType = SamplePublication + #: Types of deploys (services in cache and/or assigned to users) + deployedType = SampleUserDeploymentTwo + + + # Gui, we will use here the EditableList field + names = gui.EditableList(label=translatable('List of names')) + + def __init__(self, environment, parent, values = None): + ''' + We here can get a HUGE list from client. + Right now, this is treated same as other fields, in a near + future we will se how to handle this better + ''' + super(ServiceTwo, self).__init__(environment, parent, values) + + # No checks here + + def getNames(self): + ''' + For using at deployed services, really nothing + ''' + return self.names.value diff --git a/server/src/uds/services/Sample/SampleUserDeploymentOne.py b/server/src/uds/services/Sample/SampleUserDeploymentOne.py new file mode 100644 index 000000000..e49d4a157 --- /dev/null +++ b/server/src/uds/services/Sample/SampleUserDeploymentOne.py @@ -0,0 +1,373 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from uds.core.services import UserDeployment +from uds.core.util.State import State +import logging + +logger = logging.getLogger(__name__) + +class SampleUserDeploymentOne(UserDeployment): + ''' + This class generates the user consumable elements of the service tree. + + After creating at administration interface an Deployed Service, UDS will + create consumable services for users using UserDeployment class as + provider of this elements. + + + At class instantiation, this will receive an environment with"generator", + that are classes that provides a way to generate unique items. + + The generators provided right now are 'mac' and 'name'. To get more info + about this, look at py:class:`uds.core.util.UniqueMacGenerator.UniqueNameGenerator` + and py:class:`uds.core.util.UniqueNameGenerator.UniqueNameGenerator` + + This first sample do not uses cache. To see one with cache, see + SampleUserDeploymentTwo. The main difference are the "...Cache".." methods, + that here are not needed. + + As sample also of environment storage usage, wi will use here the provider + storage to keep all our needed info, leaving marshal and unmarshal (needed + by Serializble classes, like this) empty (that is, returns '' first and does + nothing the second one) + + Also Remember, if you don't include this class as the deployedType of the + SampleServiceOne, or whenever you trie to access a service of SampleServiceOne, + you will get an excetion that says that you havent included the deployedType. + ''' + + #: Recheck every five seconds by default (for task methods) + suggestedTime = 5 + + # Serializable needed methods + def marshal(self): + ''' + Does nothing right here, we will use envoronment storage in this sample + ''' + return '' + + def unmarshal(self, str_): + ''' + Does nothing here also, all data are keeped at environment storage + ''' + pass + + + def getName(self): + ''' + We override this to return a name to display. Default inplementation + (in base class), returns getUniqueIde() value + This name will help user to identify elements, and is only used + at administration interface. + + We will use here the environment name provided generator to generate + a name for this element. + + The namaGenerator need two params, the base name and a length for a + numeric incremental part for generating unique names. This are unique for + all UDS names generations, that is, UDS will not generate this name again + until this name is freed, or object is removed, what makes its environment + to also get removed, that makes all uniques ids (names and macs right now) + to also get released. + + Every time get method of a generator gets called, the generator creates + a new unique name, so we keep the first generated name cached and don't + generate more names. (Generator are simple utility classes) + ''' + name = self.storage().readData('name') + if name is None: + name = self.nameGenerator().get( self.service().getBaseName() + + '-' + self.service().getColour(), 3 ) + # Store value for persistence + self.storage().saveData('name', name) + + return name + + def setIp(self, ip): + ''' + In our case, there is no OS manager associated with this, so this method + will never get called, but we put here as sample. + + Whenever an os manager actor notifies the broker the state of the service + (mainly machines), the implementation of that os manager can (an probably will) + need to notify the IP of the deployed service. Remember that UDS treats with + IP services, so will probable needed in every service that you will create. + :note: This IP is the IP of the "consumed service", so the transport can + access it. + ''' + self.storage().saveData('ip', str(ip)) + + def getUniqueId(self): + ''' + Return and unique identifier for this service. + In our case, we will generate a mac name, that can be also as sample + of 'mac' generator use, and probably will get used something like this + at some services. + + The get method of a mac generator takes one param, that is the mac range + to use to get an unused mac. + ''' + mac = self.storage().readData('mac') + if mac is None: + mac = self.macGenerator().get( '00:00:00:00:00:00-00:FF:FF:FF:FF:FF' ) + self.storage().saveData('mac', mac) + return mac + + def getIp(self): + ''' + We need to implement this method, so we can return the IP for transports + use. If no IP is known for this service, this must return None + + If our sample do not returns an IP, IP transport will never work with + this service. Remember in real cases to return a valid IP address if + the service is accesible and you alredy know that (for example, because + the IP has been assigend via setIp by an os manager) or because + you get it for some other method. + + Storage returns None if key is not stored. + + :note: Keeping the IP address is responsibility of the User Deployment. + Every time the core needs to provide the service to the user, or + show the IP to the administrator, this method will get called + + ''' + ip = self.storage().readData('ip') + if ip is None: + ip = '192.168.0.34' # Sample IP for testing purposses only + return ip + + def setReady(self): + ''' + This is a task method. As that, the expected return values are + State values RUNNING, FINISHED or ERROR. + + The method is invoked whenever a machine is provided to an user, right + before presenting it (via transport rendering) to the user. + + This method exist for this kind of situations (i will explain it with a + sample) + + Imagine a Service tree (Provider, Service, ...) for virtual machines. + This machines will get created by the UserDeployment implementation, but, + at some time, the machine can be put at in an state (suspend, shut down) + that will make the transport impossible to connect with it. + + This method, in this case, will check the state of the machine, and if + it is "ready", that is, powered on and accesible, it will return + "State.FINISHED". If the machine is not accesible (has ben erased, for + example), it will return "State.ERROR" and store a reason of error so UDS + can ask for it and present this information to the Administrator. + + If the machine powered off, or suspended, or any other state that is not + directly usable but can be put in an usable state, it will return + "State.RUNNING", and core will use checkState to see when the operation + has finished. + + I hope this sample is enough to explain the use of this method.. + ''' + + # In our case, the service is always ready + return State.FINISHED + + def deployForUser(self, user): + ''' + Deploys an service instance for an user. + + This is a task method. As that, the excepted return values are + State values RUNNING, FINISHED or ERROR. + + The user parameter is not realy neded, but provided. It indicates the + Database User Object (see py:mod:`uds.modules`) to which this deployed + user service will be assigned to. + + This method will get called whenever a new deployed service for an user + is needed. This will give this class the oportunity to create + a service that is assigned to an user. + + The way of using this method is as follows: + + If the service gets created in "one step", that is, before the return + of this method, the consumable service for the user gets created, it + will return "State.FINISH". + If the service needs more steps (as in this case), we will return + "State.RUNNING", and if it has an error, it wil return "State.ERROR" and + store an error string so administration interface can show it. + + We do not use user for anything, as in most cases will be. + ''' + import random + + self.storage().saveData('count', '0') + + # random fail + if random.randint(0, 9) == 9: + self.storage().saveData('error', 'Random error at deployForUser :-)') + return State.ERROR + + return State.RUNNING + + + def checkState(self): + ''' + Our deployForUser method will initiate the consumable service deployment, + but will not finish it. + + So in our sample, we will only check if a number reaches 5, and if so + return that we have finished, else we will return that we are working + on it. + + One deployForUser returns State.RUNNING, this task will get called until + checkState returns State.FINISHED. + + Also, we will make the publication fail one of every 10 calls to this + method. + + Note: Destroying, canceling and deploying for cache also makes use of + this method, so you must keep the info of that you are checking if you + need it. + In our case, destroy is 1-step action so this will no get called while + destroying, and cancel will simply invoke destroy + ''' + import random + + count = int(self.storage().readData('count')) + 1 + # Count is always a valid value, because this method will never get + # called before deployForUser, deployForCache, destroy or cancel. + # In our sample, we only use checkState in case of deployForUser, + # so at first call count will be 0. + if count >= 5: + return State.FINISHED + + # random fail + if random.randint(0, 9) == 9: + self.storage().saveData('error', 'Random error at checkState :-)') + return State.ERROR + + self.storage().saveData('count', str(count)) + return State.RUNNING + + def finish(self): + ''' + Invoked when the core notices that the deployment of a service has finished. + (No matter wether it is for cache or for an user) + + This gives the oportunity to make something at that moment. + :note: You can also make these operations at checkState, this is really + not needed, but can be provided (default implementation of base class does + nothing) + ''' + # Note that this is not really needed, is just a sample of storage use + self.storage().remove('count') + + def assignToUser(self, user): + ''' + This method is invoked whenever a cache item gets assigned to an user. + This gives the User Deployment an oportunity to do whatever actions + are required so the service puts at a correct state for using by a service. + + In our sample, the service is always ready, so this does nothing. + + This is not a task method. All level 1 cache items can be diretly + assigned to an user with no more work needed, but, if something is needed, + here you can do whatever you need + ''' + pass + + def userLoggedIn(self, user): + ''' + This method must be available so os managers can invoke it whenever + an user get logged into a service. + + Default implementation does nothing, so if you are going to do nothing, + you don't need to implement it. + + The responability of notifying it is of os manager actor, and it's + directly invoked by os managers (right now, linux os manager and windows + os manager) + + The user provided is just an string, that is provided by actor. + ''' + # We store the value at storage, but never get used, just an example + self.storage().saveData('user', user) + + def userLoggedOut(self, user): + ''' + This method must be available so os managers can invoke it whenever + an user get logged out if a service. + + Default implementation does nothing, so if you are going to do nothing, + you don't need to implement it. + + The responability of notifying it is of os manager actor, and it's + directly invoked by os managers (right now, linux os manager and windows + os manager) + + The user provided is just an string, that is provided by actor. + ''' + # We do nothing more that remove the user + self.storage().remove('user') + + def reasonOfError(self): + ''' + Returns the reason of the error. + + Remember that the class is responsible of returning this whenever asked + for it, and it will be asked everytime it's needed to be shown to the + user (when the administation asks for it). + ''' + return self.storage().readData('error') or 'No error' + + def destroy(self): + ''' + This is a task method. As that, the excepted return values are + State values RUNNING, FINISHED or ERROR. + + Invoked for destroying a deployed service + Do whatever needed here, as deleting associated data if needed (i.e. a copy of the machine, snapshots, etc...) + @return: State.FINISHED if no more checks/steps for deployment are needed, State.RUNNING if more steps are needed (steps checked using checkState) + ''' + return State.FINISHED + + def cancel(self): + ''' + This is a task method. As that, the excepted return values are + State values RUNNING, FINISHED or ERROR. + + This can be invoked directly by an administration or by the clean up + of the deployed service (indirectly). + When administrator requests it, the cancel is "delayed" and not + invoked directly. + ''' + return State.FINISHED + \ No newline at end of file diff --git a/server/src/uds/services/Sample/SampleUserDeploymentTwo.py b/server/src/uds/services/Sample/SampleUserDeploymentTwo.py new file mode 100644 index 000000000..687971e7f --- /dev/null +++ b/server/src/uds/services/Sample/SampleUserDeploymentTwo.py @@ -0,0 +1,469 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from uds.core.services import UserDeployment +from uds.core.util.State import State +import logging + +logger = logging.getLogger(__name__) + +class SampleUserDeploymentTwo(UserDeployment): + ''' + This class generates the user consumable elements of the service tree. + + This is almost the same as SampleUserDeploymentOne, but differs that this one + uses the publication to get data from it, in a very basic way. + + After creating at administration interface an Deployed Service, UDS will + create consumable services for users using UserDeployment class as + provider of this elements. + + At class instantiation, this will receive an environment with"generator", + that are classes that provides a way to generate unique items. + + The generators provided right now are 'mac' and 'name'. To get more info + about this, look at py:class:`uds.core.util.UniqueMacGenerator.UniqueNameGenerator` + and py:class:`uds.core.util.UniqueNameGenerator.UniqueNameGenerator` + + As sample also of environment storage usage, wi will use here the provider + storage to keep all our needed info, leaving marshal and unmarshal (needed + by Serializable classes, like this) empty (that is, returns '' first and does + nothing the second one) + + Also Remember, if you don't include this class as the deployedType of the + SampleServiceTwo, or whenever you try to access a service of SampleServiceTwo, + you will get an exception that says that you haven't included the deployedType. + ''' + + #: Recheck every five seconds by default (for task methods) + suggestedTime = 2 + + def initialize(self): + ''' + Initialize default attributes values here. We can do whatever we like, + but for this sample this is just right... + ''' + self._name = '' + self._ip = '' + self._mac = '' + self._error = '' + self._count = 0 + + # Serializable needed methods + def marshal(self): + ''' + Marshal own data, in this sample we will marshal internal needed + attributes. + + In this case, the data will be store with the database record. To + minimize database storage usage, we will "zip" data before returning it. + Anyway, we should keep this data as low as possible, we also have an + storage for loading larger data. + + :note: It's a good idea when providing marshalers, to store a 'version' + beside the values, so we can, at a later stage, treat with old + data for current modules. + ''' + data = '\t'.join(['v1', self._name, self._ip, self._mac, self._error, + str(self._count)]) + return data.encode('zip') + + def unmarshal(self, str_): + ''' + We unmarshal the content. + ''' + data = str_.decode('zip').split('\t') + # Data Version check + # If we include some new data at some point in a future, we can + # add "default" values at v1 check, and load new values at 'v2' check. + if data[0] == 'v1': + self._name, self._ip, self._mac, self._error, count = data[1:] + self._count = int(count) + + def getName(self): + ''' + We override this to return a name to display. Default implementation + (in base class), returns getUniqueIde() value + This name will help user to identify elements, and is only used + at administration interface. + + We will use here the environment name provided generator to generate + a name for this element. + + The namaGenerator need two params, the base name and a length for a + numeric incremental part for generating unique names. This are unique for + all UDS names generations, that is, UDS will not generate this name again + until this name is freed, or object is removed, what makes its environment + to also get removed, that makes all unique ids (names and macs right now) + to also get released. + + Every time get method of a generator gets called, the generator creates + a new unique name, so we keep the first generated name cached and don't + generate more names. (Generator are simple utility classes) + ''' + if self._name == '': + self._name = self.nameGenerator().get( self.publication().getBaseName(), + 3 ) + # self._name will be stored when object is marshaled + return self._name + + def setIp(self, ip): + ''' + In our case, there is no OS manager associated with this, so this method + will never get called, but we put here as sample. + + Whenever an os manager actor notifies the broker the state of the service + (mainly machines), the implementation of that os manager can (an probably will) + need to notify the IP of the deployed service. Remember that UDS treats with + IP services, so will probable needed in every service that you will create. + :note: This IP is the IP of the "consumed service", so the transport can + access it. + ''' + self._ip = ip + + def getUniqueId(self): + ''' + Return and unique identifier for this service. + In our case, we will generate a mac name, that can be also as sample + of 'mac' generator use, and probably will get used something like this + at some services. + + The get method of a mac generator takes one param, that is the mac range + to use to get an unused mac. + + The mac generated is not used by anyone, it will not depend on + the range, the generator will take care that this mac is unique + and in the range provided, or it will return None. The ranges + are wide enough to ensure that we always will get a mac address + in this case, but if this is not your case, take into account that + None is a possible return value, and in that case, you should return an + invalid id right now. Every time a task method is invoked, the core + will try to update the value of the unique id using this method, so + that id can change with time. (In fact, it's not unique at database level, + it's unique in the sense that you must return an unique id that can, for + example, be used by os managers to identify this element). + + :note: Normally, getting out of macs in the mac pool is a bad thing... :-) + ''' + if self._mac == '': + self._mac = self.macGenerator().get( '00:00:00:00:00:00-00:FF:FF:FF:FF:FF' ) + return self._mac + + def getIp(self): + ''' + We need to implement this method, so we can return the IP for transports + use. If no IP is known for this service, this must return None + + If our sample do not returns an IP, IP transport will never work with + this service. Remember in real cases to return a valid IP address if + the service is accesible and you alredy know that (for example, because + the IP has been assigend via setIp by an os manager) or because + you get it for some other method. + + Storage returns None if key is not stored. + + :note: Keeping the IP address is responsibility of the User Deployment. + Every time the core needs to provide the service to the user, or + show the IP to the administrator, this method will get called + + ''' + if self._ip == '': + return '192.168.0.34' # Sample IP for testing purposes only + return self._ip + + def setReady(self): + ''' + This is a task method. As that, the excepted return values are + State values RUNNING, FINISHED or ERROR. + + The method is invoked whenever a machine is provided to an user, right + before presenting it (via transport rendering) to the user. + + This method exist for this kind of situations (i will explain it with a + sample) + + Imagine a Service tree (Provider, Service, ...) for virtual machines. + This machines will get created by the UserDeployment implementation, but, + at some time, the machine can be put at in an state (suspend, shut down) + that will make the transport impossible to connect with it. + + This method, in this case, will check the state of the machine, and if + it is "ready", that is, powered on and accessible, it will return + "State.FINISHED". If the machine is not accessible (has been erased, for + example), it will return "State.ERROR" and store a reason of error so UDS + can ask for it and present this information to the Administrator. + + If the machine powered off, or suspended, or any other state that is not + directly usable but can be put in an usable state, it will return + "State.RUNNING", and core will use checkState to see when the operation + has finished. + + I hope this sample is enough to explain the use of this method.. + ''' + + # In our case, the service is always ready + return State.FINISHED + + def deployForUser(self, user): + ''' + Deploys an service instance for an user. + + This is a task method. As that, the excepted return values are + State values RUNNING, FINISHED or ERROR. + + The user parameter is not realy neded, but provided. It indicates the + Database User Object (see py:mod:`uds.modules`) to which this deployed + user service will be assigned to. + + This method will get called whenever a new deployed service for an user + is needed. This will give this class the oportunity to create + a service that is assigned to an user. + + The way of using this method is as follows: + + If the service gets created in "one step", that is, before the return + of this method, the consumable service for the user gets created, it + will return "State.FINISH". + If the service needs more steps (as in this case), we will return + "State.RUNNING", and if it has an error, it wil return "State.ERROR" and + store an error string so administration interface can show it. + + We do not use user for anything, as in most cases will be. + ''' + import random + + self._count = 0 + + # random fail + if random.randint(0, 9) == 9: + # Note that we can mark this string as translatable, and return + # it translated at reasonOfError method + self._error = 'Random error at deployForUser :-)' + return State.ERROR + + return State.RUNNING + + def deployForCache(self, cacheLevel): + ''' + Deploys a user deployment as cache. + + This is a task method. As that, the expected return values are + State values RUNNING, FINISHED or ERROR. + + In our sample, this will do exactly the same as deploy for user, + except that it will never will give an error. + + See deployForUser for a description of what this method should do. + + :note: deployForCache is invoked whenever a new cache element is needed + for an specific user deployment. It will also indicate for what + cache level (L1, L2) is the deployment + ''' + self._count = 0 + return State.RUNNING + + def moveToCache(self, newLevel): + ''' + This method is invoked whenever the core needs to move from the current + cache level to a new cache level an user deployment. + + This is a task method. As that, the expected return values are + State values RUNNING, FINISHED or ERROR. + + We only provide newLevel, because there is only two cache levels, so if + newLevel is L1, the actual is L2, and if it is L2, the actual is L1. + + Actually there is no possibility to move assigned services again back to + cache. If some service needs that kind of functionallity, this must be + provided at service level (for example, when doing publishing creating + a number of services that will be used, released and reused by users). + + Also, user deployments that are at cache level 2 will never get directly + assigned to user. First, it will pass to L1 and then it will get assigned. + + A good sample of a real implementation of this is moving a virtual machine + from a "suspended" state to "running" state to assign it to an user. + + In this sample, there is L2 cache also, but moving from L1 to L2 and + from L2 to L1 is doing really nothing, so this method will do nothing. + + In a real scenario, we will, for example, suspend or resume virtual machine + and, return State.RUNNING and at checkState check if this task is completed. + ''' + pass + + def checkState(self): + ''' + Our deployForUser method will initiate the consumable service deployment, + but will not finish it. + + So in our sample, we will only check if a number reaches 5, and if so + return that we have finished, else we will return that we are working + on it. + + One deployForUser returns State.RUNNING, this task will get called until + checkState returns State.FINISHED. + + Also, we will make the user deployment fail one of every 10 calls to this + method. + + Note: Destroying, canceling and deploying for cache also makes use of + this method, so you must keep the info of that you are checking if you + need it. + + In our case, destroy is 1-step action so this will no get called while + destroying, and cancel will simply invoke destroy. Cache deployment is + exactly as user deployment, except that the core will not assign it to + anyone, and cache moving operations is + ''' + import random + + self._count += 1 + # Count is always a valid value, because this method will never get + # called before deployForUser, deployForCache, destroy or cancel. + # In our sample, we only use checkState in case of deployForUser, + # so at first call count will be 0. + if self._count >= 5: + return State.FINISHED + + # random fail + if random.randint(0, 9) == 9: + self._error = 'Random error at checkState :-)' + return State.ERROR + + return State.RUNNING + + def finish(self): + ''' + Invoked when the core notices that the deployment of a service has finished. + (No matter whether it is for cache or for an user) + + This gives the opportunity to make something at that moment. + + :note: You can also make these operations at checkState, this is really + not needed, but can be provided (default implementation of base class does + nothing) + ''' + # We set count to 0, not needed but for sample purposes + self._count = 0 + + def assignToUser(self, user): + ''' + This method is invoked whenever a cache item gets assigned to an user. + This is not a task method right now, simply a notification. This means + that L1 cache items must be directly usable (except for the readyness part) + by users in a single step operation. + + Note that there will be an setReady call before letting the user consume + this user deployment, so this is more informational (so, if you keep at + what cache level is this instance, you can update it) than anything else. + + This is not a task method. All level 1 cache items can be dircetly + assigned to an user with no more work needed, but, if something is needed, + here you can do whatever you need. + + user is a Database user object. + ''' + logger.debug('Assigned to user {0}'.format(user)) + + def userLoggedIn(self, user): + ''' + This method must be available so os managers can invoke it whenever + an user get logged into a service. + + Default implementation does nothing, so if you are going to do nothing, + you don't need to implement it. + + The responsibility of notifying it is of os manager actor, and it's + directly invoked by os managers (right now, linux os manager and windows + os manager) + + The user provided is just an string, that is provided by actors. + ''' + # We store the value at storage, but never get used, just an example + self.storage().saveData('user', user) + + def userLoggedOut(self, user): + ''' + This method must be available so os managers can invoke it whenever + an user get logged out if a service. + + Default implementation does nothing, so if you are going to do nothing, + you don't need to implement it. + + The responability of notifying it is of os manager actor, and it's + directly invoked by os managers (right now, linux os manager and windows + os manager) + + The user provided is just an string, that is provided by actor. + ''' + # We do nothing more that remove the user + self.storage().remove('user') + + def reasonOfError(self): + ''' + Returns the reason of the error. + + Remember that the class is responsible of returning this whenever asked + for it, and it will be asked everytime it's needed to be shown to the + user (when the administation asks for it). + + :note: Remember that you can use ugettext to translate this error to + user language whenever it is possible. (This one will get invoked + directly from admin interface and, as so, will have translation + environment correctly set up. + ''' + return self._error + + def destroy(self): + ''' + This is a task method. As that, the excepted return values are + State values RUNNING, FINISHED or ERROR. + + Invoked for destroying a deployed service + Do whatever needed here, as deleting associated data if needed (i.e. a copy of the machine, snapshots, etc...) + @return: State.FINISHED if no more checks/steps for deployment are needed, State.RUNNING if more steps are needed (steps checked using checkState) + ''' + return State.FINISHED + + def cancel(self): + ''' + This is a task method. As that, the excepted return values are + State values RUNNING, FINISHED or ERROR. + + This can be invoked directly by an administration or by the clean up + of the deployed service (indirectly). + When administrator requests it, the cancel is "delayed" and not + invoked directly. + ''' + return State.FINISHED diff --git a/server/src/uds/services/Sample/__init__.py b/server/src/uds/services/Sample/__init__.py new file mode 100644 index 000000000..38a9126af --- /dev/null +++ b/server/src/uds/services/Sample/__init__.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +Sample Service module. + +This package simply shows how a new service can be implemented. + + +The first thing to do in every package that is a module is register the +class that is responsible of providing the module with the system. + +For this, we must simply import the class at __init__, UDS will take care +of the rest +''' + +from SampleProvider import Provider + diff --git a/server/src/uds/services/Sample/provider.png b/server/src/uds/services/Sample/provider.png new file mode 100644 index 000000000..d2a954d44 Binary files /dev/null and b/server/src/uds/services/Sample/provider.png differ diff --git a/server/src/uds/services/Sample/service.png b/server/src/uds/services/Sample/service.png new file mode 100644 index 000000000..c7b626c40 Binary files /dev/null and b/server/src/uds/services/Sample/service.png differ diff --git a/server/src/uds/services/__init__.py b/server/src/uds/services/__init__.py new file mode 100644 index 000000000..de391673c --- /dev/null +++ b/server/src/uds/services/__init__.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +Authentication modules for uds are contained inside this module. +To create a new authentication module, you will need to follow this steps: + 1.- Create the authentication module, probably based on an existing one + 2.- Insert the module as child of this module + 3.- Import the class of your authentication module at __init__. For example:: + from Authenticator import SimpleAthenticator + 4.- Done. At Server restart, the module will be recognized, loaded and treated + +The registration of modules is done locating subclases of :py:class:`uds.core.auths.Authentication` + +.. moduleauthor:: Adolfo Gómez, dkmaster at dkmon dot com +''' + +def __init__(): + ''' + This imports all packages that are descendant of this package, and, after that, + it register all subclases of service provider as + ''' + import os.path, pkgutil + import sys + from uds.core import services + + # Dinamycally import children of this package. The __init__.py files must register, if needed, inside ServiceProviderFactory + pkgpath = os.path.dirname(sys.modules[__name__].__file__) + for _, name, _ in pkgutil.iter_modules([pkgpath]): + __import__(name, globals(), locals(), [], -1) + + p = services.ServiceProvider + # This is marked as error in IDE, but it's not (__subclasses__) + for cls in p.__subclasses__(): + services.factory().insert(cls) + +__init__() \ No newline at end of file diff --git a/server/src/uds/static/css/reset.css b/server/src/uds/static/css/reset.css new file mode 100644 index 000000000..e2f0075b6 --- /dev/null +++ b/server/src/uds/static/css/reset.css @@ -0,0 +1,46 @@ +@CHARSET "UTF-8"; + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ + +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} \ No newline at end of file diff --git a/server/src/uds/static/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png b/server/src/uds/static/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png new file mode 100644 index 000000000..5b5dab2ab Binary files /dev/null and b/server/src/uds/static/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png differ diff --git a/server/src/uds/static/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png b/server/src/uds/static/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png new file mode 100644 index 000000000..ac8b229af Binary files /dev/null and b/server/src/uds/static/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png differ diff --git a/server/src/uds/static/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png b/server/src/uds/static/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png new file mode 100644 index 000000000..ad3d6346e Binary files /dev/null and b/server/src/uds/static/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png differ diff --git a/server/src/uds/static/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png b/server/src/uds/static/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png new file mode 100644 index 000000000..42ccba269 Binary files /dev/null and b/server/src/uds/static/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png differ diff --git a/server/src/uds/static/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png b/server/src/uds/static/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png new file mode 100644 index 000000000..1d43b47e6 Binary files /dev/null and b/server/src/uds/static/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png differ diff --git a/server/src/uds/static/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png b/server/src/uds/static/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png new file mode 100644 index 000000000..86c2baa65 Binary files /dev/null and b/server/src/uds/static/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png differ diff --git a/server/src/uds/static/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png b/server/src/uds/static/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png new file mode 100644 index 000000000..4443fdc1a Binary files /dev/null and b/server/src/uds/static/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png differ diff --git a/server/src/uds/static/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/server/src/uds/static/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png new file mode 100644 index 000000000..7c9fa6c6e Binary files /dev/null and b/server/src/uds/static/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png differ diff --git a/server/src/uds/static/css/smoothness/images/ui-icons_222222_256x240.png b/server/src/uds/static/css/smoothness/images/ui-icons_222222_256x240.png new file mode 100644 index 000000000..b273ff111 Binary files /dev/null and b/server/src/uds/static/css/smoothness/images/ui-icons_222222_256x240.png differ diff --git a/server/src/uds/static/css/smoothness/images/ui-icons_2e83ff_256x240.png b/server/src/uds/static/css/smoothness/images/ui-icons_2e83ff_256x240.png new file mode 100644 index 000000000..09d1cdc85 Binary files /dev/null and b/server/src/uds/static/css/smoothness/images/ui-icons_2e83ff_256x240.png differ diff --git a/server/src/uds/static/css/smoothness/images/ui-icons_454545_256x240.png b/server/src/uds/static/css/smoothness/images/ui-icons_454545_256x240.png new file mode 100644 index 000000000..59bd45b90 Binary files /dev/null and b/server/src/uds/static/css/smoothness/images/ui-icons_454545_256x240.png differ diff --git a/server/src/uds/static/css/smoothness/images/ui-icons_888888_256x240.png b/server/src/uds/static/css/smoothness/images/ui-icons_888888_256x240.png new file mode 100644 index 000000000..6d02426c1 Binary files /dev/null and b/server/src/uds/static/css/smoothness/images/ui-icons_888888_256x240.png differ diff --git a/server/src/uds/static/css/smoothness/images/ui-icons_cd0a0a_256x240.png b/server/src/uds/static/css/smoothness/images/ui-icons_cd0a0a_256x240.png new file mode 100644 index 000000000..2ab019b73 Binary files /dev/null and b/server/src/uds/static/css/smoothness/images/ui-icons_cd0a0a_256x240.png differ diff --git a/server/src/uds/static/css/smoothness/jquery-ui-1.8.17.custom.css b/server/src/uds/static/css/smoothness/jquery-ui-1.8.17.custom.css new file mode 100644 index 000000000..537f43033 --- /dev/null +++ b/server/src/uds/static/css/smoothness/jquery-ui-1.8.17.custom.css @@ -0,0 +1,307 @@ +/* + * jQuery UI CSS Framework 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } +.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; } +.ui-helper-clearfix:after { clear: both; } +.ui-helper-clearfix { zoom: 1; } +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } + + +/* + * jQuery UI CSS Framework 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + * + * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px + */ + + +/* Component containers +----------------------------------*/ +.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } +.ui-widget .ui-widget { font-size: 1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } +.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } +.ui-widget-content a { color: #222222; } +.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } +.ui-widget-header a { color: #222222; } + +/* Interaction states +----------------------------------*/ +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; } +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } +.ui-widget :active { outline: none; } + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } +.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } +.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } +.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } +.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } + +/* positioning */ +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-off { background-position: -96px -144px; } +.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; } +.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; } +.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } +.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } + +/* Overlays */ +.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } +.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* + * jQuery UI Dialog 1.8.17 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Dialog#theming + */ +.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } +.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } +.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } +.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } +.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } +.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } +.ui-draggable .ui-dialog-titlebar { cursor: move; } diff --git a/server/src/uds/static/css/uds.css b/server/src/uds/static/css/uds.css new file mode 100644 index 000000000..2a7825c12 --- /dev/null +++ b/server/src/uds/static/css/uds.css @@ -0,0 +1,228 @@ +@CHARSET "UTF-8"; + +body,a{ + font-family:monospace; + font-size:1em; + color:#666666; + + +} +body{background: url("../img/bg_uds.png") no-repeat center 6em ;} + +legend{ + padding:0 2em; +} +ul{ + width:60%; + text-align:left; + margin:auto; +} + +ul li ul{ + width:100%; +} +ul.archivos li{ + background: url("../img/menos.png") no-repeat scroll 0.5em 0.5em #EDF3E3; + line-height: 2em; + margin: 1em 0; + padding-left: 2.5em; +} +ul.archivos li a{ + font-weight:900; + display:block; +} +ul.archivos li dfn{ + font-style:italic; + +} +#backtolist{ + width:100%; + clear:both; + margin:4em 0; +} +#header{ + background:url('../img/bg_barra_superior2.png') repeat-x #000; + color:#ffffff; + padding:0.8em; + text-align:right; + border-bottom:groove 6px #2b5694; + padding-bottom:1em; + } + + + +#header a{color:#ffffff} + +#header div{ + display:inline-block; + padding:0em 0.6em; + border-right:solid 2px #ffffff; +} + +#header img{ + margin:0 0 0 0.4em; + vertical-align:text-top;} + +#header #lang img{ + border: outset 1px #666666; + +} + + +#header #lheader{float:left;border:0;} +#lheader a{text-decoration:none;} +#lheader h1{ + font-size:2em; + margin-top:-0.1em; + +} +#lheader a span{color:#2b5694} + +#header .last{border-right:0} +#header #admin{cursor:pointer;text-decoration:underline;} +#header #admin ul{ + position:absolute;background:#2b5694;padding:1em;width:20em; + opacity:0.8; + filter:alpha(opacity=80); + margin-top:0.51em; + list-style:decimal-leading-zero inside url('../img/menos.png'); + + +} +#header #admin ul li a{ + padding-bottom:0.6em; + vertical-align: middle; +} + +#content{ + text-align:center; + + } + +/*desde*/ +#content form{ + width:40em; + margin:auto; + margin-top:4em; +} +#content form fieldset{ + border:solid 1px #2b5694; + background:#d5e2ff; + padding:0 1.2em; + margin-top:2em; + position:relative; + } +#services ul li{ + padding-bottom:1em; + border:solid 1px #666666; + background-color:#f1f1f1; + padding:0; + margin:1px; + font-size:1.2em; + +} +#services ul li a{ + padding-left:1em; + +} +#services ul li span{ + display:inline-block; + width:1em; + height:1em; + margin:0.5em 0.5em 0 0; + float:right; + color:#F1F1F1; + background:url('../img/down.png') top right no-repeat; +} + +#services ul li span.ampli{ + background:url('../img/up.png') top right no-repeat; +} +#services ul li ul{ + border-top:ridge #2b5694 3px; +} +#services ul li ul li{ + border:0; + background-color:#f9f9f9; + + font-size:0.81em; +} +#services ul li ul li img{ + vertical-align:middle; + padding-right:0.2em; +} +#services li{ + padding-left:1em; + line-height:1.8em; + +} + +h2{ + background: url("../img/bg_barra_pie.png") repeat-x scroll center top #FFFFFF; + /*border: 4px groove #2b5694;*/ + border:solid 1px #2b5694; + color: #2b5694; + font-size: 1.2em; + font-weight: 900; + margin: 2em; + padding: 0.8em; + text-align: center; +} + +#login fieldset{ + margin:1.2em; + font-size:1em; + + +} +#login fieldset p,#content form fieldset p{ + width:100%; + display:inline-block; + float:left; + margin:0.51em 0; + +} +#login fieldset label,#content form fieldset label{ + line-height:2em; + display:block; + font-size:1em; + float:left; +} +input,buttom,select{font-family:monospace;font-size:1em;float:right;width:17em;} +select{ + width:17.4em; +} + +input[type=submit]{ + background: url("../img/bg_barra_superior2.png") repeat-x scroll 40px -10px #000000; + color: #FFFFFF; + padding: 0.2em 1.2em; + width: auto; +} + +#adminmsgs{ + text-align:left; + margin:auto; + margin-top:2em; + padding:2em; + background:#f2f2f2; + width:40em; + border: 1px solid #666666; +} + +#footer{ + background: url("../img/bg_barra_pie.png") repeat-x scroll center top #FFFFFF; + padding:1.6% 2%; + margin-top:4em; + text-align:right; + min-height:1em; + border-top:groove 2px #2b5694; + position:absolute; + width:96%; + bottom:0; + +} + +#applet { + margin:20px 0; +} diff --git a/server/src/uds/static/img/2downarrow.png b/server/src/uds/static/img/2downarrow.png new file mode 100644 index 000000000..9f89b239d Binary files /dev/null and b/server/src/uds/static/img/2downarrow.png differ diff --git a/server/src/uds/static/img/2uparrow.png b/server/src/uds/static/img/2uparrow.png new file mode 100644 index 000000000..7bc9ab524 Binary files /dev/null and b/server/src/uds/static/img/2uparrow.png differ diff --git a/server/src/uds/static/img/access.png b/server/src/uds/static/img/access.png new file mode 100644 index 000000000..cd64a95be Binary files /dev/null and b/server/src/uds/static/img/access.png differ diff --git a/server/src/uds/static/img/bg_barra_pie.png b/server/src/uds/static/img/bg_barra_pie.png new file mode 100644 index 000000000..70b3697d3 Binary files /dev/null and b/server/src/uds/static/img/bg_barra_pie.png differ diff --git a/server/src/uds/static/img/bg_barra_superior2.png b/server/src/uds/static/img/bg_barra_superior2.png new file mode 100644 index 000000000..288cc78ca Binary files /dev/null and b/server/src/uds/static/img/bg_barra_superior2.png differ diff --git a/server/src/uds/static/img/bg_uds.png b/server/src/uds/static/img/bg_uds.png new file mode 100644 index 000000000..b29cb7918 Binary files /dev/null and b/server/src/uds/static/img/bg_uds.png differ diff --git a/server/src/uds/static/img/down.png b/server/src/uds/static/img/down.png new file mode 100644 index 000000000..72708b992 Binary files /dev/null and b/server/src/uds/static/img/down.png differ diff --git a/server/src/uds/static/img/exit.png b/server/src/uds/static/img/exit.png new file mode 100644 index 000000000..4596d267b Binary files /dev/null and b/server/src/uds/static/img/exit.png differ diff --git a/server/src/uds/static/img/favicon.ico b/server/src/uds/static/img/favicon.ico new file mode 100644 index 000000000..7da31415f Binary files /dev/null and b/server/src/uds/static/img/favicon.ico differ diff --git a/server/src/uds/static/img/favicon.png b/server/src/uds/static/img/favicon.png new file mode 100644 index 000000000..8f5be5174 Binary files /dev/null and b/server/src/uds/static/img/favicon.png differ diff --git a/server/src/uds/static/img/flags/de.png b/server/src/uds/static/img/flags/de.png new file mode 100644 index 000000000..8c21120d7 Binary files /dev/null and b/server/src/uds/static/img/flags/de.png differ diff --git a/server/src/uds/static/img/flags/en.png b/server/src/uds/static/img/flags/en.png new file mode 100644 index 000000000..0bfeaf91e Binary files /dev/null and b/server/src/uds/static/img/flags/en.png differ diff --git a/server/src/uds/static/img/flags/es.png b/server/src/uds/static/img/flags/es.png new file mode 100644 index 000000000..5ddb8e855 Binary files /dev/null and b/server/src/uds/static/img/flags/es.png differ diff --git a/server/src/uds/static/img/flags/fr.png b/server/src/uds/static/img/flags/fr.png new file mode 100644 index 000000000..d57e05bcd Binary files /dev/null and b/server/src/uds/static/img/flags/fr.png differ diff --git a/server/src/uds/static/img/ico-mas.png b/server/src/uds/static/img/ico-mas.png new file mode 100644 index 000000000..b4b3ed105 Binary files /dev/null and b/server/src/uds/static/img/ico-mas.png differ diff --git a/server/src/uds/static/img/ico-menos.png b/server/src/uds/static/img/ico-menos.png new file mode 100644 index 000000000..fd37a9259 Binary files /dev/null and b/server/src/uds/static/img/ico-menos.png differ diff --git a/server/src/uds/static/img/mas.png b/server/src/uds/static/img/mas.png new file mode 100644 index 000000000..64fb7f935 Binary files /dev/null and b/server/src/uds/static/img/mas.png differ diff --git a/server/src/uds/static/img/menos.png b/server/src/uds/static/img/menos.png new file mode 100644 index 000000000..c50a5255f Binary files /dev/null and b/server/src/uds/static/img/menos.png differ diff --git a/server/src/uds/static/img/unknown.png b/server/src/uds/static/img/unknown.png new file mode 100644 index 000000000..c0c028621 Binary files /dev/null and b/server/src/uds/static/img/unknown.png differ diff --git a/server/src/uds/static/img/up.png b/server/src/uds/static/img/up.png new file mode 100644 index 000000000..6fe3b4890 Binary files /dev/null and b/server/src/uds/static/img/up.png differ diff --git a/server/src/uds/static/img/volver.png b/server/src/uds/static/img/volver.png new file mode 100644 index 000000000..f78956faf Binary files /dev/null and b/server/src/uds/static/img/volver.png differ diff --git a/server/src/uds/static/js/PluginDetect_Java.js b/server/src/uds/static/js/PluginDetect_Java.js new file mode 100644 index 000000000..8241ace3d --- /dev/null +++ b/server/src/uds/static/js/PluginDetect_Java.js @@ -0,0 +1,7 @@ +/* +PluginDetect v0.7.8 www.pinlady.net/PluginDetect/ +www.pinlady.net/PluginDetect/license/ +[ getVersion isMinVersion onDetectionDone onWindowLoaded ] +[ Java(OTF & NOTF) ] +*/ +var PluginDetect={version:"0.7.8",name:"PluginDetect",handler:function(c,b,a){return function(){c(b,a)}},isDefined:function(b){return typeof b!="undefined"},isArray:function(b){return(/array/i).test(Object.prototype.toString.call(b))},isFunc:function(b){return typeof b=="function"},isString:function(b){return typeof b=="string"},isNum:function(b){return typeof b=="number"},isStrNum:function(b){return(typeof b=="string"&&(/\d/).test(b))},getNumRegx:/[\d][\d\.\_,-]*/,splitNumRegx:/[\.\_,-]/g,getNum:function(b,c){var d=this,a=d.isStrNum(b)?(d.isDefined(c)?new RegExp(c):d.getNumRegx).exec(b):null;return a?a[0]:null},compareNums:function(h,f,d){var e=this,c,b,a,g=parseInt;if(e.isStrNum(h)&&e.isStrNum(f)){if(e.isDefined(d)&&d.compareNums){return d.compareNums(h,f)}c=h.split(e.splitNumRegx);b=f.split(e.splitNumRegx);for(a=0;ag(b[a],10)){return 1}if(g(c[a],10)c||!(/\d/).test(e[a])){e[a]="0"}}return e.slice(0,4).join(",")},$$hasMimeType:function(a){return function(c){if(!a.isIE&&c){var f,e,b,d=a.isArray(c)?c:(a.isString(c)?[c]:[]);for(b=0;b0&&!f[g]){f[g]=f[a](f);delete f[a]}}catch(d){}}}},initObj:function(e,b,d){var a,c;if(e){if(e[b[0]]==1||d){for(a=0;a=0;f=f-2){if(d[f]&&new RegExp(d[f],"i").test(b)){c.OS=d[f+1];break}}}c.convertFuncs(c);c.head=(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]||document.body||null);c.isIE=(new Function("return "+e+"*@cc_on!@*"+e+"false"))();c.verIE=c.isIE&&(/MSIE\s*(\d+\.?\d*)/i).test(i)?parseFloat(RegExp.$1,10):null;c.ActiveXEnabled=false;if(c.isIE){var f,j=["Msxml2.XMLHTTP","Msxml2.DOMDocument","Microsoft.XMLDOM","ShockwaveFlash.ShockwaveFlash","TDCCtl.TDCCtl","Shell.UIHelper","Scripting.Dictionary","wmplayer.ocx"];for(f=0;f0&&c.isFunc(b[0])))){a.push(b)}},callArray:function(b){var c=this,a;if(c.isArray(b)){for(a=0;a0&&b.isFunc(c[0])){c[0](b,a>1?c[1]:0,a>2?c[2]:0,a>3?c[3]:0)}else{if(b.isFunc(c)){c(b)}}},$$isMinVersion:function(a){return function(h,g,d,c){var e=a.init(h),f,b=-1,j={};if(e.status<0){return e.status}f=e.plugin;g=a.formatNum(a.isNum(g)?g.toString():(a.isStrNum(g)?a.getNum(g):"0"));if(f.getVersionDone!=1){f.getVersion(g,d,c);if(f.getVersionDone===null){f.getVersionDone=1}}a.cleanup();if(f.installed!==null){b=f.installed<=0.5?f.installed:(f.installed==0.7?1:(f.version===null?0:(a.compareNums(f.version,g,f)>=0?1:-0.1)))};return b}},getVersionDelimiter:",",$$getVersion:function(a){return function(g,d,c){var e=a.init(g),f,b,h={};if(e.status<0){return null};f=e.plugin;if(f.getVersionDone!=1){f.getVersion(null,d,c);if(f.getVersionDone===null){f.getVersionDone=1}}a.cleanup();b=(f.version||f.version0);b=b?b.replace(a.splitNumRegx,a.getVersionDelimiter):b;return b}},cleanup:function(){var a=this;if(a.garbage&&a.isDefined(window.CollectGarbage)){window.CollectGarbage()}},addWinEvent:function(d,c){var e=this,a=window,b;if(e.isFunc(c)){if(a.addEventListener){a.addEventListener(d,c,false)}else{if(a.attachEvent){a.attachEvent("on"+d,c)}else{b=a["on"+d];a["on"+d]=e.winHandler(c,b)}}}},winHandler:function(d,c){return function(){d();if(typeof c=="function"){c()}}},WLfuncs0:[],WLfuncs:[],runWLfuncs:function(a){var b={};a.winLoaded=true;a.callArray(a.WLfuncs0);a.callArray(a.WLfuncs);if(a.onDoneEmptyDiv){a.onDoneEmptyDiv()}},winLoaded:false,$$onWindowLoaded:function(a){return function(b){if(a.winLoaded){a.call(b)}else{a.fPush(b,a.WLfuncs)}}},$$onDetectionDone:function(a){return function(h,g,c,b){var d=a.init(h),k,e,j={};if(d.status==-3){return -1}e=d.plugin;if(!a.isArray(e.funcs)){e.funcs=[]}if(e.getVersionDone!=1){k=a.isMinVersion?a.isMinVersion(h,"0",c,b):a.getVersion(h,c,b)}if(e.installed!=-0.5&&e.installed!=0.5){a.call(g);return 1}if(e.NOTF){a.fPush(g,e.funcs);return 0}return 1}},div:null,divID:"plugindetect",divWidth:50,pluginSize:1,emptyDiv:function(){var d=this,b,h,c,a,f,g;if(d.div&&d.div.childNodes){for(b=d.div.childNodes.length-1;b>=0;b--){c=d.div.childNodes[b];if(c&&c.childNodes){for(h=c.childNodes.length-1;h>=0;h--){g=c.childNodes[h];try{c.removeChild(g)}catch(f){}}}if(c){try{d.div.removeChild(c)}catch(f){}}}}if(!d.div){a=document.getElementById(d.divID);if(a){d.div=a}}if(d.div&&d.div.parentNode){try{d.div.parentNode.removeChild(d.div)}catch(f){}d.div=null}},DONEfuncs:[],onDoneEmptyDiv:function(){var c=this,a,b;if(!c.winLoaded){return}if(c.WLfuncs&&c.WLfuncs.length&&c.WLfuncs[c.WLfuncs.length-1]!==null){return}for(a in c){b=c[a];if(b&&b.funcs){if(b.OTF==3){return}if(b.funcs.length&&b.funcs[b.funcs.length-1]!==null){return}}}for(a=0;a=i){return -1}try{if(l==c.pluginSize&&(!c.isIE||c.getDOMobj(m).readyState==4)){if(!m.winLoaded&&c.winLoaded){return 1}if(m.winLoaded&&c.isNum(b)){if(!c.isNum(m.count)){m.count=b}if(b-m.count>=10){return 1}}}}catch(f){}return 0},getDOMobj:function(g,a){var f,d=this,c=g?g.span:0,b=c&&c.firstChild?1:0;try{if(b&&a){d.div.focus()}}catch(f){}return b?c.firstChild:null},setStyle:function(b,g){var f=b.style,a,d,c=this;if(f&&g){for(a=0;ao'+c+"/div>");d=j.getElementById(b)}catch(h){}}g=(j.getElementsByTagName("body")[0]||j.body);if(g){if(g.firstChild&&f.isDefined(g.insertBefore)){g.insertBefore(a,g.firstChild)}else{g.appendChild(a)}if(d){g.removeChild(d)}}else{}},insertHTML:function(g,b,h,a,l){var m,n=document,k=this,q,p=n.createElement("span"),o,j,f="<";var c=["outlineStyle","none","borderStyle","none","padding","0px","margin","0px","visibility","visible"];var i="outline-style:none;border-style:none;padding:0px;margin:0px;visibility:visible;";if(!k.isDefined(a)){a=""}if(k.isString(g)&&(/[^\s]/).test(g)){g=g.toLowerCase().replace(/\s/g,"");q=f+g+' width="'+k.pluginSize+'" height="'+k.pluginSize+'" ';q+='style="'+i+'display:inline;" ';for(o=0;o'}}q+=a+f+"/"+g+">"}else{q=a}if(!k.div){j=n.getElementById(k.divID);if(j){k.div=j}else{k.div=n.createElement("div");k.div.id=k.divID}k.setStyle(k.div,c.concat(["width",k.divWidth+"px","height",(k.pluginSize+3)+"px","fontSize",(k.pluginSize+3)+"px","lineHeight",(k.pluginSize+3)+"px","verticalAlign","baseline","display","block"]));if(!j){k.setStyle(k.div,["position","absolute","right","0px","top","0px"]);k.insertDivInBody(k.div)}}if(k.div&&k.div.parentNode){k.setStyle(p,c.concat(["fontSize",(k.pluginSize+3)+"px","lineHeight",(k.pluginSize+3)+"px","verticalAlign","baseline","display","inline"]));try{p.innerHTML=q}catch(m){};try{k.div.appendChild(p)}catch(m){};return{span:p,winLoaded:k.winLoaded,tagName:g,outerHTML:q}}return{span:null,winLoaded:k.winLoaded,tagName:"",outerHTML:q}},file:{$:1,any:"fileStorageAny999",valid:"fileStorageValid999",save:function(d,f,c){var b=this,e=b.$,a;if(d&&e.isDefined(c)){if(!d[b.any]){d[b.any]=[]}if(!d[b.valid]){d[b.valid]=[]}d[b.any].push(c);a=b.split(f,c);if(a){d[b.valid].push(a)}}},getValidLength:function(a){return a&&a[this.valid]?a[this.valid].length:0},getAnyLength:function(a){return a&&a[this.any]?a[this.any].length:0},getValid:function(c,a){var b=this;return c&&c[b.valid]?b.get(c[b.valid],a):null},getAny:function(c,a){var b=this;return c&&c[b.any]?b.get(c[b.any],a):null},get:function(d,a){var c=d.length-1,b=this.$.isNum(a)?a:c;return(b<0||b>c)?null:d[b]},split:function(g,c){var b=this,e=b.$,f=null,a,d;g=g?g.replace(".","\\."):"";d=new RegExp("^(.*[^\\/])("+g+"\\s*)$");if(e.isString(c)&&d.test(c)){a=(RegExp.$1).split("/");f={name:a[a.length-1],ext:RegExp.$2,full:c};a[a.length-1]="";f.path=a.join("/")}return f},z:0},Plugins:{java:{mimeType:["application/x-java-applet","application/x-java-vm","application/x-java-bean"],classID:"clsid:8AD9C840-044E-11D1-B3E9-00805F499D93",navigator:{a:window.navigator.javaEnabled(),javaEnabled:function(){return this.a},mimeObj:0,pluginObj:0},OTF:null,minIEver:7,debug:0,debugEnable:function(){var a=this,b=a.$;a.debug=1},isDisabled:{$:1,DTK:function(){var a=this,c=a.$,b=a.$$;if((c.isGecko&&c.compareNums(c.verGecko,c.formatNum("1.6"))<=0)||(c.isSafari&&c.OS==1&&(!c.verSafari||c.compareNums(c.verSafari,"5,1,0,0")<0))||c.isChrome||(c.isIE&&!c.ActiveXEnabled)){return 1}return 0},AXO:function(){var a=this,c=a.$,b=a.$$;return(!c.isIE||!c.ActiveXEnabled||(!b.debug&&b.DTK.query().status!==0))},navMime:function(){var b=this,d=b.$,c=b.$$,a=c.navigator;if(d.isIE||!a.mimeObj||!a.pluginObj){return 1}return 0},navPlugin:function(){var b=this,d=b.$,c=b.$$,a=c.navigator;if(d.isIE||!a.mimeObj||!a.pluginObj){return 1}return 0},windowDotJava:function(){var a=this,c=a.$,b=a.$$;if(!window.java){return 1}if(c.OS==2&&c.verOpera&&c.verOpera<9.2&&c.verOpera>=9){return 1}if(c.verGecko&&c.compareNums(c.verGecko,"1,9,0,0")<0&&c.compareNums(c.verGecko,"1,8,0,0")>=0){return 1}return 0},allApplets:function(){var b=this,d=b.$,c=b.$$,a=c.navigator;if(d.OS>=20){return 0}if(d.verOpera&&d.verOpera<11&&!a.javaEnabled()&&!c.lang.System.getProperty()[0]){return 1}if((d.verGecko&&d.compareNums(d.verGecko,d.formatNum("2"))<0)&&!a.mimeObj&&!c.lang.System.getProperty()[0]){return 1}return 0},AppletTag:function(){var b=this,d=b.$,c=b.$$,a=c.navigator;return d.isIE?!a.javaEnabled():0},ObjectTag:function(){var a=this,c=a.$,b=a.$$;return c.isIE?!c.ActiveXEnabled:0},z:0},getVerifyTagsDefault:function(){var a=this,c=a.$,b=[1,0,1];if(c.OS>=20){return b}if((c.isIE&&(c.verIE<9||!c.ActiveXEnabled))||(c.verGecko&&c.compareNums(c.verGecko,c.formatNum("2"))<0)||(c.isSafari&&(!c.verSafari||c.compareNums(c.verSafari,c.formatNum("4"))<0))||(c.verOpera&&c.verOpera<10)){b=[1,1,1]}return b},getVersion:function(j,g,i){var b=this,d=b.$,e,a=b.applet,h=b.verify,k=b.navigator,f=null,l=null,c=null;if(b.getVersionDone===null){b.OTF=0;k.mimeObj=d.hasMimeType(b.mimeType);if(k.mimeObj){k.pluginObj=k.mimeObj.enabledPlugin}if(h){h.begin()}}a.setVerifyTagsArray(i);d.file.save(b,".jar",g);if(b.getVersionDone===0){if(a.should_Insert_Query_Any()){e=a.insert_Query_Any();b.setPluginStatus(e[0],e[1],f)}return}if((!f||b.debug)&&b.DTK.query().version){f=b.DTK.version}if((!f||b.debug)&&b.navMime.query().version){f=b.navMime.version}if((!f||b.debug)&&b.navPlugin.query().version){f=b.navPlugin.version}if((!f||b.debug)&&b.AXO.query().version){f=b.AXO.version}if(b.nonAppletDetectionOk(f)){c=f}if(!c||b.debug||a.VerifyTagsHas(2.2)||a.VerifyTagsHas(2.5)){e=b.lang.System.getProperty();if(e[0]){f=e[0];c=e[0];l=e[1]}}b.setPluginStatus(c,l,f);if(a.should_Insert_Query_Any()){e=a.insert_Query_Any();if(e[0]){c=e[0];l=e[1]}}b.setPluginStatus(c,l,f)},nonAppletDetectionOk:function(b){var d=this,e=d.$,a=d.navigator,c=1;if(!b||(!a.javaEnabled()&&!d.lang.System.getPropertyHas(b))||(!e.isIE&&!a.mimeObj&&!d.lang.System.getPropertyHas(b))||(e.isIE&&!e.ActiveXEnabled)){c=0}else{if(e.OS>=20){}else{if(d.info&&d.info.getPlugin2Status()<0&&d.info.BrowserRequiresPlugin2()){c=0}}}return c},setPluginStatus:function(d,f,a){var c=this,e=c.$,b;a=a||c.version0;if(c.OTF>0){d=d||c.lang.System.getProperty()[0]}if(c.OTF<3){b=d?1:(a?-0.2:-1);if(c.installed===null||b>c.installed){c.installed=b}}if(c.OTF==2&&c.NOTF&&!c.applet.getResult()[0]&&!c.lang.System.getProperty()[0]){c.installed=a?-0.2:-1};if(c.OTF==3&&c.installed!=-0.5&&c.installed!=0.5){c.installed=(c.NOTF.isJavaActive(1)==1||c.lang.System.getProperty()[0])?0.5:-0.5}if(c.OTF==4&&(c.installed==-0.5||c.installed==0.5)){if(d){c.installed=1}else{if(c.NOTF.isJavaActive(1)==1){if(a){c.installed=1;d=a}else{c.installed=0}}else{if(a){c.installed=-0.2}else{c.installed=-1}}}};if(a){c.version0=e.formatNum(e.getNum(a))}if(d){c.version=e.formatNum(e.getNum(d))}if(f&&e.isString(f)){c.vendor=f}if(!c.vendor){c.vendor=""}if(c.verify&&c.verify.isEnabled()){c.getVersionDone=0}else{if(c.getVersionDone!=1){if(c.OTF<2){c.getVersionDone=0}else{c.getVersionDone=c.applet.can_Insert_Query_Any()?0:1}}}},DTK:{$:1,hasRun:0,status:null,VERSIONS:[],version:"",HTML:null,Plugin2Status:null,classID:["clsid:CAFEEFAC-DEC7-0000-0001-ABCDEFFEDCBA","clsid:CAFEEFAC-DEC7-0000-0000-ABCDEFFEDCBA"],mimeType:["application/java-deployment-toolkit","application/npruntime-scriptable-plugin;DeploymentToolkit"],disabled:function(){return this.$$.isDisabled.DTK()},query:function(){var k=this,g=k.$,d=k.$$,j,l,h,m={},f={},a,c=null,i=null,b=(k.hasRun||k.disabled());k.hasRun=1;if(b){return k}k.status=0;if(g.isIE&&g.verIE>=6){for(l=0;l0?1:-1;for(l=0;l=b.minIEver){i=a.search(j,j,d);if(i.length>0&&d){i=a.search(k,k,d)}}else{if(d){i=a.search(f,f,true)}if(i.length==0){i=a.search(h,g,false)}}if(i.length){a.version=i[0];a.VERSIONS=[].concat(i)};return a},search:function(a,j,p){var h,d,f=this,e=f.$,k=f.$$,n,c,l,q,b,o,r,i=[];if(e.compareNums(a.join(","),j.join(","))>0){j=a}j=e.formatNum(j.join(","));var m,s="1,4,2,0",g="JavaPlugin."+a[0]+""+a[1]+""+a[2]+""+(a[3]>0?("_"+(a[3]<10?"0":"")+a[3]):"");for(h=0;h=0;l--){r="JavaWebStart.isInstalled."+b+l+".0";if(e.compareNums(d[0]+","+d[1]+","+l+",0",j)>=0&&!e.getAXO(r)){continue}m=e.compareNums(d[0]+","+d[1]+","+l+",0",s)<0?true:false;for(q=d[3];q>=0;q--){c=l+"_"+(q<10?"0"+q:q);o=n+c;if(e.getAXO(o)&&(m||e.getAXO(r))){i.push(b+c);if(!p){return i}}if(o==g){return i}}if(e.getAXO(n+l)&&(m||e.getAXO(r))){i.push(b+l);if(!p){return i}}if(n+l==g){return i}}}return i}},navMime:{$:1,hasRun:0,mimetype:"",version:"",length:0,mimeObj:0,pluginObj:0,disabled:function(){return this.$$.isDisabled.navMime()},query:function(){var i=this,f=i.$,a=i.$$,b=(i.hasRun||i.disabled());i.hasRun=1;if(b){return i};var n=/^\s*application\/x-java-applet;jpi-version\s*=\s*(\d.*)$/i,g,l,j,d="",h="a",o,m,k={},c=f.formatNum("0");for(l=0;l0){c=g}}}g=k[h+c];if(g){o=f.hasMimeType(g);i.mimeObj=o;i.pluginObj=o?o.enabledPlugin:0;i.mimetype=g;i.version=c};return i}},navPlugin:{$:1,hasRun:0,version:"",disabled:function(){return this.$$.isDisabled.navPlugin()},query:function(){var m=this,e=m.$,c=m.$$,h=c.navigator,j,l,k,g,d,a,i,f=0,b=(m.hasRun||m.disabled());m.hasRun=1;if(b){return m};a=h.pluginObj.name||"";i=h.pluginObj.description||"";if(!f||c.debug){g=/Java.*TM.*Platform[^\d]*(\d+)(?:[\.,_](\d*))?(?:\s*[Update]+\s*(\d*))?/i;if((g.test(a)||g.test(i))&&parseInt(RegExp.$1,10)>=5){f="1,"+RegExp.$1+","+(RegExp.$2?RegExp.$2:"0")+","+(RegExp.$3?RegExp.$3:"0")}}if(!f||c.debug){g=/Java[^\d]*Plug-in/i;l=g.test(i)?e.formatNum(e.getNum(i)):0;k=g.test(a)?e.formatNum(e.getNum(a)):0;if(l&&(e.compareNums(l,e.formatNum("1,3"))<0||e.compareNums(l,e.formatNum("2"))>=0)){l=0}if(k&&(e.compareNums(k,e.formatNum("1,3"))<0||e.compareNums(k,e.formatNum("2"))>=0)){k=0}d=l&&k?(e.compareNums(l,k)>0?l:k):(l||k);if(d){f=d}}if(!f&&e.isSafari&&e.OS==2){j=e.findNavPlugin("Java.*\\d.*Plug-in.*Cocoa",0);if(j){l=e.getNum(j.description);if(l){f=l}}};if(f){m.version=e.formatNum(f)};return m}},lang:{$:1,System:{$:1,hasRun:0,result:[null,null],disabled:function(){return this.$$.isDisabled.windowDotJava()},getPropertyHas:function(a){var b=this,d=b.$,c=b.getProperty()[0];return(a&&c&&d.compareNums(d.formatNum(a),d.formatNum(c))===0)?1:0},getProperty:function(){var f=this,g=f.$,d=f.$$,i,h={},b=(f.hasRun||f.disabled());f.hasRun=1;if(!b){var a="java_qqq990";g[a]=null;try{var c=document.createElement("script");c.type="text/javascript";c.appendChild(document.createTextNode("(function(){var e;try{if (window.java && window.java.lang && window.java.lang.System){"+g.name+"."+a+'=[window.java.lang.System.getProperty("java.version")+" ",window.java.lang.System.getProperty("java.vendor")+" "]}}catch(e){}})();'));if(g.head.firstChild){g.head.insertBefore(c,g.head.firstChild)}else{g.head.appendChild(c)}g.head.removeChild(c)}catch(i){}if(g[a]&&g.isArray(g[a])){f.result=[].concat(g[a])}}return f.result}}},applet:{$:1,results:[[null,null],[null,null],[null,null]],getResult:function(){var c=this.results,a,b=[];for(a=0;a3){c[a]=3}b.allowed[a]=c[a]}}}},setVerifyTagsArray:function(d){var b=this,c=b.$,a=b.$$;if(a.getVersionDone===null){b.saveAsVerifyTagsArray(a.getVerifyTagsDefault())}if(a.debug||(a.verify&&a.verify.isEnabled())){b.saveAsVerifyTagsArray([3,3,3])}else{if(d){b.saveAsVerifyTagsArray(d)}}},allDisabled:function(){return this.$$.isDisabled.allApplets()},isDisabled:function(d){var b=this,c=b.$,a=b.$$;if(d==2&&!c.isIE){return 1}if(d===0||d==2){return a.isDisabled.ObjectTag()}if(d==1){return a.isDisabled.AppletTag()}},can_Insert_Query:function(b){var a=this;if(a.HTML[b]){return 0}return !a.isDisabled(b)},can_Insert_Query_Any:function(){var b=this,a;for(a=0;a=2||(b.allowed[a]==1&&!b.getResult()[0]))&&e.isAppletActive(a)>=0){return 1}}return 0},isJavaActive:function(d){var f=this,c=f.$$,a,b,e=-9;for(a=0;ae){e=b}}return e},isAppletActive:function(c,a){var d=this,b=d.$$.applet.active;if(!a){b[c]=d.isAppletActive_(c)}return b[c]},isAppletActive_:function(d){var g=this,f=g.$,b=g.$$,l=b.navigator,a=b.applet,h=a.HTML[d],i,k,c=0,j=f.getTagStatus(h,a.DummySpanTagHTML,a.DummyObjTagHTML,g.count);if(j==-2){return -2}try{if(f.isIE&&f.verIE>=b.minIEver&&f.getDOMobj(h).object){return 1}}catch(i){}for(k=0;k0){c=1}}if(j==1&&(f.isIE||((b.version0&&l.javaEnabled()&&l.mimeObj&&(h.tagName=="object"||c))||b.lang.System.getProperty()[0]))){return 1}if(j<0){return -1}return 0},winOnLoadQuery:function(c,d){var b=d.$$,a;if(b.OTF==3){a=d.queryAllApplets();d.queryCompleted(a[1],a[2])}},$$onIntervalQuery:function(d){var c=d.$,b=d.$$,a;if(b.OTF==3){a=d.queryAllApplets();if(!d.shouldContinueQuery()||(c.winLoaded&&d.count>d.countMax)){d.queryCompleted(a[1],a[2])}}d.count++;if(b.OTF==3){setTimeout(d.onIntervalQuery,d.intervalLength)}},queryAllApplets:function(){var g=this,f=g.$,e=g.$$,d=e.applet,b,a,c;for(b=0;b=4){return}b.OTF=4;var a=e.isJavaActive();b.setPluginStatus(c,f,0);if(b.funcs){d.callArray(b.funcs)}if(d.onDoneEmptyDiv){d.onDoneEmptyDiv()}}},zz:0},zz:0}};PluginDetect.initScript(); \ No newline at end of file diff --git a/server/src/uds/static/js/jquery-1.7.1.js b/server/src/uds/static/js/jquery-1.7.1.js new file mode 100644 index 000000000..8ccd0ea78 --- /dev/null +++ b/server/src/uds/static/js/jquery-1.7.1.js @@ -0,0 +1,9266 @@ +/*! + * jQuery JavaScript Library v1.7.1 + * http://jquery.com/ + * + * Copyright 2011, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Mon Nov 21 21:11:03 2011 -0500 + */ +(function( window, undefined ) { + +// Use the correct document accordingly with window argument (sandbox) +var document = window.document, + navigator = window.navigator, + location = window.location; +var jQuery = (function() { + +// Define a local copy of jQuery +var jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context, rootjQuery ); + }, + + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + + // Map over the $ in case of overwrite + _$ = window.$, + + // A central reference to the root jQuery(document) + rootjQuery, + + // A simple way to check for HTML strings or ID strings + // Prioritize #id over to avoid XSS via location.hash (#9521) + quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, + + // Check if a string has a non-whitespace character in it + rnotwhite = /\S/, + + // Used for trimming whitespace + trimLeft = /^\s+/, + trimRight = /\s+$/, + + // Match a standalone tag + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, + + // JSON RegExp + rvalidchars = /^[\],:{}\s]*$/, + rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, + rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, + rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, + + // Useragent RegExp + rwebkit = /(webkit)[ \/]([\w.]+)/, + ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, + rmsie = /(msie) ([\w.]+)/, + rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, + + // Matches dashed string for camelizing + rdashAlpha = /-([a-z]|[0-9])/ig, + rmsPrefix = /^-ms-/, + + // Used by jQuery.camelCase as callback to replace() + fcamelCase = function( all, letter ) { + return ( letter + "" ).toUpperCase(); + }, + + // Keep a UserAgent string for use with jQuery.browser + userAgent = navigator.userAgent, + + // For matching the engine and version of the browser + browserMatch, + + // The deferred used on DOM ready + readyList, + + // The ready event handler + DOMContentLoaded, + + // Save a reference to some core methods + toString = Object.prototype.toString, + hasOwn = Object.prototype.hasOwnProperty, + push = Array.prototype.push, + slice = Array.prototype.slice, + trim = String.prototype.trim, + indexOf = Array.prototype.indexOf, + + // [[Class]] -> type pairs + class2type = {}; + +jQuery.fn = jQuery.prototype = { + constructor: jQuery, + init: function( selector, context, rootjQuery ) { + var match, elem, ret, doc; + + // Handle $(""), $(null), or $(undefined) + if ( !selector ) { + return this; + } + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + } + + // The body element only exists once, optimize finding it + if ( selector === "body" && !context && document.body ) { + this.context = document; + this[0] = document.body; + this.selector = selector; + this.length = 1; + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + // Are we dealing with HTML string or an ID? + if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = quickExpr.exec( selector ); + } + + // Verify a match, and that no context was specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + context = context instanceof jQuery ? context[0] : context; + doc = ( context ? context.ownerDocument || context : document ); + + // If a single string is passed in and it's a single tag + // just do a createElement and skip the rest + ret = rsingleTag.exec( selector ); + + if ( ret ) { + if ( jQuery.isPlainObject( context ) ) { + selector = [ document.createElement( ret[1] ) ]; + jQuery.fn.attr.call( selector, context, true ); + + } else { + selector = [ doc.createElement( ret[1] ) ]; + } + + } else { + ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); + selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes; + } + + return jQuery.merge( this, selector ); + + // HANDLE: $("#id") + } else { + elem = document.getElementById( match[2] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[2] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || rootjQuery ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return rootjQuery.ready( selector ); + } + + if ( selector.selector !== undefined ) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }, + + // Start with an empty selector + selector: "", + + // The current version of jQuery being used + jquery: "1.7.1", + + // The default length of a jQuery object is 0 + length: 0, + + // The number of elements contained in the matched element set + size: function() { + return this.length; + }, + + toArray: function() { + return slice.call( this, 0 ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num == null ? + + // Return a 'clean' array + this.toArray() : + + // Return just the object + ( num < 0 ? this[ this.length + num ] : this[ num ] ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems, name, selector ) { + // Build a new jQuery matched element set + var ret = this.constructor(); + + if ( jQuery.isArray( elems ) ) { + push.apply( ret, elems ); + + } else { + jQuery.merge( ret, elems ); + } + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + ret.context = this.context; + + if ( name === "find" ) { + ret.selector = this.selector + ( this.selector ? " " : "" ) + selector; + } else if ( name ) { + ret.selector = this.selector + "." + name + "(" + selector + ")"; + } + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + ready: function( fn ) { + // Attach the listeners + jQuery.bindReady(); + + // Add the callback + readyList.add( fn ); + + return this; + }, + + eq: function( i ) { + i = +i; + return i === -1 ? + this.slice( i ) : + this.slice( i, i + 1 ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ), + "slice", slice.call(arguments).join(",") ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function( elem, i ) { + return callback.call( elem, i, elem ); + })); + }, + + end: function() { + return this.prevObject || this.constructor(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: [].sort, + splice: [].splice +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( length === i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray(src) ? src : []; + + } else { + clone = src && jQuery.isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend({ + noConflict: function( deep ) { + if ( window.$ === jQuery ) { + window.$ = _$; + } + + if ( deep && window.jQuery === jQuery ) { + window.jQuery = _jQuery; + } + + return jQuery; + }, + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Hold (or release) the ready event + holdReady: function( hold ) { + if ( hold ) { + jQuery.readyWait++; + } else { + jQuery.ready( true ); + } + }, + + // Handle when the DOM is ready + ready: function( wait ) { + // Either a released hold or an DOMready/load event and not yet ready + if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { + return setTimeout( jQuery.ready, 1 ); + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.fireWith( document, [ jQuery ] ); + + // Trigger any bound ready events + if ( jQuery.fn.trigger ) { + jQuery( document ).trigger( "ready" ).off( "ready" ); + } + } + }, + + bindReady: function() { + if ( readyList ) { + return; + } + + readyList = jQuery.Callbacks( "once memory" ); + + // Catch cases where $(document).ready() is called after the + // browser event has already occurred. + if ( document.readyState === "complete" ) { + // Handle it asynchronously to allow scripts the opportunity to delay ready + return setTimeout( jQuery.ready, 1 ); + } + + // Mozilla, Opera and webkit nightlies currently support this event + if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", jQuery.ready, false ); + + // If IE event model is used + } else if ( document.attachEvent ) { + // ensure firing before onload, + // maybe late but safe also for iframes + document.attachEvent( "onreadystatechange", DOMContentLoaded ); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", jQuery.ready ); + + // If IE and not a frame + // continually check to see if the document is ready + var toplevel = false; + + try { + toplevel = window.frameElement == null; + } catch(e) {} + + if ( document.documentElement.doScroll && toplevel ) { + doScrollCheck(); + } + } + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return jQuery.type(obj) === "function"; + }, + + isArray: Array.isArray || function( obj ) { + return jQuery.type(obj) === "array"; + }, + + // A crude way of determining if an object is a window + isWindow: function( obj ) { + return obj && typeof obj === "object" && "setInterval" in obj; + }, + + isNumeric: function( obj ) { + return !isNaN( parseFloat(obj) ) && isFinite( obj ); + }, + + type: function( obj ) { + return obj == null ? + String( obj ) : + class2type[ toString.call(obj) ] || "object"; + }, + + isPlainObject: function( obj ) { + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + try { + // Not own constructor property must be Object + if ( obj.constructor && + !hasOwn.call(obj, "constructor") && + !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { + return false; + } + } catch ( e ) { + // IE8,9 Will throw exceptions on certain host objects #9897 + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + + var key; + for ( key in obj ) {} + + return key === undefined || hasOwn.call( obj, key ); + }, + + isEmptyObject: function( obj ) { + for ( var name in obj ) { + return false; + } + return true; + }, + + error: function( msg ) { + throw new Error( msg ); + }, + + parseJSON: function( data ) { + if ( typeof data !== "string" || !data ) { + return null; + } + + // Make sure leading/trailing whitespace is removed (IE can't handle it) + data = jQuery.trim( data ); + + // Attempt to parse using the native JSON parser first + if ( window.JSON && window.JSON.parse ) { + return window.JSON.parse( data ); + } + + // Make sure the incoming data is actual JSON + // Logic borrowed from http://json.org/json2.js + if ( rvalidchars.test( data.replace( rvalidescape, "@" ) + .replace( rvalidtokens, "]" ) + .replace( rvalidbraces, "")) ) { + + return ( new Function( "return " + data ) )(); + + } + jQuery.error( "Invalid JSON: " + data ); + }, + + // Cross-browser xml parsing + parseXML: function( data ) { + var xml, tmp; + try { + if ( window.DOMParser ) { // Standard + tmp = new DOMParser(); + xml = tmp.parseFromString( data , "text/xml" ); + } else { // IE + xml = new ActiveXObject( "Microsoft.XMLDOM" ); + xml.async = "false"; + xml.loadXML( data ); + } + } catch( e ) { + xml = undefined; + } + if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { + jQuery.error( "Invalid XML: " + data ); + } + return xml; + }, + + noop: function() {}, + + // Evaluates a script in a global context + // Workarounds based on findings by Jim Driscoll + // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context + globalEval: function( data ) { + if ( data && rnotwhite.test( data ) ) { + // We use execScript on Internet Explorer + // We use an anonymous function so that context is window + // rather than jQuery in Firefox + ( window.execScript || function( data ) { + window[ "eval" ].call( window, data ); + } )( data ); + } + }, + + // Convert dashed to camelCase; used by the css and data modules + // Microsoft forgot to hump their vendor prefix (#9572) + camelCase: function( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); + }, + + // args is for internal usage only + each: function( object, callback, args ) { + var name, i = 0, + length = object.length, + isObj = length === undefined || jQuery.isFunction( object ); + + if ( args ) { + if ( isObj ) { + for ( name in object ) { + if ( callback.apply( object[ name ], args ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.apply( object[ i++ ], args ) === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isObj ) { + for ( name in object ) { + if ( callback.call( object[ name ], name, object[ name ] ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) { + break; + } + } + } + } + + return object; + }, + + // Use native String.trim function wherever possible + trim: trim ? + function( text ) { + return text == null ? + "" : + trim.call( text ); + } : + + // Otherwise use our own trimming functionality + function( text ) { + return text == null ? + "" : + text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); + }, + + // results is for internal usage only + makeArray: function( array, results ) { + var ret = results || []; + + if ( array != null ) { + // The window, strings (and functions) also have 'length' + // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 + var type = jQuery.type( array ); + + if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { + push.call( ret, array ); + } else { + jQuery.merge( ret, array ); + } + } + + return ret; + }, + + inArray: function( elem, array, i ) { + var len; + + if ( array ) { + if ( indexOf ) { + return indexOf.call( array, elem, i ); + } + + len = array.length; + i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; + + for ( ; i < len; i++ ) { + // Skip accessing in sparse arrays + if ( i in array && array[ i ] === elem ) { + return i; + } + } + } + + return -1; + }, + + merge: function( first, second ) { + var i = first.length, + j = 0; + + if ( typeof second.length === "number" ) { + for ( var l = second.length; j < l; j++ ) { + first[ i++ ] = second[ j ]; + } + + } else { + while ( second[j] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, inv ) { + var ret = [], retVal; + inv = !!inv; + + // Go through the array, only saving the items + // that pass the validator function + for ( var i = 0, length = elems.length; i < length; i++ ) { + retVal = !!callback( elems[ i ], i ); + if ( inv !== retVal ) { + ret.push( elems[ i ] ); + } + } + + return ret; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var value, key, ret = [], + i = 0, + length = elems.length, + // jquery objects are treated as arrays + isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ; + + // Go through the array, translating each of the items to their + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + + // Go through every key on the object, + } else { + for ( key in elems ) { + value = callback( elems[ key ], key, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + } + + // Flatten any nested arrays + return ret.concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + if ( typeof context === "string" ) { + var tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !jQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + var args = slice.call( arguments, 2 ), + proxy = function() { + return fn.apply( context, args.concat( slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; + + return proxy; + }, + + // Mutifunctional method to get and set values to a collection + // The value/s can optionally be executed if it's a function + access: function( elems, key, value, exec, fn, pass ) { + var length = elems.length; + + // Setting many attributes + if ( typeof key === "object" ) { + for ( var k in key ) { + jQuery.access( elems, k, key[k], exec, fn, value ); + } + return elems; + } + + // Setting one attribute + if ( value !== undefined ) { + // Optionally, function values get executed if exec is true + exec = !pass && exec && jQuery.isFunction(value); + + for ( var i = 0; i < length; i++ ) { + fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); + } + + return elems; + } + + // Getting an attribute + return length ? fn( elems[0], key ) : undefined; + }, + + now: function() { + return ( new Date() ).getTime(); + }, + + // Use of jQuery.browser is frowned upon. + // More details: http://docs.jquery.com/Utilities/jQuery.browser + uaMatch: function( ua ) { + ua = ua.toLowerCase(); + + var match = rwebkit.exec( ua ) || + ropera.exec( ua ) || + rmsie.exec( ua ) || + ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || + []; + + return { browser: match[1] || "", version: match[2] || "0" }; + }, + + sub: function() { + function jQuerySub( selector, context ) { + return new jQuerySub.fn.init( selector, context ); + } + jQuery.extend( true, jQuerySub, this ); + jQuerySub.superclass = this; + jQuerySub.fn = jQuerySub.prototype = this(); + jQuerySub.fn.constructor = jQuerySub; + jQuerySub.sub = this.sub; + jQuerySub.fn.init = function init( selector, context ) { + if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { + context = jQuerySub( context ); + } + + return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); + }; + jQuerySub.fn.init.prototype = jQuerySub.fn; + var rootjQuerySub = jQuerySub(document); + return jQuerySub; + }, + + browser: {} +}); + +// Populate the class2type map +jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +}); + +browserMatch = jQuery.uaMatch( userAgent ); +if ( browserMatch.browser ) { + jQuery.browser[ browserMatch.browser ] = true; + jQuery.browser.version = browserMatch.version; +} + +// Deprecated, use jQuery.browser.webkit instead +if ( jQuery.browser.webkit ) { + jQuery.browser.safari = true; +} + +// IE doesn't match non-breaking spaces with \s +if ( rnotwhite.test( "\xA0" ) ) { + trimLeft = /^[\s\xA0]+/; + trimRight = /[\s\xA0]+$/; +} + +// All jQuery objects should point back to these +rootjQuery = jQuery(document); + +// Cleanup functions for the document ready method +if ( document.addEventListener ) { + DOMContentLoaded = function() { + document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + jQuery.ready(); + }; + +} else if ( document.attachEvent ) { + DOMContentLoaded = function() { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( document.readyState === "complete" ) { + document.detachEvent( "onreadystatechange", DOMContentLoaded ); + jQuery.ready(); + } + }; +} + +// The DOM ready check for Internet Explorer +function doScrollCheck() { + if ( jQuery.isReady ) { + return; + } + + try { + // If IE is used, use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + document.documentElement.doScroll("left"); + } catch(e) { + setTimeout( doScrollCheck, 1 ); + return; + } + + // and execute any waiting functions + jQuery.ready(); +} + +return jQuery; + +})(); + + +// String to Object flags format cache +var flagsCache = {}; + +// Convert String-formatted flags into Object-formatted ones and store in cache +function createFlags( flags ) { + var object = flagsCache[ flags ] = {}, + i, length; + flags = flags.split( /\s+/ ); + for ( i = 0, length = flags.length; i < length; i++ ) { + object[ flags[i] ] = true; + } + return object; +} + +/* + * Create a callback list using the following parameters: + * + * flags: an optional list of space-separated flags that will change how + * the callback list behaves + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible flags: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( flags ) { + + // Convert flags from String-formatted to Object-formatted + // (we check in cache first) + flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {}; + + var // Actual callback list + list = [], + // Stack of fire calls for repeatable lists + stack = [], + // Last fire value (for non-forgettable lists) + memory, + // Flag to know if list is currently firing + firing, + // First callback to fire (used internally by add and fireWith) + firingStart, + // End of the loop when firing + firingLength, + // Index of currently firing callback (modified by remove if needed) + firingIndex, + // Add one or several callbacks to the list + add = function( args ) { + var i, + length, + elem, + type, + actual; + for ( i = 0, length = args.length; i < length; i++ ) { + elem = args[ i ]; + type = jQuery.type( elem ); + if ( type === "array" ) { + // Inspect recursively + add( elem ); + } else if ( type === "function" ) { + // Add if not in unique mode and callback is not in + if ( !flags.unique || !self.has( elem ) ) { + list.push( elem ); + } + } + } + }, + // Fire callbacks + fire = function( context, args ) { + args = args || []; + memory = !flags.memory || [ context, args ]; + firing = true; + firingIndex = firingStart || 0; + firingStart = 0; + firingLength = list.length; + for ( ; list && firingIndex < firingLength; firingIndex++ ) { + if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) { + memory = true; // Mark as halted + break; + } + } + firing = false; + if ( list ) { + if ( !flags.once ) { + if ( stack && stack.length ) { + memory = stack.shift(); + self.fireWith( memory[ 0 ], memory[ 1 ] ); + } + } else if ( memory === true ) { + self.disable(); + } else { + list = []; + } + } + }, + // Actual Callbacks object + self = { + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + var length = list.length; + add( arguments ); + // Do we need to add the callbacks to the + // current firing batch? + if ( firing ) { + firingLength = list.length; + // With memory, if we're not firing then + // we should call right away, unless previous + // firing was halted (stopOnFalse) + } else if ( memory && memory !== true ) { + firingStart = length; + fire( memory[ 0 ], memory[ 1 ] ); + } + } + return this; + }, + // Remove a callback from the list + remove: function() { + if ( list ) { + var args = arguments, + argIndex = 0, + argLength = args.length; + for ( ; argIndex < argLength ; argIndex++ ) { + for ( var i = 0; i < list.length; i++ ) { + if ( args[ argIndex ] === list[ i ] ) { + // Handle firingIndex and firingLength + if ( firing ) { + if ( i <= firingLength ) { + firingLength--; + if ( i <= firingIndex ) { + firingIndex--; + } + } + } + // Remove the element + list.splice( i--, 1 ); + // If we have some unicity property then + // we only need to do this once + if ( flags.unique ) { + break; + } + } + } + } + } + return this; + }, + // Control if a given callback is in the list + has: function( fn ) { + if ( list ) { + var i = 0, + length = list.length; + for ( ; i < length; i++ ) { + if ( fn === list[ i ] ) { + return true; + } + } + } + return false; + }, + // Remove all callbacks from the list + empty: function() { + list = []; + return this; + }, + // Have the list do nothing anymore + disable: function() { + list = stack = memory = undefined; + return this; + }, + // Is it disabled? + disabled: function() { + return !list; + }, + // Lock the list in its current state + lock: function() { + stack = undefined; + if ( !memory || memory === true ) { + self.disable(); + } + return this; + }, + // Is it locked? + locked: function() { + return !stack; + }, + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( stack ) { + if ( firing ) { + if ( !flags.once ) { + stack.push( [ context, args ] ); + } + } else if ( !( flags.once && memory ) ) { + fire( context, args ); + } + } + return this; + }, + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + // To know if the callbacks have already been called at least once + fired: function() { + return !!memory; + } + }; + + return self; +}; + + + + +var // Static reference to slice + sliceDeferred = [].slice; + +jQuery.extend({ + + Deferred: function( func ) { + var doneList = jQuery.Callbacks( "once memory" ), + failList = jQuery.Callbacks( "once memory" ), + progressList = jQuery.Callbacks( "memory" ), + state = "pending", + lists = { + resolve: doneList, + reject: failList, + notify: progressList + }, + promise = { + done: doneList.add, + fail: failList.add, + progress: progressList.add, + + state: function() { + return state; + }, + + // Deprecated + isResolved: doneList.fired, + isRejected: failList.fired, + + then: function( doneCallbacks, failCallbacks, progressCallbacks ) { + deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks ); + return this; + }, + always: function() { + deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments ); + return this; + }, + pipe: function( fnDone, fnFail, fnProgress ) { + return jQuery.Deferred(function( newDefer ) { + jQuery.each( { + done: [ fnDone, "resolve" ], + fail: [ fnFail, "reject" ], + progress: [ fnProgress, "notify" ] + }, function( handler, data ) { + var fn = data[ 0 ], + action = data[ 1 ], + returned; + if ( jQuery.isFunction( fn ) ) { + deferred[ handler ](function() { + returned = fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify ); + } else { + newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] ); + } + }); + } else { + deferred[ handler ]( newDefer[ action ] ); + } + }); + }).promise(); + }, + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + if ( obj == null ) { + obj = promise; + } else { + for ( var key in promise ) { + obj[ key ] = promise[ key ]; + } + } + return obj; + } + }, + deferred = promise.promise({}), + key; + + for ( key in lists ) { + deferred[ key ] = lists[ key ].fire; + deferred[ key + "With" ] = lists[ key ].fireWith; + } + + // Handle state + deferred.done( function() { + state = "resolved"; + }, failList.disable, progressList.lock ).fail( function() { + state = "rejected"; + }, doneList.disable, progressList.lock ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( firstParam ) { + var args = sliceDeferred.call( arguments, 0 ), + i = 0, + length = args.length, + pValues = new Array( length ), + count = length, + pCount = length, + deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ? + firstParam : + jQuery.Deferred(), + promise = deferred.promise(); + function resolveFunc( i ) { + return function( value ) { + args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; + if ( !( --count ) ) { + deferred.resolveWith( deferred, args ); + } + }; + } + function progressFunc( i ) { + return function( value ) { + pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; + deferred.notifyWith( promise, pValues ); + }; + } + if ( length > 1 ) { + for ( ; i < length; i++ ) { + if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) { + args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) ); + } else { + --count; + } + } + if ( !count ) { + deferred.resolveWith( deferred, args ); + } + } else if ( deferred !== firstParam ) { + deferred.resolveWith( deferred, length ? [ firstParam ] : [] ); + } + return promise; + } +}); + + + + +jQuery.support = (function() { + + var support, + all, + a, + select, + opt, + input, + marginDiv, + fragment, + tds, + events, + eventName, + i, + isSupported, + div = document.createElement( "div" ), + documentElement = document.documentElement; + + // Preliminary tests + div.setAttribute("className", "t"); + div.innerHTML = "
a"; + + all = div.getElementsByTagName( "*" ); + a = div.getElementsByTagName( "a" )[ 0 ]; + + // Can't get basic test support + if ( !all || !all.length || !a ) { + return {}; + } + + // First batch of supports tests + select = document.createElement( "select" ); + opt = select.appendChild( document.createElement("option") ); + input = div.getElementsByTagName( "input" )[ 0 ]; + + support = { + // IE strips leading whitespace when .innerHTML is used + leadingWhitespace: ( div.firstChild.nodeType === 3 ), + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + tbody: !div.getElementsByTagName("tbody").length, + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + htmlSerialize: !!div.getElementsByTagName("link").length, + + // Get the style information from getAttribute + // (IE uses .cssText instead) + style: /top/.test( a.getAttribute("style") ), + + // Make sure that URLs aren't manipulated + // (IE normalizes it by default) + hrefNormalized: ( a.getAttribute("href") === "/a" ), + + // Make sure that element opacity exists + // (IE uses filter instead) + // Use a regex to work around a WebKit issue. See #5145 + opacity: /^0.55/.test( a.style.opacity ), + + // Verify style float existence + // (IE uses styleFloat instead of cssFloat) + cssFloat: !!a.style.cssFloat, + + // Make sure that if no value is specified for a checkbox + // that it defaults to "on". + // (WebKit defaults to "" instead) + checkOn: ( input.value === "on" ), + + // Make sure that a selected-by-default option has a working selected property. + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) + optSelected: opt.selected, + + // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) + getSetAttribute: div.className !== "t", + + // Tests for enctype support on a form(#6743) + enctype: !!document.createElement("form").enctype, + + // Makes sure cloning an html5 element does not cause problems + // Where outerHTML is undefined, this still works + html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav>", + + // Will be defined later + submitBubbles: true, + changeBubbles: true, + focusinBubbles: false, + deleteExpando: true, + noCloneEvent: true, + inlineBlockNeedsLayout: false, + shrinkWrapBlocks: false, + reliableMarginRight: true + }; + + // Make sure checked status is properly cloned + input.checked = true; + support.noCloneChecked = input.cloneNode( true ).checked; + + // Make sure that the options inside disabled selects aren't marked as disabled + // (WebKit marks them as disabled) + select.disabled = true; + support.optDisabled = !opt.disabled; + + // Test to see if it's possible to delete an expando from an element + // Fails in Internet Explorer + try { + delete div.test; + } catch( e ) { + support.deleteExpando = false; + } + + if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { + div.attachEvent( "onclick", function() { + // Cloning a node shouldn't copy over any + // bound event handlers (IE does this) + support.noCloneEvent = false; + }); + div.cloneNode( true ).fireEvent( "onclick" ); + } + + // Check if a radio maintains its value + // after being appended to the DOM + input = document.createElement("input"); + input.value = "t"; + input.setAttribute("type", "radio"); + support.radioValue = input.value === "t"; + + input.setAttribute("checked", "checked"); + div.appendChild( input ); + fragment = document.createDocumentFragment(); + fragment.appendChild( div.lastChild ); + + // WebKit doesn't clone checked state correctly in fragments + support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Check if a disconnected checkbox will retain its checked + // value of true after appended to the DOM (IE6/7) + support.appendChecked = input.checked; + + fragment.removeChild( input ); + fragment.appendChild( div ); + + div.innerHTML = ""; + + // Check if div with explicit width and no margin-right incorrectly + // gets computed margin-right based on width of container. For more + // info see bug #3333 + // Fails in WebKit before Feb 2011 nightlies + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right + if ( window.getComputedStyle ) { + marginDiv = document.createElement( "div" ); + marginDiv.style.width = "0"; + marginDiv.style.marginRight = "0"; + div.style.width = "2px"; + div.appendChild( marginDiv ); + support.reliableMarginRight = + ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0; + } + + // Technique from Juriy Zaytsev + // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/ + // We only care about the case where non-standard event systems + // are used, namely in IE. Short-circuiting here helps us to + // avoid an eval call (in setAttribute) which can cause CSP + // to go haywire. See: https://developer.mozilla.org/en/Security/CSP + if ( div.attachEvent ) { + for( i in { + submit: 1, + change: 1, + focusin: 1 + }) { + eventName = "on" + i; + isSupported = ( eventName in div ); + if ( !isSupported ) { + div.setAttribute( eventName, "return;" ); + isSupported = ( typeof div[ eventName ] === "function" ); + } + support[ i + "Bubbles" ] = isSupported; + } + } + + fragment.removeChild( div ); + + // Null elements to avoid leaks in IE + fragment = select = opt = marginDiv = div = input = null; + + // Run tests that need a body at doc ready + jQuery(function() { + var container, outer, inner, table, td, offsetSupport, + conMarginTop, ptlm, vb, style, html, + body = document.getElementsByTagName("body")[0]; + + if ( !body ) { + // Return for frameset docs that don't have a body + return; + } + + conMarginTop = 1; + ptlm = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;"; + vb = "visibility:hidden;border:0;"; + style = "style='" + ptlm + "border:5px solid #000;padding:0;'"; + html = "
" + + "" + + "
"; + + container = document.createElement("div"); + container.style.cssText = vb + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px"; + body.insertBefore( container, body.firstChild ); + + // Construct the test element + div = document.createElement("div"); + container.appendChild( div ); + + // Check if table cells still have offsetWidth/Height when they are set + // to display:none and there are still other visible table cells in a + // table row; if so, offsetWidth/Height are not reliable for use when + // determining if an element has been hidden directly using + // display:none (it is still safe to use offsets if a parent element is + // hidden; don safety goggles and see bug #4512 for more information). + // (only IE 8 fails this test) + div.innerHTML = "
t
"; + tds = div.getElementsByTagName( "td" ); + isSupported = ( tds[ 0 ].offsetHeight === 0 ); + + tds[ 0 ].style.display = ""; + tds[ 1 ].style.display = "none"; + + // Check if empty table cells still have offsetWidth/Height + // (IE <= 8 fail this test) + support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); + + // Figure out if the W3C box model works as expected + div.innerHTML = ""; + div.style.width = div.style.paddingLeft = "1px"; + jQuery.boxModel = support.boxModel = div.offsetWidth === 2; + + if ( typeof div.style.zoom !== "undefined" ) { + // Check if natively block-level elements act like inline-block + // elements when setting their display to 'inline' and giving + // them layout + // (IE < 8 does this) + div.style.display = "inline"; + div.style.zoom = 1; + support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 ); + + // Check if elements with layout shrink-wrap their children + // (IE 6 does this) + div.style.display = ""; + div.innerHTML = "
"; + support.shrinkWrapBlocks = ( div.offsetWidth !== 2 ); + } + + div.style.cssText = ptlm + vb; + div.innerHTML = html; + + outer = div.firstChild; + inner = outer.firstChild; + td = outer.nextSibling.firstChild.firstChild; + + offsetSupport = { + doesNotAddBorder: ( inner.offsetTop !== 5 ), + doesAddBorderForTableAndCells: ( td.offsetTop === 5 ) + }; + + inner.style.position = "fixed"; + inner.style.top = "20px"; + + // safari subtracts parent border width here which is 5px + offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 ); + inner.style.position = inner.style.top = ""; + + outer.style.overflow = "hidden"; + outer.style.position = "relative"; + + offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 ); + offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop ); + + body.removeChild( container ); + div = container = null; + + jQuery.extend( support, offsetSupport ); + }); + + return support; +})(); + + + + +var rbrace = /^(?:\{.*\}|\[.*\])$/, + rmultiDash = /([A-Z])/g; + +jQuery.extend({ + cache: {}, + + // Please use with caution + uuid: 0, + + // Unique for each copy of jQuery on the page + // Non-digits removed to match rinlinejQuery + expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), + + // The following elements throw uncatchable exceptions if you + // attempt to add expando properties to them. + noData: { + "embed": true, + // Ban all objects except for Flash (which handle expandos) + "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", + "applet": true + }, + + hasData: function( elem ) { + elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; + return !!elem && !isEmptyDataObject( elem ); + }, + + data: function( elem, name, data, pvt /* Internal Use Only */ ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var privateCache, thisCache, ret, + internalKey = jQuery.expando, + getByName = typeof name === "string", + + // We have to handle DOM nodes and JS objects differently because IE6-7 + // can't GC object references properly across the DOM-JS boundary + isNode = elem.nodeType, + + // Only DOM nodes need the global jQuery cache; JS object data is + // attached directly to the object so GC can occur automatically + cache = isNode ? jQuery.cache : elem, + + // Only defining an ID for JS objects if its cache already exists allows + // the code to shortcut on the same path as a DOM node with no cache + id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey, + isEvents = name === "events"; + + // Avoid doing any more work than we need to when trying to get data on an + // object that has no data at all + if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) { + return; + } + + if ( !id ) { + // Only DOM nodes need a new unique ID for each element since their data + // ends up in the global cache + if ( isNode ) { + elem[ internalKey ] = id = ++jQuery.uuid; + } else { + id = internalKey; + } + } + + if ( !cache[ id ] ) { + cache[ id ] = {}; + + // Avoids exposing jQuery metadata on plain JS objects when the object + // is serialized using JSON.stringify + if ( !isNode ) { + cache[ id ].toJSON = jQuery.noop; + } + } + + // An object can be passed to jQuery.data instead of a key/value pair; this gets + // shallow copied over onto the existing cache + if ( typeof name === "object" || typeof name === "function" ) { + if ( pvt ) { + cache[ id ] = jQuery.extend( cache[ id ], name ); + } else { + cache[ id ].data = jQuery.extend( cache[ id ].data, name ); + } + } + + privateCache = thisCache = cache[ id ]; + + // jQuery data() is stored in a separate object inside the object's internal data + // cache in order to avoid key collisions between internal data and user-defined + // data. + if ( !pvt ) { + if ( !thisCache.data ) { + thisCache.data = {}; + } + + thisCache = thisCache.data; + } + + if ( data !== undefined ) { + thisCache[ jQuery.camelCase( name ) ] = data; + } + + // Users should not attempt to inspect the internal events object using jQuery.data, + // it is undocumented and subject to change. But does anyone listen? No. + if ( isEvents && !thisCache[ name ] ) { + return privateCache.events; + } + + // Check for both converted-to-camel and non-converted data property names + // If a data property was specified + if ( getByName ) { + + // First Try to find as-is property data + ret = thisCache[ name ]; + + // Test for null|undefined property data + if ( ret == null ) { + + // Try to find the camelCased property + ret = thisCache[ jQuery.camelCase( name ) ]; + } + } else { + ret = thisCache; + } + + return ret; + }, + + removeData: function( elem, name, pvt /* Internal Use Only */ ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var thisCache, i, l, + + // Reference to internal data cache key + internalKey = jQuery.expando, + + isNode = elem.nodeType, + + // See jQuery.data for more information + cache = isNode ? jQuery.cache : elem, + + // See jQuery.data for more information + id = isNode ? elem[ internalKey ] : internalKey; + + // If there is already no cache entry for this object, there is no + // purpose in continuing + if ( !cache[ id ] ) { + return; + } + + if ( name ) { + + thisCache = pvt ? cache[ id ] : cache[ id ].data; + + if ( thisCache ) { + + // Support array or space separated string names for data keys + if ( !jQuery.isArray( name ) ) { + + // try the string as a key before any manipulation + if ( name in thisCache ) { + name = [ name ]; + } else { + + // split the camel cased version by spaces unless a key with the spaces exists + name = jQuery.camelCase( name ); + if ( name in thisCache ) { + name = [ name ]; + } else { + name = name.split( " " ); + } + } + } + + for ( i = 0, l = name.length; i < l; i++ ) { + delete thisCache[ name[i] ]; + } + + // If there is no data left in the cache, we want to continue + // and let the cache object itself get destroyed + if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { + return; + } + } + } + + // See jQuery.data for more information + if ( !pvt ) { + delete cache[ id ].data; + + // Don't destroy the parent cache unless the internal data object + // had been the only thing left in it + if ( !isEmptyDataObject(cache[ id ]) ) { + return; + } + } + + // Browsers that fail expando deletion also refuse to delete expandos on + // the window, but it will allow it on all other JS objects; other browsers + // don't care + // Ensure that `cache` is not a window object #10080 + if ( jQuery.support.deleteExpando || !cache.setInterval ) { + delete cache[ id ]; + } else { + cache[ id ] = null; + } + + // We destroyed the cache and need to eliminate the expando on the node to avoid + // false lookups in the cache for entries that no longer exist + if ( isNode ) { + // IE does not allow us to delete expando properties from nodes, + // nor does it have a removeAttribute function on Document nodes; + // we must handle all of these cases + if ( jQuery.support.deleteExpando ) { + delete elem[ internalKey ]; + } else if ( elem.removeAttribute ) { + elem.removeAttribute( internalKey ); + } else { + elem[ internalKey ] = null; + } + } + }, + + // For internal use only. + _data: function( elem, name, data ) { + return jQuery.data( elem, name, data, true ); + }, + + // A method for determining if a DOM node can handle the data expando + acceptData: function( elem ) { + if ( elem.nodeName ) { + var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; + + if ( match ) { + return !(match === true || elem.getAttribute("classid") !== match); + } + } + + return true; + } +}); + +jQuery.fn.extend({ + data: function( key, value ) { + var parts, attr, name, + data = null; + + if ( typeof key === "undefined" ) { + if ( this.length ) { + data = jQuery.data( this[0] ); + + if ( this[0].nodeType === 1 && !jQuery._data( this[0], "parsedAttrs" ) ) { + attr = this[0].attributes; + for ( var i = 0, l = attr.length; i < l; i++ ) { + name = attr[i].name; + + if ( name.indexOf( "data-" ) === 0 ) { + name = jQuery.camelCase( name.substring(5) ); + + dataAttr( this[0], name, data[ name ] ); + } + } + jQuery._data( this[0], "parsedAttrs", true ); + } + } + + return data; + + } else if ( typeof key === "object" ) { + return this.each(function() { + jQuery.data( this, key ); + }); + } + + parts = key.split("."); + parts[1] = parts[1] ? "." + parts[1] : ""; + + if ( value === undefined ) { + data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); + + // Try to fetch any internally stored data first + if ( data === undefined && this.length ) { + data = jQuery.data( this[0], key ); + data = dataAttr( this[0], key, data ); + } + + return data === undefined && parts[1] ? + this.data( parts[0] ) : + data; + + } else { + return this.each(function() { + var self = jQuery( this ), + args = [ parts[0], value ]; + + self.triggerHandler( "setData" + parts[1] + "!", args ); + jQuery.data( this, key, value ); + self.triggerHandler( "changeData" + parts[1] + "!", args ); + }); + } + }, + + removeData: function( key ) { + return this.each(function() { + jQuery.removeData( this, key ); + }); + } +}); + +function dataAttr( elem, key, data ) { + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + + var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); + + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + jQuery.isNumeric( data ) ? parseFloat( data ) : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch( e ) {} + + // Make sure we set the data so it isn't changed later + jQuery.data( elem, key, data ); + + } else { + data = undefined; + } + } + + return data; +} + +// checks a cache object for emptiness +function isEmptyDataObject( obj ) { + for ( var name in obj ) { + + // if the public data object is empty, the private is still empty + if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { + continue; + } + if ( name !== "toJSON" ) { + return false; + } + } + + return true; +} + + + + +function handleQueueMarkDefer( elem, type, src ) { + var deferDataKey = type + "defer", + queueDataKey = type + "queue", + markDataKey = type + "mark", + defer = jQuery._data( elem, deferDataKey ); + if ( defer && + ( src === "queue" || !jQuery._data(elem, queueDataKey) ) && + ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) { + // Give room for hard-coded callbacks to fire first + // and eventually mark/queue something else on the element + setTimeout( function() { + if ( !jQuery._data( elem, queueDataKey ) && + !jQuery._data( elem, markDataKey ) ) { + jQuery.removeData( elem, deferDataKey, true ); + defer.fire(); + } + }, 0 ); + } +} + +jQuery.extend({ + + _mark: function( elem, type ) { + if ( elem ) { + type = ( type || "fx" ) + "mark"; + jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 ); + } + }, + + _unmark: function( force, elem, type ) { + if ( force !== true ) { + type = elem; + elem = force; + force = false; + } + if ( elem ) { + type = type || "fx"; + var key = type + "mark", + count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 ); + if ( count ) { + jQuery._data( elem, key, count ); + } else { + jQuery.removeData( elem, key, true ); + handleQueueMarkDefer( elem, type, "mark" ); + } + } + }, + + queue: function( elem, type, data ) { + var q; + if ( elem ) { + type = ( type || "fx" ) + "queue"; + q = jQuery._data( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !q || jQuery.isArray(data) ) { + q = jQuery._data( elem, type, jQuery.makeArray(data) ); + } else { + q.push( data ); + } + } + return q || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + fn = queue.shift(), + hooks = {}; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + } + + if ( fn ) { + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + jQuery._data( elem, type + ".run", hooks ); + fn.call( elem, function() { + jQuery.dequeue( elem, type ); + }, hooks ); + } + + if ( !queue.length ) { + jQuery.removeData( elem, type + "queue " + type + ".run", true ); + handleQueueMarkDefer( elem, type, "queue" ); + } + } +}); + +jQuery.fn.extend({ + queue: function( type, data ) { + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + } + + if ( data === undefined ) { + return jQuery.queue( this[0], type ); + } + return this.each(function() { + var queue = jQuery.queue( this, type, data ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + return this.each(function() { + jQuery.dequeue( this, type ); + }); + }, + // Based off of the plugin by Clint Helfers, with permission. + // http://blindsignals.com/index.php/2009/07/jquery-delay/ + delay: function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; + type = type || "fx"; + + return this.queue( type, function( next, hooks ) { + var timeout = setTimeout( next, time ); + hooks.stop = function() { + clearTimeout( timeout ); + }; + }); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, object ) { + if ( typeof type !== "string" ) { + object = type; + type = undefined; + } + type = type || "fx"; + var defer = jQuery.Deferred(), + elements = this, + i = elements.length, + count = 1, + deferDataKey = type + "defer", + queueDataKey = type + "queue", + markDataKey = type + "mark", + tmp; + function resolve() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + } + while( i-- ) { + if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) || + ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) || + jQuery.data( elements[ i ], markDataKey, undefined, true ) ) && + jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) { + count++; + tmp.add( resolve ); + } + } + resolve(); + return defer.promise(); + } +}); + + + + +var rclass = /[\n\t\r]/g, + rspace = /\s+/, + rreturn = /\r/g, + rtype = /^(?:button|input)$/i, + rfocusable = /^(?:button|input|object|select|textarea)$/i, + rclickable = /^a(?:rea)?$/i, + rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, + getSetAttribute = jQuery.support.getSetAttribute, + nodeHook, boolHook, fixSpecified; + +jQuery.fn.extend({ + attr: function( name, value ) { + return jQuery.access( this, name, value, true, jQuery.attr ); + }, + + removeAttr: function( name ) { + return this.each(function() { + jQuery.removeAttr( this, name ); + }); + }, + + prop: function( name, value ) { + return jQuery.access( this, name, value, true, jQuery.prop ); + }, + + removeProp: function( name ) { + name = jQuery.propFix[ name ] || name; + return this.each(function() { + // try/catch handles cases where IE balks (such as removing a property on window) + try { + this[ name ] = undefined; + delete this[ name ]; + } catch( e ) {} + }); + }, + + addClass: function( value ) { + var classNames, i, l, elem, + setClass, c, cl; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( j ) { + jQuery( this ).addClass( value.call(this, j, this.className) ); + }); + } + + if ( value && typeof value === "string" ) { + classNames = value.split( rspace ); + + for ( i = 0, l = this.length; i < l; i++ ) { + elem = this[ i ]; + + if ( elem.nodeType === 1 ) { + if ( !elem.className && classNames.length === 1 ) { + elem.className = value; + + } else { + setClass = " " + elem.className + " "; + + for ( c = 0, cl = classNames.length; c < cl; c++ ) { + if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) { + setClass += classNames[ c ] + " "; + } + } + elem.className = jQuery.trim( setClass ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + var classNames, i, l, elem, className, c, cl; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( j ) { + jQuery( this ).removeClass( value.call(this, j, this.className) ); + }); + } + + if ( (value && typeof value === "string") || value === undefined ) { + classNames = ( value || "" ).split( rspace ); + + for ( i = 0, l = this.length; i < l; i++ ) { + elem = this[ i ]; + + if ( elem.nodeType === 1 && elem.className ) { + if ( value ) { + className = (" " + elem.className + " ").replace( rclass, " " ); + for ( c = 0, cl = classNames.length; c < cl; c++ ) { + className = className.replace(" " + classNames[ c ] + " ", " "); + } + elem.className = jQuery.trim( className ); + + } else { + elem.className = ""; + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, + isBool = typeof stateVal === "boolean"; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( i ) { + jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); + }); + } + + return this.each(function() { + if ( type === "string" ) { + // toggle individual class names + var className, + i = 0, + self = jQuery( this ), + state = stateVal, + classNames = value.split( rspace ); + + while ( (className = classNames[ i++ ]) ) { + // check each className given, space seperated list + state = isBool ? state : !self.hasClass( className ); + self[ state ? "addClass" : "removeClass" ]( className ); + } + + } else if ( type === "undefined" || type === "boolean" ) { + if ( this.className ) { + // store className if set + jQuery._data( this, "__className__", this.className ); + } + + // toggle whole className + this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; + } + }); + }, + + hasClass: function( selector ) { + var className = " " + selector + " ", + i = 0, + l = this.length; + for ( ; i < l; i++ ) { + if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { + return true; + } + } + + return false; + }, + + val: function( value ) { + var hooks, ret, isFunction, + elem = this[0]; + + if ( !arguments.length ) { + if ( elem ) { + hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ]; + + if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { + return ret; + } + + ret = elem.value; + + return typeof ret === "string" ? + // handle most common string cases + ret.replace(rreturn, "") : + // handle cases where value is null/undef or number + ret == null ? "" : ret; + } + + return; + } + + isFunction = jQuery.isFunction( value ); + + return this.each(function( i ) { + var self = jQuery(this), val; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call( this, i, self.val() ); + } else { + val = value; + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + } else if ( typeof val === "number" ) { + val += ""; + } else if ( jQuery.isArray( val ) ) { + val = jQuery.map(val, function ( value ) { + return value == null ? "" : value + ""; + }); + } + + hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ]; + + // If set returns undefined, fall back to normal setting + if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { + this.value = val; + } + }); + } +}); + +jQuery.extend({ + valHooks: { + option: { + get: function( elem ) { + // attributes.value is undefined in Blackberry 4.7 but + // uses .value. See #6932 + var val = elem.attributes.value; + return !val || val.specified ? elem.value : elem.text; + } + }, + select: { + get: function( elem ) { + var value, i, max, option, + index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type === "select-one"; + + // Nothing was selected + if ( index < 0 ) { + return null; + } + + // Loop through all the selected options + i = one ? index : 0; + max = one ? index + 1 : options.length; + for ( ; i < max; i++ ) { + option = options[ i ]; + + // Don't return options that are disabled or in a disabled optgroup + if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && + (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { + + // Get the specific value for the option + value = jQuery( option ).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + // Fixes Bug #2551 -- select.val() broken in IE after form.reset() + if ( one && !values.length && options.length ) { + return jQuery( options[ index ] ).val(); + } + + return values; + }, + + set: function( elem, value ) { + var values = jQuery.makeArray( value ); + + jQuery(elem).find("option").each(function() { + this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; + }); + + if ( !values.length ) { + elem.selectedIndex = -1; + } + return values; + } + } + }, + + attrFn: { + val: true, + css: true, + html: true, + text: true, + data: true, + width: true, + height: true, + offset: true + }, + + attr: function( elem, name, value, pass ) { + var ret, hooks, notxml, + nType = elem.nodeType; + + // don't get/set attributes on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + if ( pass && name in jQuery.attrFn ) { + return jQuery( elem )[ name ]( value ); + } + + // Fallback to prop when attributes are not supported + if ( typeof elem.getAttribute === "undefined" ) { + return jQuery.prop( elem, name, value ); + } + + notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); + + // All attributes are lowercase + // Grab necessary hook if one is defined + if ( notxml ) { + name = name.toLowerCase(); + hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); + } + + if ( value !== undefined ) { + + if ( value === null ) { + jQuery.removeAttr( elem, name ); + return; + + } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) { + return ret; + + } else { + elem.setAttribute( name, "" + value ); + return value; + } + + } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) { + return ret; + + } else { + + ret = elem.getAttribute( name ); + + // Non-existent attributes return null, we normalize to undefined + return ret === null ? + undefined : + ret; + } + }, + + removeAttr: function( elem, value ) { + var propName, attrNames, name, l, + i = 0; + + if ( value && elem.nodeType === 1 ) { + attrNames = value.toLowerCase().split( rspace ); + l = attrNames.length; + + for ( ; i < l; i++ ) { + name = attrNames[ i ]; + + if ( name ) { + propName = jQuery.propFix[ name ] || name; + + // See #9699 for explanation of this approach (setting first, then removal) + jQuery.attr( elem, name, "" ); + elem.removeAttribute( getSetAttribute ? name : propName ); + + // Set corresponding property to false for boolean attributes + if ( rboolean.test( name ) && propName in elem ) { + elem[ propName ] = false; + } + } + } + } + }, + + attrHooks: { + type: { + set: function( elem, value ) { + // We can't allow the type property to be changed (since it causes problems in IE) + if ( rtype.test( elem.nodeName ) && elem.parentNode ) { + jQuery.error( "type property can't be changed" ); + } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { + // Setting the type on a radio button after the value resets the value in IE6-9 + // Reset value to it's default in case type is set after value + // This is for element creation + var val = elem.value; + elem.setAttribute( "type", value ); + if ( val ) { + elem.value = val; + } + return value; + } + } + }, + // Use the value property for back compat + // Use the nodeHook for button elements in IE6/7 (#1954) + value: { + get: function( elem, name ) { + if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { + return nodeHook.get( elem, name ); + } + return name in elem ? + elem.value : + null; + }, + set: function( elem, value, name ) { + if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { + return nodeHook.set( elem, value, name ); + } + // Does not return so that setAttribute is also used + elem.value = value; + } + } + }, + + propFix: { + tabindex: "tabIndex", + readonly: "readOnly", + "for": "htmlFor", + "class": "className", + maxlength: "maxLength", + cellspacing: "cellSpacing", + cellpadding: "cellPadding", + rowspan: "rowSpan", + colspan: "colSpan", + usemap: "useMap", + frameborder: "frameBorder", + contenteditable: "contentEditable" + }, + + prop: function( elem, name, value ) { + var ret, hooks, notxml, + nType = elem.nodeType; + + // don't get/set properties on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); + + if ( notxml ) { + // Fix name and attach hooks + name = jQuery.propFix[ name ] || name; + hooks = jQuery.propHooks[ name ]; + } + + if ( value !== undefined ) { + if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { + return ret; + + } else { + return ( elem[ name ] = value ); + } + + } else { + if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { + return ret; + + } else { + return elem[ name ]; + } + } + }, + + propHooks: { + tabIndex: { + get: function( elem ) { + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + var attributeNode = elem.getAttributeNode("tabindex"); + + return attributeNode && attributeNode.specified ? + parseInt( attributeNode.value, 10 ) : + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? + 0 : + undefined; + } + } + } +}); + +// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional) +jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex; + +// Hook for boolean attributes +boolHook = { + get: function( elem, name ) { + // Align boolean attributes with corresponding properties + // Fall back to attribute presence where some booleans are not supported + var attrNode, + property = jQuery.prop( elem, name ); + return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ? + name.toLowerCase() : + undefined; + }, + set: function( elem, value, name ) { + var propName; + if ( value === false ) { + // Remove boolean attributes when set to false + jQuery.removeAttr( elem, name ); + } else { + // value is true since we know at this point it's type boolean and not false + // Set boolean attributes to the same name and set the DOM property + propName = jQuery.propFix[ name ] || name; + if ( propName in elem ) { + // Only set the IDL specifically if it already exists on the element + elem[ propName ] = true; + } + + elem.setAttribute( name, name.toLowerCase() ); + } + return name; + } +}; + +// IE6/7 do not support getting/setting some attributes with get/setAttribute +if ( !getSetAttribute ) { + + fixSpecified = { + name: true, + id: true + }; + + // Use this for any attribute in IE6/7 + // This fixes almost every IE6/7 issue + nodeHook = jQuery.valHooks.button = { + get: function( elem, name ) { + var ret; + ret = elem.getAttributeNode( name ); + return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ? + ret.nodeValue : + undefined; + }, + set: function( elem, value, name ) { + // Set the existing or create a new attribute node + var ret = elem.getAttributeNode( name ); + if ( !ret ) { + ret = document.createAttribute( name ); + elem.setAttributeNode( ret ); + } + return ( ret.nodeValue = value + "" ); + } + }; + + // Apply the nodeHook to tabindex + jQuery.attrHooks.tabindex.set = nodeHook.set; + + // Set width and height to auto instead of 0 on empty string( Bug #8150 ) + // This is for removals + jQuery.each([ "width", "height" ], function( i, name ) { + jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { + set: function( elem, value ) { + if ( value === "" ) { + elem.setAttribute( name, "auto" ); + return value; + } + } + }); + }); + + // Set contenteditable to false on removals(#10429) + // Setting to empty string throws an error as an invalid value + jQuery.attrHooks.contenteditable = { + get: nodeHook.get, + set: function( elem, value, name ) { + if ( value === "" ) { + value = "false"; + } + nodeHook.set( elem, value, name ); + } + }; +} + + +// Some attributes require a special call on IE +if ( !jQuery.support.hrefNormalized ) { + jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { + jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { + get: function( elem ) { + var ret = elem.getAttribute( name, 2 ); + return ret === null ? undefined : ret; + } + }); + }); +} + +if ( !jQuery.support.style ) { + jQuery.attrHooks.style = { + get: function( elem ) { + // Return undefined in the case of empty string + // Normalize to lowercase since IE uppercases css property names + return elem.style.cssText.toLowerCase() || undefined; + }, + set: function( elem, value ) { + return ( elem.style.cssText = "" + value ); + } + }; +} + +// Safari mis-reports the default selected property of an option +// Accessing the parent's selectedIndex property fixes it +if ( !jQuery.support.optSelected ) { + jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { + get: function( elem ) { + var parent = elem.parentNode; + + if ( parent ) { + parent.selectedIndex; + + // Make sure that it also works with optgroups, see #5701 + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + return null; + } + }); +} + +// IE6/7 call enctype encoding +if ( !jQuery.support.enctype ) { + jQuery.propFix.enctype = "encoding"; +} + +// Radios and checkboxes getter/setter +if ( !jQuery.support.checkOn ) { + jQuery.each([ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = { + get: function( elem ) { + // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified + return elem.getAttribute("value") === null ? "on" : elem.value; + } + }; + }); +} +jQuery.each([ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { + set: function( elem, value ) { + if ( jQuery.isArray( value ) ) { + return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); + } + } + }); +}); + + + + +var rformElems = /^(?:textarea|input|select)$/i, + rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/, + rhoverHack = /\bhover(\.\S+)?\b/, + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|contextmenu)|click/, + rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, + rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/, + quickParse = function( selector ) { + var quick = rquickIs.exec( selector ); + if ( quick ) { + // 0 1 2 3 + // [ _, tag, id, class ] + quick[1] = ( quick[1] || "" ).toLowerCase(); + quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" ); + } + return quick; + }, + quickIs = function( elem, m ) { + var attrs = elem.attributes || {}; + return ( + (!m[1] || elem.nodeName.toLowerCase() === m[1]) && + (!m[2] || (attrs.id || {}).value === m[2]) && + (!m[3] || m[3].test( (attrs[ "class" ] || {}).value )) + ); + }, + hoverHack = function( events ) { + return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" ); + }; + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + add: function( elem, types, handler, data, selector ) { + + var elemData, eventHandle, events, + t, tns, type, namespaces, handleObj, + handleObjIn, quick, handlers, special; + + // Don't attach events to noData or text/comment nodes (allow plain objects tho) + if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + events = elemData.events; + if ( !events ) { + elemData.events = events = {}; + } + eventHandle = elemData.handle; + if ( !eventHandle ) { + elemData.handle = eventHandle = function( e ) { + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? + jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : + undefined; + }; + // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events + eventHandle.elem = elem; + } + + // Handle multiple events separated by a space + // jQuery(...).bind("mouseover mouseout", fn); + types = jQuery.trim( hoverHack(types) ).split( " " ); + for ( t = 0; t < types.length; t++ ) { + + tns = rtypenamespace.exec( types[t] ) || []; + type = tns[1]; + namespaces = ( tns[2] || "" ).split( "." ).sort(); + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend({ + type: type, + origType: tns[1], + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + quick: quickParse( selector ), + namespace: namespaces.join(".") + }, handleObjIn ); + + // Init the event handler queue if we're the first + handlers = events[ type ]; + if ( !handlers ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener/attachEvent if the special events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + global: {}, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + + var elemData = jQuery.hasData( elem ) && jQuery._data( elem ), + t, tns, type, origType, namespaces, origCount, + j, events, special, handle, eventType, handleObj; + + if ( !elemData || !(events = elemData.events) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = jQuery.trim( hoverHack( types || "" ) ).split(" "); + for ( t = 0; t < types.length; t++ ) { + tns = rtypenamespace.exec( types[t] ) || []; + type = origType = tns[1]; + namespaces = tns[2]; + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector? special.delegateType : special.bindType ) || type; + eventType = events[ type ] || []; + origCount = eventType.length; + namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null; + + // Remove matching events + for ( j = 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !namespaces || namespaces.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { + eventType.splice( j--, 1 ); + + if ( handleObj.selector ) { + eventType.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( eventType.length === 0 && origCount !== eventType.length ) { + if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + handle = elemData.handle; + if ( handle ) { + handle.elem = null; + } + + // removeData also checks for emptiness and clears the expando if empty + // so use it instead of delete + jQuery.removeData( elem, [ "events", "handle" ], true ); + } + }, + + // Events that are safe to short-circuit if no handlers are attached. + // Native DOM events should not be added, they may have inline handlers. + customEvent: { + "getData": true, + "setData": true, + "changeData": true + }, + + trigger: function( event, data, elem, onlyHandlers ) { + // Don't do events on text and comment nodes + if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) { + return; + } + + // Event object or event type + var type = event.type || event, + namespaces = [], + cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType; + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf( "!" ) >= 0 ) { + // Exclusive events trigger only for the exact event (no namespaces) + type = type.slice(0, -1); + exclusive = true; + } + + if ( type.indexOf( "." ) >= 0 ) { + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split("."); + type = namespaces.shift(); + namespaces.sort(); + } + + if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) { + // No jQuery handlers for this event type, and it can't have inline handlers + return; + } + + // Caller can pass in an Event, Object, or just an event type string + event = typeof event === "object" ? + // jQuery.Event object + event[ jQuery.expando ] ? event : + // Object literal + new jQuery.Event( type, event ) : + // Just the event type (string) + new jQuery.Event( type ); + + event.type = type; + event.isTrigger = true; + event.exclusive = exclusive; + event.namespace = namespaces.join( "." ); + event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null; + ontype = type.indexOf( ":" ) < 0 ? "on" + type : ""; + + // Handle a global trigger + if ( !elem ) { + + // TODO: Stop taunting the data cache; remove global events and always attach to document + cache = jQuery.cache; + for ( i in cache ) { + if ( cache[ i ].events && cache[ i ].events[ type ] ) { + jQuery.event.trigger( event, data, cache[ i ].handle.elem, true ); + } + } + return; + } + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data != null ? jQuery.makeArray( data ) : []; + data.unshift( event ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + eventPath = [[ elem, special.bindType || type ]]; + if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode; + old = null; + for ( ; cur; cur = cur.parentNode ) { + eventPath.push([ cur, bubbleType ]); + old = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( old && old === elem.ownerDocument ) { + eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]); + } + } + + // Fire handlers on the event path + for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) { + + cur = eventPath[i][0]; + event.type = eventPath[i][1]; + + handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); + if ( handle ) { + handle.apply( cur, data ); + } + // Note that this is a bare JS function and not a jQuery handler + handle = ontype && cur[ ontype ]; + if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) { + event.preventDefault(); + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) && + !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name name as the event. + // Can't use an .isFunction() check here because IE6/7 fails that test. + // Don't do default actions on window, that's where global variables be (#6170) + // IE<9 dies on focus/blur to hidden element (#1486) + if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + old = elem[ ontype ]; + + if ( old ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + elem[ type ](); + jQuery.event.triggered = undefined; + + if ( old ) { + elem[ ontype ] = old; + } + } + } + } + + return event.result; + }, + + dispatch: function( event ) { + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( event || window.event ); + + var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []), + delegateCount = handlers.delegateCount, + args = [].slice.call( arguments, 0 ), + run_all = !event.exclusive && !event.namespace, + handlerQueue = [], + i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[0] = event; + event.delegateTarget = this; + + // Determine handlers that should run if there are delegated events + // Avoid disabled elements in IE (#6911) and non-left-click bubbling in Firefox (#3861) + if ( delegateCount && !event.target.disabled && !(event.button && event.type === "click") ) { + + // Pregenerate a single jQuery object for reuse with .is() + jqcur = jQuery(this); + jqcur.context = this.ownerDocument || this; + + for ( cur = event.target; cur != this; cur = cur.parentNode || this ) { + selMatch = {}; + matches = []; + jqcur[0] = cur; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + sel = handleObj.selector; + + if ( selMatch[ sel ] === undefined ) { + selMatch[ sel ] = ( + handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel ) + ); + } + if ( selMatch[ sel ] ) { + matches.push( handleObj ); + } + } + if ( matches.length ) { + handlerQueue.push({ elem: cur, matches: matches }); + } + } + } + + // Add the remaining (directly-bound) handlers + if ( handlers.length > delegateCount ) { + handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) }); + } + + // Run delegates first; they may want to stop propagation beneath us + for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) { + matched = handlerQueue[ i ]; + event.currentTarget = matched.elem; + + for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) { + handleObj = matched.matches[ j ]; + + // Triggered event must either 1) be non-exclusive and have no namespace, or + // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). + if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) { + + event.data = handleObj.data; + event.handleObj = handleObj; + + ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) + .apply( matched.elem, args ); + + if ( ret !== undefined ) { + event.result = ret; + if ( ret === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + return event.result; + }, + + // Includes some event props shared by KeyEvent and MouseEvent + // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 *** + props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), + + fixHooks: {}, + + keyHooks: { + props: "char charCode key keyCode".split(" "), + filter: function( event, original ) { + + // Add which for key events + if ( event.which == null ) { + event.which = original.charCode != null ? original.charCode : original.keyCode; + } + + return event; + } + }, + + mouseHooks: { + props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), + filter: function( event, original ) { + var eventDoc, doc, body, + button = original.button, + fromElement = original.fromElement; + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && original.clientX != null ) { + eventDoc = event.target.ownerDocument || document; + doc = eventDoc.documentElement; + body = eventDoc.body; + + event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); + event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && fromElement ) { + event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && button !== undefined ) { + event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); + } + + return event; + } + }, + + fix: function( event ) { + if ( event[ jQuery.expando ] ) { + return event; + } + + // Create a writable copy of the event object and normalize some properties + var i, prop, + originalEvent = event, + fixHook = jQuery.event.fixHooks[ event.type ] || {}, + copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; + + event = jQuery.Event( originalEvent ); + + for ( i = copy.length; i; ) { + prop = copy[ --i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2) + if ( !event.target ) { + event.target = originalEvent.srcElement || document; + } + + // Target should not be a text node (#504, Safari) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8) + if ( event.metaKey === undefined ) { + event.metaKey = event.ctrlKey; + } + + return fixHook.filter? fixHook.filter( event, originalEvent ) : event; + }, + + special: { + ready: { + // Make sure the ready event is setup + setup: jQuery.bindReady + }, + + load: { + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + + focus: { + delegateType: "focusin" + }, + blur: { + delegateType: "focusout" + }, + + beforeunload: { + setup: function( data, namespaces, eventHandle ) { + // We only want to do this special case on windows + if ( jQuery.isWindow( this ) ) { + this.onbeforeunload = eventHandle; + } + }, + + teardown: function( namespaces, eventHandle ) { + if ( this.onbeforeunload === eventHandle ) { + this.onbeforeunload = null; + } + } + } + }, + + simulate: function( type, elem, event, bubble ) { + // Piggyback on a donor event to simulate a different one. + // Fake originalEvent to avoid donor's stopPropagation, but if the + // simulated event prevents default then we do the same on the donor. + var e = jQuery.extend( + new jQuery.Event(), + event, + { type: type, + isSimulated: true, + originalEvent: {} + } + ); + if ( bubble ) { + jQuery.event.trigger( e, null, elem ); + } else { + jQuery.event.dispatch.call( elem, e ); + } + if ( e.isDefaultPrevented() ) { + event.preventDefault(); + } + } +}; + +// Some plugins are using, but it's undocumented/deprecated and will be removed. +// The 1.7 special event interface should provide all the hooks needed now. +jQuery.event.handle = jQuery.event.dispatch; + +jQuery.removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle, false ); + } + } : + function( elem, type, handle ) { + if ( elem.detachEvent ) { + elem.detachEvent( "on" + type, handle ); + } + }; + +jQuery.Event = function( src, props ) { + // Allow instantiation without the 'new' keyword + if ( !(this instanceof jQuery.Event) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || + src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +function returnFalse() { + return false; +} +function returnTrue() { + return true; +} + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + preventDefault: function() { + this.isDefaultPrevented = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + + // if preventDefault exists run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + + // otherwise set the returnValue property of the original event to false (IE) + } else { + e.returnValue = false; + } + }, + stopPropagation: function() { + this.isPropagationStopped = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + // if stopPropagation exists run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + // otherwise set the cancelBubble property of the original event to true (IE) + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + }, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse +}; + +// Create mouseenter/leave events using mouseover/out and event-time checks +jQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var target = this, + related = event.relatedTarget, + handleObj = event.handleObj, + selector = handleObj.selector, + ret; + + // For mousenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || (related !== target && !jQuery.contains( target, related )) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +}); + +// IE submit delegation +if ( !jQuery.support.submitBubbles ) { + + jQuery.event.special.submit = { + setup: function() { + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Lazy-add a submit handler when a descendant form may potentially be submitted + jQuery.event.add( this, "click._submit keypress._submit", function( e ) { + // Node name check avoids a VML-related crash in IE (#9807) + var elem = e.target, + form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; + if ( form && !form._submit_attached ) { + jQuery.event.add( form, "submit._submit", function( event ) { + // If form was submitted by the user, bubble the event up the tree + if ( this.parentNode && !event.isTrigger ) { + jQuery.event.simulate( "submit", this.parentNode, event, true ); + } + }); + form._submit_attached = true; + } + }); + // return undefined since we don't need an event listener + }, + + teardown: function() { + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Remove delegated handlers; cleanData eventually reaps submit handlers attached above + jQuery.event.remove( this, "._submit" ); + } + }; +} + +// IE change delegation and checkbox/radio fix +if ( !jQuery.support.changeBubbles ) { + + jQuery.event.special.change = { + + setup: function() { + + if ( rformElems.test( this.nodeName ) ) { + // IE doesn't fire change on a check/radio until blur; trigger it on click + // after a propertychange. Eat the blur-change in special.change.handle. + // This still fires onchange a second time for check/radio after blur. + if ( this.type === "checkbox" || this.type === "radio" ) { + jQuery.event.add( this, "propertychange._change", function( event ) { + if ( event.originalEvent.propertyName === "checked" ) { + this._just_changed = true; + } + }); + jQuery.event.add( this, "click._change", function( event ) { + if ( this._just_changed && !event.isTrigger ) { + this._just_changed = false; + jQuery.event.simulate( "change", this, event, true ); + } + }); + } + return false; + } + // Delegated event; lazy-add a change handler on descendant inputs + jQuery.event.add( this, "beforeactivate._change", function( e ) { + var elem = e.target; + + if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) { + jQuery.event.add( elem, "change._change", function( event ) { + if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { + jQuery.event.simulate( "change", this.parentNode, event, true ); + } + }); + elem._change_attached = true; + } + }); + }, + + handle: function( event ) { + var elem = event.target; + + // Swallow native change events from checkbox/radio, we already triggered them above + if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { + return event.handleObj.handler.apply( this, arguments ); + } + }, + + teardown: function() { + jQuery.event.remove( this, "._change" ); + + return rformElems.test( this.nodeName ); + } + }; +} + +// Create "bubbling" focus and blur events +if ( !jQuery.support.focusinBubbles ) { + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler while someone wants focusin/focusout + var attaches = 0, + handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + if ( attaches++ === 0 ) { + document.addEventListener( orig, handler, true ); + } + }, + teardown: function() { + if ( --attaches === 0 ) { + document.removeEventListener( orig, handler, true ); + } + } + }; + }); +} + +jQuery.fn.extend({ + + on: function( types, selector, data, fn, /*INTERNAL*/ one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + // ( types-Object, data ) + data = selector; + selector = undefined; + } + for ( type in types ) { + this.on( type, selector, data, types[ type ], one ); + } + return this; + } + + if ( data == null && fn == null ) { + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return this; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return this.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + }); + }, + one: function( types, selector, data, fn ) { + return this.on.call( this, types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + if ( types && types.preventDefault && types.handleObj ) { + // ( event ) dispatched jQuery.Event + var handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace? handleObj.type + "." + handleObj.namespace : handleObj.type, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + // ( types-object [, selector] ) + for ( var type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each(function() { + jQuery.event.remove( this, types, fn, selector ); + }); + }, + + bind: function( types, data, fn ) { + return this.on( types, null, data, fn ); + }, + unbind: function( types, fn ) { + return this.off( types, null, fn ); + }, + + live: function( types, data, fn ) { + jQuery( this.context ).on( types, this.selector, data, fn ); + return this; + }, + die: function( types, fn ) { + jQuery( this.context ).off( types, this.selector || "**", fn ); + return this; + }, + + delegate: function( selector, types, data, fn ) { + return this.on( types, selector, data, fn ); + }, + undelegate: function( selector, types, fn ) { + // ( namespace ) or ( selector, types [, fn] ) + return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn ); + }, + + trigger: function( type, data ) { + return this.each(function() { + jQuery.event.trigger( type, data, this ); + }); + }, + triggerHandler: function( type, data ) { + if ( this[0] ) { + return jQuery.event.trigger( type, data, this[0], true ); + } + }, + + toggle: function( fn ) { + // Save reference to arguments for access in closure + var args = arguments, + guid = fn.guid || jQuery.guid++, + i = 0, + toggler = function( event ) { + // Figure out which function to execute + var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; + jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); + + // Make sure that clicks stop + event.preventDefault(); + + // and execute the function + return args[ lastToggle ].apply( this, arguments ) || false; + }; + + // link all the functions, so any of them can unbind this click handler + toggler.guid = guid; + while ( i < args.length ) { + args[ i++ ].guid = guid; + } + + return this.click( toggler ); + }, + + hover: function( fnOver, fnOut ) { + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + } +}); + +jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + + "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { + + // Handle event binding + jQuery.fn[ name ] = function( data, fn ) { + if ( fn == null ) { + fn = data; + data = null; + } + + return arguments.length > 0 ? + this.on( name, null, data, fn ) : + this.trigger( name ); + }; + + if ( jQuery.attrFn ) { + jQuery.attrFn[ name ] = true; + } + + if ( rkeyEvent.test( name ) ) { + jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks; + } + + if ( rmouseEvent.test( name ) ) { + jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks; + } +}); + + + +/*! + * Sizzle CSS Selector Engine + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){ + +var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, + expando = "sizcache" + (Math.random() + '').replace('.', ''), + done = 0, + toString = Object.prototype.toString, + hasDuplicate = false, + baseHasDuplicate = true, + rBackslash = /\\/g, + rReturn = /\r\n/g, + rNonWord = /\W/; + +// Here we check if the JavaScript engine is using some sort of +// optimization where it does not always call our comparision +// function. If that is the case, discard the hasDuplicate value. +// Thus far that includes Google Chrome. +[0, 0].sort(function() { + baseHasDuplicate = false; + return 0; +}); + +var Sizzle = function( selector, context, results, seed ) { + results = results || []; + context = context || document; + + var origContext = context; + + if ( context.nodeType !== 1 && context.nodeType !== 9 ) { + return []; + } + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + var m, set, checkSet, extra, ret, cur, pop, i, + prune = true, + contextXML = Sizzle.isXML( context ), + parts = [], + soFar = selector; + + // Reset the position of the chunker regexp (start from head) + do { + chunker.exec( "" ); + m = chunker.exec( soFar ); + + if ( m ) { + soFar = m[3]; + + parts.push( m[1] ); + + if ( m[2] ) { + extra = m[3]; + break; + } + } + } while ( m ); + + if ( parts.length > 1 && origPOS.exec( selector ) ) { + + if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { + set = posProcess( parts[0] + parts[1], context, seed ); + + } else { + set = Expr.relative[ parts[0] ] ? + [ context ] : + Sizzle( parts.shift(), context ); + + while ( parts.length ) { + selector = parts.shift(); + + if ( Expr.relative[ selector ] ) { + selector += parts.shift(); + } + + set = posProcess( selector, set, seed ); + } + } + + } else { + // Take a shortcut and set the context if the root selector is an ID + // (but not if it'll be faster if the inner selector is an ID) + if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && + Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { + + ret = Sizzle.find( parts.shift(), context, contextXML ); + context = ret.expr ? + Sizzle.filter( ret.expr, ret.set )[0] : + ret.set[0]; + } + + if ( context ) { + ret = seed ? + { expr: parts.pop(), set: makeArray(seed) } : + Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); + + set = ret.expr ? + Sizzle.filter( ret.expr, ret.set ) : + ret.set; + + if ( parts.length > 0 ) { + checkSet = makeArray( set ); + + } else { + prune = false; + } + + while ( parts.length ) { + cur = parts.pop(); + pop = cur; + + if ( !Expr.relative[ cur ] ) { + cur = ""; + } else { + pop = parts.pop(); + } + + if ( pop == null ) { + pop = context; + } + + Expr.relative[ cur ]( checkSet, pop, contextXML ); + } + + } else { + checkSet = parts = []; + } + } + + if ( !checkSet ) { + checkSet = set; + } + + if ( !checkSet ) { + Sizzle.error( cur || selector ); + } + + if ( toString.call(checkSet) === "[object Array]" ) { + if ( !prune ) { + results.push.apply( results, checkSet ); + + } else if ( context && context.nodeType === 1 ) { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { + results.push( set[i] ); + } + } + + } else { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && checkSet[i].nodeType === 1 ) { + results.push( set[i] ); + } + } + } + + } else { + makeArray( checkSet, results ); + } + + if ( extra ) { + Sizzle( extra, origContext, results, seed ); + Sizzle.uniqueSort( results ); + } + + return results; +}; + +Sizzle.uniqueSort = function( results ) { + if ( sortOrder ) { + hasDuplicate = baseHasDuplicate; + results.sort( sortOrder ); + + if ( hasDuplicate ) { + for ( var i = 1; i < results.length; i++ ) { + if ( results[i] === results[ i - 1 ] ) { + results.splice( i--, 1 ); + } + } + } + } + + return results; +}; + +Sizzle.matches = function( expr, set ) { + return Sizzle( expr, null, null, set ); +}; + +Sizzle.matchesSelector = function( node, expr ) { + return Sizzle( expr, null, null, [node] ).length > 0; +}; + +Sizzle.find = function( expr, context, isXML ) { + var set, i, len, match, type, left; + + if ( !expr ) { + return []; + } + + for ( i = 0, len = Expr.order.length; i < len; i++ ) { + type = Expr.order[i]; + + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { + left = match[1]; + match.splice( 1, 1 ); + + if ( left.substr( left.length - 1 ) !== "\\" ) { + match[1] = (match[1] || "").replace( rBackslash, "" ); + set = Expr.find[ type ]( match, context, isXML ); + + if ( set != null ) { + expr = expr.replace( Expr.match[ type ], "" ); + break; + } + } + } + } + + if ( !set ) { + set = typeof context.getElementsByTagName !== "undefined" ? + context.getElementsByTagName( "*" ) : + []; + } + + return { set: set, expr: expr }; +}; + +Sizzle.filter = function( expr, set, inplace, not ) { + var match, anyFound, + type, found, item, filter, left, + i, pass, + old = expr, + result = [], + curLoop = set, + isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); + + while ( expr && set.length ) { + for ( type in Expr.filter ) { + if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { + filter = Expr.filter[ type ]; + left = match[1]; + + anyFound = false; + + match.splice(1,1); + + if ( left.substr( left.length - 1 ) === "\\" ) { + continue; + } + + if ( curLoop === result ) { + result = []; + } + + if ( Expr.preFilter[ type ] ) { + match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); + + if ( !match ) { + anyFound = found = true; + + } else if ( match === true ) { + continue; + } + } + + if ( match ) { + for ( i = 0; (item = curLoop[i]) != null; i++ ) { + if ( item ) { + found = filter( item, match, i, curLoop ); + pass = not ^ found; + + if ( inplace && found != null ) { + if ( pass ) { + anyFound = true; + + } else { + curLoop[i] = false; + } + + } else if ( pass ) { + result.push( item ); + anyFound = true; + } + } + } + } + + if ( found !== undefined ) { + if ( !inplace ) { + curLoop = result; + } + + expr = expr.replace( Expr.match[ type ], "" ); + + if ( !anyFound ) { + return []; + } + + break; + } + } + } + + // Improper expression + if ( expr === old ) { + if ( anyFound == null ) { + Sizzle.error( expr ); + + } else { + break; + } + } + + old = expr; + } + + return curLoop; +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Utility function for retreiving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +var getText = Sizzle.getText = function( elem ) { + var i, node, + nodeType = elem.nodeType, + ret = ""; + + if ( nodeType ) { + if ( nodeType === 1 || nodeType === 9 ) { + // Use textContent || innerText for elements + if ( typeof elem.textContent === 'string' ) { + return elem.textContent; + } else if ( typeof elem.innerText === 'string' ) { + // Replace IE's carriage returns + return elem.innerText.replace( rReturn, '' ); + } else { + // Traverse it's children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + } else { + + // If no nodeType, this is expected to be an array + for ( i = 0; (node = elem[i]); i++ ) { + // Do not traverse comment nodes + if ( node.nodeType !== 8 ) { + ret += getText( node ); + } + } + } + return ret; +}; + +var Expr = Sizzle.selectors = { + order: [ "ID", "NAME", "TAG" ], + + match: { + ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, + ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, + TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, + CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, + POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, + PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ + }, + + leftMatch: {}, + + attrMap: { + "class": "className", + "for": "htmlFor" + }, + + attrHandle: { + href: function( elem ) { + return elem.getAttribute( "href" ); + }, + type: function( elem ) { + return elem.getAttribute( "type" ); + } + }, + + relative: { + "+": function(checkSet, part){ + var isPartStr = typeof part === "string", + isTag = isPartStr && !rNonWord.test( part ), + isPartStrNotTag = isPartStr && !isTag; + + if ( isTag ) { + part = part.toLowerCase(); + } + + for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { + if ( (elem = checkSet[i]) ) { + while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} + + checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? + elem || false : + elem === part; + } + } + + if ( isPartStrNotTag ) { + Sizzle.filter( part, checkSet, true ); + } + }, + + ">": function( checkSet, part ) { + var elem, + isPartStr = typeof part === "string", + i = 0, + l = checkSet.length; + + if ( isPartStr && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + var parent = elem.parentNode; + checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; + } + } + + } else { + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + checkSet[i] = isPartStr ? + elem.parentNode : + elem.parentNode === part; + } + } + + if ( isPartStr ) { + Sizzle.filter( part, checkSet, true ); + } + } + }, + + "": function(checkSet, part, isXML){ + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); + }, + + "~": function( checkSet, part, isXML ) { + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !rNonWord.test( part ) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); + } + }, + + find: { + ID: function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [m] : []; + } + }, + + NAME: function( match, context ) { + if ( typeof context.getElementsByName !== "undefined" ) { + var ret = [], + results = context.getElementsByName( match[1] ); + + for ( var i = 0, l = results.length; i < l; i++ ) { + if ( results[i].getAttribute("name") === match[1] ) { + ret.push( results[i] ); + } + } + + return ret.length === 0 ? null : ret; + } + }, + + TAG: function( match, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( match[1] ); + } + } + }, + preFilter: { + CLASS: function( match, curLoop, inplace, result, not, isXML ) { + match = " " + match[1].replace( rBackslash, "" ) + " "; + + if ( isXML ) { + return match; + } + + for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { + if ( elem ) { + if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { + if ( !inplace ) { + result.push( elem ); + } + + } else if ( inplace ) { + curLoop[i] = false; + } + } + } + + return false; + }, + + ID: function( match ) { + return match[1].replace( rBackslash, "" ); + }, + + TAG: function( match, curLoop ) { + return match[1].replace( rBackslash, "" ).toLowerCase(); + }, + + CHILD: function( match ) { + if ( match[1] === "nth" ) { + if ( !match[2] ) { + Sizzle.error( match[0] ); + } + + match[2] = match[2].replace(/^\+|\s*/g, ''); + + // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' + var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( + match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || + !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); + + // calculate the numbers (first)n+(last) including if they are negative + match[2] = (test[1] + (test[2] || 1)) - 0; + match[3] = test[3] - 0; + } + else if ( match[2] ) { + Sizzle.error( match[0] ); + } + + // TODO: Move to normal caching system + match[0] = done++; + + return match; + }, + + ATTR: function( match, curLoop, inplace, result, not, isXML ) { + var name = match[1] = match[1].replace( rBackslash, "" ); + + if ( !isXML && Expr.attrMap[name] ) { + match[1] = Expr.attrMap[name]; + } + + // Handle if an un-quoted value was used + match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); + + if ( match[2] === "~=" ) { + match[4] = " " + match[4] + " "; + } + + return match; + }, + + PSEUDO: function( match, curLoop, inplace, result, not ) { + if ( match[1] === "not" ) { + // If we're dealing with a complex expression, or a simple one + if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { + match[3] = Sizzle(match[3], null, null, curLoop); + + } else { + var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); + + if ( !inplace ) { + result.push.apply( result, ret ); + } + + return false; + } + + } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { + return true; + } + + return match; + }, + + POS: function( match ) { + match.unshift( true ); + + return match; + } + }, + + filters: { + enabled: function( elem ) { + return elem.disabled === false && elem.type !== "hidden"; + }, + + disabled: function( elem ) { + return elem.disabled === true; + }, + + checked: function( elem ) { + return elem.checked === true; + }, + + selected: function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + parent: function( elem ) { + return !!elem.firstChild; + }, + + empty: function( elem ) { + return !elem.firstChild; + }, + + has: function( elem, i, match ) { + return !!Sizzle( match[3], elem ).length; + }, + + header: function( elem ) { + return (/h\d/i).test( elem.nodeName ); + }, + + text: function( elem ) { + var attr = elem.getAttribute( "type" ), type = elem.type; + // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) + // use getAttribute instead to test this case + return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); + }, + + radio: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type; + }, + + checkbox: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type; + }, + + file: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "file" === elem.type; + }, + + password: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "password" === elem.type; + }, + + submit: function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && "submit" === elem.type; + }, + + image: function( elem ) { + return elem.nodeName.toLowerCase() === "input" && "image" === elem.type; + }, + + reset: function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && "reset" === elem.type; + }, + + button: function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && "button" === elem.type || name === "button"; + }, + + input: function( elem ) { + return (/input|select|textarea|button/i).test( elem.nodeName ); + }, + + focus: function( elem ) { + return elem === elem.ownerDocument.activeElement; + } + }, + setFilters: { + first: function( elem, i ) { + return i === 0; + }, + + last: function( elem, i, match, array ) { + return i === array.length - 1; + }, + + even: function( elem, i ) { + return i % 2 === 0; + }, + + odd: function( elem, i ) { + return i % 2 === 1; + }, + + lt: function( elem, i, match ) { + return i < match[3] - 0; + }, + + gt: function( elem, i, match ) { + return i > match[3] - 0; + }, + + nth: function( elem, i, match ) { + return match[3] - 0 === i; + }, + + eq: function( elem, i, match ) { + return match[3] - 0 === i; + } + }, + filter: { + PSEUDO: function( elem, match, i, array ) { + var name = match[1], + filter = Expr.filters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + + } else if ( name === "contains" ) { + return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0; + + } else if ( name === "not" ) { + var not = match[3]; + + for ( var j = 0, l = not.length; j < l; j++ ) { + if ( not[j] === elem ) { + return false; + } + } + + return true; + + } else { + Sizzle.error( name ); + } + }, + + CHILD: function( elem, match ) { + var first, last, + doneName, parent, cache, + count, diff, + type = match[1], + node = elem; + + switch ( type ) { + case "only": + case "first": + while ( (node = node.previousSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + if ( type === "first" ) { + return true; + } + + node = elem; + + case "last": + while ( (node = node.nextSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + return true; + + case "nth": + first = match[2]; + last = match[3]; + + if ( first === 1 && last === 0 ) { + return true; + } + + doneName = match[0]; + parent = elem.parentNode; + + if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) { + count = 0; + + for ( node = parent.firstChild; node; node = node.nextSibling ) { + if ( node.nodeType === 1 ) { + node.nodeIndex = ++count; + } + } + + parent[ expando ] = doneName; + } + + diff = elem.nodeIndex - last; + + if ( first === 0 ) { + return diff === 0; + + } else { + return ( diff % first === 0 && diff / first >= 0 ); + } + } + }, + + ID: function( elem, match ) { + return elem.nodeType === 1 && elem.getAttribute("id") === match; + }, + + TAG: function( elem, match ) { + return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match; + }, + + CLASS: function( elem, match ) { + return (" " + (elem.className || elem.getAttribute("class")) + " ") + .indexOf( match ) > -1; + }, + + ATTR: function( elem, match ) { + var name = match[1], + result = Sizzle.attr ? + Sizzle.attr( elem, name ) : + Expr.attrHandle[ name ] ? + Expr.attrHandle[ name ]( elem ) : + elem[ name ] != null ? + elem[ name ] : + elem.getAttribute( name ), + value = result + "", + type = match[2], + check = match[4]; + + return result == null ? + type === "!=" : + !type && Sizzle.attr ? + result != null : + type === "=" ? + value === check : + type === "*=" ? + value.indexOf(check) >= 0 : + type === "~=" ? + (" " + value + " ").indexOf(check) >= 0 : + !check ? + value && result !== false : + type === "!=" ? + value !== check : + type === "^=" ? + value.indexOf(check) === 0 : + type === "$=" ? + value.substr(value.length - check.length) === check : + type === "|=" ? + value === check || value.substr(0, check.length + 1) === check + "-" : + false; + }, + + POS: function( elem, match, i, array ) { + var name = match[2], + filter = Expr.setFilters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + } + } + } +}; + +var origPOS = Expr.match.POS, + fescape = function(all, num){ + return "\\" + (num - 0 + 1); + }; + +for ( var type in Expr.match ) { + Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); + Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); +} + +var makeArray = function( array, results ) { + array = Array.prototype.slice.call( array, 0 ); + + if ( results ) { + results.push.apply( results, array ); + return results; + } + + return array; +}; + +// Perform a simple check to determine if the browser is capable of +// converting a NodeList to an array using builtin methods. +// Also verifies that the returned array holds DOM nodes +// (which is not the case in the Blackberry browser) +try { + Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; + +// Provide a fallback method if it does not work +} catch( e ) { + makeArray = function( array, results ) { + var i = 0, + ret = results || []; + + if ( toString.call(array) === "[object Array]" ) { + Array.prototype.push.apply( ret, array ); + + } else { + if ( typeof array.length === "number" ) { + for ( var l = array.length; i < l; i++ ) { + ret.push( array[i] ); + } + + } else { + for ( ; array[i]; i++ ) { + ret.push( array[i] ); + } + } + } + + return ret; + }; +} + +var sortOrder, siblingCheck; + +if ( document.documentElement.compareDocumentPosition ) { + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { + return a.compareDocumentPosition ? -1 : 1; + } + + return a.compareDocumentPosition(b) & 4 ? -1 : 1; + }; + +} else { + sortOrder = function( a, b ) { + // The nodes are identical, we can exit early + if ( a === b ) { + hasDuplicate = true; + return 0; + + // Fallback to using sourceIndex (in IE) if it's available on both nodes + } else if ( a.sourceIndex && b.sourceIndex ) { + return a.sourceIndex - b.sourceIndex; + } + + var al, bl, + ap = [], + bp = [], + aup = a.parentNode, + bup = b.parentNode, + cur = aup; + + // If the nodes are siblings (or identical) we can do a quick check + if ( aup === bup ) { + return siblingCheck( a, b ); + + // If no parents were found then the nodes are disconnected + } else if ( !aup ) { + return -1; + + } else if ( !bup ) { + return 1; + } + + // Otherwise they're somewhere else in the tree so we need + // to build up a full list of the parentNodes for comparison + while ( cur ) { + ap.unshift( cur ); + cur = cur.parentNode; + } + + cur = bup; + + while ( cur ) { + bp.unshift( cur ); + cur = cur.parentNode; + } + + al = ap.length; + bl = bp.length; + + // Start walking down the tree looking for a discrepancy + for ( var i = 0; i < al && i < bl; i++ ) { + if ( ap[i] !== bp[i] ) { + return siblingCheck( ap[i], bp[i] ); + } + } + + // We ended someplace up the tree so do a sibling check + return i === al ? + siblingCheck( a, bp[i], -1 ) : + siblingCheck( ap[i], b, 1 ); + }; + + siblingCheck = function( a, b, ret ) { + if ( a === b ) { + return ret; + } + + var cur = a.nextSibling; + + while ( cur ) { + if ( cur === b ) { + return -1; + } + + cur = cur.nextSibling; + } + + return 1; + }; +} + +// Check to see if the browser returns elements by name when +// querying by getElementById (and provide a workaround) +(function(){ + // We're going to inject a fake input element with a specified name + var form = document.createElement("div"), + id = "script" + (new Date()).getTime(), + root = document.documentElement; + + form.innerHTML = ""; + + // Inject it into the root element, check its status, and remove it quickly + root.insertBefore( form, root.firstChild ); + + // The workaround has to do additional checks after a getElementById + // Which slows things down for other browsers (hence the branching) + if ( document.getElementById( id ) ) { + Expr.find.ID = function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + + return m ? + m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? + [m] : + undefined : + []; + } + }; + + Expr.filter.ID = function( elem, match ) { + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + + return elem.nodeType === 1 && node && node.nodeValue === match; + }; + } + + root.removeChild( form ); + + // release memory in IE + root = form = null; +})(); + +(function(){ + // Check to see if the browser returns only elements + // when doing getElementsByTagName("*") + + // Create a fake element + var div = document.createElement("div"); + div.appendChild( document.createComment("") ); + + // Make sure no comments are found + if ( div.getElementsByTagName("*").length > 0 ) { + Expr.find.TAG = function( match, context ) { + var results = context.getElementsByTagName( match[1] ); + + // Filter out possible comments + if ( match[1] === "*" ) { + var tmp = []; + + for ( var i = 0; results[i]; i++ ) { + if ( results[i].nodeType === 1 ) { + tmp.push( results[i] ); + } + } + + results = tmp; + } + + return results; + }; + } + + // Check to see if an attribute returns normalized href attributes + div.innerHTML = ""; + + if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && + div.firstChild.getAttribute("href") !== "#" ) { + + Expr.attrHandle.href = function( elem ) { + return elem.getAttribute( "href", 2 ); + }; + } + + // release memory in IE + div = null; +})(); + +if ( document.querySelectorAll ) { + (function(){ + var oldSizzle = Sizzle, + div = document.createElement("div"), + id = "__sizzle__"; + + div.innerHTML = "

"; + + // Safari can't handle uppercase or unicode characters when + // in quirks mode. + if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { + return; + } + + Sizzle = function( query, context, extra, seed ) { + context = context || document; + + // Only use querySelectorAll on non-XML documents + // (ID selectors don't work in non-HTML documents) + if ( !seed && !Sizzle.isXML(context) ) { + // See if we find a selector to speed up + var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); + + if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { + // Speed-up: Sizzle("TAG") + if ( match[1] ) { + return makeArray( context.getElementsByTagName( query ), extra ); + + // Speed-up: Sizzle(".CLASS") + } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { + return makeArray( context.getElementsByClassName( match[2] ), extra ); + } + } + + if ( context.nodeType === 9 ) { + // Speed-up: Sizzle("body") + // The body element only exists once, optimize finding it + if ( query === "body" && context.body ) { + return makeArray( [ context.body ], extra ); + + // Speed-up: Sizzle("#ID") + } else if ( match && match[3] ) { + var elem = context.getElementById( match[3] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id === match[3] ) { + return makeArray( [ elem ], extra ); + } + + } else { + return makeArray( [], extra ); + } + } + + try { + return makeArray( context.querySelectorAll(query), extra ); + } catch(qsaError) {} + + // qSA works strangely on Element-rooted queries + // We can work around this by specifying an extra ID on the root + // and working up from there (Thanks to Andrew Dupont for the technique) + // IE 8 doesn't work on object elements + } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { + var oldContext = context, + old = context.getAttribute( "id" ), + nid = old || id, + hasParent = context.parentNode, + relativeHierarchySelector = /^\s*[+~]/.test( query ); + + if ( !old ) { + context.setAttribute( "id", nid ); + } else { + nid = nid.replace( /'/g, "\\$&" ); + } + if ( relativeHierarchySelector && hasParent ) { + context = context.parentNode; + } + + try { + if ( !relativeHierarchySelector || hasParent ) { + return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); + } + + } catch(pseudoError) { + } finally { + if ( !old ) { + oldContext.removeAttribute( "id" ); + } + } + } + } + + return oldSizzle(query, context, extra, seed); + }; + + for ( var prop in oldSizzle ) { + Sizzle[ prop ] = oldSizzle[ prop ]; + } + + // release memory in IE + div = null; + })(); +} + +(function(){ + var html = document.documentElement, + matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector; + + if ( matches ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9 fails this) + var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ), + pseudoWorks = false; + + try { + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( document.documentElement, "[test!='']:sizzle" ); + + } catch( pseudoError ) { + pseudoWorks = true; + } + + Sizzle.matchesSelector = function( node, expr ) { + // Make sure that attribute selectors are quoted + expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); + + if ( !Sizzle.isXML( node ) ) { + try { + if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { + var ret = matches.call( node, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || !disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9, so check for that + node.document && node.document.nodeType !== 11 ) { + return ret; + } + } + } catch(e) {} + } + + return Sizzle(expr, null, null, [node]).length > 0; + }; + } +})(); + +(function(){ + var div = document.createElement("div"); + + div.innerHTML = "
"; + + // Opera can't find a second classname (in 9.6) + // Also, make sure that getElementsByClassName actually exists + if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { + return; + } + + // Safari caches class attributes, doesn't catch changes (in 3.2) + div.lastChild.className = "e"; + + if ( div.getElementsByClassName("e").length === 1 ) { + return; + } + + Expr.order.splice(1, 0, "CLASS"); + Expr.find.CLASS = function( match, context, isXML ) { + if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { + return context.getElementsByClassName(match[1]); + } + }; + + // release memory in IE + div = null; +})(); + +function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem[ expando ] === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 && !isXML ){ + elem[ expando ] = doneName; + elem.sizset = i; + } + + if ( elem.nodeName.toLowerCase() === cur ) { + match = elem; + break; + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem[ expando ] === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 ) { + if ( !isXML ) { + elem[ expando ] = doneName; + elem.sizset = i; + } + + if ( typeof cur !== "string" ) { + if ( elem === cur ) { + match = true; + break; + } + + } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { + match = elem; + break; + } + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +if ( document.documentElement.contains ) { + Sizzle.contains = function( a, b ) { + return a !== b && (a.contains ? a.contains(b) : true); + }; + +} else if ( document.documentElement.compareDocumentPosition ) { + Sizzle.contains = function( a, b ) { + return !!(a.compareDocumentPosition(b) & 16); + }; + +} else { + Sizzle.contains = function() { + return false; + }; +} + +Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; + + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +var posProcess = function( selector, context, seed ) { + var match, + tmpSet = [], + later = "", + root = context.nodeType ? [context] : context; + + // Position selectors must be done after the filter + // And so must :not(positional) so we move all PSEUDOs to the end + while ( (match = Expr.match.PSEUDO.exec( selector )) ) { + later += match[0]; + selector = selector.replace( Expr.match.PSEUDO, "" ); + } + + selector = Expr.relative[selector] ? selector + "*" : selector; + + for ( var i = 0, l = root.length; i < l; i++ ) { + Sizzle( selector, root[i], tmpSet, seed ); + } + + return Sizzle.filter( later, tmpSet ); +}; + +// EXPOSE +// Override sizzle attribute retrieval +Sizzle.attr = jQuery.attr; +Sizzle.selectors.attrMap = {}; +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[":"] = jQuery.expr.filters; +jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + +})(); + + +var runtil = /Until$/, + rparentsprev = /^(?:parents|prevUntil|prevAll)/, + // Note: This RegExp should be improved, or likely pulled from Sizzle + rmultiselector = /,/, + isSimple = /^.[^:#\[\.,]*$/, + slice = Array.prototype.slice, + POS = jQuery.expr.match.POS, + // methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend({ + find: function( selector ) { + var self = this, + i, l; + + if ( typeof selector !== "string" ) { + return jQuery( selector ).filter(function() { + for ( i = 0, l = self.length; i < l; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + }); + } + + var ret = this.pushStack( "", "find", selector ), + length, n, r; + + for ( i = 0, l = this.length; i < l; i++ ) { + length = ret.length; + jQuery.find( selector, this[i], ret ); + + if ( i > 0 ) { + // Make sure that the results are unique + for ( n = length; n < ret.length; n++ ) { + for ( r = 0; r < length; r++ ) { + if ( ret[r] === ret[n] ) { + ret.splice(n--, 1); + break; + } + } + } + } + } + + return ret; + }, + + has: function( target ) { + var targets = jQuery( target ); + return this.filter(function() { + for ( var i = 0, l = targets.length; i < l; i++ ) { + if ( jQuery.contains( this, targets[i] ) ) { + return true; + } + } + }); + }, + + not: function( selector ) { + return this.pushStack( winnow(this, selector, false), "not", selector); + }, + + filter: function( selector ) { + return this.pushStack( winnow(this, selector, true), "filter", selector ); + }, + + is: function( selector ) { + return !!selector && ( + typeof selector === "string" ? + // If this is a positional selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + POS.test( selector ) ? + jQuery( selector, this.context ).index( this[0] ) >= 0 : + jQuery.filter( selector, this ).length > 0 : + this.filter( selector ).length > 0 ); + }, + + closest: function( selectors, context ) { + var ret = [], i, l, cur = this[0]; + + // Array (deprecated as of jQuery 1.7) + if ( jQuery.isArray( selectors ) ) { + var level = 1; + + while ( cur && cur.ownerDocument && cur !== context ) { + for ( i = 0; i < selectors.length; i++ ) { + + if ( jQuery( cur ).is( selectors[ i ] ) ) { + ret.push({ selector: selectors[ i ], elem: cur, level: level }); + } + } + + cur = cur.parentNode; + level++; + } + + return ret; + } + + // String + var pos = POS.test( selectors ) || typeof selectors !== "string" ? + jQuery( selectors, context || this.context ) : + 0; + + for ( i = 0, l = this.length; i < l; i++ ) { + cur = this[i]; + + while ( cur ) { + if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { + ret.push( cur ); + break; + + } else { + cur = cur.parentNode; + if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) { + break; + } + } + } + } + + ret = ret.length > 1 ? jQuery.unique( ret ) : ret; + + return this.pushStack( ret, "closest", selectors ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1; + } + + // index in selector + if ( typeof elem === "string" ) { + return jQuery.inArray( this[0], jQuery( elem ) ); + } + + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[0] : elem, this ); + }, + + add: function( selector, context ) { + var set = typeof selector === "string" ? + jQuery( selector, context ) : + jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), + all = jQuery.merge( this.get(), set ); + + return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? + all : + jQuery.unique( all ) ); + }, + + andSelf: function() { + return this.add( this.prevObject ); + } +}); + +// A painfully simple check to see if an element is disconnected +// from a document (should be improved, where feasible). +function isDisconnected( node ) { + return !node || !node.parentNode || node.parentNode.nodeType === 11; +} + +jQuery.each({ + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return jQuery.dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return jQuery.dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return jQuery.nth( elem, 2, "nextSibling" ); + }, + prev: function( elem ) { + return jQuery.nth( elem, 2, "previousSibling" ); + }, + nextAll: function( elem ) { + return jQuery.dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return jQuery.dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return jQuery.dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return jQuery.dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return jQuery.sibling( elem.parentNode.firstChild, elem ); + }, + children: function( elem ) { + return jQuery.sibling( elem.firstChild ); + }, + contents: function( elem ) { + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.makeArray( elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var ret = jQuery.map( this, fn, until ); + + if ( !runtil.test( name ) ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = jQuery.filter( selector, ret ); + } + + ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; + + if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + + return this.pushStack( ret, name, slice.call( arguments ).join(",") ); + }; +}); + +jQuery.extend({ + filter: function( expr, elems, not ) { + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 ? + jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : + jQuery.find.matches(expr, elems); + }, + + dir: function( elem, dir, until ) { + var matched = [], + cur = elem[ dir ]; + + while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { + if ( cur.nodeType === 1 ) { + matched.push( cur ); + } + cur = cur[dir]; + } + return matched; + }, + + nth: function( cur, result, dir, elem ) { + result = result || 1; + var num = 0; + + for ( ; cur; cur = cur[dir] ) { + if ( cur.nodeType === 1 && ++num === result ) { + break; + } + } + + return cur; + }, + + sibling: function( n, elem ) { + var r = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + r.push( n ); + } + } + + return r; + } +}); + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, keep ) { + + // Can't pass null or undefined to indexOf in Firefox 4 + // Set to 0 to skip string check + qualifier = qualifier || 0; + + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep(elements, function( elem, i ) { + var retVal = !!qualifier.call( elem, i, elem ); + return retVal === keep; + }); + + } else if ( qualifier.nodeType ) { + return jQuery.grep(elements, function( elem, i ) { + return ( elem === qualifier ) === keep; + }); + + } else if ( typeof qualifier === "string" ) { + var filtered = jQuery.grep(elements, function( elem ) { + return elem.nodeType === 1; + }); + + if ( isSimple.test( qualifier ) ) { + return jQuery.filter(qualifier, filtered, !keep); + } else { + qualifier = jQuery.filter( qualifier, filtered ); + } + } + + return jQuery.grep(elements, function( elem, i ) { + return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; + }); +} + + + + +function createSafeFragment( document ) { + var list = nodeNames.split( "|" ), + safeFrag = document.createDocumentFragment(); + + if ( safeFrag.createElement ) { + while ( list.length ) { + safeFrag.createElement( + list.pop() + ); + } + } + return safeFrag; +} + +var nodeNames = "abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|" + + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", + rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, + rleadingWhitespace = /^\s+/, + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, + rtagName = /<([\w:]+)/, + rtbody = /", "" ], + legend: [ 1, "
", "
" ], + thead: [ 1, "", "
" ], + tr: [ 2, "", "
" ], + td: [ 3, "", "
" ], + col: [ 2, "", "
" ], + area: [ 1, "", "" ], + _default: [ 0, "", "" ] + }, + safeFragment = createSafeFragment( document ); + +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// IE can't serialize and + + {% block script %}{% endblock %} + + + + + +
+ {% block content %} + Contenido + {% endblock %} +
+ + + + + \ No newline at end of file diff --git a/server/src/uds/templates/uds/detectJava.html b/server/src/uds/templates/uds/detectJava.html new file mode 100644 index 000000000..eb52b774a --- /dev/null +++ b/server/src/uds/templates/uds/detectJava.html @@ -0,0 +1,40 @@ +{% extends "uds/base.html" %} +{% load i18n %} +{% load static %} + +{% block title %} +{% trans "Login redirection" %} +{% endblock %} + +{% block script %} + + +{% endblock %} + +{% block top %} + + {% include "uds/snippets/lang.html" %} +{% endblock %} + +{% block content %} + + +{% endblock %} \ No newline at end of file diff --git a/server/src/uds/templates/uds/downloads.html b/server/src/uds/templates/uds/downloads.html new file mode 100644 index 000000000..a48a858ac --- /dev/null +++ b/server/src/uds/templates/uds/downloads.html @@ -0,0 +1,25 @@ +{% extends "uds/internal_page.html" %} +{% load i18n %} +{% load static %} + +{% block content %} +{% spaceless %} +

+{% trans "Downloads" %} +

+
+

{% trans "This page contains a list of downloadables provided by different modules" %}

+
+
+ +
+{% endspaceless %} +{% include "uds/snippets/back_to_list.html" %} +{% endblock %} + diff --git a/server/src/uds/templates/uds/error.html b/server/src/uds/templates/uds/error.html new file mode 100644 index 000000000..a02a6fafb --- /dev/null +++ b/server/src/uds/templates/uds/error.html @@ -0,0 +1,16 @@ +{% extends "uds/internal_page.html" %} +{% load i18n %} +{% load static %} + +{% block title %} +{% trans "Error" %} +{% endblock %} + +{% block content %} +
+{% trans "Error" %}: {{ errorString }} +
+
+
+{% include "uds/snippets/back_to_list.html" %} +{% endblock %} \ No newline at end of file diff --git a/server/src/uds/templates/uds/index.html b/server/src/uds/templates/uds/index.html new file mode 100644 index 000000000..6a428e630 --- /dev/null +++ b/server/src/uds/templates/uds/index.html @@ -0,0 +1,85 @@ +{% extends "uds/internal_page.html" %} +{% load i18n %} +{% load static %} +{% block script %} +{{ block.super }} + +{% endblock script %} + +{% block content %} +
+

{% trans "Services" %}

+
    + {% for ser in services %} + {% if ser.transports %} +
  • + {% with trans=ser.transports|first %} + {{ ser.name }} + {% endwith %} +
      + {% for trans in ser.transports %} +
    • {{ trans.name }}{{ trans.name }}
    • + {% endfor %} +
    +
  • + {% endif %} + {% endfor %} +
+
+{% if not java %} +
+

{% trans "Java is not available on your browser, and the selected transport needs it." %}

+

{% trans "Please, install latest version from" %} {% trans "Java website" %} {% trans "and restart browser" %}

+
+{% endif %} + +{% if user.isStaff %} +
+
{% trans "Ip" %}: {{ ip }} +
{% trans "Networks" %}: {{ nets }}
+
{% trans "Transports" %}: {{ transports }}
+
+ +
+{% endif %} +{% endblock content %} \ No newline at end of file diff --git a/server/src/uds/templates/uds/internal_page.html b/server/src/uds/templates/uds/internal_page.html new file mode 100644 index 000000000..2442219a5 --- /dev/null +++ b/server/src/uds/templates/uds/internal_page.html @@ -0,0 +1,44 @@ +{% extends "uds/base.html" %} +{% load i18n %} +{% load static %} +{% block script %} + +{% endblock script %} +{% block top %} + +
+ {% trans "User" %} {{ user.real_name }} +
+ {% if user.staff_member or user.is_admin %} + {% include "uds/snippets/admin_user.html" %} + {% endif %} + + {% if not nolang %} + {% include "uds/snippets/lang.html" %} + {% endif %} +
+ {% trans "Log out" %} +
+ + +{% endblock top %} diff --git a/server/src/uds/templates/uds/login.html b/server/src/uds/templates/uds/login.html new file mode 100644 index 000000000..5d65d855a --- /dev/null +++ b/server/src/uds/templates/uds/login.html @@ -0,0 +1,98 @@ +{% extends "uds/base.html" %} +{% load i18n %} +{% load static %} + +{% block title %} +{% trans "Login to UDS" %} +{% endblock %} + +{% block script %} + + +{% endblock %} + +{% block top %} + + {% include "uds/snippets/lang.html" %} +{% endblock %} + +{% block content %} + +
+

{% trans "Login" %}

+
+
+ {% csrf_token %} +
+ {% trans "Login data" %} + {{ form.as_p }} +
+ +
+ +
+
+{% endblock %} \ No newline at end of file diff --git a/server/src/uds/templates/uds/prefs.html b/server/src/uds/templates/uds/prefs.html new file mode 100644 index 000000000..930d84cca --- /dev/null +++ b/server/src/uds/templates/uds/prefs.html @@ -0,0 +1,21 @@ +{% extends "uds/internal_page.html" %} +{% load i18n %} +{% load static %} + +{% block title %} +{% trans "UDS User Preferences" %} +{% endblock %} + +{% block content %} +
+ +

{% trans "Preferences" %}

+
+ {% csrf_token %} + {% autoescape off %}{{ prefs_form }}{% endautoescape %} + +
+ {% include "uds/snippets/back_to_list.html" %} + +
+{% endblock %} \ No newline at end of file diff --git a/server/src/uds/templates/uds/service_not_ready.html b/server/src/uds/templates/uds/service_not_ready.html new file mode 100644 index 000000000..95ef2ec5c --- /dev/null +++ b/server/src/uds/templates/uds/service_not_ready.html @@ -0,0 +1,8 @@ +{% extends "uds/internal_page.html" %} +{% load i18n %} +{% load static %} + +{% block content %} +{% trans "Service not ready at this moment. Please, try again in a while." %} +{% include "uds/snippets/back_to_list.html" %} +{% endblock %} \ No newline at end of file diff --git a/server/src/uds/templates/uds/show_transport.html b/server/src/uds/templates/uds/show_transport.html new file mode 100644 index 000000000..58e35f527 --- /dev/null +++ b/server/src/uds/templates/uds/show_transport.html @@ -0,0 +1,13 @@ +{% extends "uds/internal_page.html" %} +{% load i18n %} +{% load static %} + +{% block content %} +
+{% autoescape off %} +{{ transport }} +{% endautoescape %} +
+
+{% include "uds/snippets/back_to_list.html" %} +{% endblock %} \ No newline at end of file diff --git a/server/src/uds/templates/uds/snippets/admin_user.html b/server/src/uds/templates/uds/snippets/admin_user.html new file mode 100644 index 000000000..04acc0b7f --- /dev/null +++ b/server/src/uds/templates/uds/snippets/admin_user.html @@ -0,0 +1,10 @@ +{% load i18n static %} +{% spaceless %} +
+ {% trans "Admin" %} + +
+{% endspaceless %} \ No newline at end of file diff --git a/server/src/uds/templates/uds/snippets/back_to_list.html b/server/src/uds/templates/uds/snippets/back_to_list.html new file mode 100644 index 000000000..38aeb36b7 --- /dev/null +++ b/server/src/uds/templates/uds/snippets/back_to_list.html @@ -0,0 +1,4 @@ +{% load i18n static %} + \ No newline at end of file diff --git a/server/src/uds/templates/uds/snippets/lang.html b/server/src/uds/templates/uds/snippets/lang.html new file mode 100644 index 000000000..705232d59 --- /dev/null +++ b/server/src/uds/templates/uds/snippets/lang.html @@ -0,0 +1,21 @@ +{% load i18n static %} + +{% get_current_language as LANGUAGE_CODE %} +{% get_language_info for LANGUAGE_CODE as lang %} +{% spaceless %} +
+
+{% csrf_token %} +{% trans "Language" %}: + +{% get_language_info_list for LANGUAGES as languages %} +{% for language in languages %} +{% if language.code != lang.code %} + + {{ language.name_local }} + +{% endif %} +{% endfor %} +
+
+{% endspaceless %} \ No newline at end of file diff --git a/server/src/uds/tests.py b/server/src/uds/tests.py new file mode 100644 index 000000000..f77f651a2 --- /dev/null +++ b/server/src/uds/tests.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +""" +This file demonstrates writing tests using the unittest module. These will pass +when you run "manage.py test". + +Replace this with more appropriate tests for your application. +""" + +from django.test import TestCase +from uds.xmlrpc.util.TestTransport import rpcServer +from uds.xmlrpc.ServiceProviders import * +from models import * + +class XmlRpcTest(TestCase): + def setUp(self): + #self.Provider1 = ServiceProviders.objects.create(name="Dummy 1", type="DummyProvider") + #self.Provider2 = ServiceProviders.objects.create(name="Dummy 2", type="DummyProvider") + return + + def testProviders(self): + """ + Test the services providers api + """ + credentials = rpcServer.login('','','') + credentials = credentials['credentials'] + #rpcServer.createServiceProvider('prueba', '', r['type'], result ) + data = [ { 'name' : 'host' ,'value' : '192.168.0.15' }, + { 'name' : 'port' ,'value' : '443' }, + { 'name' : 'username' ,'value' : 'admin' }, + { 'name' : 'password' ,'value' : 'temporal' }, + ] + rpcServer.testServiceProvider(credentials, 'VmwareVCServiceProvider', data) + + \ No newline at end of file diff --git a/server/src/uds/transports/NX/NXTransport.py b/server/src/uds/transports/NX/NXTransport.py new file mode 100644 index 000000000..ddbd27315 --- /dev/null +++ b/server/src/uds/transports/NX/NXTransport.py @@ -0,0 +1,179 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +''' +Created on Jul 29, 2011 + +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' +from django.utils.translation import ugettext_noop as _ +from uds.core.managers.UserPrefsManager import CommonPrefs +from uds.core.ui.UserInterface import gui +from uds.core.transports.BaseTransport import BaseTransport +from uds.core.util import connection +from web import generateHtmlForNX, getHtmlComponent + +import logging + +logger = logging.getLogger(__name__) + +READY_CACHE_TIMEOUT = 30 + +class NXTransport(BaseTransport): + ''' + Provides access via RDP to service. + This transport can use an domain. If username processed by authenticator contains '@', it will split it and left-@-part will be username, and right password + ''' + typeName = _('NX Transport (direct)') + typeType = 'NXTransport' + typeDescription = _('NX Transport for direct connection') + iconFile = 'nx.png' + needsJava = True # If this transport needs java for rendering + + useEmptyCreds = gui.CheckBoxField(label = _('Empty creds'), order = 1, tooltip = _('If checked, the credentials used to connect will be emtpy')) + fixedName = gui.TextField(label=_('Username'), order = 2, tooltip = _('If not empty, this username will be always used as credential')) + fixedPassword = gui.PasswordField(label=_('Password'), order = 3, tooltip = _('If not empty, this password will be always used as credential')) + listenPort = gui.NumericField(label=_('Listen port'), length = 5, order = 4, tooltip = _('Listening port of NX (ssh) at client machine'), defvalue = '22') + connection = gui.ChoiceField(label=_('Connection'), order = 6, tooltip = _('Connection speed for this transport (quality)'), values = [ + {'id' : 'modem', 'text' : 'modem'}, + {'id' : 'isdn', 'text' : 'isdn'}, + {'id' : 'adsl', 'text' : 'adsl'}, + {'id' : 'wan', 'text' : 'wan'}, + {'id' : 'lan', 'text' : 'lan'}, + ] ) + session = gui.ChoiceField(label=_('Session'), order = 7, tooltip = _('Desktop session'), values = [ + {'id' : 'gnome', 'text' : 'gnome'}, + {'id' : 'kde', 'text' : 'kde'}, + {'id' : 'cde', 'text' : 'cde'}, + ] ) + cacheDisk = gui.ChoiceField(label=_('Disk Cache'), order = 8, tooltip = _('Cache size en Mb stored at disk'), values = [ + {'id' : '0', 'text' : '0 Mb'}, + {'id' : '32', 'text' : '32 Mb'}, + {'id' : '64', 'text' : '64 Mb'}, + {'id' : '128', 'text' : '128 Mb'}, + {'id' : '256', 'text' : '256 Mb'}, + {'id' : '512', 'text' : '512 Mb'}, + ] ) + cacheMem = gui.ChoiceField(label=_('Memory Cache'), order = 9, tooltip = _('Cache size en Mb keept at memory'), values = [ + {'id' : '4', 'text' : '4 Mb'}, + {'id' : '8', 'text' : '8 Mb'}, + {'id' : '16', 'text' : '16 Mb'}, + {'id' : '32', 'text' : '32 Mb'}, + {'id' : '64', 'text' : '64 Mb'}, + {'id' : '128', 'text' : '128 Mb'}, + ] ) + + + def __init__(self, environment, values = None): + super(NXTransport, self).__init__(environment, values) + if values != None: + self._useEmptyCreds = gui.strToBool(values['useEmptyCreds']) + self._fixedName = values['fixedName'] + self._fixedPassword = values['fixedPassword'] + self._listenPort = values['listenPort'] + self._connection = values['connection'] + self._session = values['session'] + self._cacheDisk = values['cacheDisk'] + self._cacheMem = values['cacheMem'] + else: + self._useEmptyCreds = '' + self._fixedName = '' + self._fixedPassword = '' + self._listenPort = '' + self._connection = '' + self._session = '' + self._cacheDisk = '' + self._cacheMem = '' + + def marshal(self): + ''' + Serializes the transport data so we can store it in database + ''' + return str.join( '\t', [ 'v1', gui.boolToStr(self._useEmptyCreds), self._fixedName, self._fixedPassword, self._listenPort, + self._connection, self._session, self._cacheDisk, self._cacheMem ] ) + + def unmarshal(self, string): + data = string.split('\t') + if data[0] == 'v1': + self._useEmptyCreds = gui.strToBool(data[1]) + self._fixedName, self._fixedPassword, self._listenPort, self._connection, self._session, self._cacheDisk, self._cacheMem = data[2:] + + + def valuesDict(self): + return { 'useEmptyCreds' : gui.boolToStr(self._useEmptyCreds), 'fixedName' : self._fixedName, + 'fixedPassword' : self._fixedPassword, 'listenPort': self._listenPort, + 'connection' : self._connection, 'session' : self._session, 'cacheDisk' : self._cacheDisk, + 'cacheMem' : self._cacheMem } + + def isAvailableFor(self, ip): + ''' + Checks if the transport is available for the requested destination ip + Override this in yours transports + ''' + logger.debug('Checking availability for {0}'.format(ip)) + ready = self.cache().get(ip) + if ready is None: + # Check again for readyness + if connection.testServer(ip, self._listenPort) == True: + self.cache().put(ip, 'Y', READY_CACHE_TIMEOUT) + return True + else: + self.cache().put(ip, 'N', READY_CACHE_TIMEOUT) + return ready == 'Y' + + def renderForHtml(self, theId, ip, os, user, password): + + prefs = user.prefs('nx') + + username = user.getUsernameForAuth() + proc = username.split('@') + username = proc[0] + if self._fixedName is not '': + username = self._fixedName + if self._fixedPassword is not '': + password = self._fixedPassword + if self._useEmptyCreds is True: + username, password = '','' + + width, height = CommonPrefs.getWidthHeight(prefs) + + # Extra data + extra = { 'width': width, 'height' : height, + 'port' : self._listenPort, 'connection' : self._connection, + 'session' : self._session, 'cacheDisk': self._cacheDisk, + 'cacheMem' : self._cacheMem } + + + return generateHtmlForNX(self, theId, ip, username, password, extra) + + def getHtmlComponent(self, theId, os, componentId): + # We use helper to keep this clean + return getHtmlComponent(self.__module__, componentId) + \ No newline at end of file diff --git a/server/src/uds/transports/NX/__init__.py b/server/src/uds/transports/NX/__init__.py new file mode 100644 index 000000000..ce28dde61 --- /dev/null +++ b/server/src/uds/transports/NX/__init__.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from uds.core.transports.TransportsFactory import TransportsFactory +from uds.core.managers.UserPrefsManager import UserPrefsManager, CommonPrefs +from uds.core.managers.DownloadsManager import DownloadsManager +from NXTransport import NXTransport +from django.utils.translation import ugettext_noop as _ +import os.path, sys + +TransportsFactory.factory().insert(NXTransport) +UserPrefsManager.manager().registerPrefs('nx', _('NX Protocol'), + [ + CommonPrefs.screenSizePref + ]) + +DownloadsManager.manager().registerDownloadable('udsactor-nx_1.0_all.deb', + _('UDS Actor connector for NX (requires nomachine packages)'), + os.path.dirname(sys.modules[__package__].__file__) + '/files/udsactor-nx_1.0_all.deb', + 'application/x-debian-package') diff --git a/server/src/uds/transports/NX/applet/nxtransport.jar b/server/src/uds/transports/NX/applet/nxtransport.jar new file mode 100644 index 000000000..c859f30cd Binary files /dev/null and b/server/src/uds/transports/NX/applet/nxtransport.jar differ diff --git a/server/src/uds/transports/NX/files/udsactor-nx_1.0_all.deb b/server/src/uds/transports/NX/files/udsactor-nx_1.0_all.deb new file mode 100644 index 000000000..96b3f9d6c Binary files /dev/null and b/server/src/uds/transports/NX/files/udsactor-nx_1.0_all.deb differ diff --git a/server/src/uds/transports/NX/nx.png b/server/src/uds/transports/NX/nx.png new file mode 100644 index 000000000..aec556e8c Binary files /dev/null and b/server/src/uds/transports/NX/nx.png differ diff --git a/server/src/uds/transports/NX/web.py b/server/src/uds/transports/NX/web.py new file mode 100644 index 000000000..fc7c7f22c --- /dev/null +++ b/server/src/uds/transports/NX/web.py @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext as _ +from django.core.urlresolvers import reverse +import logging, os, sys + +logger = logging.getLogger(__name__) + + +def simpleScrambler(data): + ''' + Simple scrambler so password are not seen at source page + ''' + res = [] + n = ord('M') + pos = 0 + for c in data: + res.append( chr(ord(c) ^ n) ) + n = n ^ pos + pos = pos + 1 + return "".join(res).encode('hex') + + + +def generateHtmlForNX(transport, id, ip, user, password, extra): + applet = reverse('uds.web.views.transcomp', kwargs = { 'idTransport' : id, 'componentId' : '1' }) + # Gets the codebase, simply remove last char from applet + codebase = applet[:-1] + # We generate the "data" parameter + data = simpleScrambler( '\t'.join([ + 'user:' + user, + 'pass:' + password, + 'ip:' + ip, + 'port:' + extra['port'], + 'session:' + extra['session'], + 'connection:' + extra['connection'], + 'cacheDisk:' + extra['cacheDisk'], + 'cacheMem:' + extra['cacheMem'], + 'width:' + str(extra['width']), + 'height:' + str(extra['height']) + ])) + res = '
' % (codebase, '1', data ) + res += '

' + _('In order to use this transport, you need to install first Nomachine Nx Client version 3.5.x') + '

' + res += '

' + _('you can obtain it for your platform from') + '' + _('nochamine web site') + '

' + return res + + +def getHtmlComponent(module, componentId): + dict = { '1' : ['nxtransport.jar', 'application/java-archive' ]} + + if dict.has_key(componentId) == False: + return ['text/plain', 'no component'] + fname = os.path.dirname(sys.modules[module].__file__) + '/applet/' + dict[componentId][0] + logger.debug('Loading component {0} from {1}'.format(componentId, fname)) + + f = open(fname, 'rb') + data = f.read() + f.close() + return [ dict[componentId][1], data ] \ No newline at end of file diff --git a/server/src/uds/transports/RDP/RDPTransport.py b/server/src/uds/transports/RDP/RDPTransport.py new file mode 100644 index 000000000..e8f0ffa45 --- /dev/null +++ b/server/src/uds/transports/RDP/RDPTransport.py @@ -0,0 +1,141 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext_noop as _ +from uds.core.managers.UserPrefsManager import CommonPrefs +from uds.core.ui.UserInterface import gui +from uds.core.transports.BaseTransport import BaseTransport +from uds.core.util import connection +from web import generateHtmlForRdp, getHtmlComponent + +import logging + +logger = logging.getLogger(__name__) + +READY_CACHE_TIMEOUT = 30 + +class RDPTransport(BaseTransport): + ''' + Provides access via RDP to service. + This transport can use an domain. If username processed by authenticator contains '@', it will split it and left-@-part will be username, and right password + ''' + typeName = _('RDP Transport (direct)') + typeType = 'RDPTransport' + typeDescription = _('RDP Transport for direct connection') + iconFile = 'rdp.png' + needsJava = True # If this transport needs java for rendering + + useEmptyCreds = gui.CheckBoxField(label = _('Empty creds'), order = 1, tooltip = _('If checked, the credentials used to connect will be emtpy')) + fixedName = gui.TextField(label=_('Username'), order = 2, tooltip = _('If not empty, this username will be always used as credential')) + fixedPassword = gui.PasswordField(label=_('Password'), order = 3, tooltip = _('If not empty, this password will be always used as credential')) + fixedDomain = gui.TextField(label=_('Domain'), order = 4, tooltip = _('If not empty, this domain will be always used as credential (used as DOMAIN\\user)')) + allowSmartcards = gui.CheckBoxField(label = _('Allow Smartcards'), order = 5, tooltip = _('If checked, this transport will allow the use of smartcards')) + allowPrinters = gui.CheckBoxField(label = _('Allow Printers'), order = 6, tooltip = _('If checked, this transport will allow the use of user printers')) + allowDrives = gui.CheckBoxField(label = _('Allow Drives'), order = 7, tooltip = _('If checked, this transport will allow the use of user drives')) + allowSerials = gui.CheckBoxField(label = _('Allow Serials'), order = 8, tooltip = _('If checked, this transport will allow the use of user serial ports')) + + def __init__(self, environment, values = None): + super(RDPTransport, self).__init__(environment, values) + if values != None: + self._useEmptyCreds = gui.strToBool(values['useEmptyCreds']) + self._fixedName = values['fixedName'] + self._fixedPassword = values['fixedPassword'] + self._fixedDomain = values['fixedDomain'] + self._allowSmartcards = gui.strToBool(values['allowSmartcards']) + self._allowPrinters = gui.strToBool(values['allowPrinters']) + self._allowDrives = gui.strToBool(values['allowDrives']) + self._allowSerials = gui.strToBool(values['allowSerials']) + else: + self._useEmptyCreds = False + self._fixedName = '' + self._fixedPassword = '' + self._fixedDomain = '' + self._allowSmartcards = False + self._allowPrinters = False + self._allowDrives = False + self._allowSerials = False + + def marshal(self): + ''' + Serializes the transport data so we can store it in database + ''' + return str.join( '\t', [ 'v1', gui.boolToStr(self._useEmptyCreds), gui.boolToStr(self._allowSmartcards), gui.boolToStr(self._allowPrinters), + gui.boolToStr(self._allowDrives), gui.boolToStr(self._allowSerials), + self._fixedName, self._fixedPassword, self._fixedDomain ] ) + + def unmarshal(self, str): + data = str.split('\t') + if data[0] == 'v1': + self._useEmptyCreds = gui.strToBool(data[1]) + self._allowSmartcards = gui.strToBool(data[2]) + self._allowPrinters = gui.strToBool(data[3]) + self._allowDrives = gui.strToBool(data[4]) + self._allowSerials = gui.strToBool(data[5]) + self._fixedName = data[6] + self._fixedPassword = data[7] + self._fixedDomain = data[8] + + def valuesDict(self): + return { 'allowSmartcards' : gui.boolToStr(self._allowSmartcards), 'allowPrinters' : gui.boolToStr(self._allowPrinters), + 'allowDrives': gui.boolToStr(self._allowDrives), 'allowSerials': gui.boolToStr(self._allowSerials), + 'fixedName' : self._fixedName, 'fixedPassword' : self._fixedPassword, 'fixedDomain' : self._fixedDomain, + 'useEmptyCreds' : gui.boolToStr(self._useEmptyCreds) } + + def isAvailableFor(self, ip): + ''' + Checks if the transport is available for the requested destination ip + Override this in yours transports + ''' + logger.debug('Checking availability for {0}'.format(ip)) + ready = self.cache().get(ip) + if ready is None: + # Check again for readyness + if connection.testServer(ip, '3389') == True: + self.cache().put(ip, 'Y', READY_CACHE_TIMEOUT) + return True + else: + self.cache().put(ip, 'N', READY_CACHE_TIMEOUT) + return ready == 'Y' + + def renderForHtml(self, id, ip, os, user, password): + # We use helper to keep this clean + username = user.getUsernameForAuth() + prefs = user.prefs('rdp') + + proc = username.split('@') + if len(proc) > 1: + domain = proc[1] + else: + domain = '' + username = proc[0] + if self._fixedName is not '': + username = self._fixedName + if self._fixedPassword is not '': + password = self._fixedPassword + if self._fixedDomain is not '': + domain = self._fixedDomain; + if self._useEmptyCreds is True: + username, password, domain = '','','' + + width, height = CommonPrefs.getWidthHeight(prefs) + depth = CommonPrefs.getDepth(prefs) + + # Extra data + extra = { 'width': width, 'height' : height, 'depth' : depth, + 'printers' : self._allowPrinters, 'smartcards' : self._allowSmartcards, + 'drives' : self._allowDrives, 'serials' : self._allowSerials, 'compression':True } + + return generateHtmlForRdp(self, id, os, ip, '3389', username, password, domain, extra) + + def getHtmlComponent(self, id, os, componentId): + # We use helper to keep this clean + return getHtmlComponent(self.__module__, componentId) + \ No newline at end of file diff --git a/server/src/uds/transports/RDP/TSRDPTransport.py b/server/src/uds/transports/RDP/TSRDPTransport.py new file mode 100644 index 000000000..9c2ff1516 --- /dev/null +++ b/server/src/uds/transports/RDP/TSRDPTransport.py @@ -0,0 +1,164 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext_noop as _ +from uds.core.managers.UserPrefsManager import CommonPrefs +from uds.core.ui.UserInterface import gui +from uds.core.transports.BaseTransport import BaseTransport +from uds.core.util import connection +from uds.core.util.Cache import Cache +from web import generateHtmlForRdp, getHtmlComponent + +import logging, random, string, time + +logger = logging.getLogger(__name__) + +READY_CACHE_TIMEOUT = 30 + +class TSRDPTransport(BaseTransport): + ''' + Provides access via RDP to service. + This transport can use an domain. If username processed by authenticator contains '@', it will split it and left-@-part will be username, and right password + ''' + typeName = _('RDP Transport (tunneled)') + typeType = 'TSRDPTransport' + typeDescription = _('RDP Transport for tunneled connection') + iconFile = 'rdp.png' + needsJava = True # If this transport needs java for rendering + + tunnelServer = gui.TextField(label=_('Tunnel server'), order = 1, tooltip = _('IP or Hostname of tunnel server send to client device ("public" ip) and port. (use HOST:PORT format)')) + tunnelCheckServer = gui.TextField(label=_('Tunnel host check'), order = 2, tooltip = _('If not empty, this server will be used to check if service is running before assigning it to user. (use HOST:PORT format)')) + + useEmptyCreds = gui.CheckBoxField(label = _('Empty creds'), order = 3, tooltip = _('If checked, the credentials used to connect will be emtpy')) + fixedName = gui.TextField(label=_('Username'), order = 4, tooltip = _('If not empty, this username will be always used as credential')) + fixedPassword = gui.PasswordField(label=_('Password'), order = 5, tooltip = _('If not empty, this password will be always used as credential')) + fixedDomain = gui.TextField(label=_('Domain'), order = 6, tooltip = _('If not empty, this domain will be always used as credential (used as DOMAIN\\user)')) + allowSmartcards = gui.CheckBoxField(label = _('Allow Smartcards'), order = 7, tooltip = _('If checked, this transport will allow the use of smartcards')) + allowPrinters = gui.CheckBoxField(label = _('Allow Printers'), order = 8, tooltip = _('If checked, this transport will allow the use of user printers')) + allowDrives = gui.CheckBoxField(label = _('Allow Drives'), order = 9, tooltip = _('If checked, this transport will allow the use of user drives')) + allowSerials = gui.CheckBoxField(label = _('Allow Serials'), order = 10, tooltip = _('If checked, this transport will allow the use of user serial ports')) + + def __init__(self, environment, values = None): + super(TSRDPTransport, self).__init__(environment, values) + if values != None: + self._tunnelServer = values['tunnelServer'] + self._tunnelCheckServer = values['tunnelCheckServer'] + self._useEmptyCreds = gui.strToBool(values['useEmptyCreds']) + self._fixedName = values['fixedName'] + self._fixedPassword = values['fixedPassword'] + self._fixedDomain = values['fixedDomain'] + self._allowSmartcards = gui.strToBool(values['allowSmartcards']) + self._allowPrinters = gui.strToBool(values['allowPrinters']) + self._allowDrives = gui.strToBool(values['allowDrives']) + self._allowSerials = gui.strToBool(values['allowSerials']) + else: + self._tunnelServer = '' + self._tunnelCheckServer = '' + self._useEmptyCreds = False + self._fixedName = '' + self._fixedPassword = '' + self._fixedDomain = '' + self._allowSmartcards = False + self._allowPrinters = False + self._allowDrives = False + self._allowSerials = False + + def marshal(self): + ''' + Serializes the transport data so we can store it in database + ''' + return str.join( '\t', [ 'v1', gui.boolToStr(self._useEmptyCreds), gui.boolToStr(self._allowSmartcards), gui.boolToStr(self._allowPrinters), + gui.boolToStr(self._allowDrives), gui.boolToStr(self._allowSerials), + self._fixedName, self._fixedPassword, self._fixedDomain, self._tunnelServer, self._tunnelCheckServer ] ) + + def unmarshal(self, str): + data = str.split('\t') + if data[0] == 'v1': + self._useEmptyCreds = gui.strToBool(data[1]) + self._allowSmartcards = gui.strToBool(data[2]) + self._allowPrinters = gui.strToBool(data[3]) + self._allowDrives = gui.strToBool(data[4]) + self._allowSerials = gui.strToBool(data[5]) + self._fixedName = data[6] + self._fixedPassword = data[7] + self._fixedDomain = data[8] + self._tunnelServer = data[9] + self._tunnelCheckServer = data[10] + + def valuesDict(self): + return { 'allowSmartcards' : gui.boolToStr(self._allowSmartcards), 'allowPrinters' : gui.boolToStr(self._allowPrinters), + 'allowDrives': gui.boolToStr(self._allowDrives), 'allowSerials': gui.boolToStr(self._allowSerials), + 'fixedName' : self._fixedName, 'fixedPassword' : self._fixedPassword, 'fixedDomain' : self._fixedDomain, + 'useEmptyCreds' : gui.boolToStr(self._useEmptyCreds), 'tunnelServer' : self._tunnelServer, + 'tunnelCheckServer' : self._tunnelCheckServer } + + def isAvailableFor(self, ip): + ''' + Checks if the transport is available for the requested destination ip + Override this in yours transports + ''' + logger.debug('Checking availability for {0}'.format(ip)) + ready = self.cache().get(ip) + if ready is None: + # Check again for readyness + if connection.testServer(ip, '3389') == True: + self.cache().put(ip, 'Y', READY_CACHE_TIMEOUT) + return True + else: + self.cache().put(ip, 'N', READY_CACHE_TIMEOUT) + return ready == 'Y' + + def renderForHtml(self, id, ip, os, user, password): + # We use helper to keep this clean + username = user.getUsernameForAuth() + prefs = user.prefs('rdp') + + proc = username.split('@') + if len(proc) > 1: + domain = proc[1] + else: + domain = '' + username = proc[0] + if self._fixedName is not '': + username = self._fixedName + if self._fixedPassword is not '': + password = self._fixedPassword + if self._fixedDomain is not '': + domain = self._fixedDomain; + if self._useEmptyCreds is True: + username, password, domain = '','','' + + width, height = CommonPrefs.getWidthHeight(prefs) + depth = CommonPrefs.getDepth(prefs) + cache = Cache('pam') + + tunuser = ''.join(random.choice(string.letters + string.digits) for i in xrange(12)) + ("%f" % time.time()).split('.')[1] + tunpass = ''.join(random.choice(string.letters + string.digits) for i in xrange(12)) + cache.put(tunuser, tunpass, 60*10) # Credential valid for ten minutes, and for 1 use only + + sshHost, sshPort = self._tunnelServer.split(':') + + logger.debug('Username generated: {0}, password: {1}'.format(tunuser, tunpass)) + tun = "{0} {1} {2} {3} {4} {5} {6}".format(tunuser, tunpass, sshHost, sshPort, ip, '3389', '9') + ip = '127.0.0.1' + + # Extra data + extra = { 'width': width, 'height' : height, 'depth' : depth, + 'printers' : self._allowPrinters, 'smartcards' : self._allowSmartcards, + 'drives' : self._allowDrives, 'serials' : self._allowSerials, + 'tun': tun, 'compression':True } + + return generateHtmlForRdp(self, id, os, ip, '-1', username, password, domain, extra) + + def getHtmlComponent(self, id, os, componentId): + # We use helper to keep this clean + return getHtmlComponent(self.__module__, componentId) + \ No newline at end of file diff --git a/server/src/uds/transports/RDP/__init__.py b/server/src/uds/transports/RDP/__init__.py new file mode 100644 index 000000000..b94beae19 --- /dev/null +++ b/server/src/uds/transports/RDP/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from uds.core.transports.TransportsFactory import TransportsFactory +from uds.core.managers.UserPrefsManager import UserPrefsManager, CommonPrefs +from uds.transports.RDP.RDPTransport import RDPTransport +from uds.transports.RDP.TSRDPTransport import TSRDPTransport +from django.utils.translation import ugettext_noop as _ + +TransportsFactory.factory().insert(RDPTransport) +TransportsFactory.factory().insert(TSRDPTransport) +UserPrefsManager.manager().registerPrefs('rdp', _('Remote Desktop Protocol'), + [ + CommonPrefs.screenSizePref, + CommonPrefs.depthPref + ]) \ No newline at end of file diff --git a/server/src/uds/transports/RDP/applet/launcher.jar b/server/src/uds/transports/RDP/applet/launcher.jar new file mode 100644 index 000000000..1b81d28ca Binary files /dev/null and b/server/src/uds/transports/RDP/applet/launcher.jar differ diff --git a/server/src/uds/transports/RDP/applet/rdp.jar b/server/src/uds/transports/RDP/applet/rdp.jar new file mode 100644 index 000000000..57828b99f Binary files /dev/null and b/server/src/uds/transports/RDP/applet/rdp.jar differ diff --git a/server/src/uds/transports/RDP/applet/rdppass.dll b/server/src/uds/transports/RDP/applet/rdppass.dll new file mode 100644 index 000000000..ce6e4a700 Binary files /dev/null and b/server/src/uds/transports/RDP/applet/rdppass.dll differ diff --git a/server/src/uds/transports/RDP/rdp.png b/server/src/uds/transports/RDP/rdp.png new file mode 100644 index 000000000..8d73815a8 Binary files /dev/null and b/server/src/uds/transports/RDP/rdp.png differ diff --git a/server/src/uds/transports/RDP/web.py b/server/src/uds/transports/RDP/web.py new file mode 100644 index 000000000..d57e02907 --- /dev/null +++ b/server/src/uds/transports/RDP/web.py @@ -0,0 +1,101 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext as _ +from django.core.urlresolvers import reverse +from uds.core.util import OsDetector +import logging, os, sys + +logger = logging.getLogger(__name__) + + +def scramble(data): + ''' + Simple scrambler so password are not seen at source page + ''' + res = [] + n = 0x32 + for c in data[::-1]: + res.append( chr(ord(c) ^ n) ) + n = (n + ord(c)) & 0xFF + return "".join(res).encode('hex') + + + +def generateHtmlForRdp(transport, id, os, ip, port, user, password, domain, extra): + isMac = os['OS'] == OsDetector.Macintosh + applet = reverse('uds.web.views.transcomp', kwargs = { 'idTransport' : id, 'componentId' : '1' }) + logger.debug('Applet: {0}'.format(applet)) + # Gets the codebase, simply remove last char from applet + codebase = applet[:-1] + # We generate the "data" parameter + data = [ 'u:' + user, + 'p:' + password, + 'd:' + domain, + 's:' + ip, + 'po:' + port, + 'sc:' + (extra['smartcards'] and '1' or '0'), + 'pr:' + (extra['printers'] and '1' or '0'), + 'se:' + (extra['serials'] and '1' or '0'), + 'dr:' + (extra['drives'] and '1' or '0'), + 'au:' + '1', # Audio, 0 do not play, 1 play + 'w:' + str(extra['width']), + 'h:' + str(extra['height']), + 'c:' + str(extra['depth']), + 'cr:' + (extra['compression'] and '1' or '0') + ] + if extra.has_key('tun'): + data.append('tun:' + extra['tun']) + + data = scramble('\t'.join(data)) + res = '
' % (codebase, '1', data ) + if isMac is True: + res += ('

' + _('In order to use this service, you should first install CoRD.') + '

' + '

' + _('You can obtain it from') + ' ' + _('CoRD Website') + '

' + '
' + ) + return res + +def getHtmlComponent(module, componentId): + filesDict = { '1' : ['rdp.jar', 'application/java-archive' ], '2' : ['rdppass.dll', 'application/x-msdos-program' ], + '3' : ['launcher.jar', 'application/java-archive'] } + + if filesDict.has_key(componentId) == False: + return ['text/plain', 'no component'] + fname = os.path.dirname(sys.modules[module].__file__) + '/applet/' + filesDict[componentId][0] + logger.debug('Loading component {0} from {1}'.format(componentId, fname)) + + f = open(fname, 'rb') + data = f.read() + f.close() + return [ filesDict[componentId][1], data ] \ No newline at end of file diff --git a/server/src/uds/transports/TSNX/TSNXTransport.py b/server/src/uds/transports/TSNX/TSNXTransport.py new file mode 100644 index 000000000..cf38feaae --- /dev/null +++ b/server/src/uds/transports/TSNX/TSNXTransport.py @@ -0,0 +1,200 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +''' +Created on Jul 29, 2011 + +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' +from django.utils.translation import ugettext_noop as _ +from uds.core.managers.UserPrefsManager import CommonPrefs +from uds.core.ui.UserInterface import gui +from uds.core.transports.BaseTransport import BaseTransport +from uds.core.util.Cache import Cache +from uds.core.util import connection +from web import generateHtmlForNX, getHtmlComponent + +import logging, random, string, time + +logger = logging.getLogger(__name__) + +READY_CACHE_TIMEOUT = 30 + +class TSNXTransport(BaseTransport): + ''' + Provides access via RDP to service. + This transport can use an domain. If username processed by authenticator contains '@', it will split it and left-@-part will be username, and right password + ''' + typeName = _('NX Transport (tunneled)') + typeType = 'TSNXTransport' + typeDescription = _('NX Transport for tunneled connection') + iconFile = 'tsnx.png' + needsJava = True # If this transport needs java for rendering + supportedOss = ['Windows', 'Macintosh', 'Linux'] + + tunnelServer = gui.TextField(label=_('Tunnel server'), order = 1, tooltip = _('IP or Hostname of tunnel server send to client device ("public" ip) and port. (use HOST:PORT format)')) + tunnelCheckServer = gui.TextField(label=_('Tunnel host check'), order = 2, tooltip = _('If not empty, this server will be used to check if service is running before assigning it to user. (use HOST:PORT format)')) + + useEmptyCreds = gui.CheckBoxField(label = _('Empty creds'), order = 3, tooltip = _('If checked, the credentials used to connect will be emtpy')) + fixedName = gui.TextField(label=_('Username'), order = 4, tooltip = _('If not empty, this username will be always used as credential')) + fixedPassword = gui.PasswordField(label=_('Password'), order = 5, tooltip = _('If not empty, this password will be always used as credential')) + listenPort = gui.NumericField(label=_('Listen port'), length = 5, order = 6, tooltip = _('Listening port of NX (ssh) at client machine'), defvalue = '22') + connection = gui.ChoiceField(label=_('Connection'), order = 7, tooltip = _('Connection speed for this transport (quality)'), values = [ + {'id' : 'modem', 'text' : 'modem'}, + {'id' : 'isdn', 'text' : 'isdn'}, + {'id' : 'adsl', 'text' : 'adsl'}, + {'id' : 'wan', 'text' : 'wan'}, + {'id' : 'lan', 'text' : 'lan'}, + ] ) + session = gui.ChoiceField(label=_('Session'), order = 8, tooltip = _('Desktop session'), values = [ + {'id' : 'gnome', 'text' : 'gnome'}, + {'id' : 'kde', 'text' : 'kde'}, + {'id' : 'cde', 'text' : 'cde'}, + ] ) + cacheDisk = gui.ChoiceField(label=_('Disk Cache'), order = 9, tooltip = _('Cache size en Mb stored at disk'), values = [ + {'id' : '0', 'text' : '0 Mb'}, + {'id' : '32', 'text' : '32 Mb'}, + {'id' : '64', 'text' : '64 Mb'}, + {'id' : '128', 'text' : '128 Mb'}, + {'id' : '256', 'text' : '256 Mb'}, + {'id' : '512', 'text' : '512 Mb'}, + ] ) + cacheMem = gui.ChoiceField(label=_('Memory Cache'), order = 10, tooltip = _('Cache size en Mb keept at memory'), values = [ + {'id' : '4', 'text' : '4 Mb'}, + {'id' : '8', 'text' : '8 Mb'}, + {'id' : '16', 'text' : '16 Mb'}, + {'id' : '32', 'text' : '32 Mb'}, + {'id' : '64', 'text' : '64 Mb'}, + {'id' : '128', 'text' : '128 Mb'}, + ] ) + + + def __init__(self, environment, values = None): + super(TSNXTransport, self).__init__(environment, values) + if values != None: + self._tunnelServer = values['tunnelServer'] + self._tunnelCheckServer = values['tunnelCheckServer'] + self._useEmptyCreds = gui.strToBool(values['useEmptyCreds']) + self._fixedName = values['fixedName'] + self._fixedPassword = values['fixedPassword'] + self._listenPort = values['listenPort'] + self._connection = values['connection'] + self._session = values['session'] + self._cacheDisk = values['cacheDisk'] + self._cacheMem = values['cacheMem'] + else: + self._tunnelServer = '' + self._tunnelCheckServer = '' + self._useEmptyCreds = '' + self._fixedName = '' + self._fixedPassword = '' + self._listenPort = '' + self._connection = '' + self._session = '' + self._cacheDisk = '' + self._cacheMem = '' + + def marshal(self): + ''' + Serializes the transport data so we can store it in database + ''' + return str.join( '\t', [ 'v1', gui.boolToStr(self._useEmptyCreds), self._fixedName, self._fixedPassword, self._listenPort, + self._connection, self._session, self._cacheDisk, self._cacheMem, self._tunnelServer, self._tunnelCheckServer ] ) + + def unmarshal(self, string): + data = string.split('\t') + if data[0] == 'v1': + self._useEmptyCreds = gui.strToBool(data[1]) + self._fixedName, self._fixedPassword, self._listenPort, self._connection, self._session, self._cacheDisk, self._cacheMem, self._tunnelServer, self._tunnelCheckServer = data[2:] + + + def valuesDict(self): + return { 'useEmptyCreds' : gui.boolToStr(self._useEmptyCreds), 'fixedName' : self._fixedName, + 'fixedPassword' : self._fixedPassword, 'listenPort': self._listenPort, + 'connection' : self._connection, 'session' : self._session, 'cacheDisk' : self._cacheDisk, + 'cacheMem' : self._cacheMem, 'tunnelServer' : self._tunnelServer, + 'tunnelCheckServer' : self._tunnelCheckServer } + + def isAvailableFor(self, ip): + ''' + Checks if the transport is available for the requested destination ip + Override this in yours transports + ''' + logger.debug('Checking availability for {0}'.format(ip)) + ready = self.cache().get(ip) + if ready is None: + # Check again for readyness + if connection.testServer(ip, self._listenPort) == True: + self.cache().put(ip, 'Y', READY_CACHE_TIMEOUT) + return True + else: + self.cache().put(ip, 'N', READY_CACHE_TIMEOUT) + return ready == 'Y' + + def renderForHtml(self, theId, ip, os, user, password): + + prefs = user.prefs('nx') + + username = user.getUsernameForAuth() + proc = username.split('@') + username = proc[0] + if self._fixedName is not '': + username = self._fixedName + if self._fixedPassword is not '': + password = self._fixedPassword + if self._useEmptyCreds is True: + username, password = '','' + + width, height = CommonPrefs.getWidthHeight(prefs) + cache = Cache('pam') + + + tunuser = ''.join(random.choice(string.letters + string.digits) for i in xrange(12)) + ("%f" % time.time()).split('.')[1] + tunpass = ''.join(random.choice(string.letters + string.digits) for i in xrange(12)) + cache.put(tunuser, tunpass, 60*10) # Credential valid for ten minutes, and for 1 use only + + sshHost, sshPort = self._tunnelServer.split(':') + + logger.debug('Username generated: {0}, password: {1}'.format(tunuser, tunpass)) + tun = "{0} {1} {2} {3} {4} {5} {6}".format(tunuser, tunpass, sshHost, sshPort, ip, self._listenPort, '9') + + # Extra data + extra = { 'width': width, 'height' : height, + 'connection' : self._connection, + 'session' : self._session, 'cacheDisk': self._cacheDisk, + 'cacheMem' : self._cacheMem, 'tun' : tun } + + + return generateHtmlForNX(self, theId, username, password, extra) + + def getHtmlComponent(self, theId, os, componentId): + # We use helper to keep this clean + return getHtmlComponent(self.__module__, componentId) + \ No newline at end of file diff --git a/server/src/uds/transports/TSNX/__init__.py b/server/src/uds/transports/TSNX/__init__.py new file mode 100644 index 000000000..a00d9b6e4 --- /dev/null +++ b/server/src/uds/transports/TSNX/__init__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from uds.core.transports.TransportsFactory import TransportsFactory +from uds.core.managers.UserPrefsManager import UserPrefsManager, CommonPrefs +from uds.core.managers.DownloadsManager import DownloadsManager +from TSNXTransport import TSNXTransport +from django.utils.translation import ugettext_noop as _ +import os.path, sys + +TransportsFactory.factory().insert(TSNXTransport) +UserPrefsManager.manager().registerPrefs('nx', _('NX Protocol'), + [ + CommonPrefs.screenSizePref + ]) diff --git a/server/src/uds/transports/TSNX/applet/launcher.jar b/server/src/uds/transports/TSNX/applet/launcher.jar new file mode 100644 index 000000000..1b81d28ca Binary files /dev/null and b/server/src/uds/transports/TSNX/applet/launcher.jar differ diff --git a/server/src/uds/transports/TSNX/applet/nxtuntransport.jar b/server/src/uds/transports/TSNX/applet/nxtuntransport.jar new file mode 100644 index 000000000..6ec27d4f2 Binary files /dev/null and b/server/src/uds/transports/TSNX/applet/nxtuntransport.jar differ diff --git a/server/src/uds/transports/TSNX/tsnx.png b/server/src/uds/transports/TSNX/tsnx.png new file mode 100644 index 000000000..aec556e8c Binary files /dev/null and b/server/src/uds/transports/TSNX/tsnx.png differ diff --git a/server/src/uds/transports/TSNX/web.py b/server/src/uds/transports/TSNX/web.py new file mode 100644 index 000000000..e19beaefb --- /dev/null +++ b/server/src/uds/transports/TSNX/web.py @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.core.urlresolvers import reverse +import logging, os, sys + +logger = logging.getLogger(__name__) + + +def simpleScrambler(data): + ''' + Simple scrambler so password are not seen at source page + ''' + res = [] + n = ord('M') + pos = 0 + for c in data: + res.append( chr(ord(c) ^ n) ) + n = n ^ pos + pos = pos + 1 + return "".join(res).encode('hex') + + + +def generateHtmlForNX(transport, id, user, password, extra): + applet = reverse('uds.web.views.transcomp', kwargs = { 'idTransport' : id, 'componentId' : '1' }) + # Gets the codebase, simply remove last char from applet + codebase = applet[:-1] + # We generate the "data" parameter + + data = [ + 'user:' + user, + 'pass:' + password, + 'session:' + extra['session'], + 'connection:' + extra['connection'], + 'cacheDisk:' + extra['cacheDisk'], + 'cacheMem:' + extra['cacheMem'], + 'width:' + str(extra['width']), + 'height:' + str(extra['height']), + 'tun:' + extra['tun'] + ] + data = simpleScrambler( '\t'.join(data)) + res = '
' % (codebase, '1', data ) + res += '

In order to use this transport, you need to install first nomachine nx client version 3.5.x

' + res += '

you can obtain it for your platform from nochamine web site

' + return res + + +def getHtmlComponent(module, componentId): + dict = { '1' : ['nxtuntransport.jar', 'application/java-archive' ], '2' : ['launcher.jar', 'application/java-archive']} + + if dict.has_key(componentId) == False: + return ['text/plain', 'no component'] + fname = os.path.dirname(sys.modules[module].__file__) + '/applet/' + dict[componentId][0] + logger.debug('Loading component {0} from {1}'.format(componentId, fname)) + + f = open(fname, 'rb') + data = f.read() + f.close() + return [ dict[componentId][1], data ] \ No newline at end of file diff --git a/server/src/uds/transports/__init__.py b/server/src/uds/transports/__init__.py new file mode 100644 index 000000000..7f702f805 --- /dev/null +++ b/server/src/uds/transports/__init__.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +import os.path, pkgutil +import sys +import uds.core + +# Dinamycally import children of this package. The __init__.py files must register, if needed, inside TransportsFactory +pkgpath = os.path.dirname(sys.modules[__name__].__file__) +for _, name, _ in pkgutil.iter_modules([pkgpath]): + __import__(name, globals(), locals(), [], -1) diff --git a/server/src/uds/urls.py b/server/src/uds/urls.py new file mode 100644 index 000000000..9c3b1bc5f --- /dev/null +++ b/server/src/uds/urls.py @@ -0,0 +1,65 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.conf.urls.defaults import patterns, include +from uds.core.util.modfinder import loadModulesUrls + +urlpatterns = patterns('uds', + (r'^$', 'web.views.index'), + (r'^login/$', 'web.views.login'), + (r'^logout$', 'web.views.logout'), + (r'^service/(?P.+)/(?P.+)$', 'web.views.service'), + # Icons + (r'^transicon/(?P.+)$', 'web.views.transportIcon'), + # Error URL + (r'^error/(?P.+)$', 'web.views.error'), + # Transport component url + (r'^transcomp/(?P.+)/(?P.+)$', 'web.views.transcomp'), + # Authenticators custom html + (r'^customAuth/(?P.*)$', 'web.views.customAuth'), + # Preferences + (r'^prefs$', 'web.views.prefs'), + # Change Language + (r'^i18n/', include('django.conf.urls.i18n')), + # Downloadables + (r'^download/(?P.*)$', 'web.views.download'), + # XMLRPC Processor + (r'^xmlrpc$', 'xmlrpc.views.xmlrpc'), + # Custom authentication callback + (r'^auth/(?P.+)', 'web.views.authCallback'), + (r'^authJava/(?P.+)/(?P.*)$', 'web.views.authJava'), + +) + +# Append urls from special dispatcher +urlpatterns += loadModulesUrls() diff --git a/server/src/uds/views.py b/server/src/uds/views.py new file mode 100644 index 000000000..b2433a1f5 --- /dev/null +++ b/server/src/uds/views.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + diff --git a/server/src/uds/web/__init__.py b/server/src/uds/web/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/server/src/uds/web/errors.py b/server/src/uds/web/errors.py new file mode 100644 index 000000000..3de86602a --- /dev/null +++ b/server/src/uds/web/errors.py @@ -0,0 +1,106 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext_lazy as _ +from django.http import HttpResponseRedirect +from django.core.urlresolvers import reverse +from transformers import scrambleId +from uds.models import DeployedService, Transport, UserService, Authenticator +from uds.core.auths.Exceptions import InvalidUserException, InvalidAuthenticatorException +from uds.core.services.Exceptions import InvalidServiceException, MaxServicesReachedException +import logging + +logger = logging.getLogger(__name__) + +UNKNOWN_ERROR = 0 +TRANSPORT_NOT_FOUND = 1 +SERVICE_NOT_FOUND = 2 +ACCESS_DENIED = 3 +INVALID_SERVICE = 4 +MAX_SERVICES_REACHED = 5 +COOKIES_NEEDED = 6 +USER_SERVICE_NOT_FOUND = 7 +AUTHENTICATOR_NOT_FOUND = 8 +INVALID_CALLBACK = 9 + + +strings = [ + _('Unknown error'), + _('Transport not found'), + _('Service not found'), + _('Access denied'), + _('Invalid service. The service is not available at this moment. Please, try later'), + _('Maximum services limit reached. Please, contact administrator'), + _('You need to enable cookies to let this application work'), + _('User service not found'), + _('Authenticator not found'), + _('Invalid authenticator callback') + ] + + +def errorString(errorId): + errorId = int(errorId) + if errorId < len(strings): + return strings[errorId] + return strings[0] + + +def errorView(request, idError): + return HttpResponseRedirect( reverse('uds.web.views.error', kwargs = { 'idError': scrambleId(request, idError) }) ) + + +def exceptionView(request, exception): + ''' + Tries to render an error page with error information + ''' + try: + raise exception + except UserService.DoesNotExist: + return errorView(request, USER_SERVICE_NOT_FOUND) + except DeployedService.DoesNotExist: + return errorView(request, SERVICE_NOT_FOUND) + except Transport.DoesNotExist: + return errorView(request, TRANSPORT_NOT_FOUND) + except Authenticator.DoesNotExist: + return errorView(request, AUTHENTICATOR_NOT_FOUND) + except InvalidUserException: + return errorView(request, ACCESS_DENIED) + except InvalidServiceException: + return errorView(request, INVALID_SERVICE) + except MaxServicesReachedException: + return errorView(request, MAX_SERVICES_REACHED) + except InvalidAuthenticatorException: + return errorView(request, INVALID_CALLBACK) + except Exception as e: + logger.exception('Exception cauthg at view!!!') + raise e diff --git a/server/src/uds/web/forms/LoginForm.py b/server/src/uds/web/forms/LoginForm.py new file mode 100644 index 000000000..3b9c77a6f --- /dev/null +++ b/server/src/uds/web/forms/LoginForm.py @@ -0,0 +1,81 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext_lazy as _ +from django import forms +from django.conf import settings +from django.forms.forms import NON_FIELD_ERRORS +from django.forms.util import ErrorDict +from uds.models import Authenticator +from uds.core.auths import Authenticator as Auth +import logging + +logger = logging.getLogger(__name__) + +class BaseForm(forms.Form): + + def __init__(self, *args, **kwargs): + super(BaseForm, self).__init__(*args, **kwargs) + + def add_form_error(self, message): + if not self._errors: + self._errors = ErrorDict() + if not NON_FIELD_ERRORS in self._errors: + self._errors[NON_FIELD_ERRORS] = self.error_class() + self._errors[NON_FIELD_ERRORS].append(message) + + +class LoginForm(BaseForm): + user = forms.CharField(label=_('Username'), max_length=64) + password = forms.CharField(label=_('Password'), widget=forms.PasswordInput({'title': _('Password')})) + authenticator = forms.ChoiceField(label=_('Authenticator'), choices = ()) + java = forms.CharField(widget = forms.HiddenInput()) + standard = forms.CharField(widget = forms.HiddenInput()) + nonStandard = forms.CharField(widget = forms.HiddenInput(), required=False) + + def __init__(self, *args, **kwargs): + super(LoginForm, self).__init__(*args, **kwargs) + choices = [] + nonStandard = [] + standard = [] + for a in Authenticator.objects.all().order_by('priority'): + if a.getType() is None: + continue + choices.append( (a.id, a.name) ) + if a.getType().getHtml != Auth.getHtml: + nonStandard.append(str(a.id)) + else: + standard.append(str(a.id)) + self.fields['authenticator'].choices = choices + self.fields['nonStandard'].initial = ','.join(nonStandard) + self.fields['standard'].initial = ','.join(standard) diff --git a/server/src/uds/web/forms/__init__.py b/server/src/uds/web/forms/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/server/src/uds/web/transformers.py b/server/src/uds/web/transformers.py new file mode 100644 index 000000000..5315ebbc5 --- /dev/null +++ b/server/src/uds/web/transformers.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from functools import wraps +import logging +import base64, random, string + +logger = logging.getLogger(__name__) + +SCRAMBLE_SES = 'scrSid' +SCRAMBLE_LEN = 10 + +# Decorator to make easier protect pages +def transformId(view_func): + ''' + Decorator to untransform id used in a function. Its generates a hash of it + To use this decorator, the view must receive 'response' and 'id' and (optionaly) 'id2', 'id3' + example: def view(response, id) + ''' + @wraps(view_func) + def _wrapped_view(request, *args, **kwargs): + for k in kwargs.keys(): + if k[:2] == 'id': + kwargs[k] = unscrambleId(request, kwargs[k]) + return view_func(request, *args, **kwargs) + return _wrapped_view + + +def scrambleId(request, id): + if request.session.get(SCRAMBLE_SES) == None: + request.session[SCRAMBLE_SES] = ''.join(random.choice(string.letters) for i in xrange(SCRAMBLE_LEN)) + return base64.b64encode(str(id) + request.session.get(SCRAMBLE_SES)).encode('hex') + +def unscrambleId(request, id): + idd = base64.b64decode(id.decode('hex')) + return idd[:-SCRAMBLE_LEN] diff --git a/server/src/uds/web/views.py b/server/src/uds/web/views.py new file mode 100644 index 000000000..1f6672b94 --- /dev/null +++ b/server/src/uds/web/views.py @@ -0,0 +1,326 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden +from django.shortcuts import render_to_response +from django.template import RequestContext +from django.utils.translation import ugettext as _ +from django.core.urlresolvers import reverse +from uds.core.auths.auth import getIp, webLogin, webLogout, webLoginRequired, authenticate, webPassword, authenticateViaCallback +from uds.models import Authenticator, DeployedService, Transport, UserService, Network +from uds.web.forms.LoginForm import LoginForm +from uds.core.managers.UserServiceManager import UserServiceManager +from uds.core.managers.UserPrefsManager import UserPrefsManager +from uds.core.managers.DownloadsManager import DownloadsManager +from uds.core.util.Config import GlobalConfig +from uds.core.util.Cache import Cache +from uds.core.util import OsDetector +from transformers import transformId, scrambleId +import errors +import logging +import random +import string + +logger = logging.getLogger(__name__) +authLogger = logging.getLogger('__authLog') + +def __authLog(request, authenticator, userName, java, os, log): + ''' + Logs authentication + ''' + javaStr = java and 'Java' or 'No Java' + authLogger.info('|'.join([authenticator.name, userName, javaStr, os['OS'], log, request.META['HTTP_USER_AGENT']])) + + +def login(request): + #request.session.set_expiry(GlobalConfig.USER_SESSION_LENGTH.getInt()) + if request.method == 'POST': + if request.COOKIES.has_key('uds') is False: + return errors.errorView(request, errors.COOKIES_NEEDED) # We need cookies to keep session data + form = LoginForm(request.POST) + if form.is_valid(): + java = form.cleaned_data['java'] == 'y' + os = OsDetector.getOsFromUA(request.META['HTTP_USER_AGENT']) + authenticator = Authenticator.objects.get(pk=form.cleaned_data['authenticator']) + userName = form.cleaned_data['user'] + + cache = Cache('auth') + cacheKey = str(authenticator.id) + userName + tries = cache.get(cacheKey) + if tries is None: + tries = 0 + if tries >= GlobalConfig.MAX_LOGIN_TRIES.getInt(): + form.add_form_error('Too many authentication errors. User temporarily blocked.') + __authLog(request, authenticator, userName, java, os, 'Temporarily blocked') + else: + user = authenticate(userName, form.cleaned_data['password'], authenticator ) + + if user is None: + logger.debug("Invalid credentials for user {0}".format(userName)) + tries += 1 + cache.put(cacheKey, tries, GlobalConfig.LOGIN_BLOCK.getInt()) + form.add_form_error('Invalid credentials') + __authLog(request, authenticator, userName, java, os, 'Invalid credentials') + else: + cache.remove(cacheKey) # Valid login, remove cached tries + response = HttpResponseRedirect(reverse('uds.web.views.index')) + webLogin(request, response, user, form.cleaned_data['password']) + # Add the "java supported" flag to session + request.session['java'] = java + request.session['OS'] = os + __authLog(request, authenticator, user.name, java, os, 'Logged in') + return response + else: + form = LoginForm() + + response = render_to_response('uds/login.html', { 'form' : form, }, context_instance=RequestContext(request)) + if request.COOKIES.has_key('uds') is False: + response.set_cookie('uds', ''.join(random.choice(string.letters + string.digits) for _ in xrange(32))) + return response + +def customAuth(request, idAuth): + res = '' + try: + getIp(request) + a = Authenticator.objects.get(pk=idAuth).getInstance() + res = a.getHtml(request) + if res is None: + res = '' + except Exception: + logger.exception('customAuth') + res = 'error' + return HttpResponse(res, content_type = 'text/html') + +def logout(request): + return webLogout(request) + +@webLoginRequired +def index(request): + # Session data + os = request.session['OS'] + java = request.session['java'] + + # We look for services for this authenticator groups. User is logged in in just 1 authenticator, so his groups must coincide with those assigned to ds + groups = request.user.groups.all() + availServices = DeployedService.getDeployedServicesForGroups(groups) + availUserServices = UserService.getUserAssignedServices(request.user) + + # Information for administrators + nets = '' + validTrans = '' + + if request.user.isStaff(): + nets = ','.join( [ n.name for n in Network.networksFor(request.ip) ]) + tt = [] + for t in Transport.objects.all(): + if t.validForIp(request.ip): + tt.append(t.name) + validTrans = ','.join(tt) + + + # Extract required data to show to user + services = [] + # Select assigned user services + for svr in availUserServices: + trans = [] + for t in svr.transports.all().order_by('priority'): + if t.validForIp(request.ip): + trans.append({ 'id' : scrambleId(request, t.id), 'name' : t.name, 'needsJava' : t.getType().needsJava }) + services.append( {'id' : scrambleId(request, 'a' + str(svr['id'])), 'name': svr['name'], 'transports' : trans } ) + + # Now generic user service + for svr in availServices: + trans = [] + for t in svr.transports.all().order_by('priority'): + if t.validForIp(request.ip): + typeTrans = t.getType() + if typeTrans.supportsOs(os['OS']): + trans.append({ 'id' : scrambleId(request, t.id), 'name' : t.name, 'needsJava' : typeTrans.needsJava }) + services.append( {'id' : scrambleId(request, 'd' + str(svr.id)), 'name': svr.name, 'transports' : trans } ) + + logger.debug('Services: {0}'.format(services)) + + if len(services) == 1 and GlobalConfig.AUTORUN_SERVICE.get() == '1' and len(services[0]['transports']) > 0: + if request.session.get('autorunDone', '0') == '0': + request.session['autorunDone'] = '1' + return HttpResponseRedirect( + reverse('uds.web.views.service', kwargs={ 'idService': services[0]['id'], + 'idTransport' : services[0]['transports'][0]['id'] } + ) + ) + + + return render_to_response('uds/index.html', + {'services' : services, 'java' : java, 'ip' : request.ip, 'nets' : nets, + 'transports' : validTrans }, + context_instance=RequestContext(request)) + +@webLoginRequired +def prefs(request): + if request.method == 'POST': + UserPrefsManager.manager().processRequestForUserPreferences(request.user, request.POST) + return HttpResponseRedirect(reverse('uds.web.views.index')) + prefs_form = UserPrefsManager().manager().getHtmlForUserPreferences(request.user) + return render_to_response('uds/prefs.html', {'prefs_form' : prefs_form }, context_instance=RequestContext(request)) + + +@webLoginRequired +@transformId +def service(request, idService, idTransport): + kind, idService = idService[0], idService[1:] + try: + logger.debug('Kind of service: {0}, idService: {1}'.format(kind, idService)) + if kind == 'a': # This is an assigned service + ads = UserService.objects.get(pk=idService) + else: + ds = DeployedService.objects.get(pk=idService) + # We first do a sanity check for this, if the user has access to this service + # If it fails, will raise an exception + ds.validateUser(request.user) + # Now we have to locate an instance of the service, so we can assign it to user. + ads = UserServiceManager.manager().getAssignationForUser(ds, request.user) + logger.debug('Found service: {0}'.format(ads)) + trans = Transport.objects.get(pk=idTransport) + # Test if the service is ready + if ads.isReady(): + logger.debug('Ads is Ready') + # If ready, show transport for this service, if also ready ofc + iads = ads.getInstance() + ip = iads.getIp() + if ip is not None: + itrans = trans.getInstance() + if itrans.isAvailableFor(ip): + transport = itrans.renderForHtml(scrambleId(request, trans.id), ip, request.session['OS'], request.user, webPassword(request)) + return render_to_response('uds/show_transport.html', {'transport' : transport, 'nolang' : True }, context_instance=RequestContext(request)) + else: + logger.debug('Transport is not ready for user service {0}'.format(ads)) + else: + logger.debug('Ip not available from user service {0}'.format(ads)) + # Not ready, show message and return to this page in a while + return render_to_response('uds/service_not_ready.html', context_instance=RequestContext(request)) + except Exception, e: + logger.exception("Exception") + return errors.exceptionView(request, e) + +@webLoginRequired +@transformId +def transcomp(request, idTransport, componentId): + try: + # We got translated first id + trans = Transport.objects.get(pk=idTransport) + itrans = trans.getInstance() + res = itrans.getHtmlComponent(scrambleId(request, trans.id), request.session['OS'], componentId) + response = HttpResponse(res[1], mimetype=res[0]) + response['Content-Length'] = len(res[1]) + return response + except Exception, e: + return errors.exceptionView(request, e) + + +@transformId +def transportIcon(request, idTrans): + try: + icon = Transport.objects.get(pk=idTrans).getInstance().icon(False) + return HttpResponse(icon, mimetype='image/png') + except Exception: + return HttpResponseRedirect('/static/img/unknown.png') + +@transformId +def error(request, idError): + return render_to_response('uds/error.html', {'errorString' : errors.errorString(idError) }, context_instance=RequestContext(request)) + + +def authCallback(request, idAuth): + ''' + This url is provided so external SSO authenticators can get an url for + redirecting back the users. + + This will invoke authCallback of the requested idAuth and, if this represents + an authenticator that has an authCallback + ''' + from uds.core.auths.Exceptions import InvalidUserException + try: + authenticator = Authenticator.objects.get(pk=idAuth) + params = request.GET.copy() + params.update(request.POST) + + logger.debug('Auth callback for {0} with params {1}'.format(authenticator, params)) + + user = authenticateViaCallback(authenticator, params) + + os = OsDetector.getOsFromUA(request.META['HTTP_USER_AGENT']) + + if user is None: + __authLog(request, authenticator, '{0}'.format(params), False, os, 'Invalid at auth callback') + raise InvalidUserException() + + response = render_to_response('uds/detectJava.html', { 'idAuth' : scrambleId(request, authenticator.id)}, + context_instance=RequestContext(request)) + + webLogin(request, response, user, '') # Password + request.session['OS'] = os + # Now we render an intermediate page, so we get Java support from user + # It will only detect java, and them redirect to Java + + return response + except Exception as e: + return errors.exceptionView(request, e) + + +@webLoginRequired +@transformId +def authJava(request, idAuth, hasJava): + request.session['java'] = hasJava == 'y' + try: + authenticator = Authenticator.objects.get(pk=idAuth) + os = request.session['OS'] + __authLog(request, authenticator, request.user.name, request.session['java'], os, 'Logged in') + return HttpResponseRedirect(reverse('uds.web.views.index')) + + except Exception as e: + return errors.exceptionView(request, e) + +@webLoginRequired +def download(request, idDownload): + ''' + Downloadables management + ''' + if request.user.isStaff() is False: + return HttpResponseForbidden(); + + if idDownload == '': + files = [ { 'id' : key, 'name' : val['name'], 'comment' : _(val['comment']) } for key, val in DownloadsManager.manager().getDownloadables().items() ] + logger.debug('Files: {0}'.format(files)) + return render_to_response('uds/downloads.html', { 'files' : files }, context_instance=RequestContext(request)) + + return DownloadsManager.manager().send(request, idDownload) diff --git a/server/src/uds/xmlrpc/__init__.py b/server/src/uds/xmlrpc/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/server/src/uds/xmlrpc/actor/Actor.py b/server/src/uds/xmlrpc/actor/Actor.py new file mode 100644 index 000000000..9a6798b44 --- /dev/null +++ b/server/src/uds/xmlrpc/actor/Actor.py @@ -0,0 +1,86 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.db import transaction +from uds.models import UserService, State +from uds.core.util import Log + +import logging + +logger = logging.getLogger(__name__) + +def test(): + ''' + Simple test function called by actors to test communication. + ''' + logger.debug("Test called") + return True + +@transaction.commit_on_success +def message(id_, message, data): + ''' + Process a message from the actor. + @param _id: Ids used by actors to identify themself and locate services to witch they belongs + @param message: Mesagge received from actor + @param data: Extra data + ''' + ids = id_.split(",")[:5] # Limit ids received to five... + logger.debug("Called message for id_ {0}, message \"{1}\" and data \"{2}\"".format(ids, message, data)) + res = "" + try: + services = UserService.objects.select_for_update().filter(unique_id__in=ids, state__in=[State.USABLE, State.PREPARING]) + if services.count() == 0: + res = "" + else: + inUse = services[0].in_use + res = services[0].getInstance().osmanager().process(services[0], message, data) + services = UserService.objects.select_for_update().filter(unique_id__in=ids, state__in=[State.USABLE, State.PREPARING]) + if services.count() > 0 and services[0].in_use != inUse: # If state changed, log it + type_ = inUse and 'login' or 'logout' + uniqueId = services[0].unique_id + serviceIp = '' + username = '' + Log.useLog(type_, uniqueId , serviceIp, username) + except Exception as e: + logger.error("Exception at message (client): {0}".format(e)) + res = "" + logger.debug("Returning {0}".format(res)) + return res + + +def registerActorFunctions(dispatcher): + ''' + Utility function to register methods at xmlrpc server for actor + ''' + dispatcher.register_function(test, 'test') + dispatcher.register_function(message, 'message') diff --git a/server/src/uds/xmlrpc/actor/__init__.py b/server/src/uds/xmlrpc/actor/__init__.py new file mode 100644 index 000000000..bf7eee4c4 --- /dev/null +++ b/server/src/uds/xmlrpc/actor/__init__.py @@ -0,0 +1,3 @@ +''' +This module is responsible of the communication betwen actors and OS Managers +''' \ No newline at end of file diff --git a/server/src/uds/xmlrpc/auths/AdminAuth.py b/server/src/uds/xmlrpc/auths/AdminAuth.py new file mode 100644 index 000000000..f88bfa062 --- /dev/null +++ b/server/src/uds/xmlrpc/auths/AdminAuth.py @@ -0,0 +1,163 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext as _, activate +from django.contrib.sessions.backends.db import SessionStore +from uds.models import Authenticator +from ..util.Exceptions import AuthException +from uds.core.util.Config import GlobalConfig +from uds.core.auths.auth import authenticate +from functools import wraps +from django.conf import settings +import logging + +logger = logging.getLogger(__name__) + +ADMIN_AUTH = '#' + +CLIENT_VERSION_REQUIRED = '1.0.7' + +class Credentials(object): + ''' + Represents a valid credential from a user connected to administration. + ''' + def __init__(self, session, credential_key): + self.idAuth = session['idAuth'] + self.isAdmin = session['isAdmin'] + self.user = session['username'] + self.locale = session['locale'] + self.key = credential_key + + def __unicode__(self): + return "authId: {0}, isAdmin: {1}, user: {2}, locale: {3}, key: {4}".format(self.idAuth, self.isAdmin, self.user, self.locale, self.key) + + def __str__(self): + return "authId: {0}, isAdmin: {1}, user: {2}, locale: {3}, key: {4}".format(self.idAuth, self.isAdmin, self.user, self.locale, self.key) + + +def makeCredentials(idAuth, username, locale, isAdmin): + session = SessionStore() + session.set_expiry(GlobalConfig.ADMIN_IDLE_TIME.getInt()) + session['idAuth'] = idAuth + session['username'] = username + session['locale'] = locale + session['isAdmin'] = isAdmin + session.save() + return { 'credentials' : session.session_key, 'versionRequired' : CLIENT_VERSION_REQUIRED, 'url' : settings.STATIC_URL + "bin/UDSAdminSetup.exe", + 'urlLinux' : settings.STATIC_URL + "bin/UDSAdminSetup.tar.gz", 'isAdmin' : isAdmin } + +# Decorator for validate credentials +def needs_credentials(xmlrpc_func): + ''' + Validates the credentials + ''' + @wraps(xmlrpc_func) + def _wrapped_xmlrcp_func(credentials, *args, **kwargs): + logger.debug('Checkin credentials {0} for function {1}'.format(credentials, xmlrpc_func.__name__)) + cred = validateCredentials(credentials) + if cred is not None: + logger.debug('Credentials valid, executing') + return xmlrpc_func(cred, *args, **kwargs) + raise AuthException(_('Credentials no longer valid')) + return _wrapped_xmlrcp_func + + +def validateCredentials(credentials): + ''' + Validates the credentials of an user + :param credentials: + ''' + session = SessionStore(session_key = credentials) + if session.exists(credentials) is False: + return None + if session.has_key('idAuth') is False: + return None + activate(session['locale']) + logger.debug('Locale activated') + # Updates the expire key, this is the slow part as we can see at debug log, better if we can only update the expire_key this takes 80 ms!!! + session.save() + logger.debug('Session updated') + return Credentials(session, credentials ) + + +def invalidateCredentials(credentials): + session = SessionStore(session_key = credentials.key) + session.delete() + + +def getAdminAuths(locale): + ''' + Returns the authenticators + ''' + activate(locale) + auths = Authenticator.all() + res = [ { 'id' : str(a.id), 'name' : a.name } for a in auths ] + return res + [ {'id' : ADMIN_AUTH, 'name' : _('Administration') }] + + +# Xmlrpc functions +def login(username, password, idAuth, locale): + ''' + Validates the user/password credentials, assign to it the specified locale for this session and returns a credentials response + ''' + + logger.info("Validating user {0} with authenticator {1} with locale {2}".format(username, idAuth, locale)) + activate(locale) + if idAuth == ADMIN_AUTH: + if GlobalConfig.SUPER_USER_LOGIN.get() == username and GlobalConfig.SUPER_USER_PASS.get(True) == password: + return makeCredentials(idAuth, username, locale, True) + else: + raise AuthException(_('Invalid credentials')) + try: + auth = Authenticator.objects.get(pk=idAuth) + user = authenticate(username, password, auth) + except Exception: + raise AuthException(_('Invalid authenticator')) + if user is None or user.staff_member is False: + raise AuthException(_('Access denied')) + return makeCredentials(idAuth, username, locale, user.is_admin) + + +@needs_credentials +def logout(credentials): + ''' + Logs out and administration user + ''' + invalidateCredentials(credentials) + logger.info('Logged out admin user {0}'.format(credentials)) + return True + +def registerAdminAuthFunctions(dispatcher): + dispatcher.register_function(login, 'login') + dispatcher.register_function(getAdminAuths, 'getAdminAuths') + dispatcher.register_function(logout, 'logout') diff --git a/server/src/uds/xmlrpc/auths/Authenticators.py b/server/src/uds/xmlrpc/auths/Authenticators.py new file mode 100644 index 000000000..a2f968cd5 --- /dev/null +++ b/server/src/uds/xmlrpc/auths/Authenticators.py @@ -0,0 +1,257 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext as _ +from django.db import IntegrityError +from uds.models import Authenticator +from Groups import getRealGroups +from uds.xmlrpc.util.Helpers import dictFromData +from uds.xmlrpc.util.Exceptions import InsertException, ParametersException, FindException, ValidationException +from uds.core.auths.Exceptions import AuthenticatorException +from uds.core import auths +from AdminAuth import needs_credentials +from uds.core.Environment import Environment +import logging + +logger = logging.getLogger(__name__) + +def dictFromAuthType(type_): + ''' + Returns a dictionary that describes the authenticator, so the administration + interface has the info to handle it. + + Args: + type_: Authenticator type (class) where to get information + + Returns: + Dictionary describing the Authenticator type + ''' + return { 'name' : type_.name(), 'type' : type_.type(), 'description' : type_.description(), + 'icon' : type_.icon(), 'isExternalSource' : type_.isExternalSource, + 'canSearchUsers' : type_.searchUsers != auths.Authenticator.searchUsers, + 'canSearchGroups' : type_.searchGroups != auths.Authenticator.searchGroups, + 'needsPassword' : type_.needsPassword, 'userNameLabel' : _(type_.userNameLabel), + 'groupNameLabel' : _(type_.groupNameLabel), 'passwordLabel' : _(type_.passwordLabel), + 'canCreateUsers' : type_.createUser != auths.Authenticator.createUser, + } + +@needs_credentials +def getAuthenticatorsTypes(credentials): + ''' + Returns the types of authenticators registered in system + ''' + res = [] + for _type in auths.factory().providers().values(): + res.append(dictFromAuthType(_type)) + return res + +@needs_credentials +def getAuthenticators(credentials): + ''' + Returns the services providers managed (at database) + ''' + logger.debug("Returning authenticators...") + res = [] + for auth in Authenticator.objects.all().order_by('priority'): + try: + val = { 'id' : str(auth.id), 'name' : auth.name, 'comments' : auth.comments, 'type' : auth.data_type, 'typeName' : auth.getInstance().name(), + 'priority' : str(auth.priority) } + res.append(val) + except Exception, e: + logger.debug("Exception: {0}".format(e)) + + return res + +@needs_credentials +def getAuthenticatorType(credentials, id): + ''' + Return the type of an authenticator + ''' + logger.debug('Returning authenticator type') + try: + auth = Authenticator.objects.get(pk=id) + logger.debug('Auth: {0}'.format(auth)) + return dictFromAuthType(auths.factory().lookup(auth.data_type)) + except Authenticator.DoesNotExist: + raise InsertException(_('Authenticator does not exists')) + +@needs_credentials +def getAuthenticatorGui(credentials, type): + ''' + Returns the description of an gui for the specified authenticator + ''' + logger.debug('Authenticator type requested: {0}'.format(type)) + authType = auths.factory().lookup(type) + return authType.guiDescription() + +@needs_credentials +def getAuthenticator(credentials, id): + ''' + Returns the specified authenticator (at database) + ''' + data = Authenticator.objects.get(pk=id) + res = [ + { 'name' : 'name', 'value' : data.name }, + { 'name' : 'comments', 'value' : data.comments }, + { 'name' : 'priority', 'value' : str(data.priority)} + ] + for key, value in data.getInstance().valuesDict().iteritems(): + valtext = 'value' + if value.__class__ == list: + valtext = 'values' + val = {'name' : key, valtext : value } + res.append(val) + return res + +@needs_credentials +def getAuthenticatorGroups(credentials, id): + ''' + ''' + return getRealGroups(id) + +@needs_credentials +def createAuthenticator(credentials, type, data): + ''' + Creates a new authenticator with specified type and data + It's mandatory that data contains at least 'name' and 'comments'. + The expected structure is the same that provided at getServiceProvider + ''' + dict_ = dictFromData(data) + # First create data without serialization, then serialies data with correct environment + auth = None + try: + auth = Authenticator.objects.create(name = dict_['name'], comments = dict_['comments'], data_type = type, priority=int(dict_['priority'])) + auth.data = auth.getInstance(dict_).serialize() + auth.save() + except auths.Authenticator.ValidationException as e: + auth.delete() + raise ValidationException(str(e)) + except IntegrityError: # Must be exception at creation + raise InsertException(_('Name %s already exists') % (dict_['name'])) + except Exception as e: + logger.exception("Exception at createAuthenticator") + logger.error(auth) + if auth is not None: + auth.delete() + raise e + + # Returns true always, + return True + +@needs_credentials +def modifyAuthenticator(credentials, id, data): + ''' + Modifies an existing service provider with specified id and data + It's mandatory that data contains at least 'name' and 'comments'. + The expected structure is the same that provided at getServiceProvider + ''' + try: + auth = Authenticator.objects.get(pk=id) + dict_ = dictFromData(data) + a = auth.getInstance(dict_) + auth.data = a.serialize() + auth.name = dict_['name'] + auth.comments = dict_['comments'] + auth.priority = int(dict_['priority']) + auth.save() + except auths.Authenticator.ValidationException as e: + raise ValidationException(str(e)) + + return True + +@needs_credentials +def removeAuthenticator(credentials, id): + ''' + Removes from database authenticator with specified id + ''' + Authenticator.objects.get(pk=id).delete() + return True + +@needs_credentials +def testAuthenticator(credentials, type, data): + ''' + invokes the test function of the specified authenticator type, with the suplied data + ''' + logger.debug("Testing authenticator, type: {0}, data:{1}".format(type, data)) + authType = auths.factory().lookup(type) + # We need an "temporary" environment to test this service + dict_ = dictFromData(data) + res = authType.test(Environment.getTempEnv(), dict_) + return {'ok' : res[0], 'message' : res[1]} + +@needs_credentials +def checkAuthenticator(credentials, id): + ''' + Invokes the check function of the specified authenticator + ''' + auth = Authenticator.objects.get(id=id) + a = auth.getInstance() + return a.check() + +@needs_credentials +def searchAuthenticator(credentials, id, srchUser, srchString): + ''' + Search for the users that match srchString + ''' + logger.debug("srchUser: {0}".format(srchUser)) + try: + auth = Authenticator.objects.get(pk=id).getInstance() + canDoSearch = srchUser is True and (auth.searchUsers != auths.Authenticator.searchUsers) or (auth.searchGroups != auths.Authenticator.searchGroups) + if canDoSearch is False: + raise ParametersException(_('Authenticator do not supports search')) + if srchUser is True: + return auth.searchUsers(srchString) + else: + return auth.searchGroups(srchString) + except Authenticator.DoesNotExist: + raise FindException(_('Specified authenticator do not exists anymore. Please, reload gui')) + except AuthenticatorException, e: + raise ParametersException(str(e)) + + raise FindException(_('BUG: Reached a point that should never have been reached!!!')) + + +def registerAuthenticatorFunctions(dispatcher): + dispatcher.register_function(getAuthenticatorsTypes, 'getAuthenticatorsTypes') + dispatcher.register_function(getAuthenticatorType, 'getAuthenticatorType') + dispatcher.register_function(getAuthenticators, 'getAuthenticators') + dispatcher.register_function(getAuthenticatorGui, 'getAuthenticatorGui') + dispatcher.register_function(getAuthenticator, 'getAuthenticator') + dispatcher.register_function(getAuthenticatorGroups, 'getAuthenticatorGroups') + dispatcher.register_function(createAuthenticator, 'createAuthenticator') + dispatcher.register_function(modifyAuthenticator, 'modifyAuthenticator') + dispatcher.register_function(removeAuthenticator, 'removeAuthenticator') + dispatcher.register_function(testAuthenticator, 'testAuthenticator') + dispatcher.register_function(checkAuthenticator, 'checkAuthenticator') + dispatcher.register_function(searchAuthenticator, 'searchAuthenticator') + diff --git a/server/src/uds/xmlrpc/auths/Groups.py b/server/src/uds/xmlrpc/auths/Groups.py new file mode 100644 index 000000000..64d6326dd --- /dev/null +++ b/server/src/uds/xmlrpc/auths/Groups.py @@ -0,0 +1,114 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from uds.models import Group, Authenticator, State +from django.db import IntegrityError +from ..util.Exceptions import DuplicateEntryException, InsertException +from uds.core.auths.Exceptions import AuthenticatorException +from AdminAuth import needs_credentials +import logging + +logger = logging.getLogger(__name__) + +def dictFromGroup(grp): + state = True if grp.state == State.ACTIVE else False + return { 'idParent' : str(grp.manager.id), 'nameParent': grp.manager.name, 'id' : str(grp.id), 'name' : grp.name, + 'comments' : grp.comments, 'active' : state } + +def getRealGroups(idParent): + auth = Authenticator.objects.get(pk=idParent) + res = [] + for grp in auth.groups.order_by('name'): + try: + res.append(dictFromGroup(grp)) + except Exception, e: + logger.debug(e) + return res + +@needs_credentials +def getGroups(credentials, idParent): + ''' + Returns the groups contained at idParent authenticator + ''' + return getRealGroups(idParent) + +@needs_credentials +def getGroup(__, id_): + ''' + ''' + grp = Group.objects.get(pk=id_) + return dictFromGroup(grp) + +@needs_credentials +def createGroup(credentials, grp): + ''' + Creates a new group associated with an authenticator + ''' + auth = Authenticator.objects.get(pk=grp['idParent']) + state = State.ACTIVE if grp['active'] == True else State.INACTIVE + try: + authInstance = auth.getInstance() + authInstance.createGroup(grp) # Remenber, this throws an exception if there is an error + auth.groups.create(name = grp['name'], comments = grp['comments'], state = state) + except IntegrityError: + raise DuplicateEntryException(grp['name']) + except AuthenticatorException, e: + logger.debug(e) + raise InsertException(str(e)) + return True + +@needs_credentials +def removeGroups(credentials, ids): + ''' + Deletes a group + ''' + Group.objects.filter(id__in=ids).delete() + return True + +@needs_credentials +def changeGroupsState(credentials, ids, newState): + ''' + Changes the state of the specified group + ''' + state = State.ACTIVE if newState == True else State.INACTIVE + Group.objects.filter(id__in=ids).update(state = state) + return True + +# Registers XML RPC Methods +def registerGroupsFunctions(dispatcher): + dispatcher.register_function(getGroups, 'getGroups') + dispatcher.register_function(getGroup, 'getGroup') + dispatcher.register_function(createGroup, 'createGroup') + dispatcher.register_function(removeGroups, 'removeGroups') + dispatcher.register_function(changeGroupsState, 'changeGroupsState') + \ No newline at end of file diff --git a/server/src/uds/xmlrpc/auths/UserPreferences.py b/server/src/uds/xmlrpc/auths/UserPreferences.py new file mode 100644 index 000000000..1e5f03e4b --- /dev/null +++ b/server/src/uds/xmlrpc/auths/UserPreferences.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from uds.models import User +from uds.core.managers.UserPrefsManager import UserPrefsManager +from ..util.Helpers import dictFromData +from AdminAuth import needs_credentials +import logging + +logger = logging.getLogger(__name__) + +@needs_credentials +def getPrefsForUser(credentials, id): + user = User.objects.get(pk=id) + return UserPrefsManager().manager().getGuiForUserPreferences(user) + +@needs_credentials +def setPrefsForUser(credentials, id, data): + user = User.objects.get(pk=id) + data = dictFromData(data) + logger.debug("Data: {0}".format(data)) + UserPrefsManager().manager().processGuiForUserPreferences(user, data) + return False + + +def registerPreferencesFunctions(dispatcher): + dispatcher.register_function(getPrefsForUser, 'getPrefsForUser') + dispatcher.register_function(setPrefsForUser, 'setPrefsForUser') + diff --git a/server/src/uds/xmlrpc/auths/Users.py b/server/src/uds/xmlrpc/auths/Users.py new file mode 100644 index 000000000..57778f479 --- /dev/null +++ b/server/src/uds/xmlrpc/auths/Users.py @@ -0,0 +1,196 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.db import IntegrityError +from uds.models import User as DbUser, Group as DbGroup, Authenticator as DbAuthenticator, State +from uds.core.managers.CryptoManager import CryptoManager +from ..util.Exceptions import DuplicateEntryException, InsertException +from uds.core.auths.Exceptions import AuthenticatorException, InvalidUserException +from AdminAuth import needs_credentials +from Groups import dictFromGroup +from uds.core.auths.User import User +import hashlib +import logging + +logger = logging.getLogger(__name__) +INVALID_PASS = '@#&&/%&$%&/adffa' + +def dictFromUser(usr, groups = None): + dict = { 'idParent' : str(usr.manager.id), 'nameParent' : usr.manager.name, 'id' : str(usr.id), 'name' : usr.name, 'realName' : usr.real_name, + 'comments' : usr.comments, 'state' : usr.state, 'lastAccess' : usr.last_access, 'password' : INVALID_PASS, 'oldPassword' : INVALID_PASS, + 'staffMember' : usr.staff_member, 'isAdmin' : usr.is_admin } + if groups != None: + dict['groups'] = groups + logger.debug('Dict: {0}'.format(dict)) + return dict + +@needs_credentials +def getUsers(credentials, idParent): + ''' + Returns the users contained at idParent authenticator + ''' + auth = DbAuthenticator.objects.get(pk=idParent) + res = [] + for usr in auth.users.order_by('name'): + try: + res.append(dictFromUser(usr)) + except Exception, e: + logger.debug(e) + return res + +@needs_credentials +def getUser(credentials, id): + ''' + ''' + usr = User(DbUser.objects.get(pk=id)) + + grps = [] + for g in usr.groups(): + grps.append(dictFromGroup(g.dbGroup())) + logger.debug(grps) + return dictFromUser(usr.dbUser(), grps) + +@needs_credentials +def createUser(credentials, usr): + ''' + Creates a new user associated with an authenticator + ''' + auth = DbAuthenticator.objects.get(pk=usr['idParent']) + try: + authInstance = auth.getInstance() + authInstance.createUser(usr) # Remenber, this throws an exception if there is an error + staffMember = isAdmin = False + if credentials.isAdmin is True: + staffMember = usr['staffMember'] + isAdmin = usr['isAdmin'] + password = '' + if authInstance.needsPassword is True: + password = CryptoManager.manager().hash(usr['password']) + + user = auth.users.create(name = usr['name'], real_name = usr['realName'], comments = usr['comments'], state = usr['state'], + password = password, staff_member = staffMember, is_admin = isAdmin) + + if authInstance.isExternalSource == False: + for grp in usr['groups']: + group = DbGroup.objects.get(pk=grp['id']) + user.groups.add(group) + except IntegrityError, e: + raise DuplicateEntryException(usr['name']) + except Exception as e: + logger.exception(e) + raise InsertException(str(e)) + return True + +@needs_credentials +def modifyUser(credentials, usr): + ''' + Modifies an existing service provider with specified id and data + It's mandatory that data contains at least 'name' and 'comments'. + The expected structure is the same that provided at getServiceProvider + ''' + try: + user = DbUser.objects.get(pk=usr['id']) + auth = user.manager.getInstance() + auth.modifyUser(usr) # Notifies authenticator + logger.debug(usr) + user.name = usr['name'] + user.real_name = usr['realName'] + user.comments = usr['comments'] + if credentials.isAdmin is True: + logger.debug('Is an admin') + user.is_admin = usr['isAdmin'] + user.staff_member = usr['staffMember'] + if usr['password'] != usr['oldPassword']: + user.password = CryptoManager.manager().hash(usr['password']) + user.state = usr['state'] + user.save() + # Now add/removes groups acordly + if auth.isExternalSource == False: + newGrps = {} + knownGrps = user.groups.all() + # Add new groups, and keep a dict of all groups selected + for g in usr['groups']: + newGrps[int(g['id'])] = g['name'] + grp = DbGroup.objects.get(pk=g['id']) + if (grp in knownGrps) == False: + user.groups.add(grp) + # Remove unselected groups + for g in knownGrps: + if newGrps.has_key(g.id) == False: + user.groups.remove(g) + # Add new groups + except Exception as e: + logger.exception(e) + raise(InsertException(str(e))) + return True + +@needs_credentials +def removeUsers(credentials, ids): + ''' + Deletes a group + ''' + DbUser.objects.filter(id__in=ids).delete() + return True + +@needs_credentials +def getUserGroups(credentials, id): + ''' + Get groups assigned to this user + ''' + user = DbUser.objects.get(pk=id) + auth = user.manager.getInstance() + res = [] + #if auth.isExternalSource == False: + for grp in user.groups.all(): + res.append(dictFromGroup(grp)) + return res + +@needs_credentials +def changeUsersState(credentials, ids, newState): + ''' + Changes the state of the specified group + ''' + #state = State.ACTIVE if newState == True else State.INACTIVE + DbUser.objects.filter(id__in=ids).update(state = newState) + return True + +# Registers XML RPC Methods +def registerUserFunctions(dispatcher): + dispatcher.register_function(getUsers, 'getUsers') + dispatcher.register_function(getUser, 'getUser') + dispatcher.register_function(getUserGroups, 'getUserGroups') + dispatcher.register_function(createUser, 'createUser') + dispatcher.register_function(modifyUser, 'modifyUser') + dispatcher.register_function(removeUsers, 'removeUsers') + dispatcher.register_function(changeUsersState, 'changeUsersState') + \ No newline at end of file diff --git a/server/src/uds/xmlrpc/auths/__init__.py b/server/src/uds/xmlrpc/auths/__init__.py new file mode 100644 index 000000000..d3f783405 --- /dev/null +++ b/server/src/uds/xmlrpc/auths/__init__.py @@ -0,0 +1,3 @@ +''' +This module is responsible of the communication betwen administration client and authenticator part of UDS +''' \ No newline at end of file diff --git a/server/src/uds/xmlrpc/osmanagers/OSManagers.py b/server/src/uds/xmlrpc/osmanagers/OSManagers.py new file mode 100644 index 000000000..f22929b36 --- /dev/null +++ b/server/src/uds/xmlrpc/osmanagers/OSManagers.py @@ -0,0 +1,184 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext as _ +from django.db import IntegrityError +from uds.models import OSManager +from uds.core.osmanagers.OSManagersFactory import OSManagersFactory +from ..util.Exceptions import DeleteException, FindException, ValidationException, InsertException, ModifyException +from ..util.Helpers import dictFromData +from ..auths.AdminAuth import needs_credentials +from uds.core.Environment import Environment +import logging +from uds.core.osmanagers.BaseOsManager import BaseOSManager + +logger = logging.getLogger(__name__) + +@needs_credentials +def getOSManagersTypes(credentials): + ''' + Returns the types of services providers registered in system + ''' + res = [] + for type in OSManagersFactory.factory().providers().values(): + val = { 'name' : type.name(), 'type' : type.type(), 'description' : type.description(), 'icon' : type.icon() } + res.append(val) + return res + +@needs_credentials +def getOSManagers(credentials): + ''' + Returns the services providers managed (at database) + ''' + res = [] + for prov in OSManager.objects.order_by('name'): + try: + val = { 'id' : str(prov.id), 'name' : prov.name, 'comments' : prov.comments, 'type' : prov.data_type, 'typeName' : prov.getInstance().name() } + res.append(val) + except Exception: + pass + return res + +@needs_credentials +def getOSManagerGui(credentials, type): + ''' + Returns the description of an gui for the specified service provider + ''' + spType = OSManagersFactory.factory().lookup(type) + return spType.guiDescription() + +@needs_credentials +def getOSManager(credentials, id): + ''' + Returns the specified service provider (at database) + ''' + data = OSManager.objects.get(pk=id) + res = [ + { 'name' : 'name', 'value' : data.name }, + { 'name' : 'comments', 'value' : data.comments }, + ] + for key, value in data.getInstance().valuesDict().iteritems(): + valtext = 'value' + if value.__class__ == list: + valtext = 'values' + val = {'name' : key, valtext : value } + res.append(val) + return res + +@needs_credentials +def createOSManager(credentials, type, data): + ''' + Creates a new service provider with specified type and data + It's mandatory that data contains at least 'name' and 'comments'. + The expected structure is the same that provided at getServiceProvider + ''' + dict = dictFromData(data) + try: + # First create data without serialization, then serialies data with correct environment + sp = OSManager.objects.create(name = dict['name'], comments = dict['comments'], data_type = type) + sp.data = sp.getInstance(dict).serialize() + sp.save() + except BaseOSManager.ValidationException, e: + sp.delete() + raise ValidationException(str(e)) + except IntegrityError: # Must be exception at creation + raise InsertException(_('Name %s already exists') % (dict['name'])) + return True + +@needs_credentials +def modifyOSManager(credentials, id, data): + ''' + Modifies an existing service provider with specified id and data + It's mandatory that data contains at least 'name' and 'comments'. + The expected structure is the same that provided at getServiceProvider + ''' + osm = OSManager.objects.get(pk=id) + dps = osm.deployedServices.all().count() + if dps > 0: + errorDps = ','.join([ o.name for o in osm.deployedServices.all()]) + raise ModifyException(_('This os mnager is being used by deployed services') + ' ' + errorDps) + dict = dictFromData(data) + sp = osm.getInstance(dict) + osm.data = sp.serialize() + osm.name = dict['name'] + osm.comments = dict['comments'] + osm.save() + return True + +@needs_credentials +def removeOSManager(credentials, id): + ''' + Removes from os manager with specified id + ''' + try: + if OSManager.objects.get(pk=id).remove() == False: + raise DeleteException(_('There is deployed services using this os manager')) + except OSManager.DoesNotExist: + raise FindException(_('Can\'t find os manager')) + + return True + +@needs_credentials +def testOsManager(credentials, type, data): + ''' + invokes the test function of the specified service provider type, with the suplied data + ''' + logger.debug("Testing service provider, type: {0}, data:{1}".format(type, data)) + spType = OSManagersFactory.factory().lookup(type) + # We need an "temporary" environment to test this service + dict = dictFromData(data) + res = spType.test(Environment.getTempEnv(), dict) + return {'ok' : res[0], 'message' : res[1]} + +@needs_credentials +def checkOSManager(credentials, id): + ''' + Invokes the check function of the specified service provider + ''' + prov = OSManager.objects.get(id=id) + sp = prov.getInstance() + return sp.check() + + +# Registers XML RPC Methods +def registerOSManagersFunctions(dispatcher): + dispatcher.register_function(getOSManagersTypes, 'getOSManagersTypes') + dispatcher.register_function(getOSManagers, 'getOSManagers') + dispatcher.register_function(getOSManagerGui, 'getOSManagerGui') + dispatcher.register_function(getOSManager, 'getOSManager') + dispatcher.register_function(createOSManager, 'createOSManager') + dispatcher.register_function(modifyOSManager, 'modifyOSManager') + dispatcher.register_function(removeOSManager, 'removeOSManager') + dispatcher.register_function(testOsManager, 'testOsManager') + dispatcher.register_function(checkOSManager, 'checkOSManager') + diff --git a/server/src/uds/xmlrpc/osmanagers/__init__.py b/server/src/uds/xmlrpc/osmanagers/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/server/src/uds/xmlrpc/services/DeployedServices.py b/server/src/uds/xmlrpc/services/DeployedServices.py new file mode 100644 index 000000000..5c7eb53ea --- /dev/null +++ b/server/src/uds/xmlrpc/services/DeployedServices.py @@ -0,0 +1,296 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from uds.models import DeployedService, Service, OSManager, Transport, State, Group +from ..auths.AdminAuth import needs_credentials +from django.db import IntegrityError +from ..util.Exceptions import DuplicateEntryException, InsertException, FindException +from Services import infoDictFromServiceInstance +from ..auths.Groups import dictFromGroup +from ..transports.Transports import dictFromTransport + +import logging + +logger = logging.getLogger(__name__) + +def dictFromDeployedService(srv): + if srv.service is not None: + service = srv.service.getInstance() + svrName = srv.service.name + else: + service = None + svrName = _('Unknown') + if srv.osmanager is not None: + osManagerName = srv.osmanager.name + else: + osManagerName = '' + transports = [] + for trans in srv.transports.order_by('name'): + transports.append( { 'id' : str(trans.id), 'name' : trans.name } ) + groups = [] + for grp in srv.assignedGroups.order_by('name'): + groups.append( { 'id' : str(grp.id), 'name' : grp.name }) + return { 'id' : str(srv.id), 'name' : srv.name, 'comments' : srv.comments, 'idService' : str(srv.service_id), + 'idOsManager' : str(srv.osmanager_id), 'initialServices' : srv.initial_srvs, 'cacheL1' : srv.cache_l1_srvs, + 'cacheL2' : srv.cache_l2_srvs, 'maxServices' : srv.max_srvs, 'state': srv.state, + 'serviceName' : svrName, 'osManagerName' : osManagerName, + 'transports' : transports, 'groups' : groups, 'info' : infoDictFromServiceInstance(service) + } + +def addTransportsToDeployedService(deployedService, transports): + ''' + Uses the dictionary transport to add transport to a deployedService. + We simply remmoves all previous transports and add the indicated transports + ''' + deployedService.transports.clear() + for tr in transports: + try: + transport = Transport.objects.get(pk=tr['id']) + logger.debug('Adding transport {0}'.format(transport)) + deployedService.transports.add(transport) + except Exception: + pass # Silently ignore unknown transports ids + return True + +@needs_credentials +def getDeployedServices(credentials, all): + ''' + Returns the available deployed services + ''' + logger.debug('Returning list of deployed services') + res = [] + if all == True: + dss = DeployedService.objects.all().order_by('name') + else: + dss = DeployedService.objects.filter(state = State.ACTIVE).order_by('name') + for ds in dss: + try: + res.append(dictFromDeployedService(ds)) + except Exception,e: + logger.debug('Exception: {0}'.format(e)) + return res + +@needs_credentials +def getDeployedService(credentials, id): + ''' + Returns the available deployed services + ''' + logger.debug('Returning list of deployed services') + ds = DeployedService.objects.get(pk=id) + if ds.state == State.ACTIVE: + return dictFromDeployedService(ds) + raise InsertException(_('Deployed Service does not exists')) + + +@needs_credentials +def createDeployedService(credentials, deployedService): + ''' + Creates a new deployed service based on params + ''' + logger.debug('Creating deployed service with params {0}'.format(deployedService)) + try: + service = Service.objects.get(pk=deployedService['idService']) + serviceInstance = service.getInstance() + initialServices = deployedService['initialServices'] + cacheL1 = deployedService['cacheL1'] + cacheL2 = deployedService['cacheL2'] + maxServices = deployedService['maxServices'] + if serviceInstance.usesCache == False: + initialServices = cacheL1 = cacheL2 = maxServices = 0 + osManager = None + if serviceInstance.needsManager: + osManager = OSManager.objects.get(pk=deployedService['idOsManager']) + dps = DeployedService.objects.create(name = deployedService['name'], comments = deployedService['comments'], service = service, + osmanager = osManager, state = State.ACTIVE, initial_srvs = initialServices, cache_l1_srvs = cacheL1, + cache_l2_srvs = cacheL2, max_srvs = maxServices, current_pub_revision = 1) + # Now we add transports + addTransportsToDeployedService(dps, deployedService['transports']) + except IntegrityError as e: + logger.error("Integrity error adding deployed service {0}".format(e)) + raise DuplicateEntryException(deployedService['name']) + except Exception as e: + logger.error("Exception adding deployed service {0}".format(deployedService)) + raise InsertException(str(e)) + return str(dps.id) + +@needs_credentials +def modifyDeployedService(credentials, deployedService): + ''' + Modifies a deployed service + ''' + logger.debug('Modifying deployed service'.format(deployedService)) + try: + dps = DeployedService.objects.get(pk=deployedService['id']) + serviceInstance = dps.service.getInstance() + initialServices = deployedService['initialServices'] + cacheL1 = deployedService['cacheL1'] + cacheL2 = deployedService['cacheL2'] + maxServices = deployedService['maxServices'] + if serviceInstance.usesCache == False: + initialServices = cacheL1 = cacheL2 = maxServices = 0 + + dps.name = deployedService['name'] + dps.comments = deployedService['comments'] + dps.initial_srvs = initialServices + dps.cache_l1_srvs = cacheL1 + dps.cache_l2_srvs = cacheL2 + dps.max_srvs = maxServices + dps.save() + # Now add transports + addTransportsToDeployedService(dps, deployedService['transports']) + except IntegrityError as e: + logger.error("Integrity error modifiying deployed service {0}".format(e)) + raise DuplicateEntryException(deployedService['name']) + except DeployedService.DoesNotExist: + logger.error("Requested deployed service does not exists") + raise InsertException(_('Deployed Service does not exists')) + except Exception as e: + logger.error("Exception modifiying deployed service {0}".format(deployedService)) + raise InsertException(str(e)) + return True + +@needs_credentials +def getGroupsAssignedToDeployedService(credentials, deployedServiceId): + ''' + Return groups assigned to this deployed service + ''' + logger.debug('Returning assigned groups to deployed service {0}'.format(deployedServiceId)) + grps = [] + try: + dps = DeployedService.objects.get(pk=deployedServiceId) + groups = dps.assignedGroups.all() + for grp in groups: + grps.append(dictFromGroup(grp)) + except DeployedService.DoesNotExist: + raise InsertException(_('Deployed Service does not exists')) + return grps + +@needs_credentials +def assignGroupToDeployedService(credentials, deployedServiceId, groupId): + ''' + Assigns a group to a deployed service + ''' + logger.debug('Assigning group {0} to deployed service {1}'.format(groupId, deployedServiceId)) + try: + grp = Group.objects.get(pk=groupId) + dps = DeployedService.objects.get(pk=deployedServiceId) + dps.assignedGroups.add(grp) + except Group.DoesNotExist: + raise InsertException(_('Group does not exists')) + except DeployedService.DoesNotExist: + raise InsertException(_('Deployed Service does not exists')) + return True + +@needs_credentials +def removeGroupsFromDeployedService(credentials, deployedServiceId, groupIds): + ''' + Removes a group from a deployed service + ''' + logger.debug('Removing groups {0} from deployed service {1}'.format(groupIds, deployedServiceId)) + try: + dps = DeployedService.objects.get(pk=deployedServiceId) + dps.assignedGroups.remove(*groupIds) + # TODO: Mark groups for this deployed services as "must clean" so services are correctly cleaned + except DeployedService.DoesNotExist: + raise InsertException(_('Deployed Service does not exists')) + return True + +@needs_credentials +def getTransportsAssignedToDeployedService(credentias, idDS): + ''' + Returns the transports associated with an iDS + ''' + try: + ds = DeployedService.objects.get(id=idDS) + return [ dictFromTransport(t) for t in ds.transports.all() ] + except DeployedService.DoesNotExist: + raise FindException(_('Can\'t find deployed service')) + except Exception as e: + logger.exception("getTransportsForDeployedService: ") + raise FindException(str(e)) + +@needs_credentials +def assignTransportToDeployedService(credentials, deployedServiceId, transportId): + logger.debug('Assigning transport {0} to service {1}'.format(transportId, deployedServiceId)) + try: + trans = Transport.objects.get(pk=transportId) + dps = DeployedService.objects.get(pk=deployedServiceId) + dps.transports.add(trans) + except Transport.DoesNotExist: + raise InsertException(_('Transport does not exists')) + except DeployedService.DoesNotExist: + raise InsertException(_('Deployed Service does not exists')) + + return True + +@needs_credentials +def removeTransportFromDeployedService(credentials, deployedServiceId, transportIds): + ''' + Removes a group from a deployed service + ''' + logger.debug('Removing transports {1} from deployed service {1}'.format(transportIds, deployedServiceId)) + try: + dps = DeployedService.objects.get(pk=deployedServiceId) + dps.transports.remove(*transportIds) + except DeployedService.DoesNotExist: + raise InsertException(_('Deployed Service does not exists')) + return True + + +@needs_credentials +def removeDeployedService(credentials, deployedServiceId): + ''' + Removes a deployed service + ''' + # First, mark all services as removable + logger.debug('Removing deployed service {0}'.format(deployedServiceId)) + try: + ds = DeployedService.objects.get(pk=deployedServiceId) + ds.remove() + except DeployedService.DoesNotExist: + raise InsertException(_('Deployed service does not exists')) + return True + +# Registers XML RPC Methods +def registerDeployedServicesFunctions(dispatcher): + dispatcher.register_function(getDeployedServices, 'getDeployedServices') + dispatcher.register_function(getDeployedService, 'getDeployedService') + dispatcher.register_function(createDeployedService, 'createDeployedService') + dispatcher.register_function(modifyDeployedService, 'modifyDeployedService') + dispatcher.register_function(assignGroupToDeployedService, 'assignGroupToDeployedService') + dispatcher.register_function(removeGroupsFromDeployedService, 'removeGroupsFromDeployedService') + dispatcher.register_function(getGroupsAssignedToDeployedService, 'getGroupsAssignedToDeployedService') + dispatcher.register_function(assignTransportToDeployedService, 'assignTransportToDeployedService') + dispatcher.register_function(removeTransportFromDeployedService, 'removeTransportFromDeployedService') + dispatcher.register_function(getTransportsAssignedToDeployedService, 'getTransportsAssignedToDeployedService') + dispatcher.register_function(removeDeployedService, 'removeDeployedService') diff --git a/server/src/uds/xmlrpc/services/Publications.py b/server/src/uds/xmlrpc/services/Publications.py new file mode 100644 index 000000000..d63f46f73 --- /dev/null +++ b/server/src/uds/xmlrpc/services/Publications.py @@ -0,0 +1,89 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from uds.models import DeployedService, DeployedServicePublication, State +from django.utils.translation import ugettext as _ +from ..util.Helpers import dictFromData +from ..auths.AdminAuth import needs_credentials +from ..util.Exceptions import PublicationException +from uds.core.managers.PublicationManager import PublicationManager +import logging + +logger = logging.getLogger(__name__) + +def dictFromPublication(pub): + res = { 'idParent' : str(pub.deployed_service_id), 'id' : str(pub.id), + 'state' : pub.state, 'publishDate' : pub.publish_date, 'reason' : State.toString(pub.state), 'revision' : str(pub.revision) + } + if State.isErrored(pub.state): + publication = pub.getInstance() + res['reason'] = publication.reasonOfError() + return res + +@needs_credentials +def getPublications(credentials, idParent): + + dps = DeployedService.objects.get(pk=idParent) + res = [] + for pub in dps.publications.all().order_by('-publish_date'): + try: + val = dictFromPublication(pub) + res.append(val) + except Exception, e: + logger.debug(e) + return res + +@needs_credentials +def publishDeployedService(credentials, idParent): + try: + ds = DeployedService.objects.get(pk=idParent) + ds.publish() + except Exception, e: + raise PublicationException(unicode(e)) + return True + +@needs_credentials +def cancelPublication(credentials, id): + try: + ds = DeployedServicePublication.objects.get(pk=id) + ds.cancel() + except Exception, e: + raise PublicationException(unicode(e)) + return True + + +# Registers XML RPC Methods +def registerPublicationsFunctions(dispatcher): + dispatcher.register_function(getPublications, 'getPublications') + dispatcher.register_function(publishDeployedService, 'publishDeployedService') + dispatcher.register_function(cancelPublication, 'cancelPublication') diff --git a/server/src/uds/xmlrpc/services/ServiceProviders.py b/server/src/uds/xmlrpc/services/ServiceProviders.py new file mode 100644 index 000000000..a47bca3c9 --- /dev/null +++ b/server/src/uds/xmlrpc/services/ServiceProviders.py @@ -0,0 +1,207 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext as _ +from django.db import IntegrityError +from uds.models import Provider +from uds.core.services.ServiceProviderFactory import ServiceProviderFactory +from ..util.Helpers import dictFromData +from ..util.Exceptions import ValidationException, InsertException, FindException, DeleteException +from ..auths.AdminAuth import needs_credentials +from uds.core.Environment import Environment +import logging +from uds.core import services + +logger = logging.getLogger(__name__) + +@needs_credentials +def getServiceProvidersTypes(credentials): + ''' + Returns the types of services providers registered in system + ''' + res = [] + for type in ServiceProviderFactory.factory().providers().values(): + val = { 'name' : _(type.name()), 'type' : type.type(), 'description' : _(type.description()), 'icon' : type.icon() } + res.append(val) + return res + +@needs_credentials +def getServiceProviders(credentials): + ''' + Returns the services providers managed (at database) + ''' + res = [] + for prov in Provider.objects.order_by('name'): + try: + val = { 'id' : str(prov.id), 'name' : prov.name, 'comments' : prov.comments, 'type' : prov.data_type, 'typeName' : _(prov.getInstance().name()) } + res.append(val) + except Exception: + pass + return res + +@needs_credentials +def getServiceProviderGui(credentials, type): + ''' + Returns the description of an gui for the specified service provider + ''' + spType = ServiceProviderFactory.factory().lookup(type) + return spType.guiDescription() + +@needs_credentials +def getServiceProvider(credentials, id): + ''' + Returns the specified service provider (at database) + ''' + data = Provider.objects.get(pk=id) + res = [ + { 'name' : 'name', 'value' : data.name }, + { 'name' : 'comments', 'value' : data.comments }, + ] + for key, value in data.getInstance().valuesDict().iteritems(): + valtext = 'value' + if value.__class__ == list: + valtext = 'values' + val = {'name' : key, valtext : value } + res.append(val) + return res + +@needs_credentials +def createServiceProvider(credentials, type, data): + ''' + Creates a new service provider with specified type and data + It's mandatory that data contains at least 'name' and 'comments'. + The expected structure is the same that provided at getServiceProvider + ''' + try: + dic = dictFromData(data) + # First create data without serialization, then serialies data with correct environment + sp = Provider.objects.create(name = dic['name'], comments = dic['comments'], data_type = type) + sp.data = sp.getInstance(dic).serialize() + sp.save() + except services.ServiceProvider.ValidationException as e: + sp.delete() + raise ValidationException(str(e)) + except IntegrityError: # Must be exception at creation + raise InsertException(_('Name %s already exists') % (dic['name'])) + except Exception as e: + logger.exception('Unexpected exception') + raise ValidationException(str(e)) + return True + +@needs_credentials +def modifyServiceProvider(credentials, id, data): + ''' + Modifies an existing service provider with specified id and data + It's mandatory that data contains at least 'name' and 'comments'. + The expected structure is the same that provided at getServiceProvider + ''' + try: + prov = Provider.objects.get(pk=id) + dic = dictFromData(data) + sp = prov.getInstance(dic) + prov.data = sp.serialize() + prov.name = dic['name'] + prov.comments = dic['comments'] + prov.save() + except services.ServiceProvider.ValidationException as e: + raise ValidationException(str(e)) + except IntegrityError: # Must be exception at creation + raise InsertException(_('Name %s already exists') % (dic['name'])) + except Exception as e: + logger.exception('Unexpected exception') + raise ValidationException(str(e)) + + return True + +@needs_credentials +def removeServiceProvider(credentials, id): + ''' + Removes from database provider with specified id + ''' + try: + prov = Provider.objects.get(pk=id) + if prov.services.count() > 0: + raise DeleteException(_('Can\'t delete service provider with services associated')) + prov.delete() + except Provider.DoesNotExist: + raise FindException(_('Can\'t locate the service provider') + '.' + _('Please, refresh interface')) + return True + +@needs_credentials +def getOffersFromServiceProvider(credentials, type): + ''' + Returns the services offered from the provider + ''' + spType = ServiceProviderFactory.factory().lookup(type) + res = [] + for type in spType.getServicesTypes(): + val = { 'name' : _(type.name()), 'type' : type.type(), 'description' : _(type.description()), 'icon' : type.icon() } + res.append(val) + return res + +@needs_credentials +def testServiceProvider(credentials, type, data): + ''' + invokes the test function of the specified service provider type, with the suplied data + ''' + logger.debug("Testing service provider, type: {0}, data:{1}".format(type, data)) + spType = ServiceProviderFactory.factory().lookup(type) + # We need an "temporary" environment to test this service + dict = dictFromData(data) + res = spType.test(Environment.getTempEnv(), dict) + return {'ok' : res[0], 'message' : res[1]} + +@needs_credentials +def checkServiceProvider(credentials, id): + ''' + Invokes the check function of the specified service provider + ''' + prov = Provider.objects.get(id=id) + sp = prov.getInstance() + return sp.check() + + +# Registers XML RPC Methods +def registerServiceProvidersFunctions(dispatcher): + dispatcher.register_function(getServiceProvidersTypes, 'getServiceProvidersTypes') + dispatcher.register_function(getServiceProviders, 'getServiceProviders') + dispatcher.register_function(getServiceProviderGui, 'getServiceProviderGui') + dispatcher.register_function(getServiceProvider, 'getServiceProvider') + dispatcher.register_function(createServiceProvider, 'createServiceProvider') + dispatcher.register_function(modifyServiceProvider, 'modifyServiceProvider') + dispatcher.register_function(removeServiceProvider, 'removeServiceProvider') + dispatcher.register_function(getOffersFromServiceProvider, 'getOffersFromServiceProvider') + dispatcher.register_function(testServiceProvider, 'testServiceProvider') + dispatcher.register_function(checkServiceProvider, 'checkServiceProvider') + + \ No newline at end of file diff --git a/server/src/uds/xmlrpc/services/Services.py b/server/src/uds/xmlrpc/services/Services.py new file mode 100644 index 000000000..8a89ef953 --- /dev/null +++ b/server/src/uds/xmlrpc/services/Services.py @@ -0,0 +1,214 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext as _ +from django.db import IntegrityError +from uds.models import Provider, Service +from uds.xmlrpc.util.Helpers import dictFromData +from uds.xmlrpc.auths.AdminAuth import needs_credentials +from uds.xmlrpc.util.Exceptions import InsertException, FindException, DeleteException, ValidationException +from uds.core.Environment import Environment +from uds.core import services +import logging + +logger = logging.getLogger(__name__) + +def infoDictFromServiceInstance(service): + if service is not None: + needsPublication = service.publicationType is not None + maxDeployed = service.maxDeployed + usesCache = service.usesCache + usesCache_L2 = service.usesCache_L2 + cacheTooltip = _(service.cacheTooltip) + cacheTooltip_L2 = _(service.cacheTooltip_L2) + needsManager = service.needsManager + mustAssignManually = service.mustAssignManually + typeName = service.name() + else: + needsPublication = False + maxDeployed = 0 + usesCache = False + usesCache_L2 = False + cacheTooltip = '' + cacheTooltip_L2 = '' + needsManager = False + mustAssignManually = False + typeName = '' + + + return { 'needsPublication' : needsPublication, 'maxDeployed' : maxDeployed, + 'usesCache' : usesCache, 'usesCacheL2' : usesCache_L2, + 'cacheTooltip' : cacheTooltip, 'cacheTooltipL2' : cacheTooltip_L2, + 'needsManager' : needsManager, 'mustAssignManually' : mustAssignManually, + 'typeName' : typeName + } + +def dictFromService(serv): + service = serv.getInstance() + return { 'idParent' : str(serv.provider_id), 'id' : str(serv.id), 'name' : serv.name, + 'comments' : serv.comments, 'type' : serv.data_type, 'typeName' : _(service.name()), 'info' : infoDictFromServiceInstance(service) + } + +@needs_credentials +def getServices(credentials, idParent): + ''' + Returns the services providers managed (at database) + ''' + provider = Provider.objects.get(id=idParent) + res = [] + for serv in provider.services.order_by('name'): + try: + val = dictFromService(serv) + res.append(val) + except Exception, e: + logger.debug(e) + return res + +@needs_credentials +def getAllServices(credentials): + ''' + Returns all services, don't limited by parent id + ''' + res = [] + for serv in Service.objects.all().order_by('name'): + try: + val = dictFromService(serv) + res.append(val) + except Exception, e: + logger.debug(e) + return res + +@needs_credentials +def getServiceGui(credentials, idParent, type): + ''' + Returns the description of an gui for the specified service provider + ''' + logger.debug('getServiceGui parameters: {0}, {1}'.format(idParent, type)) + provider = Provider.objects.get(id=idParent).getInstance() + serviceType = provider.getServiceByType(type) + service = serviceType( Environment.getTempEnv(), provider) # Instantiate it so it has the opportunity to alter gui description based on parent + return service.guiDescription(service) + +@needs_credentials +def getService(credentials, id): + ''' + Returns the specified service provider (at database) + ''' + logger.debug('getService parameters: {0}'.format(id)) + srv = Service.objects.get(id=id) + res = [ + { 'name' : 'name', 'value' : srv.name }, + { 'name' : 'comments', 'value' : srv.comments }, + ] + for key, value in srv.getInstance().valuesDict().iteritems(): + valtext = 'value' + if value.__class__ == list: + valtext = 'values' + val = {'name' : key, valtext : value } + res.append(val) + return res + +@needs_credentials +def createService(credentials, idParent, type, data): + ''' + Creates a new service with specified type and data associated to the specified parent + It's mandatory that data contains at least 'name' and 'comments'. + The expected structure is the same that provided at getServiceProvider, getServices, ... + ''' + provider = Provider.objects.get(id=idParent) + dic = dictFromData(data) + try: + srv = provider.services.create(name = dic['name'], comments = dic['comments'], data_type = type) + # Invoque serialization with correct environment + srv.data = srv.getInstance(dic).serialize() + srv.save() + except services.Service.ValidationException as e: + srv.delete() + raise ValidationException(str(e)) + except IntegrityError: # Must be exception at creation + raise InsertException(_('Name %s already exists') % (dic['name'])) + except Exception as e: + logger.exception('Unexpected exception') + raise ValidationException(str(e)) + return True + +@needs_credentials +def modifyService(credentials, id, data): + ''' + Modifies an existing service with specified id and data + It's mandatory that data contains at least 'name' and 'comments'. + The expected structure is the same that provided at getServiceProvider + ''' + try: + serv = Service.objects.get(pk=id) + dic = dictFromData(data) + sp = serv.getInstance(dic) + serv.data = sp.serialize() + serv.name = dic['name'] + serv.comments = dic['comments'] + serv.save() + except services.Service.ValidationException as e: + raise ValidationException(str(e)) + except IntegrityError: # Must be exception at creation + raise InsertException(_('Name %s already exists') % (dic['name'])) + except Exception as e: + logger.exception('Unexpected exception') + raise ValidationException(str(e)) + + return True + +@needs_credentials +def removeService(credentials, id): + ''' + Removes from database provider with specified id + ''' + try: + s = Service.objects.get(id=id) + if s.deployedServices.count() > 0: + raise DeleteException(_('Can\'t delete services with deployed services associated')) + s.delete() + except Service.DoesNotExist: + raise FindException(_('Can\'t locate the service') + '.' + _('Please, refresh interface')) + return True + + + +# Registers XML RPC Methods +def registerServiceFunctions(dispatcher): + dispatcher.register_function(getServices, 'getServices') + dispatcher.register_function(getAllServices, 'getAllServices') + dispatcher.register_function(getServiceGui, 'getServiceGui') + dispatcher.register_function(getService, 'getService') + dispatcher.register_function(createService, 'createService') + dispatcher.register_function(modifyService, 'modifyService') + dispatcher.register_function(removeService, 'removeService') diff --git a/server/src/uds/xmlrpc/services/UserDeployedServices.py b/server/src/uds/xmlrpc/services/UserDeployedServices.py new file mode 100644 index 000000000..f242772ea --- /dev/null +++ b/server/src/uds/xmlrpc/services/UserDeployedServices.py @@ -0,0 +1,157 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from uds.models import DeployedService, State, User, UserService +from django.utils.translation import ugettext as _ +from ..auths.AdminAuth import needs_credentials +from ..util.Exceptions import FindException +from uds.core.managers.UserServiceManager import UserServiceManager +import logging + +logger = logging.getLogger(__name__) + +def dictFromCachedDeployedService(cs): + res = { 'idParent' : str(cs.deployed_service_id), 'id' : str(cs.id), 'uniqueId' : cs.unique_id, 'friendlyName' : cs.friendly_name, 'state' : cs.state, 'osState': cs.os_state, 'stateDate' : cs.state_date, + 'creationDate' : cs.creation_date, 'cacheLevel' : str(cs.cache_level), 'revision' : str(cs.publication.revision) } + return res + +def dictFromAssignedDeployedService(ads): + if ads.publication is not None: + revision = str(ads.publication.revision) + else: + revision = '' + + res = { 'idParent' : str(ads.deployed_service_id), 'id' : str(ads.id), 'uniqueId' : ads.unique_id, 'friendlyName' : ads.friendly_name, 'state' : ads.state, 'osState': ads.os_state, 'stateDate' : ads.state_date, + 'creationDate' : ads.creation_date, 'revision' : revision, 'user': ads.user.manager.name + "-" + ads.user.name, 'inUse': ads.in_use, 'inUseDate': ads.in_use_date } + return res + +@needs_credentials +def getCachedDeployedServices(credentials, idParent): + + dps = DeployedService.objects.get(pk=idParent) + + res = [] + for cache in dps.cachedUserServices().order_by('-creation_date'): + try: + val = dictFromCachedDeployedService(cache) + res.append(val) + except Exception, e: + logger.debug(e) + return res + +@needs_credentials +def getAssignedDeployedServices(credentials, idParent): + + dps = DeployedService.objects.get(pk=idParent) + + res = [] + for assigned in dps.assignedUserServices().order_by('-creation_date'): + try: + val = dictFromAssignedDeployedService(assigned) + res.append(val) + except Exception, e: + logger.debug(e) + logger.debug(res) + return res + +@needs_credentials +def getAssignableDeployedServices(crecentials, idParent): + + res = [] + try: + dps = DeployedService.objects.get(pk=idParent) + if dps.state != State.ACTIVE: + raise FindException(_('The deployed service is not active')) + servInstance = dps.service.getInstance() + if servInstance.mustAssignManually is False: + raise FindException(_('This service don\'t allows assignations')) + assignables = servInstance.requestServicesForAssignation() + for ass in assignables: + res.append( {'id' : ass.getName(), 'name' : ass.getName() } ) + except DeployedService.DoesNotExist: + raise FindException(_('Deployed service not found!!! (refresh interface)')) + return res + +@needs_credentials +def assignDeployedService(credentials, idParent, idDeployedUserService, idUser): + try: + dps = DeployedService.objects.get(pk=idParent) + if dps.state != State.ACTIVE: + raise FindException(_('The deployed service is not active')) + servInstance = dps.service.getInstance() + if servInstance.mustAssignManually is False: + raise FindException(_('This service don\'t allows assignations')) + user = dps.authenticator.users.get(pk=idUser) + assignables = servInstance.requestServicesForAssignation() + for ass in assignables: + if ass.getName() == idDeployedUserService: # Found, create it + UserServiceManager.manager().createAssignable(dps, ass, user) + except DeployedService.DoesNotExist: + raise FindException(_('Deployed service not found!!! (refresh interface)')) + except User.DoesNotExist: + raise FindException(_('User not found!!! (refresh interface)')) + + return True + +@needs_credentials +def removeUserService(cretentials, ids): + try: + for service in UserService.objects.filter(id__in=ids): + if service.state == State.USABLE: + service.remove() + elif service.state == State.PREPARING: + service.cancel() + except Exception: + logger.exception("Exception at removeUserService:") + return False + return True + +@needs_credentials +def getUserDeployedServiceError(credentials, idService): + error = _('No error') + try: + uds = UserService.objects.get(pk=idService) + if uds.state == State.ERROR: + error = uds.getInstance().reasonOfError() + except UserService.DoesNotExist: + raise FindException(_('User deployed service not found!!!')) + return error + +# Registers XML RPC Methods +def registerUserDeployedServiceFunctions(dispatcher): + dispatcher.register_function(getCachedDeployedServices, 'getCachedDeployedServices') + dispatcher.register_function(getAssignedDeployedServices, 'getAssignedDeployedServices') + dispatcher.register_function(getAssignableDeployedServices, 'getAssignableDeployedServices') + dispatcher.register_function(assignDeployedService, 'assignDeployedService') + dispatcher.register_function(removeUserService, 'removeUserService') + dispatcher.register_function(getUserDeployedServiceError, 'getUserDeployedServiceError') diff --git a/server/src/uds/xmlrpc/services/__init__.py b/server/src/uds/xmlrpc/services/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/server/src/uds/xmlrpc/tools/Cache.py b/server/src/uds/xmlrpc/tools/Cache.py new file mode 100644 index 000000000..c414c0742 --- /dev/null +++ b/server/src/uds/xmlrpc/tools/Cache.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from ..auths.AdminAuth import needs_credentials +from uds.core.util.Cache import Cache +import logging + +logger = logging.getLogger(__name__) + +@needs_credentials +def flushCache(credentials): + Cache.purge() + return True + + +# Registers XML RPC Methods +def registerCacheFunctions(dispatcher): + dispatcher.register_function(flushCache, 'flushCache') diff --git a/server/src/uds/xmlrpc/tools/Config.py b/server/src/uds/xmlrpc/tools/Config.py new file mode 100644 index 000000000..2d22285f5 --- /dev/null +++ b/server/src/uds/xmlrpc/tools/Config.py @@ -0,0 +1,65 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from ..auths.AdminAuth import needs_credentials +from uds.core.util.Config import Config + +import logging + +logger = logging.getLogger(__name__) + +@needs_credentials +def getConfiguration(credentials): + res = [] + addCrypt = credentials.isAdmin + for cfg in Config.enumerate(): + if cfg.isCrypted() is True and addCrypt is False: + continue + res.append( {'section': cfg.section(), 'key' : cfg.key(), 'value' : cfg.get(), 'crypt': cfg.isCrypted() } ) + logger.debug('Configuration: {0}'.format(res)) + return res + + +@needs_credentials +def updateConfiguration(credentials, configuration): + ''' + Configuration is an array of dicts containing 'section', 'key' and 'value' (crypt is in fact ignored, used the one from database) + ''' + for cfg in configuration: + Config.update( cfg['section'], cfg['key'], cfg['value'] ) + return True + +# Registers XML RPC Methods +def registerConfigurationFunctions(dispatcher): + dispatcher.register_function(getConfiguration, 'getConfiguration') + dispatcher.register_function(updateConfiguration, 'updateConfiguration') diff --git a/server/src/uds/xmlrpc/tools/__init__.py b/server/src/uds/xmlrpc/tools/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/server/src/uds/xmlrpc/transports/Networks.py b/server/src/uds/xmlrpc/transports/Networks.py new file mode 100644 index 000000000..dc7fd09f7 --- /dev/null +++ b/server/src/uds/xmlrpc/transports/Networks.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext as _ +from django.db import IntegrityError +from uds.models import Network, Transport +from ..util.Exceptions import InsertException, FindException, DeleteException +from ..auths.AdminAuth import needs_credentials +import logging + +logger = logging.getLogger(__name__) + +def dictFromNetwork(net): + return { 'id' : str(net.id), 'name' : net.name, 'netStart' : net.netStart, 'netEnd' : net.netEnd } + +@needs_credentials +def getNetworks(credentials): + ''' + Returns the services providers managed (at database) + ''' + res = [] + for net in Network.objects.all(): + res.append(dictFromNetwork(net)) + return res + +@needs_credentials +def getNetworksForTransport(credentials, id): + try: + res = [ str(n.id) for n in Transport.objects.get(pk=id).networks.all().order_by('name') ] + except Exception: + res = [] + return res + +@needs_credentials +def setNetworksForTransport(credentials, id, networks): + try: + trans = Transport.objects.get(pk=id) + trans.networks = Network.objects.filter(id__in=networks) + except Transport.DoesNotExist: + raise FindException(_('Can\'t locate the transport') + '.' + _('Please, refresh interface')) + return True + +@needs_credentials +def getNetwork(credentials, id): + try: + net = Network.objects.get(pk=id) + except Network.DoesNotExist: + raise FindException(_('Can\'t locate the network') + '.' + _('Please, refresh interface')) + return dictFromNetwork(net) + +@needs_credentials +def createNetwork(credentials, network): + try: + net = Network.create(network['name'], network['netStart'], network['netEnd']) + except IntegrityError: + raise InsertException(_('Name %s already exists') % (network['name'])) + return True + +@needs_credentials +def modifyNetwork(credentials, network): + try: + net = Network.objects.get(pk=network['id']) + net.update(network['name'], network['netStart'], network['netEnd']) + except Network.DoesNotExist: + raise FindException(_('Can\'t locate the network') + '.' + _('Please, refresh interface')) + except IntegrityError: + raise InsertException(_('Name %s already exists') % (network['name'])) + return True + +@needs_credentials +def removeNetworks(credentials, ids): + Network.objects.filter(id__in=ids).delete() + return True + +def registerNetworksFunctions(dispatcher): + dispatcher.register_function(getNetworks, 'getNetworks') + dispatcher.register_function(getNetworksForTransport, 'getNetworksForTransport') + dispatcher.register_function(setNetworksForTransport, 'setNetworksForTransport') + dispatcher.register_function(getNetwork, 'getNetwork') + dispatcher.register_function(createNetwork, 'createNetwork') + dispatcher.register_function(modifyNetwork, 'modifyNetwork') + dispatcher.register_function(removeNetworks, 'removeNetworks') + diff --git a/server/src/uds/xmlrpc/transports/Transports.py b/server/src/uds/xmlrpc/transports/Transports.py new file mode 100644 index 000000000..e6e467a7a --- /dev/null +++ b/server/src/uds/xmlrpc/transports/Transports.py @@ -0,0 +1,162 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.utils.translation import ugettext as _ +from uds.models import Transport, DeployedService +from uds.core.transports.TransportsFactory import TransportsFactory +from uds.core.ui.UserInterface import gui +from ..util.Helpers import dictFromData +from ..auths.AdminAuth import needs_credentials +from ..util.Exceptions import FindException +from uds.core.Environment import Environment +import logging + +logger = logging.getLogger(__name__) + +def dictFromTransport(trans): + return { + 'id' : str(trans.id), + 'name' : trans.name, + 'comments' : trans.comments, + 'type' : trans.data_type, + 'typeName' : trans.getInstance().name(), + 'priority' : str(trans.priority), + 'networks' : [ t.name for t in trans.networks.all().order_by('name') ] + } + + +@needs_credentials +def getTransportsTypes(credentials): + ''' + Returns the types of services providers registered in system + ''' + res = [] + for type in TransportsFactory.factory().providers().values(): + val = { 'name' : type.name(), 'type' : type.type(), 'description' : type.description(), 'icon' : type.icon() } + res.append(val) + return res + +@needs_credentials +def getTransports(credentials): + ''' + Returns the services providers managed (at database) + ''' + res = [] + for trans in Transport.objects.order_by('priority'): + try: + res.append(dictFromTransport(trans)) + except Exception: + logger.exception("At getTransports: ") + return res + + +@needs_credentials +def getTransportGui(credentials, type): + ''' + Returns the description of an gui for the specified service provider + ''' + spType = TransportsFactory.factory().lookup(type) + return spType.guiDescription() + +@needs_credentials +def getTransport(credentials, id): + ''' + Returns the specified service provider (at database) + ''' + data = Transport.objects.get(pk=id) + res = [ + { 'name' : 'name', 'value' : data.name }, + { 'name' : 'comments', 'value' : data.comments }, + { 'name' : 'priority', 'value' : str(data.priority) }, + { 'name' : 'positiveNet', 'value' : gui.boolToStr(data.nets_positive) }, + ] + for key, value in data.getInstance().valuesDict().iteritems(): + valtext = 'value' + if value.__class__ == list: + valtext = 'values' + val = {'name' : key, valtext : value } + res.append(val) + return res + +@needs_credentials +def createTransport(credentials, type, data): + ''' + Creates a new service provider with specified type and data + It's mandatory that data contains at least 'name' and 'comments'. + The expected structure is the same that provided at getServiceProvider + ''' + dict = dictFromData(data) + # First create data without serialization, then serialies data with correct environment + sp = Transport.objects.create(name = dict['name'], comments = dict['comments'], data_type = type, + priority=int(dict['priority']), nets_positive=gui.strToBool(dict['positiveNet']) ) + sp.data = sp.getInstance(dict).serialize() + sp.save() + return str(sp.id) + +@needs_credentials +def modifyTransport(credentials, id, data): + ''' + Modifies an existing service provider with specified id and data + It's mandatory that data contains at least 'name' and 'comments'. + The expected structure is the same that provided at getServiceProvider + ''' + trans = Transport.objects.get(pk=id) + dict = dictFromData(data) + sp = trans.getInstance(dict) + trans.data = sp.serialize() + trans.name = dict['name'] + trans.comments = dict['comments'] + trans.priority = int(dict['priority']) + trans.nets_positive = gui.strToBool(dict['positiveNet']) + trans.save() + return True + +@needs_credentials +def removeTransport(credentials, id): + ''' + Removes from database provider with specified id + ''' + Transport.objects.get(pk=id).delete() + return True + + +# Registers XML RPC Methods +def registerTransportsFunctions(dispatcher): + dispatcher.register_function(getTransportsTypes, 'getTransportsTypes') + dispatcher.register_function(getTransports, 'getTransports') + dispatcher.register_function(getTransportGui, 'getTransportGui') + dispatcher.register_function(getTransport, 'getTransport') + dispatcher.register_function(createTransport, 'createTransport') + dispatcher.register_function(modifyTransport, 'modifyTransport') + dispatcher.register_function(removeTransport, 'removeTransport') + diff --git a/server/src/uds/xmlrpc/transports/__init__.py b/server/src/uds/xmlrpc/transports/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/server/src/uds/xmlrpc/util/Callbacks.py b/server/src/uds/xmlrpc/util/Callbacks.py new file mode 100644 index 000000000..a6fecd4b6 --- /dev/null +++ b/server/src/uds/xmlrpc/util/Callbacks.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + + +from ..auths.AdminAuth import validateCredentials + +from uds.core.ui.UserInterface import gui + +def chooseCallback(credentials, name, parameters): + validateCredentials(credentials) + res = {} + params = {} + for p in parameters: + params[p['name']] = p['value'] + if gui.callbacks.has_key(name): + res = gui.callbacks[name](params) + return res + +def registerCallbackFunctions(dispatcher): + dispatcher.register_function(chooseCallback, 'chooseCallback') diff --git a/server/src/uds/xmlrpc/util/Exceptions.py b/server/src/uds/xmlrpc/util/Exceptions.py new file mode 100644 index 000000000..b4ef9768d --- /dev/null +++ b/server/src/uds/xmlrpc/util/Exceptions.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' +from xmlrpclib import Fault + +AUTH_CLASS = 0x1000 +DATA_CLASS = 0x2000 +ACTION_CLASS = 0x3000 + +FAIL = 0x0100 + +AUTH_FAILED = AUTH_CLASS | FAIL | 0x0001 +DUPLICATE_FAIL = DATA_CLASS | FAIL | 0x0001 +INSERT_FAIL = DATA_CLASS | FAIL | 0x0002 +DELETE_FAIL = DATA_CLASS | FAIL | 0x0003 +FIND_FAIL = DATA_CLASS | FAIL | 0x0004 +VALIDATION_FAIL = DATA_CLASS | FAIL | 0x0005 +PARAMETERS_FAIL = DATA_CLASS | FAIL | 0x0006 +MODIFY_FAIL = DATA_CLASS | FAIL | 0x0007 + +PUBLISH_FAIL = ACTION_CLASS | FAIL | 0x0001 + +CANCEL_FAIL = ACTION_CLASS | FAIL | 0x0001 + +def AuthException(msg): + return Fault(AUTH_FAILED, msg) + +def DuplicateEntryException(msg): + return Fault(DUPLICATE_FAIL, msg) + +def InsertException(msg): + return Fault(FIND_FAIL, msg) + +def FindException(msg): + return Fault() + +def DeleteException(msg): + return Fault(DELETE_FAIL, msg) + +def ModifyException(msg): + return Fault(MODIFY_FAIL, msg) + +def PublicationException(msg): + return Fault(PUBLISH_FAIL, msg) + +def CancelationException(msg): + return Fault(CANCEL_FAIL, msg) + +def ValidationException(msg): + return Fault(VALIDATION_FAIL, msg) + +def ParametersException(msg): + return Fault(PARAMETERS_FAIL, msg) \ No newline at end of file diff --git a/server/src/uds/xmlrpc/util/Helpers.py b/server/src/uds/xmlrpc/util/Helpers.py new file mode 100644 index 000000000..7cae4ec7f --- /dev/null +++ b/server/src/uds/xmlrpc/util/Helpers.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +import logging + +logger = logging.getLogger(__name__) + + +def dictFromData(data): + ''' + This function converts an array of dicts of type { 'name' : ..., 'value' : ...} to a single dict where keys are the "name"s and the values are the "value"s + example: + data = [ { 'name' : 'var1', 'value' : 'value1' }, { 'name' : 'var2', 'value' : 'value2' }, 'name' : 'var3', 'values' : [ ...] ] + this will return { 'var1' : 'value1', 'var2' : 'value2' } + ''' + dict = {} + for val in data: + if val.has_key('value'): + dict[val['name']] = val['value'] + else: + ary = [] + for value in val['values']: + ary.append(value['id']) + dict[val['name']] = ary + logger.debug("Dictionary obtained: {0} from {1}".format(dict, data)) + return dict \ No newline at end of file diff --git a/server/src/uds/xmlrpc/util/TestTransport.py b/server/src/uds/xmlrpc/util/TestTransport.py new file mode 100644 index 000000000..b953aabf6 --- /dev/null +++ b/server/src/uds/xmlrpc/util/TestTransport.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +import cStringIO + +from xmlrpclib import Transport, ServerProxy +from django.test.client import Client + +class TestTransport(Transport,object): + + """ Handles connections to XML-RPC server through Django test client.""" + + def __init__(self, *args, **kwargs): + super(TestTransport, self).__init__(*args, **kwargs) + self.client = Client() + + def request(self, host, handler, request_body, verbose=0): + + self.verbose = verbose + + response = self.client.post(handler, + request_body, + content_type="text/xml") + + res = cStringIO.StringIO(response.content) + res.seek(0) + + return self.parse_response(res) + +rpcServer = ServerProxy("http://test:test@172.27.0.1:8000/xmlrpc", verbose = 1, transport=TestTransport()) diff --git a/server/src/uds/xmlrpc/util/__init__.py b/server/src/uds/xmlrpc/util/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/server/src/uds/xmlrpc/views.py b/server/src/uds/xmlrpc/views.py new file mode 100644 index 000000000..43a4562a3 --- /dev/null +++ b/server/src/uds/xmlrpc/views.py @@ -0,0 +1,110 @@ +# -*- coding: utf-8 -*- + +# +# Copyright (c) 2012 Virtual Cable S.L. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of Virtual Cable S.L. nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +''' +@author: Adolfo Gómez, dkmaster at dkmon dot com +''' + +from django.http import HttpResponse +from SimpleXMLRPCServer import SimpleXMLRPCDispatcher +from django.views.decorators.csrf import csrf_exempt + +from services.ServiceProviders import registerServiceProvidersFunctions +from services.Services import registerServiceFunctions +from services.DeployedServices import registerDeployedServicesFunctions +from services.Publications import registerPublicationsFunctions +from services.UserDeployedServices import registerUserDeployedServiceFunctions +from actor.Actor import registerActorFunctions +from util.Callbacks import registerCallbackFunctions +from auths.AdminAuth import registerAdminAuthFunctions +from auths.Authenticators import registerAuthenticatorFunctions +from osmanagers.OSManagers import registerOSManagersFunctions +from transports.Transports import registerTransportsFunctions +from transports.Networks import registerNetworksFunctions +from auths.Groups import registerGroupsFunctions +from auths.Users import registerUserFunctions +from auths.UserPreferences import registerPreferencesFunctions +from tools.Cache import registerCacheFunctions +from tools.Config import registerConfigurationFunctions + +import logging + +logger = logging.getLogger(__name__) + +dispatcher = SimpleXMLRPCDispatcher(allow_none=False, encoding=None) + +# csrf_exempt is needed because we don't expect xmlrcp to be called from a web form +@csrf_exempt +def xmlrpc(request): + if len(request.POST): + response = HttpResponse(mimetype="text/xml") + data = dispatcher._marshaled_dispatch(request.raw_post_data) + #logger.debug(data) + response.write(data) + else: + logger.error('XMLRPC invocation with GET method {0}'.format(request.path)) + response = HttpResponse() + response.write("This is an XML-RPC Service.
") + response.write("You need to invoke it using an XML-RPC Client!
") + #response.write("The following methods are available:
    ") + #methods = dispatcher.system_listMethods() + #for method in methods: + # right now, my version of SimpleXMLRPCDispatcher always + # returns "signatures not supported"... :( + # but, in an ideal world it will tell users what args are expected + # sig = dispatcher.system_methodSignature(method) + + # this just reads your docblock, so fill it in! + # help = dispatcher.system_methodHelp(method) + + # response.write("
  • %s: [%s] %s" % (method, sig, help)) + + # response.write("
") + + response['Content-length'] = str(len(response.content)) + return response + +# Register every xmlrpc function +registerServiceProvidersFunctions(dispatcher) +registerServiceFunctions(dispatcher) +registerPublicationsFunctions(dispatcher) +registerUserDeployedServiceFunctions(dispatcher) +registerOSManagersFunctions(dispatcher) +registerTransportsFunctions(dispatcher) +registerNetworksFunctions(dispatcher) +registerAdminAuthFunctions(dispatcher) +registerAuthenticatorFunctions(dispatcher) +registerGroupsFunctions(dispatcher) +registerUserFunctions(dispatcher) +registerCallbackFunctions(dispatcher) +registerDeployedServicesFunctions(dispatcher) +registerActorFunctions(dispatcher) +registerPreferencesFunctions(dispatcher) +registerCacheFunctions(dispatcher) +registerConfigurationFunctions(dispatcher) diff --git a/ssh-tunnel/pam-http/.autotools b/ssh-tunnel/pam-http/.autotools new file mode 100644 index 000000000..2094731e7 --- /dev/null +++ b/ssh-tunnel/pam-http/.autotools @@ -0,0 +1,42 @@ + + + + + diff --git a/ssh-tunnel/pam-http/.cproject b/ssh-tunnel/pam-http/.cproject new file mode 100644 index 000000000..c1306987e --- /dev/null +++ b/ssh-tunnel/pam-http/.cproject @@ -0,0 +1,507 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + make + + all + true + true + false + + + make + + am--refresh + true + true + false + + + make + + check + true + true + false + + + make + + clean + true + true + false + + + make + + clean-libtool + true + true + false + + + make + + ctags + true + true + false + + + make + + ctags-recursive + true + true + false + + + make + + dist + true + true + false + + + make + + dist-all + true + true + false + + + make + + dist-bzip2 + true + true + false + + + make + + dist-gzip + true + true + false + + + make + + dist-lzma + true + true + false + + + make + + dist-shar + true + true + false + + + make + + dist-tarZ + true + true + false + + + make + + dist-xz + true + true + false + + + make + + dist-zip + true + true + false + + + make + + distcheck + true + true + false + + + make + + distclean + true + true + false + + + make + + distclean-libtool + true + true + false + + + make + + distclean-tags + true + true + false + + + make + + distcleancheck + true + true + false + + + make + + distdir + true + true + false + + + make + + distuninstallcheck + true + true + false + + + make + + dvi + true + true + false + + + make + + html + true + true + false + + + make + + info + true + true + false + + + make + + install + true + true + false + + + make + + install-data + true + true + false + + + make + + install-dvi + true + true + false + + + make + + install-exec + true + true + false + + + make + + install-html + true + true + false + + + make + + install-info + true + true + false + + + make + + install-man + true + true + false + + + make + + install-pdf + true + true + false + + + make + + install-ps + true + true + false + + + make + + install-strip + true + true + false + + + make + + installcheck + true + true + false + + + make + + installdirs + true + true + false + + + make + + maintainer-clean + true + true + false + + + make + + Makefile + true + true + false + + + make + + mostlyclean + true + true + false + + + make + + mostlyclean-libtool + true + true + false + + + make + + pdf + true + true + false + + + make + + ps + true + true + false + + + make + + tags + true + true + false + + + make + + tags-recursive + true + true + false + + + make + + uninstall + true + true + false + + + + + + + + + diff --git a/ssh-tunnel/pam-http/.project b/ssh-tunnel/pam-http/.project new file mode 100644 index 000000000..bf819ed97 --- /dev/null +++ b/ssh-tunnel/pam-http/.project @@ -0,0 +1,76 @@ + + + pam-http + + + + + + org.eclipse.linuxtools.cdt.autotools.core.genmakebuilderV2 + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + ?name? + + + + org.eclipse.cdt.make.core.append_environment + true + + + org.eclipse.cdt.make.core.buildArguments + + + + org.eclipse.cdt.make.core.buildCommand + make + + + org.eclipse.cdt.make.core.buildLocation + ${workspace_loc:/pam-http/bin} + + + org.eclipse.cdt.make.core.contents + org.eclipse.cdt.make.core.activeConfigSettings + + + org.eclipse.cdt.make.core.enableAutoBuild + false + + + org.eclipse.cdt.make.core.enableCleanBuild + true + + + org.eclipse.cdt.make.core.enableFullBuild + true + + + org.eclipse.cdt.make.core.stopOnError + true + + + org.eclipse.cdt.make.core.useDefaultBuildCmd + true + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + org.eclipse.linuxtools.cdt.autotools.core.autotoolsNatureV2 + + diff --git a/ssh-tunnel/pam-http/.settings/org.eclipse.cdt.managedbuilder.core.prefs b/ssh-tunnel/pam-http/.settings/org.eclipse.cdt.managedbuilder.core.prefs new file mode 100644 index 000000000..2896e0ac4 --- /dev/null +++ b/ssh-tunnel/pam-http/.settings/org.eclipse.cdt.managedbuilder.core.prefs @@ -0,0 +1,8 @@ +#Tue Jan 03 04:44:38 CET 2012 +eclipse.preferences.version=1 +environment/buildEnvironmentInclude/org.eclipse.linuxtools.cdt.autotools.core.configuration.build.1972532328/CPATH/delimiter=\: +environment/buildEnvironmentInclude/org.eclipse.linuxtools.cdt.autotools.core.configuration.build.1972532328/CPATH/operation=remove +environment/buildEnvironmentInclude/org.eclipse.linuxtools.cdt.autotools.core.configuration.build.1972532328/C_INCLUDE_PATH/delimiter=\: +environment/buildEnvironmentInclude/org.eclipse.linuxtools.cdt.autotools.core.configuration.build.1972532328/C_INCLUDE_PATH/operation=remove +environment/buildEnvironmentInclude/org.eclipse.linuxtools.cdt.autotools.core.configuration.build.1972532328/append=true +environment/buildEnvironmentInclude/org.eclipse.linuxtools.cdt.autotools.core.configuration.build.1972532328/appendContributed=true diff --git a/ssh-tunnel/pam-http/AUTHORS b/ssh-tunnel/pam-http/AUTHORS new file mode 100644 index 000000000..e231b7d67 --- /dev/null +++ b/ssh-tunnel/pam-http/AUTHORS @@ -0,0 +1 @@ +Adolfo Gómez diff --git a/ssh-tunnel/pam-http/COPYING b/ssh-tunnel/pam-http/COPYING new file mode 100644 index 000000000..54c4590d2 --- /dev/null +++ b/ssh-tunnel/pam-http/COPYING @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ssh-tunnel/pam-http/ChangeLog b/ssh-tunnel/pam-http/ChangeLog new file mode 100644 index 000000000..e69de29bb diff --git a/ssh-tunnel/pam-http/INSTALL b/ssh-tunnel/pam-http/INSTALL new file mode 100644 index 000000000..7d1c323be --- /dev/null +++ b/ssh-tunnel/pam-http/INSTALL @@ -0,0 +1,365 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006, 2007, 2008, 2009 Free Software Foundation, Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Basic Installation +================== + + Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + + The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package, generally using the just-built uninstalled binaries. + + 4. Type `make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. + + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. + + 6. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. This +is known as a "VPATH" build. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + +Installation Names +================== + + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX', where PREFIX must be an +absolute file name. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the +default for these options is expressed in terms of `${prefix}', so that +specifying just `--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to `configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +`make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, `make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +`${prefix}'. Any directories that were specified during `configure', +but not in terms of `${prefix}', must each be overridden at install +time for the entire installation to be relocated. The approach of +makefile variable overrides for each directory variable is required by +the GNU Coding Standards, and ideally causes no recompilation. +However, some platforms have known limitations with the semantics of +shared libraries that end up requiring recompilation when using this +method, particularly noticeable in packages that use GNU Libtool. + + The second method involves providing the `DESTDIR' variable. For +example, `make install DESTDIR=/alternate/directory' will prepend +`/alternate/directory' before all installation names. The approach of +`DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of `${prefix}' +at `configure' time. + +Optional Features +================= + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + + Some packages offer the ability to configure how verbose the +execution of `make' will be. For these packages, running `./configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with `make V=1'; while running `./configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with `make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put `/usr/ucb' early in your `PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' +in your `PATH', put it _after_ `/usr/bin'. + + On Haiku, software installed for all users goes in `/boot/common', +not `/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS + KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: + + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/ssh-tunnel/pam-http/Makefile.am b/ssh-tunnel/pam-http/Makefile.am new file mode 100644 index 000000000..c0c032a35 --- /dev/null +++ b/ssh-tunnel/pam-http/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS=src +ACLOCAL_AMFLAGS=-I m4 \ No newline at end of file diff --git a/ssh-tunnel/pam-http/Makefile.in b/ssh-tunnel/pam-http/Makefile.in new file mode 100644 index 000000000..7f86e7c22 --- /dev/null +++ b/ssh-tunnel/pam-http/Makefile.in @@ -0,0 +1,710 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \ + ChangeLog INSTALL NEWS compile config.guess config.sub depcomp \ + install-sh ltmain.sh missing +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir dist dist-all distcheck +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d "$(distdir)" \ + || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr "$(distdir)"; }; } +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CURL_CFLAGS = @CURL_CFLAGS@ +CURL_LIBS = @CURL_LIBS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = src +ACLOCAL_AMFLAGS = -I m4 +all: all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @$(am__cd) '$(distuninstallcheck_dir)' \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ + install-am install-strip tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ + dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-generic distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/ssh-tunnel/pam-http/NEWS b/ssh-tunnel/pam-http/NEWS new file mode 100644 index 000000000..908f7658d --- /dev/null +++ b/ssh-tunnel/pam-http/NEWS @@ -0,0 +1 @@ +Sample NEWS file for pam-http project. diff --git a/ssh-tunnel/pam-http/README b/ssh-tunnel/pam-http/README new file mode 100644 index 000000000..aeb969141 --- /dev/null +++ b/ssh-tunnel/pam-http/README @@ -0,0 +1 @@ +Sample readme file for pam-http project. diff --git a/ssh-tunnel/pam-http/aclocal.m4 b/ssh-tunnel/pam-http/aclocal.m4 new file mode 100644 index 000000000..d44228412 --- /dev/null +++ b/ssh-tunnel/pam-http/aclocal.m4 @@ -0,0 +1,1151 @@ +# generated automatically by aclocal 1.11.1 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, +[m4_warning([this file was generated for autoconf 2.68. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 1 (pkg-config-0.24) +# +# Copyright © 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) +m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +# only at the first occurence in configure.ac, so if the first place +# it's called might be skipped (such as if it is within an "if", you +# have to call PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_default([$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes ], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + m4_default([$4], [AC_MSG_ERROR( +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT])[]dnl + ]) +elif test $pkg_failed = untried; then + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])[]dnl + ]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + $3 +fi[]dnl +])# PKG_CHECK_MODULES + +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.11.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 10 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 5 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 16 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.62])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) + +dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# AM_PROG_CC_C_O +# -------------- +# Like AC_PROG_CC_C_O, but changed for automake. +AC_DEFUN([AM_PROG_CC_C_O], +[AC_REQUIRE([AC_PROG_CC_C_O])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +dnl Make sure AC_PROG_CC is never called again, or it will override our +dnl setting of CC. +m4_define([AC_PROG_CC], + [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([m4/libtool.m4]) +m4_include([m4/ltoptions.m4]) +m4_include([m4/ltsugar.m4]) +m4_include([m4/ltversion.m4]) +m4_include([m4/lt~obsolete.m4]) diff --git a/ssh-tunnel/pam-http/compile b/ssh-tunnel/pam-http/compile new file mode 100755 index 000000000..c0096a7b5 --- /dev/null +++ b/ssh-tunnel/pam-http/compile @@ -0,0 +1,143 @@ +#! /bin/sh +# Wrapper for compilers which do not understand `-c -o'. + +scriptversion=2009-10-06.20; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software +# Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand `-c -o'. +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file `INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; +esac + +ofile= +cfile= +eat= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we strip `-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use `[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/ssh-tunnel/pam-http/config.guess b/ssh-tunnel/pam-http/config.guess new file mode 100755 index 000000000..40eaed482 --- /dev/null +++ b/ssh-tunnel/pam-http/config.guess @@ -0,0 +1,1517 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011 Free Software Foundation, Inc. + +timestamp='2011-05-11' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free +Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-tilera-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/ssh-tunnel/pam-http/config.sub b/ssh-tunnel/pam-http/config.sub new file mode 100755 index 000000000..30fdca812 --- /dev/null +++ b/ssh-tunnel/pam-http/config.sub @@ -0,0 +1,1760 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011 Free Software Foundation, Inc. + +timestamp='2011-03-23' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted GNU ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free +Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 \ + | ns16k | ns32k \ + | open8 \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | picochip) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile-* | tilegx-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze) + basic_machine=microblaze-xilinx + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + # This must be matched before tile*. + tilegx*) + basic_machine=tilegx-unknown + os=-linux-gnu + ;; + tile*) + basic_machine=tile-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/ssh-tunnel/pam-http/configure b/ssh-tunnel/pam-http/configure new file mode 100755 index 000000000..032aed0ae --- /dev/null +++ b/ssh-tunnel/pam-http/configure @@ -0,0 +1,13978 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.68 for pam-http 1.0. +# +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + # Preserve -v and -x to the replacement shell. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; + esac + exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='pam-http' +PACKAGE_TARNAME='pam-http' +PACKAGE_VERSION='1.0' +PACKAGE_STRING='pam-http 1.0' +PACKAGE_BUGREPORT='' +PACKAGE_URL='' + +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +CURL_LIBS +CURL_CFLAGS +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH +PKG_CONFIG +CPP +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +ac_ct_AR +AR +DLLTOOL +OBJDUMP +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +LIBTOOL +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_dependency_tracking +enable_shared +enable_static +with_pic +enable_fast_install +with_gnu_ld +with_sysroot +enable_libtool_lock +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR +CURL_CFLAGS +CURL_LIBS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used" >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures pam-http 1.0 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/pam-http] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of pam-http 1.0:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path + CURL_CFLAGS C compiler flags for CURL, overriding pkg-config + CURL_LIBS linker flags for CURL, overriding pkg-config + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +pam-http configure 1.0 +generated by GNU Autoconf 2.68 + +Copyright (C) 2010 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by pam-http $as_me 1.0, which was +generated by GNU Autoconf 2.68. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if ${ac_cv_target+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + + + +am__api_version='1.11' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE=pam-http + VERSION=1.0 + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4.2' +macro_revision='1.3337' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if ${ac_cv_path_FGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if ${lt_cv_path_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if ${lt_cv_nm_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if ${lt_cv_sys_max_cmd_len+:} false; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if ${lt_cv_ld_reload_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if ${lt_cv_deplibs_check_method+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if ${lt_cv_sys_global_symbol_pipe+:} false; then : + $as_echo_n "(cached) " >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if ${lt_cv_cc_needs_belf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if ${lt_cv_apple_cc_single_mod+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if ${lt_cv_ld_exported_symbols_list+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + + + +# Set options + + + + enable_dlopen=no + + + enable_win32_dll=no + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + pic_mode=default +fi + + +test -z "$pic_mode" && pic_mode=default + + + + + + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if ${lt_cv_objdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if ${lt_cv_prog_compiler_pic_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + linux* | k*bsd*-gnu | gnu*) + link_all_deplibs=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + link_all_deplibs=no + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + export_dynamic_flag_spec='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self_static+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + +if test "x$CC" != xcc; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 +$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 +$as_echo_n "checking whether cc understands -c and -o together... " >&6; } +fi +set dummy $CC; ac_cc=`$as_echo "$2" | + sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +rm -f conftest2.* +if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; +then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + if test "x$CC" != xcc; then + # Test first that cc exists at all. + if { ac_try='cc -c conftest.$ac_ext >&5' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' + rm -f conftest2.* + if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; + then + # cc works too. + : + else + # cc exists but doesn't like -o. + eval ac_cv_prog_cc_${ac_cc}_c_o=no + fi + fi + fi +else + eval ac_cv_prog_cc_${ac_cc}_c_o=no +fi +rm -f core conftest* + +fi +if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h + +fi + +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pam_get_user in -lpam" >&5 +$as_echo_n "checking for pam_get_user in -lpam... " >&6; } +if ${ac_cv_lib_pam_pam_get_user+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpam $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pam_get_user (); +int +main () +{ +return pam_get_user (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pam_pam_get_user=yes +else + ac_cv_lib_pam_pam_get_user=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pam_pam_get_user" >&5 +$as_echo "$ac_cv_lib_pam_pam_get_user" >&6; } +if test "x$ac_cv_lib_pam_pam_get_user" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPAM 1 +_ACEOF + + LIBS="-lpam $LIBS" + +else + as_fn_error $? "PAM library missing" "$LINENO" 5 +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpam" >&5 +$as_echo_n "checking for main in -lpam... " >&6; } +if ${ac_cv_lib_pam_main+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpam $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pam_main=yes +else + ac_cv_lib_pam_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pam_main" >&5 +$as_echo "$ac_cv_lib_pam_main" >&6; } +if test "x$ac_cv_lib_pam_main" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPAM 1 +_ACEOF + + LIBS="-lpam $LIBS" + +else + as_fn_error $? "libpam-devel >1.0 Not Found" "$LINENO" 5 +fi + +ac_fn_c_check_header_mongrel "$LINENO" "security/pam_modules.h" "ac_cv_header_security_pam_modules_h" "$ac_includes_default" +if test "x$ac_cv_header_security_pam_modules_h" = xyes; then : + +else + as_fn_error $? "PAM headers missing" "$LINENO" 5 +fi + + + + + + + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi +fi + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CURL" >&5 +$as_echo_n "checking for CURL... " >&6; } + +if test -n "$CURL_CFLAGS"; then + pkg_cv_CURL_CFLAGS="$CURL_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcurl >= 7.0.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libcurl >= 7.0.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_CURL_CFLAGS=`$PKG_CONFIG --cflags "libcurl >= 7.0.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$CURL_LIBS"; then + pkg_cv_CURL_LIBS="$CURL_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcurl >= 7.0.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libcurl >= 7.0.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_CURL_LIBS=`$PKG_CONFIG --libs "libcurl >= 7.0.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + CURL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcurl >= 7.0.0" 2>&1` + else + CURL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcurl >= 7.0.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$CURL_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (libcurl >= 7.0.0) were not met: + +$CURL_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables CURL_CFLAGS +and CURL_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables CURL_CFLAGS +and CURL_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } +else + CURL_CFLAGS=$pkg_cv_CURL_CFLAGS + CURL_LIBS=$pkg_cv_CURL_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +fi + + +ac_config_files="$ac_config_files Makefile src/Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by pam-http $as_me 1.0, which was +generated by GNU Autoconf 2.68. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +pam-http config.status 1.0 +configured by $0, generated by GNU Autoconf 2.68, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2010 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +OBJDUMP \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +DLLTOOL \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +nm_file_list_spec \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="" + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# An object symbol dumper. +OBJDUMP=$lt_OBJDUMP + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + diff --git a/ssh-tunnel/pam-http/configure.ac b/ssh-tunnel/pam-http/configure.ac new file mode 100644 index 000000000..3955c28f7 --- /dev/null +++ b/ssh-tunnel/pam-http/configure.ac @@ -0,0 +1,26 @@ +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.59) +AC_INIT(pam-http, 1.0) + + +AC_CANONICAL_SYSTEM +AC_CONFIG_MACRO_DIR([m4]) + +AM_INIT_AUTOMAKE(pam-http, 1.0) + + +AC_PROG_CC +AC_PROG_LIBTOOL +AM_PROG_CC_C_O + +AC_CHECK_LIB(pam, pam_get_user, ,AC_MSG_ERROR([PAM library missing])) +AC_CHECK_LIB([pam], [main],,AC_MSG_ERROR(libpam-devel >1.0 Not Found)) +AC_CHECK_HEADER([security/pam_modules.h], ,[AC_MSG_ERROR([PAM headers missing])]) + +PKG_CHECK_MODULES(CURL, [libcurl >= 7.0.0]) + + +AC_CONFIG_FILES(Makefile src/Makefile) +AC_OUTPUT + diff --git a/ssh-tunnel/pam-http/depcomp b/ssh-tunnel/pam-http/depcomp new file mode 100755 index 000000000..df8eea7e4 --- /dev/null +++ b/ssh-tunnel/pam-http/depcomp @@ -0,0 +1,630 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2009-04-28.21; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free +# Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u="sed s,\\\\\\\\,/,g" + depmode=msvisualcpp +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> "$depfile" + echo >> "$depfile" + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/ssh-tunnel/pam-http/doc/requests.txt b/ssh-tunnel/pam-http/doc/requests.txt new file mode 100644 index 000000000..32942d42e --- /dev/null +++ b/ssh-tunnel/pam-http/doc/requests.txt @@ -0,0 +1,18 @@ +functional: + +The function of module is as follow: + +With a given base, the module will invoke this urls, and expects the responses indicated: + +Imagine that base is http://192.168.0.30/nss + +1.- For Authenticating user: + http://192.168.0.30/nss?id=[USERID]&pass=[PASSWORD] + expects a response of "1" of user is valid, "0" if not. + +2.- For user (nsswitch passwd): + http://192.168.0.30/nss?name=[USERNAME] + expects a response of "*" for invalid username or "id" (integer between 10000-65500) if not + + http://192.168.0.30/nss?uid=[UID] + expects a response of "*" for invalid uid, or the username if not. \ No newline at end of file diff --git a/ssh-tunnel/pam-http/doc/setup.txt b/ssh-tunnel/pam-http/doc/setup.txt new file mode 100644 index 000000000..8d4db1a61 --- /dev/null +++ b/ssh-tunnel/pam-http/doc/setup.txt @@ -0,0 +1,35 @@ +Setting up pam module: + +add to to common-auth this line: +auth required pam_uds.so base=http://192.168.0.30/nss + +Setting up nsswitch module: + +1.- Copy libnss_uds.so.2 to /usr/lib +2.- Edit /etc/nsswitch.conf, and put: + +passwd: compat uds +group: compat +shadow: compat + +host: files dns +networks: files +protocols: files +services: files +ethers: files +rcp: files + +netgroup: files + +(look passwd file, rest is sample content) + +3.- Create /etc/uds.cfg file, that hast the BASE url of the auth provider +example: +https://192.168.0.30/nss + + +Every connection takes about 2.5 Mb, so with 380 Megas default machine memory size, we have for 100 connections (the 100Mb of "plus" is for OS) + +So, machine memory should be 128 + 2.5 * Expected concurrent connections. + +No limit has been detected, every connection spawn a process on server, but no data has been collected so far. \ No newline at end of file diff --git a/ssh-tunnel/pam-http/install-sh b/ssh-tunnel/pam-http/install-sh new file mode 100755 index 000000000..6781b987b --- /dev/null +++ b/ssh-tunnel/pam-http/install-sh @@ -0,0 +1,520 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2009-04-28.21; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dst_arg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + -*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/ssh-tunnel/pam-http/ltmain.sh b/ssh-tunnel/pam-http/ltmain.sh new file mode 100644 index 000000000..c7d06c3c0 --- /dev/null +++ b/ssh-tunnel/pam-http/ltmain.sh @@ -0,0 +1,9661 @@ + +# libtool (GNU libtool) 2.4.2 +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# Usage: $progname [OPTION]... [MODE-ARG]... +# +# Provide generalized library-building support services. +# +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --no-warn don't display warning messages +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message +# +# MODE must be one of the following: +# +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory +# +# MODE-ARGS vary depending on the MODE. When passed as first option, +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1 +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . +# GNU libtool home page: . +# General help using GNU software: . + +PROGRAM=libtool +PACKAGE=libtool +VERSION="2.4.2 Debian-2.4.2-1" +TIMESTAMP="" +package_revision=1.3337 + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# NLS nuisances: We save the old values to restore during execute mode. +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + fi" +done +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL + +$lt_unset CDPATH + + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + + + +: ${CP="cp -f"} +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} +: ${Xsed="$SED -e 1s/^X//"} + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +exit_status=$EXIT_SUCCESS + +# Make sure IFS has a sensible default +lt_nl=' +' +IFS=" $lt_nl" + +dirname="s,/[^/]*$,," +basename="s,^.*/,," + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} # func_dirname may be replaced by extended shell implementation + + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} # func_basename may be replaced by extended shell implementation + + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} # func_dirname_and_basename may be replaced by extended shell implementation + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname may be replaced by extended shell implementation + + +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar='s,^/\([^/]*\).*$,\1,' +pathcdr='s,^/[^/]*,,' +removedotparts=':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes='s@/\{1,\}@/@g' +finalslash='s,/*$,/,' + +# func_normal_abspath PATH +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` + while :; do + # Processed it all yet? + if test "$func_normal_abspath_tpath" = / ; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result" ; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + +# func_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=${func_dirname_result} + if test "x$func_relative_path_tlibdir" = x ; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test "x$func_stripname_result" != x ; then + func_relative_path_result=${func_relative_path_result}/${func_stripname_result} + fi + + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=$func_stripname_result + fi +} + +# The name of this program: +func_dirname_and_basename "$progpath" +progname=$func_basename_result + +# Make sure we have an absolute path for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=$func_dirname_result + progdir=`cd "$progdir" && pwd` + progpath="$progdir/$progname" + ;; + *) + save_IFS="$IFS" + IFS=${PATH_SEPARATOR-:} + for progdir in $PATH; do + IFS="$save_IFS" + test -x "$progdir/$progname" && break + done + IFS="$save_IFS" + test -n "$progdir" || progdir=`pwd` + progpath="$progdir/$progname" + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed="${SED}"' -e 1s/^X//' +sed_quote_subst='s/\([`"$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' + +# Sed substitution that converts a w32 file name or path +# which contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Re-`\' parameter expansions in output of double_quote_subst that were +# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +# in input to double_quote_subst, that '$' was protected from expansion. +# Since each input `\' is now two `\'s, look for any number of runs of +# four `\'s followed by two `\'s and then a '$'. `\' that '$'. +bs='\\' +bs2='\\\\' +bs4='\\\\\\\\' +dollar='\$' +sed_double_backslash="\ + s/$bs4/&\\ +/g + s/^$bs2$dollar/$bs&/ + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g + s/\n//g" + +# Standard options: +opt_dry_run=false +opt_help=false +opt_quiet=false +opt_verbose=false +opt_warning=: + +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }$*" +} + +# func_verbose arg... +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $opt_verbose && func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 +} + +# func_warning arg... +# Echo program name prefixed warning message to standard error. +func_warning () +{ + $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 + + # bash bug again: + : +} + +# func_fatal_error arg... +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + +# func_fatal_help arg... +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + func_error ${1+"$@"} + func_fatal_error "$help" +} +help="Try \`$progname --help' for more information." ## default + + +# func_grep expression filename +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_mkdir_p directory-path +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + my_directory_path="$1" + my_dir_list= + + if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then + + # Protect directory names starting with `-' + case $my_directory_path in + -*) my_directory_path="./$my_directory_path" ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$my_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + my_dir_list="$my_directory_path:$my_dir_list" + + # If the last portion added has no slash in it, the list is done + case $my_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` + done + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` + + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" + + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi +} + + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$opt_dry_run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi + + $ECHO "$my_tmpdir" +} + + +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () +{ + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; + esac + + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac +} + + +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "$1" | $SED \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg="$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac + + func_quote_for_expand_result="$my_arg" +} + + +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + +# func_tr_sh +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $opt_debug + + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# / / + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} + +# func_usage +# Echo short help message to standard output and exit. +func_usage () +{ + $opt_debug + + $SED -n '/^# Usage:/,/^# *.*--help/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + echo + $ECHO "run \`$progname --help | more' for full usage" + exit $? +} + +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. +func_help () +{ + $opt_debug + + $SED -n '/^# Usage:/,/# Report bugs to/ { + :print + s/^# // + s/^# *$// + s*\$progname*'$progname'* + s*\$host*'"$host"'* + s*\$SHELL*'"$SHELL"'* + s*\$LTCC*'"$LTCC"'* + s*\$LTCFLAGS*'"$LTCFLAGS"'* + s*\$LD*'"$LD"'* + s/\$with_gnu_ld/'"$with_gnu_ld"'/ + s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ + p + d + } + /^# .* home page:/b print + /^# General help using/b print + ' < "$progpath" + ret=$? + if test -z "$1"; then + exit $ret + fi +} + +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + $opt_debug + + func_error "missing argument for $1." + exit_cmd=exit +} + + +# func_split_short_opt shortopt +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +func_split_short_opt () +{ + my_sed_short_opt='1s/^\(..\).*$/\1/;q' + my_sed_short_rest='1s/^..\(.*\)$/\1/;q' + + func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` + func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` +} # func_split_short_opt may be replaced by extended shell implementation + + +# func_split_long_opt longopt +# Set func_split_long_opt_name and func_split_long_opt_arg shell +# variables after splitting LONGOPT at the `=' sign. +func_split_long_opt () +{ + my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' + my_sed_long_arg='1s/^--[^=]*=//' + + func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` + func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` +} # func_split_long_opt may be replaced by extended shell implementation + +exit_cmd=: + + + + + +magic="%%%MAGIC variable%%%" +magic_exe="%%%MAGIC EXE variable%%%" + +# Global variables. +nonopt= +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "${1}=\$${1}\${2}" +} # func_append may be replaced by extended shell implementation + +# func_append_quoted var value +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +func_append_quoted () +{ + func_quote_for_eval "${2}" + eval "${1}=\$${1}\\ \$func_quote_for_eval_result" +} # func_append_quoted may be replaced by extended shell implementation + + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "${@}"` +} # func_arith may be replaced by extended shell implementation + + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` +} # func_len may be replaced by extended shell implementation + + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} # func_lo2o may be replaced by extended shell implementation + + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} # func_xform may be replaced by extended shell implementation + + +# func_fatal_configuration arg... +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func_error ${1+"$@"} + func_error "See the $PACKAGE documentation for more information." + func_fatal_error "Fatal configuration error." +} + + +# func_config +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf='^# ### BEGIN LIBTOOL' + re_endcf='^# ### END LIBTOOL' + + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + + # Now print the configurations for the tags. + for tagname in $taglist; do + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" + done + + exit $? +} + +# func_features +# Display the features supported by this script. +func_features () +{ + echo "host: $host" + if test "$build_libtool_libs" = yes; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + + exit $? +} + +# func_enable_tag tagname +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname="$1" + + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf="/$re_begincf/,/$re_endcf/p" + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac + + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +# Shorthand for --mode=foo, only valid as the first argument +case $1 in +clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; +compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; +execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; +finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; +install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; +link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; +uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; +esac + + + +# Option defaults: +opt_debug=: +opt_dry_run=false +opt_config=false +opt_preserve_dup_deps=false +opt_features=false +opt_finish=false +opt_help=false +opt_help_all=false +opt_silent=: +opt_warning=: +opt_verbose=: +opt_silent=false +opt_verbose=false + + +# Parse options once, thoroughly. This comes as soon as possible in the +# script to make things like `--version' happen as quickly as we can. +{ + # this just eases exit handling + while test $# -gt 0; do + opt="$1" + shift + case $opt in + --debug|-x) opt_debug='set -x' + func_echo "enabling shell trace mode" + $opt_debug + ;; + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + --config) + opt_config=: +func_config + ;; + --dlopen|-dlopen) + optarg="$1" + opt_dlopen="${opt_dlopen+$opt_dlopen +}$optarg" + shift + ;; + --preserve-dup-deps) + opt_preserve_dup_deps=: + ;; + --features) + opt_features=: +func_features + ;; + --finish) + opt_finish=: +set dummy --mode finish ${1+"$@"}; shift + ;; + --help) + opt_help=: + ;; + --help-all) + opt_help_all=: +opt_help=': help-all' + ;; + --mode) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_mode="$optarg" +case $optarg in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; +esac + shift + ;; + --no-silent|--no-quiet) + opt_silent=false +func_append preserve_args " $opt" + ;; + --no-warning|--no-warn) + opt_warning=false +func_append preserve_args " $opt" + ;; + --no-verbose) + opt_verbose=false +func_append preserve_args " $opt" + ;; + --silent|--quiet) + opt_silent=: +func_append preserve_args " $opt" + opt_verbose=false + ;; + --verbose|-v) + opt_verbose=: +func_append preserve_args " $opt" +opt_silent=false + ;; + --tag) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_tag="$optarg" +func_append preserve_args " $opt $optarg" +func_enable_tag "$optarg" + shift + ;; + + -\?|-h) func_usage ;; + --help) func_help ;; + --version) func_version ;; + + # Separate optargs to long options: + --*=*) + func_split_long_opt "$opt" + set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-n*|-v*) + func_split_short_opt "$opt" + set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognized option \`$opt'" ;; + *) set dummy "$opt" ${1+"$@"}; shift; break ;; + esac + done + + # Validate options: + + # save first non-option argument + if test "$#" -gt 0; then + nonopt="$opt" + shift + fi + + # preserve --debug + test "$opt_debug" = : || func_append preserve_args " --debug" + + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac + + $opt_help || { + # Sanity checks first: + func_check_version_match + + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test "$opt_mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$opt_mode' for more information." + } + + + # Bail if the options were screwed + $exit_cmd $EXIT_FAILURE +} + + + + +## ----------- ## +## Main. ## +## ----------- ## + +# func_lalib_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if `file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case "$lalib_p_line" in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test "$lalib_p" = yes +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + func_lalib_p "$1" +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $opt_debug + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$save_ifs + eval cmd=\"$cmd\" + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# `FILE.' does not work on cygwin managed mounts. +func_source () +{ + $opt_debug + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case "$lt_sysroot:$1" in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result="=$func_stripname_result" + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $opt_debug + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with \`--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=${1} + if test "$build_libtool_libs" = yes; then + write_lobj=\'${2}\' + else + write_lobj=none + fi + + if test "$build_old_libs" = yes; then + write_oldobj=\'${3}\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T </dev/null` + if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$lt_sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $opt_debug + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result="" + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result" ; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $opt_debug + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $opt_debug + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $opt_debug + if test -z "$2" && test -n "$1" ; then + func_error "Could not determine host file name corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result="$1" + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $opt_debug + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " \`$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result="$3" + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $opt_debug + case $4 in + $1 ) func_to_host_path_result="$3$func_to_host_path_result" + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via `$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $opt_debug + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $opt_debug + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result="$1" +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result="$func_convert_core_msys_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via `$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $opt_debug + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd="func_convert_path_${func_stripname_result}" + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $opt_debug + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result="$1" +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_msys_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + +# func_mode_compile arg... +func_mode_compile () +{ + $opt_debug + # Get the compilation command and the source file. + base_compile= + srcfile="$nonopt" # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + pie_flag= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg="$arg" + arg_mode=normal + ;; + + target ) + libobj="$arg" + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + test -n "$libobj" && \ + func_fatal_error "you cannot specify \`-o' more than once" + arg_mode=target + continue + ;; + + -pie | -fpie | -fPIE) + func_append pie_flag " $arg" + continue + ;; + + -shared | -static | -prefer-pic | -prefer-non-pic) + func_append later " $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + func_append_quoted lastarg "$arg" + done + IFS="$save_ifs" + func_stripname ' ' '' "$lastarg" + lastarg=$func_stripname_result + + # Add the arguments to base_compile. + func_append base_compile " $lastarg" + continue + ;; + + *) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg="$srcfile" + srcfile="$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + func_append_quoted base_compile "$lastarg" + done # for arg + + case $arg_mode in + arg) + func_fatal_error "you must specify an argument for -Xcompile" + ;; + target) + func_fatal_error "you must specify a target with \`-o'" + ;; + *) + # Get the name of the library object. + test -z "$libobj" && { + func_basename "$srcfile" + libobj="$func_basename_result" + } + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + case $libobj in + *.[cCFSifmso] | \ + *.ada | *.adb | *.ads | *.asm | \ + *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) + func_xform "$libobj" + libobj=$func_xform_result + ;; + esac + + case $libobj in + *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; + *) + func_fatal_error "cannot determine name of library object from \`$libobj'" + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + continue + ;; + + -static) + build_libtool_libs=no + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + func_quote_for_eval "$libobj" + test "X$libobj" != "X$func_quote_for_eval_result" \ + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && func_warning "libobj name \`$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname="$func_basename_result" + xdir="$func_dirname_result" + lobj=${xdir}$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + func_append removelist " $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + func_append removelist " $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test "$build_libtool_libs" = yes; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test "$pic_mode" != no; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + func_append command " -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test "$suppress_opt" = yes; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test "$build_old_libs" = yes; then + if test "$pic_mode" != yes; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test "$compiler_c_o" = yes; then + func_append command " -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + func_append command "$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test "$need_locks" != no; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test "$opt_mode" = compile && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $opt_mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode \`$opt_mode'" + ;; + esac + + echo + $ECHO "Try \`$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test "$opt_help" = :; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | sed -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + sed '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $opt_debug + # The first argument is the command name. + cmd="$nonopt" + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $opt_dlopen; do + test -f "$file" \ + || func_fatal_help "\`$file' is not a file" + + dir= + case $file in + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "\`$file' was not linked with \`-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir="$func_dirname_result" + + if test -f "$dir/$objdir/$dlname"; then + func_append dir "/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir="$func_dirname_result" + ;; + + *) + func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file="$progdir/$program" + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_append_quoted args "$file" + done + + if test "X$opt_dry_run" = Xfalse; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + fi +} + +test "$opt_mode" = execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + libs= + libdirs= + admincmds= + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "\`$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument \`$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and \`=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || func_append admincmds " + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_silent && exit $EXIT_SUCCESS + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + echo + + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi + exit $EXIT_SUCCESS +} + +test "$opt_mode" = finish && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $opt_debug + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + case $nonopt in *shtool*) :;; *) false;; esac; then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + func_append files " $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test "x$prev" = x-m && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + func_append install_shared_prog " $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the \`$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir="$func_dirname_result" + destname="$func_basename_result" + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "\`$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "\`$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + func_append staticlibs " $file" + ;; + + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) func_append current_libdirs " $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) func_append future_libdirs " $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir="$func_dirname_result" + func_append dir "$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking \`$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname="$1" + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme="$stripme" + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme="" + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name="$func_basename_result" + instname="$dir/$name"i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && func_append staticlibs " $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to \`$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script \`$wrapper'" + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=no + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + $opt_dry_run || { + if test "$finalize" = yes; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file="$func_basename_result" + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_silent || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink \`$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file="$outputname" + else + func_warning "cannot relink \`$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name="$func_basename_result" + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run \`$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test "$opt_mode" = install && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $opt_debug + my_outputname="$1" + my_originator="$2" + my_pic_p="${3-no}" + my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms="${my_outputname}S.c" + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${my_outputname}.nm" + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + func_verbose "generating symbol list for \`$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $opt_dry_run || { + $RM $export_symbols + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from \`$dlprefile'" + func_basename "$dlprefile" + name="$func_basename_result" + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename="" + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname" ; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename="$func_basename_result" + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename" ; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +extern LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[]; +LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{\ + { \"$my_originator\", (void *) 0 }," + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + if test "X$my_pic_p" != Xno; then + pic_flag_for_symtable=" $pic_flag" + fi + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) func_append symtab_cflags " $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' + + # Transform the symbol file into the correct name. + symfileobj="$output_objdir/${my_outputname}S.$objext" + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for \`$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $opt_debug + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' + 1,100{ + / I /{ + s,.*,import, + p + q + } + }'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $opt_debug + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $opt_debug + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive which possess that section. Heuristic: eliminate + # all those which have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $opt_debug + if func_cygming_gnu_implib_p "$1" ; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1" ; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result="" + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $opt_debug + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + if test "$lock_old_archive_extraction" = yes; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test "$lock_old_archive_extraction" = yes; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $opt_debug + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib="$func_basename_result" + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`basename "$darwin_archive"` + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result="$my_oldobjs" +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ which is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options which match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${1+\"\$@\"} + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} + + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +/* declarations of non-ANSI functions */ +#if defined(__MINGW32__) +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined(__CYGWIN__) +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined (other platforms) ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined(_MSC_VER) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined(__CYGWIN__) +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined (other platforms) ... */ +#endif + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +#if defined(LT_DEBUGWRAPPER) +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp (str, pat) == 0) + *str = '\0'; + } + return str; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + int len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + int orig_value_len = strlen (orig_value); + int add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + int len = strlen (new_value); + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[len-1] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $opt_debug + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $opt_debug + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll which has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=no + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module="${wl}-single_module" + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir="$arg" + prev= + continue + ;; + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + func_append dlfiles " $arg" + else + func_append dlprefiles " $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + test -f "$arg" \ + || func_fatal_error "symbol file \`$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) func_append deplibs " $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# func_append moreargs " $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file \`$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) func_append rpath " $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) func_append xrpath " $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + weak) + func_append weak_libs " $arg" + prev= + continue + ;; + xcclinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "\`-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -bindir) + prev=bindir + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between \`-L' and \`$1'" + else + func_fatal_error "need path for \`-L' option" + fi + fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of \`$dir'" + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; + *) + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) func_append dllsearchpath ":$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + func_append deplibs " System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + func_append deplibs " $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + continue + ;; + + -multi_module) + single_module="${wl}-multi_module" + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "\`-no-install' is ignored for $host" + func_warning "assuming \`-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-flto*|-fwhopr*|-fuse-linker-plugin) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + func_append compile_command " $arg" + func_append finalize_command " $arg" + func_append compiler_flags " $arg" + continue + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + *.$objext) + # A standard object. + func_append objs " $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + func_append deplibs " $arg" + func_append old_deplibs " $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + func_resolve_sysroot "$arg" + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + func_append dlfiles " $func_resolve_sysroot_result" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + func_append dlprefiles " $func_resolve_sysroot_result" + prev= + else + func_append deplibs " $func_resolve_sysroot_result" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the \`$prevarg' option requires an argument" + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname="$func_basename_result" + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + func_dirname "$output" "/" "" + output_objdir="$func_dirname_result$objdir" + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if $opt_preserve_dup_deps ; then + case "$libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append libs " $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; + esac + func_append pre_post_deps " $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + + case $linkmode in + lib) + passes="conv dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test "$linkmode,$pass" = "lib,link"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs="$tmp_deplibs" + fi + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) + libs="$deplibs %DEPLIBS%" + test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" + ;; + esac + fi + if test "$linkmode,$pass" = "lib,dlpreopen"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + func_resolve_sysroot "$lib" + case $lib in + *.la) func_source "$func_resolve_sysroot_result" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + func_basename "$deplib" + deplib_base=$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; + *) func_append deplibs " $deplib" ;; + esac + done + done + libs="$dlprefiles" + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append compiler_flags " $deplib" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + func_warning "\`-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test "$linkmode" = lib; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + *.ltframework) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + *) + func_warning "\`-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + func_stripname '-R' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + echo + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." + else + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + ;; + esac + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + func_append newdlprefiles " $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append newdlfiles " $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + + if test "$found" = yes || test -f "$lib"; then : + else + func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" + fi + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "\`$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + # It is a libtool convenience library, so add in its objects. + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" + fi + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + if test -n "$old_library" && + { test "$prefer_static_libs" = yes || + test "$prefer_static_libs,$installed" = "built,no"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib="$l" + done + fi + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + func_fatal_error "cannot -dlopen a convenience library: \`$lib'" + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + func_append dlprefiles " $lib $dependency_libs" + else + func_append newdlfiles " $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + func_warning "cannot determine absolute directory name of \`$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir="$ladir" + fi + ;; + esac + func_basename "$lib" + laname="$func_basename_result" + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library \`$lib' was moved." + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$lt_sysroot$libdir" + absdir="$lt_sysroot$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + func_append notinst_path " $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + func_append notinst_path " $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir" && test "$linkmode" = prog; then + func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" + fi + case "$host" in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + func_append newlib_search_path " $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath:" in + *"$absdir:"*) ;; + *) func_append temp_rpath "$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded + func_append notinst_deplibs " $lib" + need_relink=no + ;; + *) + if test "$installed" = no; then + func_append notinst_deplibs " $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule="" + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule="$dlpremoduletest" + break + fi + done + if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then + echo + if test "$linkmode" = prog; then + $ECHO "*** Warning: Linking the executable $output against the loadable module" + else + $ECHO "*** Warning: Linking the shared library $output against the loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname="$1" + shift + libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc*) + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + func_basename "$soroot" + soname="$func_basename_result" + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from \`$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for \`$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$opt_mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we can not + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null ; then + if test "X$dlopenmodule" != "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + elif test -n "$old_library"; then + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$absdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) func_append compile_shlibpath "$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && + test "$hardcode_minus_L" != yes && + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$opt_mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + echo + $ECHO "*** Warning: This system can not link to static lib archive $lib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) func_append xrpath " $temp_xrpath";; + esac;; + *) func_append temp_deplibs " $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + func_append newlib_search_path " $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; + esac + fi + func_append tmp_libs " $func_resolve_sysroot_result" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path= + case $deplib in + -L*) path="$deplib" ;; + *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result + func_dirname "$deplib" "" "." + dir=$func_dirname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of \`$dir'" + absdir="$dir" + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$absdir/$objdir/$depdepl" ; then + depdepl="$absdir/$objdir/$depdepl" + darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" + path= + fi + fi + ;; + *) + path="-L$absdir/$objdir" + ;; + esac + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "\`$deplib' seems to be moved" + + path="-L$absdir" + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test "$pass" = link; then + if test "$linkmode" = "prog"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) func_append lib_search_path " $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) func_append tmp_libs " $deplib" ;; + esac + ;; + *) func_append tmp_libs " $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + func_append tmp_libs " $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + fi + if test "$linkmode" = prog || test "$linkmode" = lib; then + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "\`-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "\`-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + func_append objs "$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test "$module" = no && \ + func_fatal_help "libtool library \`$output' must begin with \`lib'" + + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" + else + echo + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + func_append libobjs " $objs" + fi + fi + + test "$dlself" != no && \ + func_warning "\`-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test "$#" -gt 1 && \ + func_warning "ignoring multiple \`-rpath's for a libtool library" + + install_libdir="$1" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "\`-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + shift + IFS="$save_ifs" + + test -n "$7" && \ + func_fatal_help "too many parameters to \`-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$1" + number_minor="$2" + number_revision="$3" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + # correct linux to gnu/linux during the next big refactor + darwin|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|qnx|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + *) + func_fatal_configuration "$modename: unknown library version type \`$version_type'" + ;; + esac + ;; + no) + current="$1" + revision="$2" + age="$3" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE \`$age' is greater than the current interface number \`$current'" + func_fatal_error "\`$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current" + ;; + + irix | nonstopux) + if test "X$lt_irix_increment" = "Xno"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) # correct to gnu/linux during the next big refactor + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + func_append verstring ":${current}.0" + ;; + + qnx) + major=".$current" + versuffix=".$current" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + + *) + func_fatal_configuration "unknown library version type \`$version_type'" + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + func_warning "undefined symbols not allowed in $host shared libraries" + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + + fi + + func_generate_dlsyms "$libname" "$libname" "yes" + func_append libobjs " $symfileobj" + test "X$libobjs" = "X " && libobjs= + + if test "$opt_mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + func_append removelist " $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + func_append oldlibs " $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) func_append dlfiles " $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) func_append dlprefiles " $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + func_append deplibs " System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + func_append deplibs " -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + func_append newdeplibs " $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + echo + if test "X$deplibs_check_method" = "Xnone"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + ;; + esac + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + deplibs="$new_libs" + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + # Remove ${wl} instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$opt_mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append dep_rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + shift + realname="$1" + shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + linknames= + for link + do + func_append linknames " $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols="$output_objdir/$libname.uexp" + func_append delfiles " $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols="$export_symbols" + export_symbols= + always_export_symbols=yes + fi + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd1 in $cmds; do + IFS="$save_ifs" + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test "$try_normal_branch" = yes \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=${output_objdir}/${output_la}.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" + func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + func_append tmp_deplibs " $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test "$compiler_needs_object" = yes && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + func_append linker_flags " $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$opt_mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + func_basename "$output" + output_la=$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then + output=${output_objdir}/${output_la}.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result + elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then + output=${output_objdir}/${output_la}.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test "$compiler_needs_object" = yes; then + firstobj="$1 " + shift + fi + for obj + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-${k}.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test "X$objlist" = X || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-${k}.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\${concat_cmds}$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + fi + func_append delfiles " $output" + + else + output= + fi + + if ${skipped_export-false}; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + fi + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + if ${skipped_export-false}; then + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + fi + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "\`-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object \`$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $opt_dry_run || $RM $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec and hope we can get by with + # turning comma into space.. + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + else + gentop="$output_objdir/${obj}x" + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # If we're not building shared, we need to use non_pic_objs + test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "\`-release' is ignored for programs" + + test "$preload" = yes \ + && test "$dlopen_support" = unknown \ + && test "$dlopen_self" = unknown \ + && test "$dlopen_self_static" = unknown && \ + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test "$tagname" = CXX ; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + func_append compile_command " ${wl}-bind_at_load" + func_append finalize_command " ${wl}-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) func_append dllsearchpath ":$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) func_append finalize_perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=yes + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=no + ;; + *cygwin* | *mingw* ) + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + *) + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + esac + if test "$wrappers_required" = no; then + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.${objext}"; then + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' + fi + + exit $exit_status + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + func_append rpath "$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "\`$output' will be relinked during installation" + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host" ; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save $symfileobj" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + if test "$preload" = yes && test -f "$symfileobj"; then + func_append oldobjs " $symfileobj" + fi + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $addlibs + func_append oldobjs " $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append oldobjs " $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + echo "copying selected object files to avoid basename conflicts..." + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase="$func_basename_result" + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" + ;; + *) func_append oldobjs " $obj" ;; + esac + done + fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + oldobjs= + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + len=$len0 + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name="$func_basename_result" + func_resolve_sysroot "$deplib" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" + ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" + ;; + *) func_append newdlfiles " $lib" ;; + esac + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" + ;; + esac + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlfiles " $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlprefiles " $abs" + done + dlprefiles="$newdlprefiles" + fi + $RM $output + # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test "x$bindir" != x ; + then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +{ test "$opt_mode" = link || test "$opt_mode" = relink; } && + func_mode_link ${1+"$@"} + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $opt_debug + RM="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) func_append RM " $arg"; rmforce=yes ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + for file in $files; do + func_dirname "$file" "" "." + dir="$func_dirname_result" + if test "X$dir" = X.; then + odir="$objdir" + else + odir="$dir/$objdir" + fi + func_basename "$file" + name="$func_basename_result" + test "$opt_mode" = uninstall && odir="$dir" + + # Remember odir for removal later, being careful to avoid duplicates + if test "$opt_mode" = clean; then + case " $rmdirs " in + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + func_append rmfiles " $odir/$n" + done + test -n "$old_library" && func_append rmfiles " $odir/$old_library" + + case "$opt_mode" in + clean) + case " $library_names " in + *" $dlname "*) ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + esac + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && + test "$pic_object" != none; then + func_append rmfiles " $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && + test "$non_pic_object" != none; then + func_append rmfiles " $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$opt_mode" = clean ; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + func_append rmfiles " $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + func_append rmfiles " $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + func_append rmfiles " $odir/$name $odir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + func_append rmfiles " $odir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + func_append rmfiles " $odir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && + func_mode_uninstall ${1+"$@"} + +test -z "$opt_mode" && { + help="$generic_help" + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode \`$opt_mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: +# vi:sw=2 + diff --git a/ssh-tunnel/pam-http/missing b/ssh-tunnel/pam-http/missing new file mode 100755 index 000000000..28055d2ae --- /dev/null +++ b/ssh-tunnel/pam-http/missing @@ -0,0 +1,376 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2009-04-28.21; # UTC + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, +# 2008, 2009 Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and +\`g' are ignored when checking the name. + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# normalize program name to check for. +program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). This is about non-GNU programs, so use $1 not +# $program. +case $1 in + lex*|yacc*) + # Not GNU programs, they don't have --version. + ;; + + tar*) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $program in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te*) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison*|yacc*) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex*|flex*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit $? + fi + ;; + + makeinfo*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar*) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case $firstarg in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case $firstarg in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/ssh-tunnel/pam-http/src/Makefile.am b/ssh-tunnel/pam-http/src/Makefile.am new file mode 100644 index 000000000..b3f6bd45e --- /dev/null +++ b/ssh-tunnel/pam-http/src/Makefile.am @@ -0,0 +1,17 @@ +lib_LTLIBRARIES = libnss_uds.la +libnss_uds_la_SOURCES = shadow.c passwd.c group.c http.c http.h +libnss_uds_la_LDFLAGS = $(AM_LDFLAGS) -shrext .so.2 +libnss_uds_la_LIBADD = $(CURL_LIBS) + +pam_http_PROGRAMS = pam_uds.so test +pam_httpdir = /lib/security + +pam_uds_so_SOURCES=pam_uds.c http.c http.h +pam_uds_so_CFLAGS = -fPIC +pam_uds_so_LDFLAGS = -Xcompiler -shared $(CURL_LDFLAGS) +pam_uds_so_LDADD = $(CURL_LIBS) $(PAM_LIBS) + + +test_SOURCES = test.c http.c http.h +test_LDADD = $(CURL_LIBS) +test_CFLAGS = $(AM_CFLAGS) \ No newline at end of file diff --git a/ssh-tunnel/pam-http/src/Makefile.in b/ssh-tunnel/pam-http/src/Makefile.in new file mode 100644 index 000000000..f1f454151 --- /dev/null +++ b/ssh-tunnel/pam-http/src/Makefile.in @@ -0,0 +1,671 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +pam_http_PROGRAMS = pam_uds.so$(EXEEXT) test$(EXEEXT) +subdir = src +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pam_httpdir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libnss_uds_la_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_libnss_uds_la_OBJECTS = shadow.lo passwd.lo group.lo http.lo +libnss_uds_la_OBJECTS = $(am_libnss_uds_la_OBJECTS) +libnss_uds_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libnss_uds_la_LDFLAGS) $(LDFLAGS) -o $@ +PROGRAMS = $(pam_http_PROGRAMS) +am_pam_uds_so_OBJECTS = pam_uds_so-pam_uds.$(OBJEXT) \ + pam_uds_so-http.$(OBJEXT) +pam_uds_so_OBJECTS = $(am_pam_uds_so_OBJECTS) +pam_uds_so_DEPENDENCIES = $(am__DEPENDENCIES_1) +pam_uds_so_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(pam_uds_so_CFLAGS) \ + $(CFLAGS) $(pam_uds_so_LDFLAGS) $(LDFLAGS) -o $@ +am_test_OBJECTS = test-test.$(OBJEXT) test-http.$(OBJEXT) +test_OBJECTS = $(am_test_OBJECTS) +test_DEPENDENCIES = $(am__DEPENDENCIES_1) +test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(test_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libnss_uds_la_SOURCES) $(pam_uds_so_SOURCES) \ + $(test_SOURCES) +DIST_SOURCES = $(libnss_uds_la_SOURCES) $(pam_uds_so_SOURCES) \ + $(test_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CURL_CFLAGS = @CURL_CFLAGS@ +CURL_LIBS = @CURL_LIBS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +lib_LTLIBRARIES = libnss_uds.la +libnss_uds_la_SOURCES = shadow.c passwd.c group.c http.c http.h +libnss_uds_la_LDFLAGS = $(AM_LDFLAGS) -shrext .so.2 +libnss_uds_la_LIBADD = $(CURL_LIBS) +pam_httpdir = /lib/security +pam_uds_so_SOURCES = pam_uds.c http.c http.h +pam_uds_so_CFLAGS = -fPIC +pam_uds_so_LDFLAGS = -Xcompiler -shared $(CURL_LDFLAGS) +pam_uds_so_LDADD = $(CURL_LIBS) $(PAM_LIBS) +test_SOURCES = test.c http.c http.h +test_LDADD = $(CURL_LIBS) +test_CFLAGS = $(AM_CFLAGS) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libnss_uds.la: $(libnss_uds_la_OBJECTS) $(libnss_uds_la_DEPENDENCIES) + $(libnss_uds_la_LINK) -rpath $(libdir) $(libnss_uds_la_OBJECTS) $(libnss_uds_la_LIBADD) $(LIBS) +install-pam_httpPROGRAMS: $(pam_http_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(pam_httpdir)" || $(MKDIR_P) "$(DESTDIR)$(pam_httpdir)" + @list='$(pam_http_PROGRAMS)'; test -n "$(pam_httpdir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(pam_httpdir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(pam_httpdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-pam_httpPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(pam_http_PROGRAMS)'; test -n "$(pam_httpdir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(pam_httpdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pam_httpdir)" && rm -f $$files + +clean-pam_httpPROGRAMS: + @list='$(pam_http_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +pam_uds.so$(EXEEXT): $(pam_uds_so_OBJECTS) $(pam_uds_so_DEPENDENCIES) + @rm -f pam_uds.so$(EXEEXT) + $(pam_uds_so_LINK) $(pam_uds_so_OBJECTS) $(pam_uds_so_LDADD) $(LIBS) +test$(EXEEXT): $(test_OBJECTS) $(test_DEPENDENCIES) + @rm -f test$(EXEEXT) + $(test_LINK) $(test_OBJECTS) $(test_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/group.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pam_uds_so-http.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pam_uds_so-pam_uds.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/passwd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shadow.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-http.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-test.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +pam_uds_so-pam_uds.o: pam_uds.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pam_uds_so_CFLAGS) $(CFLAGS) -MT pam_uds_so-pam_uds.o -MD -MP -MF $(DEPDIR)/pam_uds_so-pam_uds.Tpo -c -o pam_uds_so-pam_uds.o `test -f 'pam_uds.c' || echo '$(srcdir)/'`pam_uds.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/pam_uds_so-pam_uds.Tpo $(DEPDIR)/pam_uds_so-pam_uds.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pam_uds.c' object='pam_uds_so-pam_uds.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pam_uds_so_CFLAGS) $(CFLAGS) -c -o pam_uds_so-pam_uds.o `test -f 'pam_uds.c' || echo '$(srcdir)/'`pam_uds.c + +pam_uds_so-pam_uds.obj: pam_uds.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pam_uds_so_CFLAGS) $(CFLAGS) -MT pam_uds_so-pam_uds.obj -MD -MP -MF $(DEPDIR)/pam_uds_so-pam_uds.Tpo -c -o pam_uds_so-pam_uds.obj `if test -f 'pam_uds.c'; then $(CYGPATH_W) 'pam_uds.c'; else $(CYGPATH_W) '$(srcdir)/pam_uds.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/pam_uds_so-pam_uds.Tpo $(DEPDIR)/pam_uds_so-pam_uds.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pam_uds.c' object='pam_uds_so-pam_uds.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pam_uds_so_CFLAGS) $(CFLAGS) -c -o pam_uds_so-pam_uds.obj `if test -f 'pam_uds.c'; then $(CYGPATH_W) 'pam_uds.c'; else $(CYGPATH_W) '$(srcdir)/pam_uds.c'; fi` + +pam_uds_so-http.o: http.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pam_uds_so_CFLAGS) $(CFLAGS) -MT pam_uds_so-http.o -MD -MP -MF $(DEPDIR)/pam_uds_so-http.Tpo -c -o pam_uds_so-http.o `test -f 'http.c' || echo '$(srcdir)/'`http.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/pam_uds_so-http.Tpo $(DEPDIR)/pam_uds_so-http.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='http.c' object='pam_uds_so-http.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pam_uds_so_CFLAGS) $(CFLAGS) -c -o pam_uds_so-http.o `test -f 'http.c' || echo '$(srcdir)/'`http.c + +pam_uds_so-http.obj: http.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pam_uds_so_CFLAGS) $(CFLAGS) -MT pam_uds_so-http.obj -MD -MP -MF $(DEPDIR)/pam_uds_so-http.Tpo -c -o pam_uds_so-http.obj `if test -f 'http.c'; then $(CYGPATH_W) 'http.c'; else $(CYGPATH_W) '$(srcdir)/http.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/pam_uds_so-http.Tpo $(DEPDIR)/pam_uds_so-http.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='http.c' object='pam_uds_so-http.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pam_uds_so_CFLAGS) $(CFLAGS) -c -o pam_uds_so-http.obj `if test -f 'http.c'; then $(CYGPATH_W) 'http.c'; else $(CYGPATH_W) '$(srcdir)/http.c'; fi` + +test-test.o: test.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-test.o -MD -MP -MF $(DEPDIR)/test-test.Tpo -c -o test-test.o `test -f 'test.c' || echo '$(srcdir)/'`test.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test-test.Tpo $(DEPDIR)/test-test.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test.c' object='test-test.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-test.o `test -f 'test.c' || echo '$(srcdir)/'`test.c + +test-test.obj: test.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-test.obj -MD -MP -MF $(DEPDIR)/test-test.Tpo -c -o test-test.obj `if test -f 'test.c'; then $(CYGPATH_W) 'test.c'; else $(CYGPATH_W) '$(srcdir)/test.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test-test.Tpo $(DEPDIR)/test-test.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test.c' object='test-test.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-test.obj `if test -f 'test.c'; then $(CYGPATH_W) 'test.c'; else $(CYGPATH_W) '$(srcdir)/test.c'; fi` + +test-http.o: http.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-http.o -MD -MP -MF $(DEPDIR)/test-http.Tpo -c -o test-http.o `test -f 'http.c' || echo '$(srcdir)/'`http.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test-http.Tpo $(DEPDIR)/test-http.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='http.c' object='test-http.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-http.o `test -f 'http.c' || echo '$(srcdir)/'`http.c + +test-http.obj: http.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -MT test-http.obj -MD -MP -MF $(DEPDIR)/test-http.Tpo -c -o test-http.obj `if test -f 'http.c'; then $(CYGPATH_W) 'http.c'; else $(CYGPATH_W) '$(srcdir)/http.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/test-http.Tpo $(DEPDIR)/test-http.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='http.c' object='test-http.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_CFLAGS) $(CFLAGS) -c -o test-http.obj `if test -f 'http.c'; then $(CYGPATH_W) 'http.c'; else $(CYGPATH_W) '$(srcdir)/http.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pam_httpdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + clean-pam_httpPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-pam_httpPROGRAMS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES uninstall-pam_httpPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool clean-pam_httpPROGRAMS \ + ctags distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libLTLIBRARIES install-man \ + install-pam_httpPROGRAMS install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-libLTLIBRARIES \ + uninstall-pam_httpPROGRAMS + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/ssh-tunnel/pam-http/src/group.c b/ssh-tunnel/pam-http/src/group.c new file mode 100644 index 000000000..1a7741e05 --- /dev/null +++ b/ssh-tunnel/pam-http/src/group.c @@ -0,0 +1,42 @@ +#define _GNU_SOURCE 1 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +enum nss_status _nss_uds_setgrent (void); +enum nss_status _nss_uds_endgrent (void); +enum nss_status _nss_uds_getgrent_r (struct group *gr, + char * buffer, size_t buflen,int * errnop); +enum nss_status _nss_uds_getgrnam_r (const char * name, struct group *gr, + char * buffer, size_t buflen,int *errnop); +enum nss_status _nss_uds_getgrgid_r (const gid_t gid, struct group *gr, + char * buffer, size_t buflen,int *errnop); + + +enum nss_status _nss_uds_setgrent (void) { +} + +enum nss_status _nss_uds_endgrent (void) { +} + + +enum nss_status _nss_uds_getgrent_r (struct group *gr, + char * buffer, size_t buflen,int * errnop) { +} + + +enum nss_status _nss_uds_getgrnam_r (const char * name, struct group *gr, + char * buffer, size_t buflen,int *errnop) { +} + +enum nss_status _nss_uds_getgrgid_r (const gid_t gid, struct group *gr, + char * buffer, size_t buflen,int *errnop) { +} diff --git a/ssh-tunnel/pam-http/src/http.c b/ssh-tunnel/pam-http/src/http.c new file mode 100644 index 000000000..c89fc0e9a --- /dev/null +++ b/ssh-tunnel/pam-http/src/http.c @@ -0,0 +1,120 @@ +#include +#include +#include + +#include +#include + +#define DATASIZE 256 +#define UID "uid" +#define NAME "name" +#define AUTHID "id" +#define AUTHPASS "pass" + +struct OutputData { + char* buffer; + size_t size; + size_t pos; + }; + + +static size_t authenticatorData(void *buffer, size_t size, size_t nmemb, void *userp) { + struct OutputData* data = (struct OutputData*)userp; + size_t realSize = size * nmemb; + if( data->pos + realSize >= data->size ) + return 0; + memcpy( data->buffer + data->pos, buffer, realSize ); + data->pos += realSize; + return realSize; +} + +static int getUrl(const char* url, char* buffer, size_t size ) { + CURL *curl = curl_easy_init(); + CURLcode res = -1; + + struct OutputData* data = malloc(sizeof(struct OutputData)); + data->buffer = buffer; + data->size = size; + data->pos = 0; + + if (!curl) return -1; + + curl_easy_setopt(curl, CURLOPT_URL, url); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, authenticatorData); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, data ); + /* provide no progress indicator */ + curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1); + /* fail on HTTP errors */ + curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1); + + curl_easy_setopt(curl, CURLOPT_RANDOM_FILE, "/dev/urandom"); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0 ); + + res = curl_easy_perform(curl); + + cleanup: + curl_easy_cleanup(curl); + buffer[data->pos] = '\0'; + free(data); + + return res; + +} + +int httpAuthenticate(const char* username, const char* password, const char* authHost) +{ + char* buffer = malloc(DATASIZE); + char* url = malloc(256); + int res; + + sprintf( url, "%s?%s=%s&%s=%s", authHost, AUTHID, username, AUTHPASS, password ); + res = getUrl( url, buffer, DATASIZE ); + free(url); + + if( res == 0 && buffer[0] == '0' ) + res = -1; + + + free(buffer); + + return res; +} + +static int getUserData( const char* host, const char* kind, const char* id, char* username, int* uid ) { + char* buffer = malloc(DATASIZE); + char* url = malloc(256); + int res; + + *username = '\0'; + *uid = -1; + + sprintf( url, "%s?%s=%s", host, kind, id ); + res = getUrl( url, buffer, DATASIZE ); + free(url); + + if( res == 0 ) { + if( *buffer == '*' ) + res = -1; + else { + sscanf( buffer, "%d %s", uid, username ); + if( *uid == -1 ) + res = -1; + } + + } + + free(buffer); + + return res; +} + +int getUID( const char* host, const char* name, char* username, int* uid ) { + return getUserData( host, UID, name, username, uid ); +} + +int getName( const char* host, int id, char* username, int* uid ) { + char tmp[32]; + sprintf( tmp, "%d", id ); + return getUserData( host, NAME, tmp, username, uid ); +} diff --git a/ssh-tunnel/pam-http/src/http.h b/ssh-tunnel/pam-http/src/http.h new file mode 100644 index 000000000..0689d3b5c --- /dev/null +++ b/ssh-tunnel/pam-http/src/http.h @@ -0,0 +1,13 @@ +#ifndef __HTTP_H_DK__ +#define __HTTP_H_DK__ + + +int httpAuthenticate(const char* username, const char* password, const char* authHost); + +int getUID( const char* host, const char* name, char* username, int* uid ); + + +int getName( const char* host, int id, char* username, int* uid ); + + +#endif diff --git a/ssh-tunnel/pam-http/src/pam_uds.c b/ssh-tunnel/pam-http/src/pam_uds.c new file mode 100644 index 000000000..4603c9683 --- /dev/null +++ b/ssh-tunnel/pam-http/src/pam_uds.c @@ -0,0 +1,109 @@ +/* (c) 2007 Adolfo Gómez */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "http.h" + +#define PAM_SM_AUTH +#include +#include + +#define UDS_DEBUG 020 /* keep quiet about things */ +#define UDS_QUIET 040 /* keep quiet about things */ + +/* some syslogging */ +static void _log_err(int err, const char *format, ...) +{ + va_list args; + + va_start(args, format); + openlog("PAM-uds", LOG_CONS|LOG_PID, LOG_AUTH); + vsyslog(err, format, args); + va_end(args); + closelog(); +} + +static char baseUrl[128] = ""; + +static int _pam_parse(int flags, int argc, const char **argv) +{ + int ctrl = 0; + + /* does the appliction require quiet? */ + if ((flags & PAM_SILENT) == PAM_SILENT) + ctrl |= UDS_QUIET; + + /* step through arguments */ + for (; argc-- > 0; ++argv) + { + if (!strcmp(*argv, "silent")) { + ctrl |= UDS_QUIET; + } else if (!strncmp(*argv,"base=",5)) { + strncpy(baseUrl,*argv+5,sizeof(baseUrl)); + baseUrl[sizeof(baseUrl)-1] = '\0'; + _log_err(LOG_ERR, "option base: %s", baseUrl); + } else { + _log_err(LOG_ERR, "unknown option; %s", *argv); + } + } + + D(("ctrl = %o", ctrl)); + return ctrl; +} + +/******************** + * PAM + ********************/ + + +PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh, int flags, + int argc, const char **argv) +{ + const char *username; + const char* passwd; + int res; + + int rv = PAM_SUCCESS, ctrl; + + ctrl = _pam_parse(flags, argc, argv); + + if (strlen(baseUrl) == 0) + { + _log_err(LOG_ERR, "Need a host for authentication" ); + return PAM_AUTH_ERR; + } + + if (pam_get_user(pamh, &username, 0) != PAM_SUCCESS) { + _log_err( LOG_ERR, "Couldn't get username"); + return PAM_AUTH_ERR; + } + + if( pam_get_item(pamh, PAM_AUTHTOK, (const void **)&passwd) != PAM_SUCCESS ) { + _log_err( LOG_ERR, "Couldn't get password" ); + return PAM_AUTH_ERR; + } + + if ( (res = httpAuthenticate(username, passwd, baseUrl)) != 0 ) { + _log_err( LOG_ERR, "Failed to check credentials., base = %s, Result = %d", baseUrl, res ); + rv = PAM_AUTH_ERR; + } + else { + rv = PAM_SUCCESS; + } + + return rv; +} + +PAM_EXTERN int pam_sm_setcred(pam_handle_t *pamh, int flags, + int argc, const char **argv) +{ + return PAM_SUCCESS; +} + diff --git a/ssh-tunnel/pam-http/src/passwd.c b/ssh-tunnel/pam-http/src/passwd.c new file mode 100644 index 000000000..a3365a4fe --- /dev/null +++ b/ssh-tunnel/pam-http/src/passwd.c @@ -0,0 +1,104 @@ +#define _GNU_SOURCE 1 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +char baseUrl[256] = { '\0' }; + +enum nss_status _nss_uds_getpwuid_r(uid_t,struct passwd *,char *, size_t,int *); +enum nss_status _nss_uds_setpwent (void); +enum nss_status _nss_uds_endpwent (void); +enum nss_status _nss_uds_getpwnam_r(const char *,struct passwd *,char *,size_t,int *); +enum nss_status _nss_uds_getpwent_r(struct passwd *, char *, size_t,int *); + +static enum nss_status p_search(FILE *f,const char *name,const uid_t uid,struct passwd *pw, int *errnop,char *buffer, size_t buflen); + + +static void read_config(char* host, size_t size) { + FILE* f = fopen("/etc/uds.conf", "r"); + int n; + fgets( host, size-1, f ); + n = strlen(host) - 1; + if( host[n] == '\n' ) + host[n] = '\0'; + fclose(f); + +} + +enum nss_status _nss_uds_getpwuid_r( uid_t uid, struct passwd *result, + char *buf, size_t buflen, int *errnop) { + char host[128]; + char *dir; + read_config( host, sizeof(host) ); + + if ( result == NULL || buflen < 128 ) + return NSS_STATUS_UNAVAIL; + + *errnop = getName( host, uid, buf, &result->pw_uid ); + + if( *errnop != 0 ) + return NSS_STATUS_NOTFOUND; + + dir = buf + strlen(buf) + 1; + sprintf( dir, "/home/udstmp", buf ); + result->pw_name = buf; + result->pw_passwd = "molongo;pongo"; + result->pw_gid = 65534; // Nogroup + result->pw_gecos = "bugoma"; + result->pw_dir = dir; + result->pw_shell = "/bin/false"; + return NSS_STATUS_SUCCESS; +} + +enum nss_status _nss_uds_getpwnam_r(const char *name, struct passwd *result, + char *buf, size_t buflen, int *errnop) { + char host[128]; + char *dir; + read_config( host, sizeof(host) ); + + if ( result == NULL || buflen < 128 ) + return NSS_STATUS_UNAVAIL; + + *errnop = getUID( host, name, buf, &result->pw_uid ); + + if( *errnop != 0 ) + return NSS_STATUS_NOTFOUND; + + dir = buf + strlen(buf) + 1; + strcpy( dir, "/home/udstmp"); + result->pw_name = buf; + result->pw_passwd = "molongo;pongo"; + result->pw_gid = 65534; // Nogroup + result->pw_gecos = "bugoma"; + result->pw_dir = dir; + result->pw_shell = "/bin/false"; + return NSS_STATUS_SUCCESS; +} + +static FILE *usersfile = NULL; + +enum nss_status _nss_uds_setpwent (void) { + + return NSS_STATUS_SUCCESS; +} + +enum nss_status _nss_uds_endpwent (void) { + return NSS_STATUS_SUCCESS; +} + +enum nss_status _nss_uds_getpwent_r (struct passwd *pw, + char * buffer, size_t buflen,int * errnop) { + return NSS_STATUS_UNAVAIL; +} + diff --git a/ssh-tunnel/pam-http/src/shadow.c b/ssh-tunnel/pam-http/src/shadow.c new file mode 100644 index 000000000..adaac23b3 --- /dev/null +++ b/ssh-tunnel/pam-http/src/shadow.c @@ -0,0 +1,49 @@ +/* + Copyright (C) 2001,2002 Bernhard R. Link + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + Please tell me, if you find errors or mistakes. + +Based on parts of the GNU C Library: + + Common code for file-based database parsers in nss_files module. + Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. +*/ + +#define _GNU_SOURCE 1 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +enum nss_status _nss_uds_getspnam_r (const char *name, struct spwd *spw, + char *buffer, size_t buflen,int * errnop) +{ +} diff --git a/ssh-tunnel/pam-http/src/test.c b/ssh-tunnel/pam-http/src/test.c new file mode 100644 index 000000000..a5673634b --- /dev/null +++ b/ssh-tunnel/pam-http/src/test.c @@ -0,0 +1,29 @@ +/* + * test.c + * + * Created on: Jan 4, 2012 + * Author: dkmaster + */ + +#include +#include +#include +#include "http.h" + +int main(int argc, char** argv) +{ + int id; + char username[128]; + const char* baseUrl = "http://172.27.0.1:8000/pam"; + + + printf("Authenticate: %d\n", httpAuthenticate("pepito", "juanito", baseUrl)); + + int res = getUID(baseUrl,"pepito", username, &id); + printf("GetUID:res: %d, username: %s, id: %d\n", res, username, id); + + *username = '\0'; + res = getName(baseUrl, 10000, username, &id); + printf("GetName:res: %d, username: %s, id: %d\n", res, username, id); + +} diff --git a/ssh-tunnel/tunnelLaucher/.classpath b/ssh-tunnel/tunnelLaucher/.classpath new file mode 100644 index 000000000..18d70f02c --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/ssh-tunnel/tunnelLaucher/.project b/ssh-tunnel/tunnelLaucher/.project new file mode 100644 index 000000000..f11e9713b --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/.project @@ -0,0 +1,17 @@ + + + tunnelLaucher + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/ssh-tunnel/tunnelLaucher/.settings/org.eclipse.jdt.core.prefs b/ssh-tunnel/tunnelLaucher/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..f0eaf0f73 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,12 @@ +#Mon Jan 09 01:35:02 CET 2012 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/ssh-tunnel/tunnelLaucher/description.jardesc b/ssh-tunnel/tunnelLaucher/description.jardesc new file mode 100644 index 000000000..770466cec --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/description.jardesc @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/ssh-tunnel/tunnelLaucher/jar/launcher.jar b/ssh-tunnel/tunnelLaucher/jar/launcher.jar new file mode 100644 index 000000000..1b81d28ca Binary files /dev/null and b/ssh-tunnel/tunnelLaucher/jar/launcher.jar differ diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/Buffer.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/Buffer.java new file mode 100644 index 000000000..c963a64c7 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/Buffer.java @@ -0,0 +1,254 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +public class Buffer{ + final byte[] tmp=new byte[4]; + byte[] buffer; + int index; + int s; + public Buffer(int size){ + buffer=new byte[size]; + index=0; + s=0; + } + public Buffer(byte[] buffer){ + this.buffer=buffer; + index=0; + s=0; + } + public Buffer(){ this(1024*10*2); } + public void putByte(byte foo){ + buffer[index++]=foo; + } + public void putByte(byte[] foo) { + putByte(foo, 0, foo.length); + } + public void putByte(byte[] foo, int begin, int length) { + System.arraycopy(foo, begin, buffer, index, length); + index+=length; + } + public void putString(byte[] foo){ + putString(foo, 0, foo.length); + } + public void putString(byte[] foo, int begin, int length) { + putInt(length); + putByte(foo, begin, length); + } + public void putInt(int val) { + tmp[0]=(byte)(val >>> 24); + tmp[1]=(byte)(val >>> 16); + tmp[2]=(byte)(val >>> 8); + tmp[3]=(byte)(val); + System.arraycopy(tmp, 0, buffer, index, 4); + index+=4; + } + public void putLong(long val) { + tmp[0]=(byte)(val >>> 56); + tmp[1]=(byte)(val >>> 48); + tmp[2]=(byte)(val >>> 40); + tmp[3]=(byte)(val >>> 32); + System.arraycopy(tmp, 0, buffer, index, 4); + tmp[0]=(byte)(val >>> 24); + tmp[1]=(byte)(val >>> 16); + tmp[2]=(byte)(val >>> 8); + tmp[3]=(byte)(val); + System.arraycopy(tmp, 0, buffer, index+4, 4); + index+=8; + } + void skip(int n) { + index+=n; + } + void putPad(int n) { + while(n>0){ + buffer[index++]=(byte)0; + n--; + } + } + public void putMPInt(byte[] foo){ + int i=foo.length; + if((foo[0]&0x80)!=0){ + i++; + putInt(i); + putByte((byte)0); + } + else{ + putInt(i); + } + putByte(foo); + } + public int getLength(){ + return index-s; + } + public int getOffSet(){ + return s; + } + public void setOffSet(int s){ + this.s=s; + } + public long getLong(){ + long foo = getInt()&0xffffffffL; + foo = ((foo<<32)) | (getInt()&0xffffffffL); + return foo; + } + public int getInt(){ + int foo = getShort(); + foo = ((foo<<16)&0xffff0000) | (getShort()&0xffff); + return foo; + } + public long getUInt(){ + long foo = 0L; + long bar = 0L; + foo = getByte(); + foo = ((foo<<8)&0xff00)|(getByte()&0xff); + bar = getByte(); + bar = ((bar<<8)&0xff00)|(getByte()&0xff); + foo = ((foo<<16)&0xffff0000) | (bar&0xffff); + return foo; + } + int getShort() { + int foo = getByte(); + foo = ((foo<<8)&0xff00)|(getByte()&0xff); + return foo; + } + public int getByte() { + return (buffer[s++]&0xff); + } + public void getByte(byte[] foo) { + getByte(foo, 0, foo.length); + } + void getByte(byte[] foo, int start, int len) { + System.arraycopy(buffer, s, foo, start, len); + s+=len; + } + public int getByte(int len) { + int foo=s; + s+=len; + return foo; + } + public byte[] getMPInt() { + int i=getInt(); // uint32 + if(i<0 || // bigger than 0x7fffffff + i>8*1024){ + // TODO: an exception should be thrown. + i = 8*1024; // the session will be broken, but working around OOME. + } + byte[] foo=new byte[i]; + getByte(foo, 0, i); + return foo; + } + public byte[] getMPIntBits() { + int bits=getInt(); + int bytes=(bits+7)/8; + byte[] foo=new byte[bytes]; + getByte(foo, 0, bytes); + if((foo[0]&0x80)!=0){ + byte[] bar=new byte[foo.length+1]; + bar[0]=0; // ?? + System.arraycopy(foo, 0, bar, 1, foo.length); + foo=bar; + } + return foo; + } + public byte[] getString() { + int i = getInt(); // uint32 + if(i<0 || // bigger than 0x7fffffff + i>256*1024){ + // TODO: an exception should be thrown. + i = 256*1024; // the session will be broken, but working around OOME. + } + byte[] foo=new byte[i]; + getByte(foo, 0, i); + return foo; + } + byte[] getString(int[]start, int[]len) { + int i=getInt(); + start[0]=getByte(i); + len[0]=i; + return buffer; + } + public void reset(){ + index=0; + s=0; + } + public void shift(){ + if(s==0)return; + System.arraycopy(buffer, s, buffer, 0, index-s); + index=index-s; + s=0; + } + void rewind(){ + s=0; + } + + byte getCommand(){ + return buffer[5]; + } + + void checkFreeSize(int n){ + if(buffer.length>>4)&0xf]); + System.err.print(chars[foo&0xf]); + if(i%16==15){ + System.err.println(""); + continue; + } + if(i>0 && i%2==1){ + System.err.print(" "); + } + } + System.err.println(""); + } + static void dump(byte[] b){ + dump(b, 0, b.length); + } + static void dump(byte[] b, int s, int l){ + for(int i=s; i0) + notifyAll(); + } + int getRecipient(){ + return recipient; + } + + void init() throws JSchException { + } + + public void connect() throws JSchException{ + connect(0); + } + + public void connect(int connectTimeout) throws JSchException{ + Session _session=getSession(); + if(!_session.isConnected()){ + throw new JSchException("session is down"); + } + this.connectTimeout=connectTimeout; + try{ + Buffer buf=new Buffer(100); + Packet packet=new Packet(buf); + // send + // byte SSH_MSG_CHANNEL_OPEN(90) + // string channel type // + // uint32 sender channel // 0 + // uint32 initial window size // 0x100000(65536) + // uint32 maxmum packet size // 0x4000(16384) + packet.reset(); + buf.putByte((byte)90); + buf.putString(this.type); + buf.putInt(this.id); + buf.putInt(this.lwsize); + buf.putInt(this.lmpsize); + _session.write(packet); + int retry=10; + long start=System.currentTimeMillis(); + long timeout=connectTimeout; + if(timeout!=0L) retry = 1; + synchronized(this){ + while(this.getRecipient()==-1 && + _session.isConnected() && + retry>0){ + if(timeout>0L){ + if((System.currentTimeMillis()-start)>timeout){ + retry=0; + continue; + } + } + try{ + long t = timeout==0L ? 5000L : timeout; + this.notifyme=1; + wait(t); + } + catch(java.lang.InterruptedException e){ + } + finally{ + this.notifyme=0; + } + retry--; + } + } + if(!_session.isConnected()){ + throw new JSchException("session is down"); + } + if(this.getRecipient()==-1){ // timeout + throw new JSchException("channel is not opened."); + } + if(this.open_confirmation==false){ // SSH_MSG_CHANNEL_OPEN_FAILURE + throw new JSchException("channel is not opened."); + } + + connected=true; + start(); + } + catch(Exception e){ + connected=false; + disconnect(); + if(e instanceof JSchException) + throw (JSchException)e; + throw new JSchException(e.toString(), e); + } + } + + public void setXForwarding(boolean foo){ + } + + public void start() throws JSchException{} + + public boolean isEOF() {return eof_remote;} + + void getData(Buffer buf){ + setRecipient(buf.getInt()); + setRemoteWindowSize(buf.getUInt()); + setRemotePacketSize(buf.getInt()); + } + + public void setInputStream(InputStream in){ + io.setInputStream(in, false); + } + public void setInputStream(InputStream in, boolean dontclose){ + io.setInputStream(in, dontclose); + } + public void setOutputStream(OutputStream out){ + io.setOutputStream(out, false); + } + public void setOutputStream(OutputStream out, boolean dontclose){ + io.setOutputStream(out, dontclose); + } + public void setExtOutputStream(OutputStream out){ + io.setExtOutputStream(out, false); + } + public void setExtOutputStream(OutputStream out, boolean dontclose){ + io.setExtOutputStream(out, dontclose); + } + public InputStream getInputStream() throws IOException { + PipedInputStream in= + new MyPipedInputStream( + 32*1024 // this value should be customizable. + ); + io.setOutputStream(new PassiveOutputStream(in), false); + return in; + } + public InputStream getExtInputStream() throws IOException { + PipedInputStream in= + new MyPipedInputStream( + 32*1024 // this value should be customizable. + ); + io.setExtOutputStream(new PassiveOutputStream(in), false); + return in; + } + public OutputStream getOutputStream() throws IOException { + /* + PipedOutputStream out=new PipedOutputStream(); + io.setInputStream(new PassiveInputStream(out + , 32*1024 + ), false); + return out; + */ + + final Channel channel=this; + OutputStream out=new OutputStream(){ + private int dataLen=0; + private Buffer buffer=null; + private Packet packet=null; + private boolean closed=false; + private synchronized void init() throws java.io.IOException{ + buffer=new Buffer(rmpsize); + packet=new Packet(buffer); + + byte[] _buf=buffer.buffer; + if(_buf.length-(14+0)-Session.buffer_margin<=0){ + buffer=null; + packet=null; + throw new IOException("failed to initialize the channel."); + } + + } + byte[] b=new byte[1]; + public void write(int w) throws java.io.IOException{ + b[0]=(byte)w; + write(b, 0, 1); + } + public void write(byte[] buf, int s, int l) throws java.io.IOException{ + if(packet==null){ + init(); + } + + if(closed){ + throw new java.io.IOException("Already closed"); + } + + byte[] _buf=buffer.buffer; + int _bufl=_buf.length; + while(l>0){ + int _l=l; + if(l>_bufl-(14+dataLen)-Session.buffer_margin){ + _l=_bufl-(14+dataLen)-Session.buffer_margin; + } + + if(_l<=0){ + flush(); + continue; + } + + System.arraycopy(buf, s, _buf, 14+dataLen, _l); + dataLen+=_l; + s+=_l; + l-=_l; + } + } + + public void flush() throws java.io.IOException{ + if(closed){ + throw new java.io.IOException("Already closed"); + } + if(dataLen==0) + return; + packet.reset(); + buffer.putByte((byte)Session.SSH_MSG_CHANNEL_DATA); + buffer.putInt(recipient); + buffer.putInt(dataLen); + buffer.skip(dataLen); + try{ + int foo=dataLen; + dataLen=0; + getSession().write(packet, channel, foo); + } + catch(Exception e){ + close(); + throw new java.io.IOException(e.toString()); + } + + } + public void close() throws java.io.IOException{ + if(packet==null){ + try{ + init(); + } + catch(java.io.IOException e){ + // close should be finished silently. + return; + } + } + if(closed){ + return; + } + if(dataLen>0){ + flush(); + } + channel.eof(); + closed=true; + } + }; + return out; + } + + class MyPipedInputStream extends PipedInputStream{ + MyPipedInputStream() throws IOException{ super(); } + MyPipedInputStream(int size) throws IOException{ + super(); + buffer=new byte[size]; + } + MyPipedInputStream(PipedOutputStream out) throws IOException{ super(out); } + MyPipedInputStream(PipedOutputStream out, int size) throws IOException{ + super(out); + buffer=new byte[size]; + } + + /* + * TODO: We should have our own Piped[I/O]Stream implementation. + * Before accepting data, JDK's PipedInputStream will check the existence of + * reader thread, and if it is not alive, the stream will be closed. + * That behavior may cause the problem if multiple threads make access to it. + */ + public synchronized void updateReadSide() throws IOException { + if(available() != 0){ // not empty + return; + } + in = 0; + out = 0; + buffer[in++] = 0; + read(); + } + } + void setLocalWindowSizeMax(int foo){ this.lwsize_max=foo; } + void setLocalWindowSize(int foo){ this.lwsize=foo; } + void setLocalPacketSize(int foo){ this.lmpsize=foo; } + synchronized void setRemoteWindowSize(long foo){ this.rwsize=foo; } + synchronized void addRemoteWindowSize(int foo){ + this.rwsize+=foo; + if(notifyme>0) + notifyAll(); + } + void setRemotePacketSize(int foo){ this.rmpsize=foo; } + + public void run(){ + } + + void write(byte[] foo) throws IOException { + write(foo, 0, foo.length); + } + void write(byte[] foo, int s, int l) throws IOException { + try{ + io.put(foo, s, l); + }catch(NullPointerException e){} + } + void write_ext(byte[] foo, int s, int l) throws IOException { + try{ + io.put_ext(foo, s, l); + }catch(NullPointerException e){} + } + + void eof_remote(){ + eof_remote=true; + try{ + io.out_close(); + } + catch(NullPointerException e){} + } + + void eof(){ + if(eof_local)return; + eof_local=true; + + try{ + Buffer buf=new Buffer(100); + Packet packet=new Packet(buf); + packet.reset(); + buf.putByte((byte)Session.SSH_MSG_CHANNEL_EOF); + buf.putInt(getRecipient()); + synchronized(this){ + if(!close) + getSession().write(packet); + } + } + catch(Exception e){ + //System.err.println("Channel.eof"); + //e.printStackTrace(); + } + /* + if(!isConnected()){ disconnect(); } + */ + } + + /* + http://www1.ietf.org/internet-drafts/draft-ietf-secsh-connect-24.txt + +5.3 Closing a Channel + When a party will no longer send more data to a channel, it SHOULD + send SSH_MSG_CHANNEL_EOF. + + byte SSH_MSG_CHANNEL_EOF + uint32 recipient_channel + + No explicit response is sent to this message. However, the + application may send EOF to whatever is at the other end of the + channel. Note that the channel remains open after this message, and + more data may still be sent in the other direction. This message + does not consume window space and can be sent even if no window space + is available. + + When either party wishes to terminate the channel, it sends + SSH_MSG_CHANNEL_CLOSE. Upon receiving this message, a party MUST + send back a SSH_MSG_CHANNEL_CLOSE unless it has already sent this + message for the channel. The channel is considered closed for a + party when it has both sent and received SSH_MSG_CHANNEL_CLOSE, and + the party may then reuse the channel number. A party MAY send + SSH_MSG_CHANNEL_CLOSE without having sent or received + SSH_MSG_CHANNEL_EOF. + + byte SSH_MSG_CHANNEL_CLOSE + uint32 recipient_channel + + This message does not consume window space and can be sent even if no + window space is available. + + It is recommended that any data sent before this message is delivered + to the actual destination, if possible. + */ + + void close(){ + if(close)return; + close=true; + eof_local=eof_remote=true; + + try{ + Buffer buf=new Buffer(100); + Packet packet=new Packet(buf); + packet.reset(); + buf.putByte((byte)Session.SSH_MSG_CHANNEL_CLOSE); + buf.putInt(getRecipient()); + synchronized(this){ + getSession().write(packet); + } + } + catch(Exception e){ + //e.printStackTrace(); + } + } + public boolean isClosed(){ + return close; + } + static void disconnect(Session session){ + Channel[] channels=null; + int count=0; + synchronized(pool){ + channels=new Channel[pool.size()]; + for(int i=0; irbuf.getLength()){ + rbuf.s-=4; + return; + } + + int typ=rbuf.getByte(); + + Session _session=null; + try{ + _session=getSession(); + } + catch(JSchException e){ + throw new java.io.IOException(e.toString()); + } + + Vector identities=_session.jsch.identities; + UserInfo userinfo=_session.getUserInfo(); + + if(typ==SSH2_AGENTC_REQUEST_IDENTITIES){ + mbuf.reset(); + mbuf.putByte((byte)SSH2_AGENT_IDENTITIES_ANSWER); + synchronized(identities){ + int count=0; + for(int i=0; i0){ + if(timeout>0L){ + if((System.currentTimeMillis()-start)>timeout){ + retry=0; + continue; + } + } + try{ + long t = timeout==0L ? 5000L : timeout; + this.notifyme=1; + wait(t); + } + catch(java.lang.InterruptedException e){ + } + finally{ + this.notifyme=0; + } + retry--; + } + } + if(!_session.isConnected()){ + throw new JSchException("session is down"); + } + if(this.getRecipient()==-1){ // timeout + throw new JSchException("channel is not opened."); + } + if(this.open_confirmation==false){ // SSH_MSG_CHANNEL_OPEN_FAILURE + throw new JSchException("channel is not opened."); + } + + connected=true; + + if(io.in!=null){ + thread=new Thread(this); + thread.setName("DirectTCPIP thread "+_session.getHost()); + if(_session.daemon_thread){ + thread.setDaemon(_session.daemon_thread); + } + thread.start(); + } + } + catch(Exception e){ + io.close(); + io=null; + Channel.del(this); + if (e instanceof JSchException) { + throw (JSchException) e; + } + } + } + + public void run(){ + + Buffer buf=new Buffer(rmpsize); + Packet packet=new Packet(buf); + int i=0; + + try{ + Session _session=getSession(); + while(isConnected() && + thread!=null && + io!=null && + io.in!=null){ + i=io.in.read(buf.buffer, + 14, + buf.buffer.length-14 + -Session.buffer_margin + ); + + if(i<=0){ + eof(); + break; + } + if(close)break; + packet.reset(); + buf.putByte((byte)Session.SSH_MSG_CHANNEL_DATA); + buf.putInt(recipient); + buf.putInt(i); + buf.skip(i); + _session.write(packet, this, i); + } + } + catch(Exception e){ + } + disconnect(); + //System.err.println("connect end"); + } + + public void setInputStream(InputStream in){ + io.setInputStream(in); + } + public void setOutputStream(OutputStream out){ + io.setOutputStream(out); + } + + public void setHost(String host){this.host=host;} + public void setPort(int port){this.port=port;} + public void setOrgIPAddress(String foo){this.originator_IP_address=foo;} + public void setOrgPort(int foo){this.originator_port=foo;} +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ChannelExec.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ChannelExec.java new file mode 100644 index 000000000..272dff2d3 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ChannelExec.java @@ -0,0 +1,83 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +import java.util.*; + +public class ChannelExec extends ChannelSession{ + + byte[] command=new byte[0]; + + public void start() throws JSchException{ + Session _session=getSession(); + try{ + sendRequests(); + Request request=new RequestExec(command); + request.request(_session, this); + } + catch(Exception e){ + if(e instanceof JSchException) throw (JSchException)e; + if(e instanceof Throwable) + throw new JSchException("ChannelExec", (Throwable)e); + throw new JSchException("ChannelExec"); + } + + if(io.in!=null){ + thread=new Thread(this); + thread.setName("Exec thread "+_session.getHost()); + if(_session.daemon_thread){ + thread.setDaemon(_session.daemon_thread); + } + thread.start(); + } + } + + public void setCommand(String command){ + this.command=Util.str2byte(command); + } + public void setCommand(byte[] command){ + this.command=command; + } + + void init() throws JSchException { + io.setInputStream(getSession().in); + io.setOutputStream(getSession().out); + } + + public void setErrStream(java.io.OutputStream out){ + setExtOutputStream(out); + } + public void setErrStream(java.io.OutputStream out, boolean dontclose){ + setExtOutputStream(out, dontclose); + } + public java.io.InputStream getErrStream() throws java.io.IOException { + return getExtInputStream(); + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ChannelForwardedTCPIP.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ChannelForwardedTCPIP.java new file mode 100644 index 000000000..9f81b0ec0 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ChannelForwardedTCPIP.java @@ -0,0 +1,311 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +import java.net.*; +import java.io.*; + +public class ChannelForwardedTCPIP extends Channel{ + + static java.util.Vector pool=new java.util.Vector(); + + static private final int LOCAL_WINDOW_SIZE_MAX=0x20000; +//static private final int LOCAL_WINDOW_SIZE_MAX=0x100000; + static private final int LOCAL_MAXIMUM_PACKET_SIZE=0x4000; + + static private final int TIMEOUT=10*1000; + + SocketFactory factory=null; + private Socket socket=null; + private ForwardedTCPIPDaemon daemon=null; + String target; + int lport; + int rport; + + ChannelForwardedTCPIP(){ + super(); + setLocalWindowSizeMax(LOCAL_WINDOW_SIZE_MAX); + setLocalWindowSize(LOCAL_WINDOW_SIZE_MAX); + setLocalPacketSize(LOCAL_MAXIMUM_PACKET_SIZE); + io=new IO(); + connected=true; + } + + public void run(){ + try{ + if(lport==-1){ + Class c=Class.forName(target); + daemon=(ForwardedTCPIPDaemon)c.newInstance(); + + PipedOutputStream out=new PipedOutputStream(); + io.setInputStream(new PassiveInputStream(out + , 32*1024 + ), false); + + daemon.setChannel(this, getInputStream(), out); + Object[] foo=getPort(getSession(), rport); + daemon.setArg((Object[])foo[3]); + + new Thread(daemon).start(); + } + else{ + socket=(factory==null) ? + Util.createSocket(target, lport, TIMEOUT) : + factory.createSocket(target, lport); + socket.setTcpNoDelay(true); + io.setInputStream(socket.getInputStream()); + io.setOutputStream(socket.getOutputStream()); + } + sendOpenConfirmation(); + } + catch(Exception e){ + sendOpenFailure(SSH_OPEN_ADMINISTRATIVELY_PROHIBITED); + close=true; + disconnect(); + return; + } + + thread=Thread.currentThread(); + Buffer buf=new Buffer(rmpsize); + Packet packet=new Packet(buf); + int i=0; + try{ + while(thread!=null && + io!=null && + io.in!=null){ + i=io.in.read(buf.buffer, + 14, + buf.buffer.length-14 + -Session.buffer_margin + ); + if(i<=0){ + eof(); + break; + } + packet.reset(); + if(close)break; + buf.putByte((byte)Session.SSH_MSG_CHANNEL_DATA); + buf.putInt(recipient); + buf.putInt(i); + buf.skip(i); + getSession().write(packet, this, i); + } + } + catch(Exception e){ + //System.err.println(e); + } + //thread=null; + //eof(); + disconnect(); + } + + void getData(Buffer buf){ + setRecipient(buf.getInt()); + setRemoteWindowSize(buf.getUInt()); + setRemotePacketSize(buf.getInt()); + byte[] addr=buf.getString(); + int port=buf.getInt(); + byte[] orgaddr=buf.getString(); + int orgport=buf.getInt(); + + /* + System.err.println("addr: "+Util.byte2str(addr)); + System.err.println("port: "+port); + System.err.println("orgaddr: "+Util.byte2str(orgaddr)); + System.err.println("orgport: "+orgport); + */ + + Session _session=null; + try{ + _session=getSession(); + } + catch(JSchException e){ + // session has been already down. + } + + synchronized(pool){ + for(int i=0; i=6){ + this.factory=((SocketFactory)foo[5]); + } + break; + } + if(target==null){ + //System.err.println("??"); + } + } + } + + static Object[] getPort(Session session, int rport){ + synchronized(pool){ + for(int i=0; iname and value are needed to be passed + * to the remote in your faivorite encoding,use + * {@link #setEnv(byte[], byte[])}. + * + * @param name A name for environment variable. + * @param value A value for environment variable. + * @see RFC4254 6.4 Environment Variable Passing + */ + public void setEnv(String name, String value){ + setEnv(Util.str2byte(name), Util.str2byte(value)); + } + + /** + * Set the environment variable. + * + * @param name A name of environment variable. + * @param value A value of environment variable. + * @see #setEnv(String, String) + * @see RFC4254 6.4 Environment Variable Passing + */ + public void setEnv(byte[] name, byte[] value){ + synchronized(this){ + getEnv().put(name, value); + } + } + + private Hashtable getEnv(){ + if(env==null) + env=new Hashtable(); + return env; + } + + /** + * Allocate a Pseudo-Terminal. + * + * @param enable + * @see RFC4254 6.2. Requesting a Pseudo-Terminal + */ + public void setPty(boolean enable){ + pty=enable; + } + + /** + * Set the terminal mode. + * + * @param terminal_mode + */ + public void setTerminalMode(byte[] terminal_mode){ + this.terminal_mode=terminal_mode; + } + + /** + * Change the window dimension interactively. + * + * @param col terminal width, columns + * @param row terminal height, rows + * @param wp terminal width, pixels + * @param hp terminal height, pixels + * @see RFC4254 6.7. Window Dimension Change Message + */ + public void setPtySize(int col, int row, int wp, int hp){ + setPtyType(this.ttype, col, row, wp, hp); + if(!pty || !isConnected()){ + return; + } + try{ + RequestWindowChange request=new RequestWindowChange(); + request.setSize(col, row, wp, hp); + request.request(getSession(), this); + } + catch(Exception e){ + //System.err.println("ChannelSessio.setPtySize: "+e); + } + } + + /** + * Set the terminal type. + * This method is not effective after Channel#connect(). + * + * @param ttype terminal type(for example, "vt100") + * @see #setPtyType(String, int, int, int, int) + */ + public void setPtyType(String ttype){ + setPtyType(ttype, 80, 24, 640, 480); + } + + /** + * Set the terminal type. + * This method is not effective after Channel#connect(). + * + * @param ttype terminal type(for example, "vt100") + * @param col terminal width, columns + * @param row terminal height, rows + * @param wp terminal width, pixels + * @param hp terminal height, pixels + */ + public void setPtyType(String ttype, int col, int row, int wp, int hp){ + this.ttype=ttype; + this.tcol=col; + this.trow=row; + this.twp=wp; + this.thp=hp; + } + + protected void sendRequests() throws Exception{ + Session _session=getSession(); + Request request; + if(agent_forwarding){ + request=new RequestAgentForwarding(); + request.request(_session, this); + } + + if(xforwading){ + request=new RequestX11(); + request.request(_session, this); + } + + if(pty){ + request=new RequestPtyReq(); + ((RequestPtyReq)request).setTType(ttype); + ((RequestPtyReq)request).setTSize(tcol, trow, twp, thp); + if(terminal_mode!=null){ + ((RequestPtyReq)request).setTerminalMode(terminal_mode); + } + request.request(_session, this); + } + + if(env!=null){ + for(Enumeration _env=env.keys(); _env.hasMoreElements();){ + Object name=_env.nextElement(); + Object value=env.get(name); + request=new RequestEnv(); + ((RequestEnv)request).setEnv(toByteArray(name), + toByteArray(value)); + request.request(_session, this); + } + } + } + + private byte[] toByteArray(Object o){ + if(o instanceof String){ + return Util.str2byte((String)o); + } + return (byte[])o; + } + + public void run(){ + //System.err.println(this+":run >"); + + Buffer buf=new Buffer(rmpsize); + Packet packet=new Packet(buf); + int i=-1; + try{ + while(isConnected() && + thread!=null && + io!=null && + io.in!=null){ + i=io.in.read(buf.buffer, + 14, + buf.buffer.length-14 + -Session.buffer_margin + ); + if(i==0)continue; + if(i==-1){ + eof(); + break; + } + if(close)break; + //System.out.println("write: "+i); + packet.reset(); + buf.putByte((byte)Session.SSH_MSG_CHANNEL_DATA); + buf.putInt(recipient); + buf.putInt(i); + buf.skip(i); + getSession().write(packet, this, i); + } + } + catch(Exception e){ + //System.err.println("# ChannelExec.run"); + //e.printStackTrace(); + } + Thread _thread=thread; + if(_thread!=null){ + synchronized(_thread){ _thread.notifyAll(); } + } + thread=null; + //System.err.println(this+":run <"); + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ChannelSftp.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ChannelSftp.java new file mode 100644 index 000000000..1e9dd43a1 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ChannelSftp.java @@ -0,0 +1,2651 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +import java.io.*; + +import java.util.Vector; + +public class ChannelSftp extends ChannelSession{ + + static private final int LOCAL_MAXIMUM_PACKET_SIZE=32*1024; + static private final int LOCAL_WINDOW_SIZE_MAX=(64*LOCAL_MAXIMUM_PACKET_SIZE); + + private static final byte SSH_FXP_INIT= 1; + private static final byte SSH_FXP_VERSION= 2; + private static final byte SSH_FXP_OPEN= 3; + private static final byte SSH_FXP_CLOSE= 4; + private static final byte SSH_FXP_READ= 5; + private static final byte SSH_FXP_WRITE= 6; + private static final byte SSH_FXP_LSTAT= 7; + private static final byte SSH_FXP_FSTAT= 8; + private static final byte SSH_FXP_SETSTAT= 9; + private static final byte SSH_FXP_FSETSTAT= 10; + private static final byte SSH_FXP_OPENDIR= 11; + private static final byte SSH_FXP_READDIR= 12; + private static final byte SSH_FXP_REMOVE= 13; + private static final byte SSH_FXP_MKDIR= 14; + private static final byte SSH_FXP_RMDIR= 15; + private static final byte SSH_FXP_REALPATH= 16; + private static final byte SSH_FXP_STAT= 17; + private static final byte SSH_FXP_RENAME= 18; + private static final byte SSH_FXP_READLINK= 19; + private static final byte SSH_FXP_SYMLINK= 20; + private static final byte SSH_FXP_STATUS= 101; + private static final byte SSH_FXP_HANDLE= 102; + private static final byte SSH_FXP_DATA= 103; + private static final byte SSH_FXP_NAME= 104; + private static final byte SSH_FXP_ATTRS= 105; + private static final byte SSH_FXP_EXTENDED= (byte)200; + private static final byte SSH_FXP_EXTENDED_REPLY= (byte)201; + + // pflags + private static final int SSH_FXF_READ= 0x00000001; + private static final int SSH_FXF_WRITE= 0x00000002; + private static final int SSH_FXF_APPEND= 0x00000004; + private static final int SSH_FXF_CREAT= 0x00000008; + private static final int SSH_FXF_TRUNC= 0x00000010; + private static final int SSH_FXF_EXCL= 0x00000020; + + private static final int SSH_FILEXFER_ATTR_SIZE= 0x00000001; + private static final int SSH_FILEXFER_ATTR_UIDGID= 0x00000002; + private static final int SSH_FILEXFER_ATTR_PERMISSIONS= 0x00000004; + private static final int SSH_FILEXFER_ATTR_ACMODTIME= 0x00000008; + private static final int SSH_FILEXFER_ATTR_EXTENDED= 0x80000000; + + public static final int SSH_FX_OK= 0; + public static final int SSH_FX_EOF= 1; + public static final int SSH_FX_NO_SUCH_FILE= 2; + public static final int SSH_FX_PERMISSION_DENIED= 3; + public static final int SSH_FX_FAILURE= 4; + public static final int SSH_FX_BAD_MESSAGE= 5; + public static final int SSH_FX_NO_CONNECTION= 6; + public static final int SSH_FX_CONNECTION_LOST= 7; + public static final int SSH_FX_OP_UNSUPPORTED= 8; +/* + SSH_FX_OK + Indicates successful completion of the operation. + SSH_FX_EOF + indicates end-of-file condition; for SSH_FX_READ it means that no + more data is available in the file, and for SSH_FX_READDIR it + indicates that no more files are contained in the directory. + SSH_FX_NO_SUCH_FILE + is returned when a reference is made to a file which should exist + but doesn't. + SSH_FX_PERMISSION_DENIED + is returned when the authenticated user does not have sufficient + permissions to perform the operation. + SSH_FX_FAILURE + is a generic catch-all error message; it should be returned if an + error occurs for which there is no more specific error code + defined. + SSH_FX_BAD_MESSAGE + may be returned if a badly formatted packet or protocol + incompatibility is detected. + SSH_FX_NO_CONNECTION + is a pseudo-error which indicates that the client has no + connection to the server (it can only be generated locally by the + client, and MUST NOT be returned by servers). + SSH_FX_CONNECTION_LOST + is a pseudo-error which indicates that the connection to the + server has been lost (it can only be generated locally by the + client, and MUST NOT be returned by servers). + SSH_FX_OP_UNSUPPORTED + indicates that an attempt was made to perform an operation which + is not supported for the server (it may be generated locally by + the client if e.g. the version number exchange indicates that a + required feature is not supported by the server, or it may be + returned by the server if the server does not implement an + operation). +*/ + private static final int MAX_MSG_LENGTH = 256* 1024; + + public static final int OVERWRITE=0; + public static final int RESUME=1; + public static final int APPEND=2; + + private boolean interactive=false; + private int seq=1; + private int[] ackid=new int[1]; + + private Buffer buf; + private Packet packet; + + // The followings will be used in file uploading. + private Buffer obuf; + private Packet opacket; + + private int client_version=3; + private int server_version=3; + private String version=String.valueOf(client_version); + + private java.util.Hashtable extensions=null; + private InputStream io_in=null; + +/* +10. Changes from previous protocol versions + The SSH File Transfer Protocol has changed over time, before it's + standardization. The following is a description of the incompatible + changes between different versions. +10.1 Changes between versions 3 and 2 + o The SSH_FXP_READLINK and SSH_FXP_SYMLINK messages were added. + o The SSH_FXP_EXTENDED and SSH_FXP_EXTENDED_REPLY messages were added. + o The SSH_FXP_STATUS message was changed to include fields `error + message' and `language tag'. +10.2 Changes between versions 2 and 1 + o The SSH_FXP_RENAME message was added. +10.3 Changes between versions 1 and 0 + o Implementation changes, no actual protocol changes. +*/ + + private static final String file_separator=java.io.File.separator; + private static final char file_separatorc=java.io.File.separatorChar; + private static boolean fs_is_bs=(byte)java.io.File.separatorChar == '\\'; + + private String cwd; + private String home; + private String lcwd; + + private static final String UTF8="UTF-8"; + private String fEncoding=UTF8; + private boolean fEncoding_is_utf8=true; + + private RequestQueue rq = new RequestQueue(10); + public void setBulkRequests(int bulk_requests) throws JSchException { + if(bulk_requests>0) + rq = new RequestQueue(bulk_requests); + else + throw new JSchException("setBulkRequests: "+ + bulk_requests+" must be greater than 0."); + } + public int getBulkRequests(){ + return rq.size(); + } + + ChannelSftp(){ + super(); + setLocalWindowSizeMax(LOCAL_WINDOW_SIZE_MAX); + setLocalWindowSize(LOCAL_WINDOW_SIZE_MAX); + setLocalPacketSize(LOCAL_MAXIMUM_PACKET_SIZE); + } + + void init(){ + } + + public void start() throws JSchException{ + try{ + + PipedOutputStream pos=new PipedOutputStream(); + io.setOutputStream(pos); + PipedInputStream pis=new MyPipedInputStream(pos, rmpsize); + io.setInputStream(pis); + + io_in=io.in; + + if(io_in==null){ + throw new JSchException("channel is down"); + } + + Request request=new RequestSftp(); + request.request(getSession(), this); + + /* + System.err.println("lmpsize: "+lmpsize); + System.err.println("lwsize: "+lwsize); + System.err.println("rmpsize: "+rmpsize); + System.err.println("rwsize: "+rwsize); + */ + + buf=new Buffer(lmpsize); + packet=new Packet(buf); + + obuf=new Buffer(rmpsize); + opacket=new Packet(obuf); + + int i=0; + int length; + int type; + byte[] str; + + // send SSH_FXP_INIT + sendINIT(); + + // receive SSH_FXP_VERSION + Header header=new Header(); + header=header(buf, header); + length=header.length; + if(length > MAX_MSG_LENGTH){ + throw new SftpException(SSH_FX_FAILURE, + "Received message is too long: " + length); + } + type=header.type; // 2 -> SSH_FXP_VERSION + server_version=header.rid; + //System.err.println("SFTP protocol server-version="+server_version); + if(length>0){ + extensions=new java.util.Hashtable(); + // extension data + fill(buf, length); + byte[] extension_name=null; + byte[] extension_data=null; + while(length>0){ + extension_name=buf.getString(); + length-=(4+extension_name.length); + extension_data=buf.getString(); + length-=(4+extension_data.length); + extensions.put(Util.byte2str(extension_name), + Util.byte2str(extension_data)); + } + } + + lcwd=new File(".").getCanonicalPath(); + } + catch(Exception e){ + //System.err.println(e); + if(e instanceof JSchException) throw (JSchException)e; + if(e instanceof Throwable) + throw new JSchException(e.toString(), (Throwable)e); + throw new JSchException(e.toString()); + } + } + + public void quit(){ disconnect();} + public void exit(){ disconnect();} + public void lcd(String path) throws SftpException{ + path=localAbsolutePath(path); + if((new File(path)).isDirectory()){ + try{ + path=(new File(path)).getCanonicalPath(); + } + catch(Exception e){} + lcwd=path; + return; + } + throw new SftpException(SSH_FX_NO_SUCH_FILE, "No such directory"); + } + + public void cd(String path) throws SftpException{ + try{ + ((MyPipedInputStream)io_in).updateReadSide(); + + path=remoteAbsolutePath(path); + path=isUnique(path); + + byte[] str=_realpath(path); + SftpATTRS attr=_stat(str); + + if((attr.getFlags()&SftpATTRS.SSH_FILEXFER_ATTR_PERMISSIONS)==0){ + throw new SftpException(SSH_FX_FAILURE, + "Can't change directory: "+path); + } + if(!attr.isDir()){ + throw new SftpException(SSH_FX_FAILURE, + "Can't change directory: "+path); + } + + setCwd(Util.byte2str(str, fEncoding)); + } + catch(Exception e){ + if(e instanceof SftpException) throw (SftpException)e; + if(e instanceof Throwable) + throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e); + throw new SftpException(SSH_FX_FAILURE, ""); + } + } + + public void put(String src, String dst) throws SftpException{ + put(src, dst, null, OVERWRITE); + } + public void put(String src, String dst, int mode) throws SftpException{ + put(src, dst, null, mode); + } + public void put(String src, String dst, + SftpProgressMonitor monitor) throws SftpException{ + put(src, dst, monitor, OVERWRITE); + } + public void put(String src, String dst, + SftpProgressMonitor monitor, int mode) throws SftpException{ + + try{ + ((MyPipedInputStream)io_in).updateReadSide(); + + src=localAbsolutePath(src); + dst=remoteAbsolutePath(dst); + + Vector v=glob_remote(dst); + int vsize=v.size(); + if(vsize!=1){ + if(vsize==0){ + if(isPattern(dst)) + throw new SftpException(SSH_FX_FAILURE, dst); + else + dst=Util.unquote(dst); + } + throw new SftpException(SSH_FX_FAILURE, v.toString()); + } + else{ + dst=(String)(v.elementAt(0)); + } + + boolean isRemoteDir=isRemoteDir(dst); + + v=glob_local(src); + vsize=v.size(); + + StringBuffer dstsb=null; + if(isRemoteDir){ + if(!dst.endsWith("/")){ + dst+="/"; + } + dstsb=new StringBuffer(dst); + } + else if(vsize>1){ + throw new SftpException(SSH_FX_FAILURE, + "Copying multiple files, but the destination is missing or a file."); + } + + for(int j=0; ji) + i=ii; + } + if(i==-1) dstsb.append(_src); + else dstsb.append(_src.substring(i + 1)); + _dst=dstsb.toString(); + dstsb.delete(dst.length(), _dst.length()); + } + else{ + _dst=dst; + } + //System.err.println("_dst "+_dst); + + long size_of_dst=0; + if(mode==RESUME){ + try{ + SftpATTRS attr=_stat(_dst); + size_of_dst=attr.getSize(); + } + catch(Exception eee){ + //System.err.println(eee); + } + long size_of_src=new File(_src).length(); + if(size_of_src0){ + long skipped=src.skip(skip); + if(skipped0){ + int sent=sendWRITE(handle, _offset[0], d, s, _len); + writecount++; + _offset[0]+=sent; + s+=sent; + _len-=sent; + if((seq-1)==startid || + io_in.available()>=1024){ + while(io_in.available()>0){ + if(checkStatus(ackid, header)){ + _ackid=ackid[0]; + if(startid>_ackid || _ackid>seq-1){ + throw new SftpException(SSH_FX_FAILURE, ""); + } + ackcount++; + } + else{ + break; + } + } + } + } + if(monitor!=null && !monitor.count(len)){ + close(); + throw new IOException("canceled"); + } + } + catch(IOException e){ throw e; } + catch(Exception e){ throw new IOException(e.toString()); } + } + + byte[] _data=new byte[1]; + public void write(int foo) throws java.io.IOException{ + _data[0]=(byte)foo; + write(_data, 0, 1); + } + + public void flush() throws java.io.IOException{ + + if(isClosed){ + throw new IOException("stream already closed"); + } + + if(!init){ + try{ + while(writecount>ackcount){ + if(!checkStatus(null, header)){ + break; + } + ackcount++; + } + } + catch(SftpException e){ + throw new IOException(e.toString()); + } + } + } + + public void close() throws java.io.IOException{ + if(isClosed){ + return; + } + flush(); + if(monitor!=null)monitor.end(); + try{ _sendCLOSE(handle, header); } + catch(IOException e){ throw e; } + catch(Exception e){ + throw new IOException(e.toString()); + } + isClosed=true; + } + }; + return out; + } + catch(Exception e){ + if(e instanceof SftpException) throw (SftpException)e; + if(e instanceof Throwable) + throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e); + throw new SftpException(SSH_FX_FAILURE, ""); + } + } + + public void get(String src, String dst) throws SftpException{ + get(src, dst, null, OVERWRITE); + } + public void get(String src, String dst, + SftpProgressMonitor monitor) throws SftpException{ + get(src, dst, monitor, OVERWRITE); + } + public void get(String src, String dst, + SftpProgressMonitor monitor, int mode) throws SftpException{ + // System.out.println("get: "+src+" "+dst); + + boolean _dstExist = false; + String _dst=null; + try{ + ((MyPipedInputStream)io_in).updateReadSide(); + + src=remoteAbsolutePath(src); + dst=localAbsolutePath(dst); + + Vector v=glob_remote(src); + int vsize=v.size(); + if(vsize==0){ + throw new SftpException(SSH_FX_NO_SUCH_FILE, "No such file"); + } + + File dstFile=new File(dst); + boolean isDstDir=dstFile.isDirectory(); + StringBuffer dstsb=null; + if(isDstDir){ + if(!dst.endsWith(file_separator)){ + dst+=file_separator; + } + dstsb=new StringBuffer(dst); + } + else if(vsize>1){ + throw new SftpException(SSH_FX_FAILURE, + "Copying multiple files, but destination is missing or a file."); + } + + for(int j=0; jsize_of_src){ + throw new SftpException(SSH_FX_FAILURE, + "failed to resume for "+_dst); + } + if(size_of_dst==size_of_src){ + return; + } + } + + if(monitor!=null){ + monitor.init(SftpProgressMonitor.GET, _src, _dst, attr.getSize()); + if(mode==RESUME){ + monitor.count(_dstFile.length()); + } + } + + FileOutputStream fos=null; + _dstExist = _dstFile.exists(); + try{ + if(mode==OVERWRITE){ + fos=new FileOutputStream(_dst); + } + else{ + fos=new FileOutputStream(_dst, true); // append + } + // System.err.println("_get: "+_src+", "+_dst); + _get(_src, fos, monitor, mode, new File(_dst).length()); + } + finally{ + if(fos!=null){ + fos.close(); + } + } + } + } + catch(Exception e){ + if(!_dstExist && _dst!=null){ + File _dstFile = new File(_dst); + if(_dstFile.exists() && _dstFile.length()==0){ + _dstFile.delete(); + } + } + if(e instanceof SftpException) throw (SftpException)e; + if(e instanceof Throwable) + throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e); + throw new SftpException(SSH_FX_FAILURE, ""); + } + } + public void get(String src, OutputStream dst) throws SftpException{ + get(src, dst, null, OVERWRITE, 0); + } + public void get(String src, OutputStream dst, + SftpProgressMonitor monitor) throws SftpException{ + get(src, dst, monitor, OVERWRITE, 0); + } + public void get(String src, OutputStream dst, + SftpProgressMonitor monitor, int mode, long skip) throws SftpException{ +//System.err.println("get: "+src+", "+dst); + try{ + ((MyPipedInputStream)io_in).updateReadSide(); + + src=remoteAbsolutePath(src); + src=isUnique(src); + + if(monitor!=null){ + SftpATTRS attr=_stat(src); + monitor.init(SftpProgressMonitor.GET, src, "??", attr.getSize()); + if(mode==RESUME){ + monitor.count(skip); + } + } + _get(src, dst, monitor, mode, skip); + } + catch(Exception e){ + if(e instanceof SftpException) throw (SftpException)e; + if(e instanceof Throwable) + throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e); + throw new SftpException(SSH_FX_FAILURE, ""); + } + } + + private void _get(String src, OutputStream dst, + SftpProgressMonitor monitor, int mode, long skip) throws SftpException{ + //System.err.println("_get: "+src+", "+dst); + + byte[] srcb=Util.str2byte(src, fEncoding); + try{ + sendOPENR(srcb); + + Header header=new Header(); + header=header(buf, header); + int length=header.length; + int type=header.type; + + fill(buf, length); + + if(type!=SSH_FXP_STATUS && type!=SSH_FXP_HANDLE){ + throw new SftpException(SSH_FX_FAILURE, ""); + } + + if(type==SSH_FXP_STATUS){ + int i=buf.getInt(); + throwStatusError(buf, i); + } + + byte[] handle=buf.getString(); // filename + + long offset=0; + if(mode==RESUME){ + offset+=skip; + } + + int request_max=1; + rq.init(); + long request_offset=offset; + + int request_len = buf.buffer.length-13; + if(server_version==0){ request_len=1024; } + + loop: + while(true){ + + while(rq.count() < request_max){ + sendREAD(handle, request_offset, request_len, rq); + request_offset += request_len; + } + + header=header(buf, header); + length=header.length; + type=header.type; + + RequestQueue.Request rr = rq.get(header.rid); + + if(type==SSH_FXP_STATUS){ + fill(buf, length); + int i=buf.getInt(); + if(i==SSH_FX_EOF){ + break loop; + } + throwStatusError(buf, i); + } + + if(type!=SSH_FXP_DATA){ + break loop; + } + + buf.rewind(); + fill(buf.buffer, 0, 4); length-=4; + int length_of_data = buf.getInt(); // length of data + + /** + Since sftp protocol version 6, "end-of-file" has been defined, + + byte SSH_FXP_DATA + uint32 request-id + string data + bool end-of-file [optional] + + but some sftpd server will send such a field in the sftp protocol 3 ;-( + */ + int optional_data = length - length_of_data; + + int foo = length_of_data; + while(foo>0){ + int bar=foo; + if(bar>buf.buffer.length){ + bar=buf.buffer.length; + } + int data_len = io_in.read(buf.buffer, 0, bar); + if(data_len<0){ + break loop; + } + + dst.write(buf.buffer, 0, data_len); + + offset+=data_len; + foo-=data_len; + + if(monitor!=null){ + if(!monitor.count(data_len)){ + skip(foo); + if(optional_data>0){ + skip(optional_data); + } + break loop; + } + } + + } + //System.err.println("length: "+length); // length should be 0 + + if(optional_data>0){ + skip(optional_data); + } + + if(length_of_data=rrq.length) tail -= rrq.length; + rrq[tail].id=id; + rrq[tail].offset=offset; + rrq[tail].length=length; + count++; + } + + Request get(int id){ + count -= 1; + int i=head; + head++; + if(head==rrq.length) head=0; + if(rrq[i].id!=id){ + System.err.println("The request is not in order."); + } + rrq[i].id=0; + return rrq[i]; + } + + int count() { + return count; + } + + int size() { + return rrq.length; + } + + void cancel(Header header, Buffer buf) throws IOException { + int _count = count; + for(int i=0; i<_count; i++){ + header=header(buf, header); + int length=header.length; + get(header.rid); + skip(length); + } + } + } + + public InputStream get(String src) throws SftpException{ + return get(src, null, 0L); + } + public InputStream get(String src, SftpProgressMonitor monitor) throws SftpException{ + return get(src, monitor, 0L); + } + + /** + * @deprecated This method will be deleted in the future. + */ + public InputStream get(String src, int mode) throws SftpException{ + return get(src, null, 0L); + } + /** + * @deprecated This method will be deleted in the future. + */ + public InputStream get(String src, final SftpProgressMonitor monitor, final int mode) throws SftpException{ + return get(src, monitor, 0L); + } + public InputStream get(String src, final SftpProgressMonitor monitor, final long skip) throws SftpException{ + + try{ + ((MyPipedInputStream)io_in).updateReadSide(); + + src=remoteAbsolutePath(src); + src=isUnique(src); + + byte[] srcb=Util.str2byte(src, fEncoding); + + SftpATTRS attr=_stat(srcb); + if(monitor!=null){ + monitor.init(SftpProgressMonitor.GET, src, "??", attr.getSize()); + } + + sendOPENR(srcb); + + Header header=new Header(); + header=header(buf, header); + int length=header.length; + int type=header.type; + + fill(buf, length); + + if(type!=SSH_FXP_STATUS && type!=SSH_FXP_HANDLE){ + throw new SftpException(SSH_FX_FAILURE, ""); + } + if(type==SSH_FXP_STATUS){ + int i=buf.getInt(); + throwStatusError(buf, i); + } + + final byte[] handle=buf.getString(); // handle + + java.io.InputStream in=new java.io.InputStream(){ + long offset=skip; + boolean closed=false; + int rest_length=0; + byte[] _data=new byte[1]; + byte[] rest_byte=new byte[1024]; + Header header=new Header(); + + public int read() throws java.io.IOException{ + if(closed)return -1; + int i=read(_data, 0, 1); + if (i==-1) { return -1; } + else { + return _data[0]&0xff; + } + } + public int read(byte[] d) throws java.io.IOException{ + if(closed)return -1; + return read(d, 0, d.length); + } + public int read(byte[] d, int s, int len) throws java.io.IOException{ + if(closed)return -1; + if(d==null){throw new NullPointerException();} + if(s<0 || len <0 || s+len>d.length){ + throw new IndexOutOfBoundsException(); + } + if(len==0){ return 0; } + + if(rest_length>0){ + int foo=rest_length; + if(foo>len) foo=len; + System.arraycopy(rest_byte, 0, d, s, foo); + if(foo!=rest_length){ + System.arraycopy(rest_byte, foo, + rest_byte, 0, rest_length-foo); + } + + if(monitor!=null){ + if(!monitor.count(foo)){ + close(); + return -1; + } + } + + rest_length-=foo; + return foo; + } + + if(buf.buffer.length-131024){ + len=1024; + } + + try{sendREAD(handle, offset, len);} + catch(Exception e){ throw new IOException("error"); } + + header=header(buf, header); + rest_length=header.length; + int type=header.type; + int id=header.rid; + + if(type!=SSH_FXP_STATUS && type!=SSH_FXP_DATA){ + throw new IOException("error"); + } + if(type==SSH_FXP_STATUS){ + fill(buf, rest_length); + int i=buf.getInt(); + rest_length=0; + if(i==SSH_FX_EOF){ + close(); + return -1; + } + //throwStatusError(buf, i); + throw new IOException("error"); + } + buf.rewind(); + fill(buf.buffer, 0, 4); + int length_of_data = buf.getInt(); rest_length-=4; + + /** + Since sftp protocol version 6, "end-of-file" has been defined, + + byte SSH_FXP_DATA + uint32 request-id + string data + bool end-of-file [optional] + + but some sftpd server will send such a field in the sftp protocol 3 ;-( + */ + int optional_data = rest_length - length_of_data; + + offset += length_of_data; + int foo = length_of_data; + if(foo>0){ + int bar=foo; + if(bar>len){ + bar=len; + } + int i=io_in.read(d, s, bar); + if(i<0){ + return -1; + } + foo-=i; + rest_length=foo; + + if(foo>0){ + if(rest_byte.length0){ + j=io_in.read(rest_byte, _s, _len); + if(j<=0)break; + _s+=j; + _len-=j; + } + } + + if(optional_data>0){ + io_in.skip(optional_data); + } + + if(monitor!=null){ + if(!monitor.count(i)){ + close(); + return -1; + } + } + + return i; + } + return 0; // ?? + } + public void close() throws IOException{ + if(closed)return; + closed=true; + if(monitor!=null)monitor.end(); + try{_sendCLOSE(handle, header);} + catch(Exception e){throw new IOException("error");} + } + }; + return in; + } + catch(Exception e){ + if(e instanceof SftpException) throw (SftpException)e; + if(e instanceof Throwable) + throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e); + throw new SftpException(SSH_FX_FAILURE, ""); + } + } + + public java.util.Vector ls(String path) throws SftpException{ + //System.out.println("ls: "+path); + try{ + ((MyPipedInputStream)io_in).updateReadSide(); + + path=remoteAbsolutePath(path); + byte[] pattern=null; + java.util.Vector v=new java.util.Vector(); + + int foo=path.lastIndexOf('/'); + String dir=path.substring(0, ((foo==0)?1:foo)); + String _pattern=path.substring(foo+1); + dir=Util.unquote(dir); + + // If pattern has included '*' or '?', we need to convert + // to UTF-8 string before globbing. + byte[][] _pattern_utf8=new byte[1][]; + boolean pattern_has_wildcard=isPattern(_pattern, _pattern_utf8); + + if(pattern_has_wildcard){ + pattern=_pattern_utf8[0]; + } + else{ + String upath=Util.unquote(path); + //SftpATTRS attr=_lstat(upath); + SftpATTRS attr=_stat(upath); + if(attr.isDir()){ + pattern=null; + dir=upath; + } + else{ + /* + // If we can generage longname by ourself, + // we don't have to use openDIR. + String filename=Util.unquote(_pattern); + String longname=... + v.addElement(new LsEntry(filename, longname, attr)); + return v; + */ + + if(fEncoding_is_utf8){ + pattern=_pattern_utf8[0]; + pattern=Util.unquote(pattern); + } + else{ + _pattern=Util.unquote(_pattern); + pattern=Util.str2byte(_pattern, fEncoding); + } + + } + } + + sendOPENDIR(Util.str2byte(dir, fEncoding)); + + Header header=new Header(); + header=header(buf, header); + int length=header.length; + int type=header.type; + + fill(buf, length); + + if(type!=SSH_FXP_STATUS && type!=SSH_FXP_HANDLE){ + throw new SftpException(SSH_FX_FAILURE, ""); + } + if(type==SSH_FXP_STATUS){ + int i=buf.getInt(); + throwStatusError(buf, i); + } + + byte[] handle=buf.getString(); // handle + + while(true){ + sendREADDIR(handle); + + header=header(buf, header); + length=header.length; + type=header.type; + if(type!=SSH_FXP_STATUS && type!=SSH_FXP_NAME){ + throw new SftpException(SSH_FX_FAILURE, ""); + } + if(type==SSH_FXP_STATUS){ + fill(buf, length); + int i=buf.getInt(); + if(i==SSH_FX_EOF) + break; + throwStatusError(buf, i); + } + + buf.rewind(); + fill(buf.buffer, 0, 4); length-=4; + int count=buf.getInt(); + + byte[] str; + int flags; + + buf.reset(); + while(count>0){ + if(length>0){ + buf.shift(); + int j=(buf.buffer.length>(buf.index+length)) ? + length : + (buf.buffer.length-buf.index); + int i=fill(buf.buffer, buf.index, j); + buf.index+=i; + length-=i; + } + byte[] filename=buf.getString(); + byte[] longname=null; + if(server_version<=3){ + longname=buf.getString(); + } + SftpATTRS attrs=SftpATTRS.getATTR(buf); + + boolean find=false; + String f=null; + if(pattern==null){ + find=true; + } + else if(!pattern_has_wildcard){ + find=Util.array_equals(pattern, filename); + } + else{ + byte[] _filename=filename; + if(!fEncoding_is_utf8){ + f=Util.byte2str(_filename, fEncoding); + _filename=Util.str2byte(f, UTF8); + } + find=Util.glob(pattern, _filename); + } + + if(find){ + if(f==null){ + f=Util.byte2str(filename, fEncoding); + } + String l=null; + if(longname==null){ + // TODO: we need to generate long name from attrs + // for the sftp protocol 4(and later). + l=attrs.toString()+" "+f; + } + else{ + l=Util.byte2str(longname, fEncoding); + } + v.addElement(new LsEntry(f, l, attrs)); + } + + count--; + } + } + _sendCLOSE(handle, header); + + /* + if(v.size()==1 && pattern_has_wildcard){ + LsEntry le=(LsEntry)v.elementAt(0); + if(le.getAttrs().isDir()){ + String f=le.getFilename(); + if(isPattern(f)){ + f=Util.quote(f); + } + if(!dir.endsWith("/")){ + dir+="/"; + } + v=null; + return ls(dir+f); + } + } + */ + + return v; + } + catch(Exception e){ + if(e instanceof SftpException) throw (SftpException)e; + if(e instanceof Throwable) + throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e); + throw new SftpException(SSH_FX_FAILURE, ""); + } + } + public String readlink(String path) throws SftpException{ + try{ + if(server_version<3){ + throw new SftpException(SSH_FX_OP_UNSUPPORTED, + "The remote sshd is too old to support symlink operation."); + } + + ((MyPipedInputStream)io_in).updateReadSide(); + + path=remoteAbsolutePath(path); + + path=isUnique(path); + + sendREADLINK(Util.str2byte(path, fEncoding)); + + Header header=new Header(); + header=header(buf, header); + int length=header.length; + int type=header.type; + + fill(buf, length); + + if(type!=SSH_FXP_STATUS && type!=SSH_FXP_NAME){ + throw new SftpException(SSH_FX_FAILURE, ""); + } + if(type==SSH_FXP_NAME){ + int count=buf.getInt(); // count + byte[] filename=null; + for(int i=0; i=2){ + throw new SftpException(SSH_FX_FAILURE, v.toString()); + } + if(vsize==1){ + newpath=(String)(v.elementAt(0)); + } + else{ // vsize==0 + if(isPattern(newpath)) + throw new SftpException(SSH_FX_FAILURE, newpath); + newpath=Util.unquote(newpath); + } + + sendRENAME(Util.str2byte(oldpath, fEncoding), + Util.str2byte(newpath, fEncoding)); + + Header header=new Header(); + header=header(buf, header); + int length=header.length; + int type=header.type; + + fill(buf, length); + + if(type!=SSH_FXP_STATUS){ + throw new SftpException(SSH_FX_FAILURE, ""); + } + + int i=buf.getInt(); + if(i==SSH_FX_OK) return; + throwStatusError(buf, i); + } + catch(Exception e){ + if(e instanceof SftpException) throw (SftpException)e; + if(e instanceof Throwable) + throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e); + throw new SftpException(SSH_FX_FAILURE, ""); + } + } + public void rm(String path) throws SftpException{ + try{ + ((MyPipedInputStream)io_in).updateReadSide(); + + path=remoteAbsolutePath(path); + + Vector v=glob_remote(path); + int vsize=v.size(); + + Header header=new Header(); + + for(int j=0; j0){ + str=buf.getString(); // absolute path; + if(server_version<=3){ + byte[] lname=buf.getString(); // long filename + } + SftpATTRS attr=SftpATTRS.getATTR(buf); // dummy attribute + } + return str; + } + + public void setStat(String path, SftpATTRS attr) throws SftpException{ + try{ + ((MyPipedInputStream)io_in).updateReadSide(); + + path=remoteAbsolutePath(path); + + Vector v=glob_remote(path); + int vsize=v.size(); + for(int j=0; j0){ + i=io_in.read(buf, s, l); + if(i<=0){ + throw new SftpException(SSH_FX_FAILURE, ""); + } + s+=i; + l-=i; + } + } + + private boolean checkStatus(int[] ackid, Header header) throws IOException, SftpException{ + header=header(buf, header); + int length=header.length; + int type=header.type; + if(ackid!=null) + ackid[0]=header.rid; + + fill(buf, length); + + if(type!=SSH_FXP_STATUS){ + throw new SftpException(SSH_FX_FAILURE, ""); + } + int i=buf.getInt(); + if(i!=SSH_FX_OK){ + throwStatusError(buf, i); + } + return true; + } + private boolean _sendCLOSE(byte[] handle, Header header) throws Exception{ + sendCLOSE(handle); + return checkStatus(null, header); + } + + private void sendINIT() throws Exception{ + packet.reset(); + putHEAD(SSH_FXP_INIT, 5); + buf.putInt(3); // version 3 + getSession().write(packet, this, 5+4); + } + + private void sendREALPATH(byte[] path) throws Exception{ + sendPacketPath(SSH_FXP_REALPATH, path); + } + private void sendSTAT(byte[] path) throws Exception{ + sendPacketPath(SSH_FXP_STAT, path); + } + private void sendLSTAT(byte[] path) throws Exception{ + sendPacketPath(SSH_FXP_LSTAT, path); + } + private void sendFSTAT(byte[] handle) throws Exception{ + sendPacketPath(SSH_FXP_FSTAT, handle); + } + private void sendSETSTAT(byte[] path, SftpATTRS attr) throws Exception{ + packet.reset(); + putHEAD(SSH_FXP_SETSTAT, 9+path.length+attr.length()); + buf.putInt(seq++); + buf.putString(path); // path + attr.dump(buf); + getSession().write(packet, this, 9+path.length+attr.length()+4); + } + private void sendREMOVE(byte[] path) throws Exception{ + sendPacketPath(SSH_FXP_REMOVE, path); + } + private void sendMKDIR(byte[] path, SftpATTRS attr) throws Exception{ + packet.reset(); + putHEAD(SSH_FXP_MKDIR, 9+path.length+(attr!=null?attr.length():4)); + buf.putInt(seq++); + buf.putString(path); // path + if(attr!=null) attr.dump(buf); + else buf.putInt(0); + getSession().write(packet, this, 9+path.length+(attr!=null?attr.length():4)+4); + } + private void sendRMDIR(byte[] path) throws Exception{ + sendPacketPath(SSH_FXP_RMDIR, path); + } + private void sendSYMLINK(byte[] p1, byte[] p2) throws Exception{ + sendPacketPath(SSH_FXP_SYMLINK, p1, p2); + } + private void sendREADLINK(byte[] path) throws Exception{ + sendPacketPath(SSH_FXP_READLINK, path); + } + private void sendOPENDIR(byte[] path) throws Exception{ + sendPacketPath(SSH_FXP_OPENDIR, path); + } + private void sendREADDIR(byte[] path) throws Exception{ + sendPacketPath(SSH_FXP_READDIR, path); + } + private void sendRENAME(byte[] p1, byte[] p2) throws Exception{ + sendPacketPath(SSH_FXP_RENAME, p1, p2); + } + private void sendCLOSE(byte[] path) throws Exception{ + sendPacketPath(SSH_FXP_CLOSE, path); + } + private void sendOPENR(byte[] path) throws Exception{ + sendOPEN(path, SSH_FXF_READ); + } + private void sendOPENW(byte[] path) throws Exception{ + sendOPEN(path, SSH_FXF_WRITE|SSH_FXF_CREAT|SSH_FXF_TRUNC); + } + private void sendOPENA(byte[] path) throws Exception{ + sendOPEN(path, SSH_FXF_WRITE|/*SSH_FXF_APPEND|*/SSH_FXF_CREAT); + } + private void sendOPEN(byte[] path, int mode) throws Exception{ + packet.reset(); + putHEAD(SSH_FXP_OPEN, 17+path.length); + buf.putInt(seq++); + buf.putString(path); + buf.putInt(mode); + buf.putInt(0); // attrs + getSession().write(packet, this, 17+path.length+4); + } + private void sendPacketPath(byte fxp, byte[] path) throws Exception{ + packet.reset(); + putHEAD(fxp, 9+path.length); + buf.putInt(seq++); + buf.putString(path); // path + getSession().write(packet, this, 9+path.length+4); + } + private void sendPacketPath(byte fxp, byte[] p1, byte[] p2) throws Exception{ + packet.reset(); + putHEAD(fxp, 13+p1.length+p2.length); + buf.putInt(seq++); + buf.putString(p1); + buf.putString(p2); + getSession().write(packet, this, 13+p1.length+p2.length+4); + } + + private int sendWRITE(byte[] handle, long offset, + byte[] data, int start, int length) throws Exception{ + int _length=length; + opacket.reset(); + if(obuf.buffer.length0){ + if(length>0){ + buf.shift(); + int j=(buf.buffer.length>(buf.index+length)) ? length : (buf.buffer.length-buf.index); + i=io_in.read(buf.buffer, buf.index, j); + if(i<=0)break; + buf.index+=i; + length-=i; + } + + byte[] filename=buf.getString(); + //System.err.println("filename: "+new String(filename)); + if(server_version<=3){ + str=buf.getString(); // longname + } + SftpATTRS attrs=SftpATTRS.getATTR(buf); + + byte[] _filename=filename; + String f=null; + boolean found=false; + + if(!fEncoding_is_utf8){ + f=Util.byte2str(filename, fEncoding); + _filename=Util.str2byte(f, UTF8); + } + found=Util.glob(pattern, _filename); + + if(found){ + if(f==null){ + f=Util.byte2str(filename, fEncoding); + } + if(pdir==null){ + pdir=dir; + if(!pdir.endsWith("/")){ + pdir+="/"; + } + } + v.addElement(pdir+f); + } + count--; + } + } + if(_sendCLOSE(handle, header)) + return v; + return null; + } + + private boolean isPattern(byte[] path){ + int length=path.length; + int i=0; + while(i=0){ + if(path[i]!='*' && path[i]!='?'){ + i--; + continue; + } + if(!fs_is_bs && + i>0 && path[i-1]=='\\'){ + i--; + if(i>0 && path[i-1]=='\\'){ + i--; + i--; + continue; + } + } + break; + } + + if(i<0){ v.addElement(fs_is_bs ? _path : Util.unquote(_path)); return v;} + + while(i>=0){ + if(path[i]==file_separatorc || + (fs_is_bs && path[i]=='/')){ // On Windows, '/' is also the separator. + break; + } + i--; + } + + if(i<0){ v.addElement(fs_is_bs ? _path : Util.unquote(_path)); return v;} + + byte[] dir; + if(i==0){dir=new byte[]{(byte)file_separatorc};} + else{ + dir=new byte[i]; + System.arraycopy(path, 0, dir, 0, i); + } + + byte[] pattern=new byte[path.length-i-1]; + System.arraycopy(path, i+1, pattern, 0, pattern.length); + +//System.err.println("dir: "+new String(dir)+" pattern: "+new String(pattern)); + try{ + String[] children=(new File(Util.byte2str(dir, UTF8))).list(); + String pdir=Util.byte2str(dir)+file_separator; + for(int j=0; j=3 && // WindRiver's sftp will send invalid + buf.getLength()>=4){ // SSH_FXP_STATUS packet. + byte[] str=buf.getString(); + //byte[] tag=buf.getString(); + throw new SftpException(i, Util.byte2str(str, UTF8)); + } + else{ + throw new SftpException(i, "Failure"); + } + } + + private static boolean isLocalAbsolutePath(String path){ + return (new File(path)).isAbsolute(); + } + + public void disconnect(){ + super.disconnect(); + } + + private boolean isPattern(String path, byte[][] utf8){ + byte[] _path=Util.str2byte(path, UTF8); + if(utf8!=null) + utf8[0]=_path; + return isPattern(_path); + } + + private boolean isPattern(String path){ + return isPattern(path, null); + } + + private void fill(Buffer buf, int len) throws IOException{ + buf.reset(); + fill(buf.buffer, 0, len); + buf.skip(len); + } + + private int fill(byte[] buf, int s, int len) throws IOException{ + int i=0; + int foo=s; + while(len>0){ + i=io_in.read(buf, s, len); + if(i<=0){ + throw new IOException("inputstream is closed"); + //return (s-foo)==0 ? i : s-foo; + } + s+=i; + len-=i; + } + return s-foo; + } + private void skip(long foo) throws IOException{ + while(foo>0){ + long bar=io_in.skip(foo); + if(bar<=0) + break; + foo-=bar; + } + } + + class Header{ + int length; + int type; + int rid; + } + private Header header(Buffer buf, Header header) throws IOException{ + buf.rewind(); + int i=fill(buf.buffer, 0, 9); + header.length=buf.getInt()-5; + header.type=buf.getByte()&0xff; + header.rid=buf.getInt(); + return header; + } + + private String remoteAbsolutePath(String path) throws SftpException{ + if(path.charAt(0)=='/') return path; + String cwd=getCwd(); +// if(cwd.equals(getHome())) return path; + if(cwd.endsWith("/")) return cwd+path; + return cwd+"/"+path; + } + + private String localAbsolutePath(String path){ + if(isLocalAbsolutePath(path)) return path; + if(lcwd.endsWith(file_separator)) return lcwd+path; + return lcwd+file_separator+path; + } + + /** + * This method will check if the given string can be expanded to the + * unique string. If it can be expanded to mutiple files, SftpException + * will be thrown. + * @return the returned string is unquoted. + */ + private String isUnique(String path) throws SftpException, Exception{ + Vector v=glob_remote(path); + if(v.size()!=1){ + throw new SftpException(SSH_FX_FAILURE, path+" is not unique: "+v.toString()); + } + return (String)(v.elementAt(0)); + } + + public int getServerVersion() throws SftpException{ + if(!isConnected()){ + throw new SftpException(SSH_FX_FAILURE, "The channel is not connected."); + } + return server_version; + } + + public void setFilenameEncoding(String encoding) throws SftpException{ + int sversion=getServerVersion(); + if(3 <= sversion && sversion <= 5 && + !encoding.equals(UTF8)){ + throw new SftpException(SSH_FX_FAILURE, + "The encoding can not be changed for this sftp server."); + } + if(encoding.equals(UTF8)){ + encoding=UTF8; + } + fEncoding=encoding; + fEncoding_is_utf8=fEncoding.equals(UTF8); + } + + public String getExtension(String key){ + if(extensions==null) + return null; + return (String)extensions.get(key); + } + + public String realpath(String path) throws SftpException{ + try{ + byte[] _path=_realpath(remoteAbsolutePath(path)); + return Util.byte2str(_path, fEncoding); + } + catch(Exception e){ + if(e instanceof SftpException) throw (SftpException)e; + if(e instanceof Throwable) + throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e); + throw new SftpException(SSH_FX_FAILURE, ""); + } + } + + public class LsEntry implements Comparable{ + private String filename; + private String longname; + private SftpATTRS attrs; + LsEntry(String filename, String longname, SftpATTRS attrs){ + setFilename(filename); + setLongname(longname); + setAttrs(attrs); + } + public String getFilename(){return filename;}; + void setFilename(String filename){this.filename = filename;}; + public String getLongname(){return longname;}; + void setLongname(String longname){this.longname = longname;}; + public SftpATTRS getAttrs(){return attrs;}; + void setAttrs(SftpATTRS attrs) {this.attrs = attrs;}; + public String toString(){ return longname; } + public int compareTo(Object o) throws ClassCastException{ + if(o instanceof LsEntry){ + return filename.compareTo(((LsEntry)o).getFilename()); + } + throw new ClassCastException("a decendent of LsEntry must be given."); + } + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ChannelShell.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ChannelShell.java new file mode 100644 index 000000000..f96b06178 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ChannelShell.java @@ -0,0 +1,70 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +import java.util.*; + +public class ChannelShell extends ChannelSession{ + + ChannelShell(){ + super(); + pty=true; + } + + public void start() throws JSchException{ + Session _session=getSession(); + try{ + sendRequests(); + + Request request=new RequestShell(); + request.request(_session, this); + } + catch(Exception e){ + if(e instanceof JSchException) throw (JSchException)e; + if(e instanceof Throwable) + throw new JSchException("ChannelShell", (Throwable)e); + throw new JSchException("ChannelShell"); + } + + if(io.in!=null){ + thread=new Thread(this); + thread.setName("Shell for "+_session.host); + if(_session.daemon_thread){ + thread.setDaemon(_session.daemon_thread); + } + thread.start(); + } + } + + void init() throws JSchException { + io.setInputStream(getSession().in); + io.setOutputStream(getSession().out); + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ChannelSubsystem.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ChannelSubsystem.java new file mode 100644 index 000000000..20aaa725f --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ChannelSubsystem.java @@ -0,0 +1,83 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2005-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +public class ChannelSubsystem extends ChannelSession{ + boolean xforwading=false; + boolean pty=false; + boolean want_reply=true; + String subsystem=""; + public void setXForwarding(boolean foo){ xforwading=foo; } + public void setPty(boolean foo){ pty=foo; } + public void setWantReply(boolean foo){ want_reply=foo; } + public void setSubsystem(String foo){ subsystem=foo; } + public void start() throws JSchException{ + Session _session=getSession(); + try{ + Request request; + if(xforwading){ + request=new RequestX11(); + request.request(_session, this); + } + if(pty){ + request=new RequestPtyReq(); + request.request(_session, this); + } + request=new RequestSubsystem(); + ((RequestSubsystem)request).request(_session, this, subsystem, want_reply); + } + catch(Exception e){ + if(e instanceof JSchException){ throw (JSchException)e; } + if(e instanceof Throwable) + throw new JSchException("ChannelSubsystem", (Throwable)e); + throw new JSchException("ChannelSubsystem"); + } + if(io.in!=null){ + thread=new Thread(this); + thread.setName("Subsystem for "+_session.host); + if(_session.daemon_thread){ + thread.setDaemon(_session.daemon_thread); + } + thread.start(); + } + } + + void init() throws JSchException { + io.setInputStream(getSession().in); + io.setOutputStream(getSession().out); + } + + public void setErrStream(java.io.OutputStream out){ + setExtOutputStream(out); + } + public java.io.InputStream getErrStream() throws java.io.IOException { + return getExtInputStream(); + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ChannelX11.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ChannelX11.java new file mode 100644 index 000000000..cf216cc0a --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ChannelX11.java @@ -0,0 +1,273 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +import java.net.*; + +class ChannelX11 extends Channel{ + + static private final int LOCAL_WINDOW_SIZE_MAX=0x20000; + static private final int LOCAL_MAXIMUM_PACKET_SIZE=0x4000; + + static private final int TIMEOUT=10*1000; + + private static String host="127.0.0.1"; + private static int port=6000; + + private boolean init=true; + + static byte[] cookie=null; + private static byte[] cookie_hex=null; + + private static java.util.Hashtable faked_cookie_pool=new java.util.Hashtable(); + private static java.util.Hashtable faked_cookie_hex_pool=new java.util.Hashtable(); + + private static byte[] table={0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39, + 0x61,0x62,0x63,0x64,0x65,0x66}; + + private Socket socket = null; + + static int revtable(byte foo){ + for(int i=0; i>>4)&0xf]; + bar[2*i+1]=table[(foo[i])&0xf]; + } + faked_cookie_hex_pool.put(session, bar); + foo=bar; + } + return foo; + } + } + + static void removeFakedCookie(Session session){ + synchronized(faked_cookie_hex_pool){ + faked_cookie_hex_pool.remove(session); + faked_cookie_pool.remove(session); + } + } + + ChannelX11(){ + super(); + + setLocalWindowSizeMax(LOCAL_WINDOW_SIZE_MAX); + setLocalWindowSize(LOCAL_WINDOW_SIZE_MAX); + setLocalPacketSize(LOCAL_MAXIMUM_PACKET_SIZE); + + type=Util.str2byte("x11"); + + connected=true; + /* + try{ + socket=Util.createSocket(host, port, TIMEOUT); + socket.setTcpNoDelay(true); + io=new IO(); + io.setInputStream(socket.getInputStream()); + io.setOutputStream(socket.getOutputStream()); + } + catch(Exception e){ + //System.err.println(e); + } + */ + } + + public void run(){ + + try{ + socket=Util.createSocket(host, port, TIMEOUT); + socket.setTcpNoDelay(true); + io=new IO(); + io.setInputStream(socket.getInputStream()); + io.setOutputStream(socket.getOutputStream()); + sendOpenConfirmation(); + } + catch(Exception e){ + sendOpenFailure(SSH_OPEN_ADMINISTRATIVELY_PROHIBITED); + close=true; + disconnect(); + return; + } + + thread=Thread.currentThread(); + Buffer buf=new Buffer(rmpsize); + Packet packet=new Packet(buf); + int i=0; + try{ + while(thread!=null && + io!=null && + io.in!=null){ + i=io.in.read(buf.buffer, + 14, + buf.buffer.length-14-Session.buffer_margin); + if(i<=0){ + eof(); + break; + } + if(close)break; + packet.reset(); + buf.putByte((byte)Session.SSH_MSG_CHANNEL_DATA); + buf.putInt(recipient); + buf.putInt(i); + buf.skip(i); + getSession().write(packet, this, i); + } + } + catch(Exception e){ + //System.err.println(e); + } + disconnect(); + } + + private byte[] cache=new byte[0]; + private byte[] addCache(byte[] foo, int s, int l){ + byte[] bar=new byte[cache.length+l]; + System.arraycopy(foo, s, bar, cache.length, l); + if(cache.length>0) + System.arraycopy(cache, 0, bar, 0, cache.length); + cache=bar; + return cache; + } + + void write(byte[] foo, int s, int l) throws java.io.IOException { + //if(eof_local)return; + + if(init){ + + Session _session=null; + try{ + _session=getSession(); + } + catch(JSchException e){ + throw new java.io.IOException(e.toString()); + } + + foo=addCache(foo, s, l); + s=0; + l=foo.length; + + if(l<9) + return; + + int plen=(foo[s+6]&0xff)*256+(foo[s+7]&0xff); + int dlen=(foo[s+8]&0xff)*256+(foo[s+9]&0xff); + + if((foo[s]&0xff)==0x42){ + } + else if((foo[s]&0xff)==0x6c){ + plen=((plen>>>8)&0xff)|((plen<<8)&0xff00); + dlen=((dlen>>>8)&0xff)|((dlen<<8)&0xff00); + } + else{ + // ?? + } + + if(l<12+plen+((-plen)&3)+dlen) + return; + + byte[] bar=new byte[dlen]; + System.arraycopy(foo, s+12+plen+((-plen)&3), bar, 0, dlen); + byte[] faked_cookie=null; + + synchronized(faked_cookie_pool){ + faked_cookie=(byte[])faked_cookie_pool.get(_session); + } + + /* +System.err.print("faked_cookie: "); +for(int i=0; i "); //dump(H, 0, H.length); + + i=0; + j=0; + j=((K_S[i++]<<24)&0xff000000)|((K_S[i++]<<16)&0x00ff0000)| + ((K_S[i++]<<8)&0x0000ff00)|((K_S[i++])&0x000000ff); + String alg=Util.byte2str(K_S, i, j); + i+=j; + + boolean result=false; + + if(alg.equals("ssh-rsa")){ + byte[] tmp; + byte[] ee; + byte[] n; + + type=RSA; + + j=((K_S[i++]<<24)&0xff000000)|((K_S[i++]<<16)&0x00ff0000)| + ((K_S[i++]<<8)&0x0000ff00)|((K_S[i++])&0x000000ff); + tmp=new byte[j]; System.arraycopy(K_S, i, tmp, 0, j); i+=j; + ee=tmp; + j=((K_S[i++]<<24)&0xff000000)|((K_S[i++]<<16)&0x00ff0000)| + ((K_S[i++]<<8)&0x0000ff00)|((K_S[i++])&0x000000ff); + tmp=new byte[j]; System.arraycopy(K_S, i, tmp, 0, j); i+=j; + n=tmp; + +// SignatureRSA sig=new SignatureRSA(); +// sig.init(); + + SignatureRSA sig=null; + try{ + Class c=Class.forName(session.getConfig("signature.rsa")); + sig=(SignatureRSA)(c.newInstance()); + sig.init(); + } + catch(Exception e){ + System.err.println(e); + } + + sig.setPubKey(ee, n); + sig.update(H); + result=sig.verify(sig_of_H); + + if(JSch.getLogger().isEnabled(Logger.INFO)){ + JSch.getLogger().log(Logger.INFO, + "ssh_rsa_verify: signature "+result); + } + + } + else if(alg.equals("ssh-dss")){ + byte[] q=null; + byte[] tmp; + byte[] p; + byte[] g; + + type=DSS; + + j=((K_S[i++]<<24)&0xff000000)|((K_S[i++]<<16)&0x00ff0000)| + ((K_S[i++]<<8)&0x0000ff00)|((K_S[i++])&0x000000ff); + tmp=new byte[j]; System.arraycopy(K_S, i, tmp, 0, j); i+=j; + p=tmp; + j=((K_S[i++]<<24)&0xff000000)|((K_S[i++]<<16)&0x00ff0000)| + ((K_S[i++]<<8)&0x0000ff00)|((K_S[i++])&0x000000ff); + tmp=new byte[j]; System.arraycopy(K_S, i, tmp, 0, j); i+=j; + q=tmp; + j=((K_S[i++]<<24)&0xff000000)|((K_S[i++]<<16)&0x00ff0000)| + ((K_S[i++]<<8)&0x0000ff00)|((K_S[i++])&0x000000ff); + tmp=new byte[j]; System.arraycopy(K_S, i, tmp, 0, j); i+=j; + g=tmp; + j=((K_S[i++]<<24)&0xff000000)|((K_S[i++]<<16)&0x00ff0000)| + ((K_S[i++]<<8)&0x0000ff00)|((K_S[i++])&0x000000ff); + tmp=new byte[j]; System.arraycopy(K_S, i, tmp, 0, j); i+=j; + f=tmp; +// SignatureDSA sig=new SignatureDSA(); +// sig.init(); + SignatureDSA sig=null; + try{ + Class c=Class.forName(session.getConfig("signature.dss")); + sig=(SignatureDSA)(c.newInstance()); + sig.init(); + } + catch(Exception e){ + System.err.println(e); + } + sig.setPubKey(f, p, q, g); + sig.update(H); + result=sig.verify(sig_of_H); + + if(JSch.getLogger().isEnabled(Logger.INFO)){ + JSch.getLogger().log(Logger.INFO, + "ssh_dss_verify: signature "+result); + } + + } + else{ + System.err.println("unknown alg"); + } + state=STATE_END; + return result; + } + return false; + } + + public String getKeyType(){ + if(type==DSS) return "DSA"; + return "RSA"; + } + + public int getState(){return state; } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/DHG14.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/DHG14.java new file mode 100644 index 000000000..3d0ef6fc1 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/DHG14.java @@ -0,0 +1,310 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +public class DHG14 extends KeyExchange{ + + static final byte[] g={ 2 }; + static final byte[] p={ +(byte)0x00, +(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF, +(byte)0xC9,(byte)0x0F,(byte)0xDA,(byte)0xA2,(byte)0x21,(byte)0x68,(byte)0xC2,(byte)0x34, +(byte)0xC4,(byte)0xC6,(byte)0x62,(byte)0x8B,(byte)0x80,(byte)0xDC,(byte)0x1C,(byte)0xD1, +(byte)0x29,(byte)0x02,(byte)0x4E,(byte)0x08,(byte)0x8A,(byte)0x67,(byte)0xCC,(byte)0x74, +(byte)0x02,(byte)0x0B,(byte)0xBE,(byte)0xA6,(byte)0x3B,(byte)0x13,(byte)0x9B,(byte)0x22, +(byte)0x51,(byte)0x4A,(byte)0x08,(byte)0x79,(byte)0x8E,(byte)0x34,(byte)0x04,(byte)0xDD, +(byte)0xEF,(byte)0x95,(byte)0x19,(byte)0xB3,(byte)0xCD,(byte)0x3A,(byte)0x43,(byte)0x1B, +(byte)0x30,(byte)0x2B,(byte)0x0A,(byte)0x6D,(byte)0xF2,(byte)0x5F,(byte)0x14,(byte)0x37, +(byte)0x4F,(byte)0xE1,(byte)0x35,(byte)0x6D,(byte)0x6D,(byte)0x51,(byte)0xC2,(byte)0x45, +(byte)0xE4,(byte)0x85,(byte)0xB5,(byte)0x76,(byte)0x62,(byte)0x5E,(byte)0x7E,(byte)0xC6, +(byte)0xF4,(byte)0x4C,(byte)0x42,(byte)0xE9,(byte)0xA6,(byte)0x37,(byte)0xED,(byte)0x6B, +(byte)0x0B,(byte)0xFF,(byte)0x5C,(byte)0xB6,(byte)0xF4,(byte)0x06,(byte)0xB7,(byte)0xED, +(byte)0xEE,(byte)0x38,(byte)0x6B,(byte)0xFB,(byte)0x5A,(byte)0x89,(byte)0x9F,(byte)0xA5, +(byte)0xAE,(byte)0x9F,(byte)0x24,(byte)0x11,(byte)0x7C,(byte)0x4B,(byte)0x1F,(byte)0xE6, +(byte)0x49,(byte)0x28,(byte)0x66,(byte)0x51,(byte)0xEC,(byte)0xE4,(byte)0x5B,(byte)0x3D, +(byte)0xC2,(byte)0x00,(byte)0x7C,(byte)0xB8,(byte)0xA1,(byte)0x63,(byte)0xBF,(byte)0x05, +(byte)0x98,(byte)0xDA,(byte)0x48,(byte)0x36,(byte)0x1C,(byte)0x55,(byte)0xD3,(byte)0x9A, +(byte)0x69,(byte)0x16,(byte)0x3F,(byte)0xA8,(byte)0xFD,(byte)0x24,(byte)0xCF,(byte)0x5F, +(byte)0x83,(byte)0x65,(byte)0x5D,(byte)0x23,(byte)0xDC,(byte)0xA3,(byte)0xAD,(byte)0x96, +(byte)0x1C,(byte)0x62,(byte)0xF3,(byte)0x56,(byte)0x20,(byte)0x85,(byte)0x52,(byte)0xBB, +(byte)0x9E,(byte)0xD5,(byte)0x29,(byte)0x07,(byte)0x70,(byte)0x96,(byte)0x96,(byte)0x6D, +(byte)0x67,(byte)0x0C,(byte)0x35,(byte)0x4E,(byte)0x4A,(byte)0xBC,(byte)0x98,(byte)0x04, +(byte)0xF1,(byte)0x74,(byte)0x6C,(byte)0x08,(byte)0xCA,(byte)0x18,(byte)0x21,(byte)0x7C, +(byte)0x32,(byte)0x90,(byte)0x5E,(byte)0x46,(byte)0x2E,(byte)0x36,(byte)0xCE,(byte)0x3B, +(byte)0xE3,(byte)0x9E,(byte)0x77,(byte)0x2C,(byte)0x18,(byte)0x0E,(byte)0x86,(byte)0x03, +(byte)0x9B,(byte)0x27,(byte)0x83,(byte)0xA2,(byte)0xEC,(byte)0x07,(byte)0xA2,(byte)0x8F, +(byte)0xB5,(byte)0xC5,(byte)0x5D,(byte)0xF0,(byte)0x6F,(byte)0x4C,(byte)0x52,(byte)0xC9, +(byte)0xDE,(byte)0x2B,(byte)0xCB,(byte)0xF6,(byte)0x95,(byte)0x58,(byte)0x17,(byte)0x18, +(byte)0x39,(byte)0x95,(byte)0x49,(byte)0x7C,(byte)0xEA,(byte)0x95,(byte)0x6A,(byte)0xE5, +(byte)0x15,(byte)0xD2,(byte)0x26,(byte)0x18,(byte)0x98,(byte)0xFA,(byte)0x05,(byte)0x10, +(byte)0x15,(byte)0x72,(byte)0x8E,(byte)0x5A,(byte)0x8A,(byte)0xAC,(byte)0xAA,(byte)0x68, +(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF +}; + + private static final int SSH_MSG_KEXDH_INIT= 30; + private static final int SSH_MSG_KEXDH_REPLY= 31; + + static final int RSA=0; + static final int DSS=1; + private int type=0; + + private int state; + + DH dh; + + byte[] V_S; + byte[] V_C; + byte[] I_S; + byte[] I_C; + + byte[] e; + + private Buffer buf; + private Packet packet; + + public void init(Session session, + byte[] V_S, byte[] V_C, byte[] I_S, byte[] I_C) throws Exception{ + this.session=session; + this.V_S=V_S; + this.V_C=V_C; + this.I_S=I_S; + this.I_C=I_C; + + try{ + Class c=Class.forName(session.getConfig("sha-1")); + sha=(HASH)(c.newInstance()); + sha.init(); + } + catch(Exception e){ + System.err.println(e); + } + + buf=new Buffer(); + packet=new Packet(buf); + + try{ + Class c=Class.forName(session.getConfig("dh")); + dh=(DH)(c.newInstance()); + dh.init(); + } + catch(Exception e){ + //System.err.println(e); + throw e; + } + + dh.setP(p); + dh.setG(g); + // The client responds with: + // byte SSH_MSG_KEXDH_INIT(30) + // mpint e <- g^x mod p + // x is a random number (1 < x < (p-1)/2) + + e=dh.getE(); + packet.reset(); + buf.putByte((byte)SSH_MSG_KEXDH_INIT); + buf.putMPInt(e); + + if(V_S==null){ // This is a really ugly hack for Session.checkKexes ;-( + return; + } + + session.write(packet); + + if(JSch.getLogger().isEnabled(Logger.INFO)){ + JSch.getLogger().log(Logger.INFO, + "SSH_MSG_KEXDH_INIT sent"); + JSch.getLogger().log(Logger.INFO, + "expecting SSH_MSG_KEXDH_REPLY"); + } + + state=SSH_MSG_KEXDH_REPLY; + } + + public boolean next(Buffer _buf) throws Exception{ + int i,j; + + switch(state){ + case SSH_MSG_KEXDH_REPLY: + // The server responds with: + // byte SSH_MSG_KEXDH_REPLY(31) + // string server public host key and certificates (K_S) + // mpint f + // string signature of H + j=_buf.getInt(); + j=_buf.getByte(); + j=_buf.getByte(); + if(j!=31){ + System.err.println("type: must be 31 "+j); + return false; + } + + K_S=_buf.getString(); + // K_S is server_key_blob, which includes .... + // string ssh-dss + // impint p of dsa + // impint q of dsa + // impint g of dsa + // impint pub_key of dsa + //System.err.print("K_S: "); //dump(K_S, 0, K_S.length); + byte[] f=_buf.getMPInt(); + byte[] sig_of_H=_buf.getString(); + + dh.setF(f); + K=dh.getK(); + + //The hash H is computed as the HASH hash of the concatenation of the + //following: + // string V_C, the client's version string (CR and NL excluded) + // string V_S, the server's version string (CR and NL excluded) + // string I_C, the payload of the client's SSH_MSG_KEXINIT + // string I_S, the payload of the server's SSH_MSG_KEXINIT + // string K_S, the host key + // mpint e, exchange value sent by the client + // mpint f, exchange value sent by the server + // mpint K, the shared secret + // This value is called the exchange hash, and it is used to authenti- + // cate the key exchange. + buf.reset(); + buf.putString(V_C); buf.putString(V_S); + buf.putString(I_C); buf.putString(I_S); + buf.putString(K_S); + buf.putMPInt(e); buf.putMPInt(f); + buf.putMPInt(K); + byte[] foo=new byte[buf.getLength()]; + buf.getByte(foo); + sha.update(foo, 0, foo.length); + H=sha.digest(); + //System.err.print("H -> "); //dump(H, 0, H.length); + + i=0; + j=0; + j=((K_S[i++]<<24)&0xff000000)|((K_S[i++]<<16)&0x00ff0000)| + ((K_S[i++]<<8)&0x0000ff00)|((K_S[i++])&0x000000ff); + String alg=Util.byte2str(K_S, i, j); + i+=j; + + boolean result=false; + + if(alg.equals("ssh-rsa")){ + byte[] tmp; + byte[] ee; + byte[] n; + + type=RSA; + + j=((K_S[i++]<<24)&0xff000000)|((K_S[i++]<<16)&0x00ff0000)| + ((K_S[i++]<<8)&0x0000ff00)|((K_S[i++])&0x000000ff); + tmp=new byte[j]; System.arraycopy(K_S, i, tmp, 0, j); i+=j; + ee=tmp; + j=((K_S[i++]<<24)&0xff000000)|((K_S[i++]<<16)&0x00ff0000)| + ((K_S[i++]<<8)&0x0000ff00)|((K_S[i++])&0x000000ff); + tmp=new byte[j]; System.arraycopy(K_S, i, tmp, 0, j); i+=j; + n=tmp; + + SignatureRSA sig=null; + try{ + Class c=Class.forName(session.getConfig("signature.rsa")); + sig=(SignatureRSA)(c.newInstance()); + sig.init(); + } + catch(Exception e){ + System.err.println(e); + } + + sig.setPubKey(ee, n); + sig.update(H); + result=sig.verify(sig_of_H); + + if(JSch.getLogger().isEnabled(Logger.INFO)){ + JSch.getLogger().log(Logger.INFO, + "ssh_rsa_verify: signature "+result); + } + + } + else if(alg.equals("ssh-dss")){ + byte[] q=null; + byte[] tmp; + byte[] p; + byte[] g; + + type=DSS; + + j=((K_S[i++]<<24)&0xff000000)|((K_S[i++]<<16)&0x00ff0000)| + ((K_S[i++]<<8)&0x0000ff00)|((K_S[i++])&0x000000ff); + tmp=new byte[j]; System.arraycopy(K_S, i, tmp, 0, j); i+=j; + p=tmp; + j=((K_S[i++]<<24)&0xff000000)|((K_S[i++]<<16)&0x00ff0000)| + ((K_S[i++]<<8)&0x0000ff00)|((K_S[i++])&0x000000ff); + tmp=new byte[j]; System.arraycopy(K_S, i, tmp, 0, j); i+=j; + q=tmp; + j=((K_S[i++]<<24)&0xff000000)|((K_S[i++]<<16)&0x00ff0000)| + ((K_S[i++]<<8)&0x0000ff00)|((K_S[i++])&0x000000ff); + tmp=new byte[j]; System.arraycopy(K_S, i, tmp, 0, j); i+=j; + g=tmp; + j=((K_S[i++]<<24)&0xff000000)|((K_S[i++]<<16)&0x00ff0000)| + ((K_S[i++]<<8)&0x0000ff00)|((K_S[i++])&0x000000ff); + tmp=new byte[j]; System.arraycopy(K_S, i, tmp, 0, j); i+=j; + f=tmp; + + SignatureDSA sig=null; + try{ + Class c=Class.forName(session.getConfig("signature.dss")); + sig=(SignatureDSA)(c.newInstance()); + sig.init(); + } + catch(Exception e){ + System.err.println(e); + } + sig.setPubKey(f, p, q, g); + sig.update(H); + result=sig.verify(sig_of_H); + + if(JSch.getLogger().isEnabled(Logger.INFO)){ + JSch.getLogger().log(Logger.INFO, + "ssh_dss_verify: signature "+result); + } + + } + else{ + System.err.println("unknown alg"); + } + state=STATE_END; + return result; + } + return false; + } + + public String getKeyType(){ + if(type==DSS) return "DSA"; + return "RSA"; + } + + public int getState(){return state; } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/DHGEX.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/DHGEX.java new file mode 100644 index 000000000..c1b4f3baf --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/DHGEX.java @@ -0,0 +1,340 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +public class DHGEX extends KeyExchange{ + + private static final int SSH_MSG_KEX_DH_GEX_GROUP= 31; + private static final int SSH_MSG_KEX_DH_GEX_INIT= 32; + private static final int SSH_MSG_KEX_DH_GEX_REPLY= 33; + private static final int SSH_MSG_KEX_DH_GEX_REQUEST= 34; + + static int min=1024; + +// static int min=512; + static int preferred=1024; + static int max=1024; + +// static int preferred=1024; +// static int max=2000; + + static final int RSA=0; + static final int DSS=1; + private int type=0; + + private int state; + +// com.jcraft.jsch.DH dh; + DH dh; + + byte[] V_S; + byte[] V_C; + byte[] I_S; + byte[] I_C; + + private Buffer buf; + private Packet packet; + + private byte[] p; + private byte[] g; + private byte[] e; + //private byte[] f; + + public void init(Session session, + byte[] V_S, byte[] V_C, byte[] I_S, byte[] I_C) throws Exception{ + this.session=session; + this.V_S=V_S; + this.V_C=V_C; + this.I_S=I_S; + this.I_C=I_C; + + try{ + Class c=Class.forName(session.getConfig("sha-1")); + sha=(HASH)(c.newInstance()); + sha.init(); + } + catch(Exception e){ + System.err.println(e); + } + + buf=new Buffer(); + packet=new Packet(buf); + + try{ + Class c=Class.forName(session.getConfig("dh")); + dh=(com.jcraft.jsch.DH)(c.newInstance()); + dh.init(); + } + catch(Exception e){ +// System.err.println(e); + throw e; + } + + packet.reset(); + buf.putByte((byte)SSH_MSG_KEX_DH_GEX_REQUEST); + buf.putInt(min); + buf.putInt(preferred); + buf.putInt(max); + session.write(packet); + + if(JSch.getLogger().isEnabled(Logger.INFO)){ + JSch.getLogger().log(Logger.INFO, + "SSH_MSG_KEX_DH_GEX_REQUEST("+min+"<"+preferred+"<"+max+") sent"); + JSch.getLogger().log(Logger.INFO, + "expecting SSH_MSG_KEX_DH_GEX_GROUP"); + } + + state=SSH_MSG_KEX_DH_GEX_GROUP; + } + + public boolean next(Buffer _buf) throws Exception{ + int i,j; + switch(state){ + case SSH_MSG_KEX_DH_GEX_GROUP: + // byte SSH_MSG_KEX_DH_GEX_GROUP(31) + // mpint p, safe prime + // mpint g, generator for subgroup in GF (p) + _buf.getInt(); + _buf.getByte(); + j=_buf.getByte(); + if(j!=SSH_MSG_KEX_DH_GEX_GROUP){ + System.err.println("type: must be SSH_MSG_KEX_DH_GEX_GROUP "+j); + return false; + } + + p=_buf.getMPInt(); + g=_buf.getMPInt(); + /* +for(int iii=0; iii "); dump(H, 0, H.length); + + i=0; + j=0; + j=((K_S[i++]<<24)&0xff000000)|((K_S[i++]<<16)&0x00ff0000)| + ((K_S[i++]<<8)&0x0000ff00)|((K_S[i++])&0x000000ff); + String alg=Util.byte2str(K_S, i, j); + i+=j; + + boolean result=false; + if(alg.equals("ssh-rsa")){ + byte[] tmp; + byte[] ee; + byte[] n; + + type=RSA; + + j=((K_S[i++]<<24)&0xff000000)|((K_S[i++]<<16)&0x00ff0000)| + ((K_S[i++]<<8)&0x0000ff00)|((K_S[i++])&0x000000ff); + tmp=new byte[j]; System.arraycopy(K_S, i, tmp, 0, j); i+=j; + ee=tmp; + j=((K_S[i++]<<24)&0xff000000)|((K_S[i++]<<16)&0x00ff0000)| + ((K_S[i++]<<8)&0x0000ff00)|((K_S[i++])&0x000000ff); + tmp=new byte[j]; System.arraycopy(K_S, i, tmp, 0, j); i+=j; + n=tmp; + +// SignatureRSA sig=new SignatureRSA(); +// sig.init(); + + SignatureRSA sig=null; + try{ + Class c=Class.forName(session.getConfig("signature.rsa")); + sig=(SignatureRSA)(c.newInstance()); + sig.init(); + } + catch(Exception e){ + System.err.println(e); + } + + sig.setPubKey(ee, n); + sig.update(H); + result=sig.verify(sig_of_H); + + if(JSch.getLogger().isEnabled(Logger.INFO)){ + JSch.getLogger().log(Logger.INFO, + "ssh_rsa_verify: signature "+result); + } + + } + else if(alg.equals("ssh-dss")){ + byte[] q=null; + byte[] tmp; + + type=DSS; + + j=((K_S[i++]<<24)&0xff000000)|((K_S[i++]<<16)&0x00ff0000)| + ((K_S[i++]<<8)&0x0000ff00)|((K_S[i++])&0x000000ff); + tmp=new byte[j]; System.arraycopy(K_S, i, tmp, 0, j); i+=j; + p=tmp; + j=((K_S[i++]<<24)&0xff000000)|((K_S[i++]<<16)&0x00ff0000)| + ((K_S[i++]<<8)&0x0000ff00)|((K_S[i++])&0x000000ff); + tmp=new byte[j]; System.arraycopy(K_S, i, tmp, 0, j); i+=j; + q=tmp; + j=((K_S[i++]<<24)&0xff000000)|((K_S[i++]<<16)&0x00ff0000)| + ((K_S[i++]<<8)&0x0000ff00)|((K_S[i++])&0x000000ff); + tmp=new byte[j]; System.arraycopy(K_S, i, tmp, 0, j); i+=j; + g=tmp; + j=((K_S[i++]<<24)&0xff000000)|((K_S[i++]<<16)&0x00ff0000)| + ((K_S[i++]<<8)&0x0000ff00)|((K_S[i++])&0x000000ff); + tmp=new byte[j]; System.arraycopy(K_S, i, tmp, 0, j); i+=j; + f=tmp; + +// SignatureDSA sig=new SignatureDSA(); +// sig.init(); + + SignatureDSA sig=null; + try{ + Class c=Class.forName(session.getConfig("signature.dss")); + sig=(SignatureDSA)(c.newInstance()); + sig.init(); + } + catch(Exception e){ + System.err.println(e); + } + + sig.setPubKey(f, p, q, g); + sig.update(H); + result=sig.verify(sig_of_H); + + if(JSch.getLogger().isEnabled(Logger.INFO)){ + JSch.getLogger().log(Logger.INFO, + "ssh_dss_verify: signature "+result); + } + + } + else{ + System.err.println("unknown alg"); + } + state=STATE_END; + return result; + } + return false; + } + + public String getKeyType(){ + if(type==DSS) return "DSA"; + return "RSA"; + } + + public int getState(){return state; } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ForwardedTCPIPDaemon.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ForwardedTCPIPDaemon.java new file mode 100644 index 000000000..3cccb05ad --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ForwardedTCPIPDaemon.java @@ -0,0 +1,36 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; +import java.io.*; + +public interface ForwardedTCPIPDaemon extends Runnable{ + void setChannel(ChannelForwardedTCPIP channel, InputStream in, OutputStream out); + void setArg(Object[] arg); +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/GSSContext.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/GSSContext.java new file mode 100644 index 000000000..167d53f79 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/GSSContext.java @@ -0,0 +1,38 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2004-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +public interface GSSContext{ + public void create(String user, String host) throws JSchException; + public boolean isEstablished(); + public byte[] init(byte[] token, int s, int l) throws JSchException; + public byte[] getMIC(byte[] message, int s, int l); + public void dispose(); +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/HASH.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/HASH.java new file mode 100644 index 000000000..ebdccfbc7 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/HASH.java @@ -0,0 +1,37 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +public interface HASH{ + void init() throws Exception; + int getBlockSize(); + void update(byte[] foo, int start, int len) throws Exception; + byte[] digest() throws Exception; +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/HostKey.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/HostKey.java new file mode 100644 index 000000000..f8501c826 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/HostKey.java @@ -0,0 +1,104 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +public class HostKey{ + private static final byte[] sshdss=Util.str2byte("ssh-dss"); + private static final byte[] sshrsa=Util.str2byte("ssh-rsa"); + + protected static final int GUESS=0; + public static final int SSHDSS=1; + public static final int SSHRSA=2; + static final int UNKNOWN=3; + + protected String host; + protected int type; + protected byte[] key; + + public HostKey(String host, byte[] key) throws JSchException { + this(host, GUESS, key); + } + + public HostKey(String host, int type, byte[] key) throws JSchException { + this.host=host; + if(type==GUESS){ + if(key[8]=='d'){ this.type=SSHDSS; } + else if(key[8]=='r'){ this.type=SSHRSA; } + else { throw new JSchException("invalid key type");} + } + else{ + this.type=type; + } + this.key=key; + } + + public String getHost(){ return host; } + public String getType(){ + if(type==SSHDSS){ return Util.byte2str(sshdss); } + if(type==SSHRSA){ return Util.byte2str(sshrsa);} + return "UNKNOWN"; + } + public String getKey(){ + return Util.byte2str(Util.toBase64(key, 0, key.length)); + } + public String getFingerPrint(JSch jsch){ + HASH hash=null; + try{ + Class c=Class.forName(jsch.getConfig("md5")); + hash=(HASH)(c.newInstance()); + } + catch(Exception e){ System.err.println("getFingerPrint: "+e); } + return Util.getFingerPrint(hash, key); + } + + boolean isMatched(String _host){ + return isIncluded(_host); + } + + private boolean isIncluded(String _host){ + int i=0; + String hosts=this.host; + int hostslen=hosts.length(); + int hostlen=_host.length(); + int j; + while(i0); + } + + void out_close(){ + try{ + if(out!=null && !out_dontclose) out.close(); + out=null; + } + catch(Exception ee){} + } + + public void close(){ + try{ + if(in!=null && !in_dontclose) in.close(); + in=null; + } + catch(Exception ee){} + + out_close(); + + try{ + if(out_ext!=null && !out_ext_dontclose) out_ext.close(); + out_ext=null; + } + catch(Exception ee){} + } + + /* + public void finalize() throws Throwable{ + try{ + if(in!=null) in.close(); + } + catch(Exception ee){} + try{ + if(out!=null) out.close(); + } + catch(Exception ee){} + try{ + if(out_ext!=null) out_ext.close(); + } + catch(Exception ee){} + } + */ +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/Identity.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/Identity.java new file mode 100644 index 000000000..338f19cb7 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/Identity.java @@ -0,0 +1,41 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +public interface Identity{ + public boolean setPassphrase(byte[] passphrase) throws JSchException; + public byte[] getPublicKeyBlob(); + public byte[] getSignature(byte[] data); + public boolean decrypt(); + public String getAlgName(); + public String getName(); + public boolean isEncrypted(); + public void clear(); +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/IdentityFile.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/IdentityFile.java new file mode 100644 index 000000000..a4758ff05 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/IdentityFile.java @@ -0,0 +1,918 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +import java.io.*; + +class IdentityFile implements Identity{ + String identity; + byte[] key; + byte[] iv; + private JSch jsch; + private HASH hash; + private byte[] encoded_data; + + private Cipher cipher; + + // DSA + private byte[] P_array; + private byte[] Q_array; + private byte[] G_array; + private byte[] pub_array; + private byte[] prv_array; + + // RSA + private byte[] n_array; // modulus + private byte[] e_array; // public exponent + private byte[] d_array; // private exponent + +// private String algname="ssh-dss"; + private String algname="ssh-rsa"; + + private static final int ERROR=0; + private static final int RSA=1; + private static final int DSS=2; + private static final int UNKNOWN=3; + + private static final int OPENSSH=0; + private static final int FSECURE=1; + private static final int PUTTY=2; + + private int type=ERROR; + private int keytype=OPENSSH; + + private byte[] publickeyblob=null; + + private boolean encrypted=true; + + static IdentityFile newInstance(String prvfile, String pubfile, JSch jsch) throws JSchException{ + byte[] prvkey=null; + byte[] pubkey=null; + + File file=null; + FileInputStream fis=null; + try{ + file=new File(prvfile); + fis=new FileInputStream(prvfile); + prvkey=new byte[(int)(file.length())]; + int len=0; + while(true){ + int i=fis.read(prvkey, len, prvkey.length-len); + if(i<=0) + break; + len+=i; + } + fis.close(); + } + catch(Exception e){ + try{ if(fis!=null) fis.close();} + catch(Exception ee){} + if(e instanceof Throwable) + throw new JSchException(e.toString(), (Throwable)e); + throw new JSchException(e.toString()); + } + + String _pubfile=pubfile; + if(pubfile==null){ + _pubfile=prvfile+".pub"; + } + + try{ + file=new File(_pubfile); + fis = new FileInputStream(_pubfile); + pubkey=new byte[(int)(file.length())]; + int len=0; + while(true){ + int i=fis.read(pubkey, len, pubkey.length-len); + if(i<=0) + break; + len+=i; + } + fis.close(); + } + catch(Exception e){ + try{ if(fis!=null) fis.close();} + catch(Exception ee){} + if(pubfile!=null){ + // The pubfile is explicitry given, but not accessible. + if(e instanceof Throwable) + throw new JSchException(e.toString(), (Throwable)e); + throw new JSchException(e.toString()); + } + } + return newInstance(prvfile, prvkey, pubkey, jsch); + } + + static IdentityFile newInstance(String name, byte[] prvkey, byte[] pubkey, JSch jsch) throws JSchException{ + try{ + return new IdentityFile(name, prvkey, pubkey, jsch); + } + finally{ + Util.bzero(prvkey); + } + } + + private IdentityFile(String name, byte[] prvkey, byte[] pubkey, JSch jsch) throws JSchException{ + this.identity=name; + this.jsch=jsch; + + /* TODO: IdentityFile should use KeyPair. + * The following logic exists also in KeyPair. It is redundant. + */ + try{ + Class c; + c=Class.forName((String)jsch.getConfig("3des-cbc")); + cipher=(Cipher)(c.newInstance()); + key=new byte[cipher.getBlockSize()]; // 24 + iv=new byte[cipher.getIVSize()]; // 8 + c=Class.forName((String)jsch.getConfig("md5")); + hash=(HASH)(c.newInstance()); + hash.init(); + + byte[] buf=prvkey; + int len=buf.length; + + int i=0; + + while(i4 && // FSecure + encoded_data[0]==(byte)0x3f && + encoded_data[1]==(byte)0x6f && + encoded_data[2]==(byte)0xf9 && + encoded_data[3]==(byte)0xeb){ + + Buffer _buf=new Buffer(encoded_data); + _buf.getInt(); // 0x3f6ff9be + _buf.getInt(); + byte[]_type=_buf.getString(); + //System.err.println("type: "+new String(_type)); + byte[] _cipher=_buf.getString(); + String cipher=Util.byte2str(_cipher); + //System.err.println("cipher: "+cipher); + if(cipher.equals("3des-cbc")){ + _buf.getInt(); + byte[] foo=new byte[encoded_data.length-_buf.getOffSet()]; + _buf.getByte(foo); + encoded_data=foo; + encrypted=true; + throw new JSchException("unknown privatekey format: "+identity); + } + else if(cipher.equals("none")){ + _buf.getInt(); + //_buf.getInt(); + + encrypted=false; + + byte[] foo=new byte[encoded_data.length-_buf.getOffSet()]; + _buf.getByte(foo); + encoded_data=foo; + } + + } + + if(pubkey==null){ + return; + } + + buf=pubkey; + len=buf.length; + + if(buf.length>4 && // FSecure's public key + buf[0]=='-' && buf[1]=='-' && buf[2]=='-' && buf[3]=='-'){ + i=0; + do{i++;}while(len>i && buf[i]!=0x0a); + if(len<=i) return; + while(i8){ + if(publickeyblob[8]=='d'){ + type=DSS; + } + else if(publickeyblob[8]=='r'){ + type=RSA; + } + } + } + else{ + if(buf[0]!='s'|| buf[1]!='s'|| buf[2]!='h'|| buf[3]!='-') return; + i=0; + while(i=len) return; + start=i; + while(i 8 ? 8: iv.length); + tmp=hash.digest(); + System.arraycopy(tmp, 0, hn, index, tmp.length); + index+=tmp.length; + } + System.arraycopy(hn, 0, key, 0, key.length); + } + else if(keytype==FSECURE){ + for(int index=0; index+hsize<=hn.length;){ + if(tmp!=null){ hash.update(tmp, 0, tmp.length); } + hash.update(passphrase, 0, passphrase.length); + tmp=hash.digest(); + System.arraycopy(tmp, 0, hn, index, tmp.length); + index+=tmp.length; + } + System.arraycopy(hn, 0, key, 0, key.length); + } + Util.bzero(passphrase); + } + if(decrypt()){ + encrypted=false; + return true; + } + P_array=Q_array=G_array=pub_array=prv_array=null; + return false; + } + catch(Exception e){ + if(e instanceof JSchException) throw (JSchException)e; + if(e instanceof Throwable) + throw new JSchException(e.toString(), (Throwable)e); + throw new JSchException(e.toString()); + } + } + + public byte[] getPublicKeyBlob(){ + if(publickeyblob!=null) return publickeyblob; + if(type==RSA) return getPublicKeyBlob_rsa(); + return getPublicKeyBlob_dss(); + } + + byte[] getPublicKeyBlob_rsa(){ + if(e_array==null) return null; + Buffer buf=new Buffer("ssh-rsa".length()+4+ + e_array.length+4+ + n_array.length+4); + buf.putString(Util.str2byte("ssh-rsa")); + buf.putString(e_array); + buf.putString(n_array); + return buf.buffer; + } + + byte[] getPublicKeyBlob_dss(){ + if(P_array==null) return null; + Buffer buf=new Buffer("ssh-dss".length()+4+ + P_array.length+4+ + Q_array.length+4+ + G_array.length+4+ + pub_array.length+4); + buf.putString(Util.str2byte("ssh-dss")); + buf.putString(P_array); + buf.putString(Q_array); + buf.putString(G_array); + buf.putString(pub_array); + return buf.buffer; + } + + public byte[] getSignature(byte[] data){ + if(type==RSA) return getSignature_rsa(data); + return getSignature_dss(data); + } + + byte[] getSignature_rsa(byte[] data){ + try{ + Class c=Class.forName((String)jsch.getConfig("signature.rsa")); + SignatureRSA rsa=(SignatureRSA)(c.newInstance()); + + rsa.init(); + rsa.setPrvKey(d_array, n_array); + + rsa.update(data); + byte[] sig = rsa.sign(); + Buffer buf=new Buffer("ssh-rsa".length()+4+ + sig.length+4); + buf.putString(Util.str2byte("ssh-rsa")); + buf.putString(sig); + return buf.buffer; + } + catch(Exception e){ + } + return null; + } + + byte[] getSignature_dss(byte[] data){ +/* + byte[] foo; + int i; + System.err.print("P "); + foo=P_array; + for(i=0; i0){ length=(length<<8)+(plain[index++]&0xff); } + } + + if(plain[index]!=0x02)return false; + index++; // INTEGER + length=plain[index++]&0xff; + if((length&0x80)!=0){ + int foo=length&0x7f; length=0; + while(foo-->0){ length=(length<<8)+(plain[index++]&0xff); } + } + index+=length; + +//System.err.println("int: len="+length); +//System.err.print(Integer.toHexString(plain[index-1]&0xff)+":"); +//System.err.println(""); + + index++; + length=plain[index++]&0xff; + if((length&0x80)!=0){ + int foo=length&0x7f; length=0; + while(foo-->0){ length=(length<<8)+(plain[index++]&0xff); } + } + n_array=new byte[length]; + System.arraycopy(plain, index, n_array, 0, length); + index+=length; +/* +System.err.println("int: N len="+length); +for(int i=0; i0){ length=(length<<8)+(plain[index++]&0xff); } + } + e_array=new byte[length]; + System.arraycopy(plain, index, e_array, 0, length); + index+=length; +/* +System.err.println("int: E len="+length); +for(int i=0; i0){ length=(length<<8)+(plain[index++]&0xff); } + } + d_array=new byte[length]; + System.arraycopy(plain, index, d_array, 0, length); + index+=length; +/* +System.err.println("int: D len="+length); +for(int i=0; i0){ length=(length<<8)+(plain[index++]&0xff); } + } + p_array=new byte[length]; + System.arraycopy(plain, index, p_array, 0, length); + index+=length; +/* +System.err.println("int: P len="+length); +for(int i=0; i0){ length=(length<<8)+(plain[index++]&0xff); } + } + q_array=new byte[length]; + System.arraycopy(plain, index, q_array, 0, length); + index+=length; +/* +System.err.println("int: q len="+length); +for(int i=0; i0){ length=(length<<8)+(plain[index++]&0xff); } + } + dmp1_array=new byte[length]; + System.arraycopy(plain, index, dmp1_array, 0, length); + index+=length; +/* +System.err.println("int: dmp1 len="+length); +for(int i=0; i0){ length=(length<<8)+(plain[index++]&0xff); } + } + dmq1_array=new byte[length]; + System.arraycopy(plain, index, dmq1_array, 0, length); + index+=length; +/* +System.err.println("int: dmq1 len="+length); +for(int i=0; i0){ length=(length<<8)+(plain[index++]&0xff); } + } + iqmp_array=new byte[length]; + System.arraycopy(plain, index, iqmp_array, 0, length); + index+=length; +/* +System.err.println("int: iqmp len="+length); +for(int i=0; i0){ length=(length<<8)+(plain[index++]&0xff); } + } + if(plain[index]!=0x02)return false; + index++; // INTEGER + length=plain[index++]&0xff; + if((length&0x80)!=0){ + int foo=length&0x7f; length=0; + while(foo-->0){ length=(length<<8)+(plain[index++]&0xff); } + } + index+=length; + + index++; + length=plain[index++]&0xff; + if((length&0x80)!=0){ + int foo=length&0x7f; length=0; + while(foo-->0){ length=(length<<8)+(plain[index++]&0xff); } + } + P_array=new byte[length]; + System.arraycopy(plain, index, P_array, 0, length); + index+=length; + + index++; + length=plain[index++]&0xff; + if((length&0x80)!=0){ + int foo=length&0x7f; length=0; + while(foo-->0){ length=(length<<8)+(plain[index++]&0xff); } + } + Q_array=new byte[length]; + System.arraycopy(plain, index, Q_array, 0, length); + index+=length; + + index++; + length=plain[index++]&0xff; + if((length&0x80)!=0){ + int foo=length&0x7f; length=0; + while(foo-->0){ length=(length<<8)+(plain[index++]&0xff); } + } + G_array=new byte[length]; + System.arraycopy(plain, index, G_array, 0, length); + index+=length; + + index++; + length=plain[index++]&0xff; + if((length&0x80)!=0){ + int foo=length&0x7f; length=0; + while(foo-->0){ length=(length<<8)+(plain[index++]&0xff); } + } + pub_array=new byte[length]; + System.arraycopy(plain, index, pub_array, 0, length); + index+=length; + + index++; + length=plain[index++]&0xff; + if((length&0x80)!=0){ + int foo=length&0x7f; length=0; + while(foo-->0){ length=(length<<8)+(plain[index++]&0xff); } + } + prv_array=new byte[length]; + System.arraycopy(plain, index, prv_array, 0, length); + index+=length; + } + catch(Exception e){ + //System.err.println(e); + //e.printStackTrace(); + return false; + } + return true; + } + + public boolean isEncrypted(){ + return encrypted; + } + + public String getName(){ + return identity; + } + + private byte a2b(byte c){ + if('0'<=c&&c<='9') return (byte)(c-'0'); + if('a'<=c&&c<='z') return (byte)(c-'a'+10); + return (byte)(c-'A'+10); + } + + public boolean equals(Object o){ + if(!(o instanceof IdentityFile)) return super.equals(o); + IdentityFile foo=(IdentityFile)o; + return getName().equals(foo.getName()); + } + + public void clear(){ + Util.bzero(encoded_data); + Util.bzero(prv_array); + Util.bzero(d_array); + Util.bzero(key); + Util.bzero(iv); + } + + public void finalize (){ + clear(); + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/JSch.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/JSch.java new file mode 100644 index 000000000..04f2806b2 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/JSch.java @@ -0,0 +1,301 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +import java.io.InputStream; +import java.util.Vector; + +public class JSch{ + static java.util.Hashtable config=new java.util.Hashtable(); + static{ +// config.put("kex", "diffie-hellman-group-exchange-sha1"); + config.put("kex", "diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1"); + config.put("server_host_key", "ssh-rsa,ssh-dss"); +// config.put("server_host_key", "ssh-dss,ssh-rsa"); + + config.put("cipher.s2c", + "aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-cbc,aes256-cbc"); + config.put("cipher.c2s", + "aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-cbc,aes256-cbc"); + + config.put("mac.s2c", "hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-96"); + config.put("mac.c2s", "hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-96"); + config.put("compression.s2c", "none"); + // config.put("compression.s2c", "zlib@openssh.com,zlib,none"); + config.put("compression.c2s", "none"); + // config.put("compression.c2s", "zlib@openssh.com,zlib,none"); + + config.put("lang.s2c", ""); + config.put("lang.c2s", ""); + + config.put("compression_level", "6"); + + config.put("diffie-hellman-group-exchange-sha1", + "com.jcraft.jsch.DHGEX"); + config.put("diffie-hellman-group1-sha1", + "com.jcraft.jsch.DHG1"); + config.put("diffie-hellman-group14-sha1", + "com.jcraft.jsch.DHG14"); + + config.put("dh", "com.jcraft.jsch.jce.DH"); + config.put("3des-cbc", "com.jcraft.jsch.jce.TripleDESCBC"); + config.put("blowfish-cbc", "com.jcraft.jsch.jce.BlowfishCBC"); + config.put("hmac-sha1", "com.jcraft.jsch.jce.HMACSHA1"); + config.put("hmac-sha1-96", "com.jcraft.jsch.jce.HMACSHA196"); + config.put("hmac-md5", "com.jcraft.jsch.jce.HMACMD5"); + config.put("hmac-md5-96", "com.jcraft.jsch.jce.HMACMD596"); + config.put("sha-1", "com.jcraft.jsch.jce.SHA1"); + config.put("md5", "com.jcraft.jsch.jce.MD5"); + config.put("signature.dss", "com.jcraft.jsch.jce.SignatureDSA"); + config.put("signature.rsa", "com.jcraft.jsch.jce.SignatureRSA"); + config.put("keypairgen.dsa", "com.jcraft.jsch.jce.KeyPairGenDSA"); + config.put("keypairgen.rsa", "com.jcraft.jsch.jce.KeyPairGenRSA"); + config.put("random", "com.jcraft.jsch.jce.Random"); + + config.put("none", "com.jcraft.jsch.CipherNone"); + + config.put("aes128-cbc", "com.jcraft.jsch.jce.AES128CBC"); + config.put("aes192-cbc", "com.jcraft.jsch.jce.AES192CBC"); + config.put("aes256-cbc", "com.jcraft.jsch.jce.AES256CBC"); + + config.put("aes128-ctr", "com.jcraft.jsch.jce.AES128CTR"); + config.put("aes192-ctr", "com.jcraft.jsch.jce.AES192CTR"); + config.put("aes256-ctr", "com.jcraft.jsch.jce.AES256CTR"); + config.put("3des-ctr", "com.jcraft.jsch.jce.TripleDESCTR"); + config.put("arcfour", "com.jcraft.jsch.jce.ARCFOUR"); + config.put("arcfour128", "com.jcraft.jsch.jce.ARCFOUR128"); + config.put("arcfour256", "com.jcraft.jsch.jce.ARCFOUR256"); + + config.put("userauth.none", "com.jcraft.jsch.UserAuthNone"); + config.put("userauth.password", "com.jcraft.jsch.UserAuthPassword"); + config.put("userauth.keyboard-interactive", "com.jcraft.jsch.UserAuthKeyboardInteractive"); + config.put("userauth.publickey", "com.jcraft.jsch.UserAuthPublicKey"); + config.put("userauth.gssapi-with-mic", "com.jcraft.jsch.UserAuthGSSAPIWithMIC"); + config.put("gssapi-with-mic.krb5", "com.jcraft.jsch.jgss.GSSContextKrb5"); + + config.put("zlib", "com.jcraft.jsch.jcraft.Compression"); + config.put("zlib@openssh.com", "com.jcraft.jsch.jcraft.Compression"); + + config.put("StrictHostKeyChecking", "ask"); + config.put("HashKnownHosts", "no"); + //config.put("HashKnownHosts", "yes"); + config.put("PreferredAuthentications", "gssapi-with-mic,publickey,keyboard-interactive,password"); + + config.put("CheckCiphers", "aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256"); + config.put("CheckKexes", "diffie-hellman-group14-sha1"); + } + java.util.Vector pool=new java.util.Vector(); + java.util.Vector identities=new java.util.Vector(); + private HostKeyRepository known_hosts=null; + + private static final Logger DEVNULL=new Logger(){ + public boolean isEnabled(int level){return false;} + public void log(int level, String message){} + }; + static Logger logger=DEVNULL; + + public JSch(){ + + try{ + String osname=(String)(System.getProperties().get("os.name")); + if(osname!=null && osname.equals("Mac OS X")){ + config.put("hmac-sha1", "com.jcraft.jsch.jcraft.HMACSHA1"); + config.put("hmac-md5", "com.jcraft.jsch.jcraft.HMACMD5"); + config.put("hmac-md5-96", "com.jcraft.jsch.jcraft.HMACMD596"); + config.put("hmac-sha1-96", "com.jcraft.jsch.jcraft.HMACSHA196"); + } + } + catch(Exception e){ + } + + } + + public Session getSession(String username, String host) throws JSchException { return getSession(username, host, 22); } + public Session getSession(String username, String host, int port) throws JSchException { + if(username==null){ + throw new JSchException("username must not be null."); + } + if(host==null){ + throw new JSchException("host must not be null."); + } + Session s=new Session(this); + s.setUserName(username); + s.setHost(host); + s.setPort(port); + //pool.addElement(s); + return s; + } + + protected void addSession(Session session){ + synchronized(pool){ + pool.addElement(session); + } + } + + protected boolean removeSession(Session session){ + synchronized(pool){ + return pool.remove(session); + } + } + public void setHostKeyRepository(HostKeyRepository hkrepo){ + known_hosts=hkrepo; + } + + public void setKnownHosts(String filename) throws JSchException{ + if(known_hosts==null) known_hosts=new KnownHosts(this); + if(known_hosts instanceof KnownHosts){ + synchronized(known_hosts){ + ((KnownHosts)known_hosts).setKnownHosts(filename); + } + } + } + + public void setKnownHosts(InputStream stream) throws JSchException{ + if(known_hosts==null) known_hosts=new KnownHosts(this); + if(known_hosts instanceof KnownHosts){ + synchronized(known_hosts){ + ((KnownHosts)known_hosts).setKnownHosts(stream); + } + } + } + + public HostKeyRepository getHostKeyRepository(){ + if(known_hosts==null) known_hosts=new KnownHosts(this); + return known_hosts; + } + + public void addIdentity(String prvkey) throws JSchException{ + addIdentity(prvkey, (byte[])null); + } + + public void addIdentity(String prvkey, String passphrase) throws JSchException{ + byte[] _passphrase=null; + if(passphrase!=null){ + _passphrase=Util.str2byte(passphrase); + } + addIdentity(prvkey, _passphrase); + if(_passphrase!=null) + Util.bzero(_passphrase); + } + + public void addIdentity(String prvkey, byte[] passphrase) throws JSchException{ + Identity identity=IdentityFile.newInstance(prvkey, null, this); + addIdentity(identity, passphrase); + } + public void addIdentity(String prvkey, String pubkey, byte[] passphrase) throws JSchException{ + Identity identity=IdentityFile.newInstance(prvkey, pubkey, this); + addIdentity(identity, passphrase); + } + + public void addIdentity(String name, byte[]prvkey, byte[]pubkey, byte[] passphrase) throws JSchException{ + Identity identity=IdentityFile.newInstance(name, prvkey, pubkey, this); + addIdentity(identity, passphrase); + } + + public void addIdentity(Identity identity, byte[] passphrase) throws JSchException{ + if(passphrase!=null){ + try{ + byte[] goo=new byte[passphrase.length]; + System.arraycopy(passphrase, 0, goo, 0, passphrase.length); + passphrase=goo; + identity.setPassphrase(passphrase); + } + finally{ + Util.bzero(passphrase); + } + } + synchronized(identities){ + if(!identities.contains(identity)){ + identities.addElement(identity); + } + } + } + + public void removeIdentity(String name) throws JSchException{ + synchronized(identities){ + for(int i=0; iclient"+ + " "+guess[PROPOSAL_ENC_ALGS_STOC]+ + " "+guess[PROPOSAL_MAC_ALGS_STOC]+ + " "+guess[PROPOSAL_COMP_ALGS_STOC]); + JSch.getLogger().log(Logger.INFO, + "kex: client->server"+ + " "+guess[PROPOSAL_ENC_ALGS_CTOS]+ + " "+guess[PROPOSAL_MAC_ALGS_CTOS]+ + " "+guess[PROPOSAL_COMP_ALGS_CTOS]); + } + +// for(int i=0; i>>4)&0x0f))); + out.write(b2a((byte)(iv[i]&0x0f))); + } + out.write(cr); + out.write(cr); + } + int i=0; + while(i0){ + len>>>=8; + i++; + } + return i; + } + + int writeLength(byte[] data, int index, int len){ + int i=countLength(len)-1; + if(i==0){ + data[index++]=(byte)len; + return index; + } + data[index++]=(byte)(0x80|i); + int j=index+i; + while(i>0){ + data[index+i-1]=(byte)(len&0xff); + len>>>=8; + i--; + } + return j; + } + + private Random genRandom(){ + if(random==null){ + try{ + Class c=Class.forName(jsch.getConfig("random")); + random=(Random)(c.newInstance()); + } + catch(Exception e){ System.err.println("connect: random "+e); } + } + return random; + } + + private HASH genHash(){ + try{ + Class c=Class.forName(jsch.getConfig("md5")); + hash=(HASH)(c.newInstance()); + hash.init(); + } + catch(Exception e){ + } + return hash; + } + private Cipher genCipher(){ + try{ + Class c; + c=Class.forName(jsch.getConfig("3des-cbc")); + cipher=(Cipher)(c.newInstance()); + } + catch(Exception e){ + } + return cipher; + } + + /* + hash is MD5 + h(0) <- hash(passphrase, iv); + h(n) <- hash(h(n-1), passphrase, iv); + key <- (h(0),...,h(n))[0,..,key.length]; + */ + synchronized byte[] genKey(byte[] passphrase, byte[] iv){ + if(cipher==null) cipher=genCipher(); + if(hash==null) hash=genHash(); + + byte[] key=new byte[cipher.getBlockSize()]; + int hsize=hash.getBlockSize(); + byte[] hn=new byte[key.length/hsize*hsize+ + (key.length%hsize==0?0:hsize)]; + try{ + byte[] tmp=null; + if(vendor==VENDOR_OPENSSH){ + for(int index=0; index+hsize<=hn.length;){ + if(tmp!=null){ hash.update(tmp, 0, tmp.length); } + hash.update(passphrase, 0, passphrase.length); + hash.update(iv, 0, iv.length > 8 ? 8: iv.length); + tmp=hash.digest(); + System.arraycopy(tmp, 0, hn, index, tmp.length); + index+=tmp.length; + } + System.arraycopy(hn, 0, key, 0, key.length); + } + else if(vendor==VENDOR_FSECURE){ + for(int index=0; index+hsize<=hn.length;){ + if(tmp!=null){ hash.update(tmp, 0, tmp.length); } + hash.update(passphrase, 0, passphrase.length); + tmp=hash.digest(); + System.arraycopy(tmp, 0, hn, index, tmp.length); + index+=tmp.length; + } + System.arraycopy(hn, 0, key, 0, key.length); + } + } + catch(Exception e){ + System.err.println(e); + } + return key; + } + + public void setPassphrase(String passphrase){ + if(passphrase==null || passphrase.length()==0){ + setPassphrase((byte[])null); + } + else{ + setPassphrase(Util.str2byte(passphrase)); + } + } + public void setPassphrase(byte[] passphrase){ + if(passphrase!=null && passphrase.length==0) + passphrase=null; + this.passphrase=passphrase; + } + + private boolean encrypted=false; + private byte[] data=null; + private byte[] iv=null; + private byte[] publickeyblob=null; + + public boolean isEncrypted(){ return encrypted; } + public boolean decrypt(String _passphrase){ + if(_passphrase==null || _passphrase.length()==0){ + return !encrypted; + } + return decrypt(Util.str2byte(_passphrase)); + } + public boolean decrypt(byte[] _passphrase){ + if(!encrypted){ + return true; + } + if(_passphrase==null){ + return !encrypted; + } + byte[] bar=new byte[_passphrase.length]; + System.arraycopy(_passphrase, 0, bar, 0, bar.length); + _passphrase=bar; + byte[] foo=decrypt(data, _passphrase, iv); + Util.bzero(_passphrase); + if(parse(foo)){ + encrypted=false; + } + return !encrypted; + } + + public static KeyPair load(JSch jsch, String prvkey) throws JSchException{ + String pubkey=prvkey+".pub"; + if(!new File(pubkey).exists()){ + pubkey=null; + } + return load(jsch, prvkey, pubkey); + } + public static KeyPair load(JSch jsch, String prvkey, String pubkey) throws JSchException{ + + byte[] iv=new byte[8]; // 8 + boolean encrypted=true; + byte[] data=null; + + byte[] publickeyblob=null; + + int type=ERROR; + int vendor=VENDOR_OPENSSH; + String publicKeyComment = ""; + Cipher cipher=null; + + try{ + File file=new File(prvkey); + FileInputStream fis=new FileInputStream(prvkey); + byte[] buf=new byte[(int)(file.length())]; + int len=0; + while(true){ + int i=fis.read(buf, len, buf.length-len); + if(i<=0) + break; + len+=i; + } + fis.close(); + + int i=0; + + while(i4 && // FSecure + data[0]==(byte)0x3f && + data[1]==(byte)0x6f && + data[2]==(byte)0xf9 && + data[3]==(byte)0xeb){ + + Buffer _buf=new Buffer(data); + _buf.getInt(); // 0x3f6ff9be + _buf.getInt(); + byte[]_type=_buf.getString(); + //System.err.println("type: "+new String(_type)); + String _cipher=Util.byte2str(_buf.getString()); + //System.err.println("cipher: "+_cipher); + if(_cipher.equals("3des-cbc")){ + _buf.getInt(); + byte[] foo=new byte[data.length-_buf.getOffSet()]; + _buf.getByte(foo); + data=foo; + encrypted=true; + throw new JSchException("unknown privatekey format: "+prvkey); + } + else if(_cipher.equals("none")){ + _buf.getInt(); + _buf.getInt(); + + encrypted=false; + + byte[] foo=new byte[data.length-_buf.getOffSet()]; + _buf.getByte(foo); + data=foo; + } + } + + if(pubkey!=null){ + try{ + file=new File(pubkey); + fis=new FileInputStream(pubkey); + buf=new byte[(int)(file.length())]; + len=0; + while(true){ + i=fis.read(buf, len, buf.length-len); + if(i<=0) + break; + len+=i; + } + fis.close(); + + if(buf.length>4 && // FSecure's public key + buf[0]=='-' && buf[1]=='-' && buf[2]=='-' && buf[3]=='-'){ + + boolean valid=true; + i=0; + do{i++;}while(buf.length>i && buf[i]!=0x0a); + if(buf.length<=i) {valid=false;} + + while(valid){ + if(buf[i]==0x0a){ + boolean inheader=false; + for(int j=i+1; j0){ length=(length<<8)+(plain[index++]&0xff); } + } + + if(plain[index]!=0x02)return false; + index++; // INTEGER + length=plain[index++]&0xff; + if((length&0x80)!=0){ + int foo=length&0x7f; length=0; + while(foo-->0){ length=(length<<8)+(plain[index++]&0xff); } + } + index+=length; + + index++; + length=plain[index++]&0xff; + if((length&0x80)!=0){ + int foo=length&0x7f; length=0; + while(foo-->0){ length=(length<<8)+(plain[index++]&0xff); } + } + P_array=new byte[length]; + System.arraycopy(plain, index, P_array, 0, length); + index+=length; + + index++; + length=plain[index++]&0xff; + if((length&0x80)!=0){ + int foo=length&0x7f; length=0; + while(foo-->0){ length=(length<<8)+(plain[index++]&0xff); } + } + Q_array=new byte[length]; + System.arraycopy(plain, index, Q_array, 0, length); + index+=length; + + index++; + length=plain[index++]&0xff; + if((length&0x80)!=0){ + int foo=length&0x7f; length=0; + while(foo-->0){ length=(length<<8)+(plain[index++]&0xff); } + } + G_array=new byte[length]; + System.arraycopy(plain, index, G_array, 0, length); + index+=length; + + index++; + length=plain[index++]&0xff; + if((length&0x80)!=0){ + int foo=length&0x7f; length=0; + while(foo-->0){ length=(length<<8)+(plain[index++]&0xff); } + } + pub_array=new byte[length]; + System.arraycopy(plain, index, pub_array, 0, length); + index+=length; + + index++; + length=plain[index++]&0xff; + if((length&0x80)!=0){ + int foo=length&0x7f; length=0; + while(foo-->0){ length=(length<<8)+(plain[index++]&0xff); } + } + prv_array=new byte[length]; + System.arraycopy(plain, index, prv_array, 0, length); + index+=length; + } + catch(Exception e){ + //System.err.println(e); + //e.printStackTrace(); + return false; + } + return true; + } + + public byte[] getPublicKeyBlob(){ + byte[] foo=super.getPublicKeyBlob(); + if(foo!=null) return foo; + + if(P_array==null) return null; + + Buffer buf=new Buffer(sshdss.length+4+ + P_array.length+4+ + Q_array.length+4+ + G_array.length+4+ + pub_array.length+4); + buf.putString(sshdss); + buf.putString(P_array); + buf.putString(Q_array); + buf.putString(G_array); + buf.putString(pub_array); + return buf.buffer; + } + + private static final byte[] sshdss=Util.str2byte("ssh-dss"); + byte[] getKeyTypeName(){return sshdss;} + public int getKeyType(){return DSA;} + + public int getKeySize(){return key_size; } + public void dispose(){ + super.dispose(); + Util.bzero(prv_array); + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/KeyPairGenDSA.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/KeyPairGenDSA.java new file mode 100644 index 000000000..ef7ade934 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/KeyPairGenDSA.java @@ -0,0 +1,39 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +public interface KeyPairGenDSA{ + void init(int key_size) throws Exception; + byte[] getX(); + byte[] getY(); + byte[] getP(); + byte[] getQ(); + byte[] getG(); +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/KeyPairGenRSA.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/KeyPairGenRSA.java new file mode 100644 index 000000000..fcd0e1ea5 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/KeyPairGenRSA.java @@ -0,0 +1,43 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +public interface KeyPairGenRSA{ + void init(int key_size) throws Exception; + byte[] getD(); + byte[] getE(); + byte[] getN(); + + byte[] getC(); + byte[] getEP(); + byte[] getEQ(); + byte[] getP(); + byte[] getQ(); +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/KeyPairRSA.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/KeyPairRSA.java new file mode 100644 index 000000000..68d264ba1 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/KeyPairRSA.java @@ -0,0 +1,320 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +public class KeyPairRSA extends KeyPair{ + private byte[] prv_array; + private byte[] pub_array; + private byte[] n_array; + + private byte[] p_array; // prime p + private byte[] q_array; // prime q + private byte[] ep_array; // prime exponent p + private byte[] eq_array; // prime exponent q + private byte[] c_array; // coefficient + + //private int key_size=0; + private int key_size=1024; + + public KeyPairRSA(JSch jsch){ + super(jsch); + } + + void generate(int key_size) throws JSchException{ + this.key_size=key_size; + try{ + Class c=Class.forName(jsch.getConfig("keypairgen.rsa")); + KeyPairGenRSA keypairgen=(KeyPairGenRSA)(c.newInstance()); + keypairgen.init(key_size); + pub_array=keypairgen.getE(); + prv_array=keypairgen.getD(); + n_array=keypairgen.getN(); + + p_array=keypairgen.getP(); + q_array=keypairgen.getQ(); + ep_array=keypairgen.getEP(); + eq_array=keypairgen.getEQ(); + c_array=keypairgen.getC(); + + keypairgen=null; + } + catch(Exception e){ + //System.err.println("KeyPairRSA: "+e); + if(e instanceof Throwable) + throw new JSchException(e.toString(), (Throwable)e); + throw new JSchException(e.toString()); + } + } + + private static final byte[] begin=Util.str2byte("-----BEGIN RSA PRIVATE KEY-----"); + private static final byte[] end=Util.str2byte("-----END RSA PRIVATE KEY-----"); + + byte[] getBegin(){ return begin; } + byte[] getEnd(){ return end; } + + byte[] getPrivateKey(){ + int content= + 1+countLength(1) + 1 + // INTEGER + 1+countLength(n_array.length) + n_array.length + // INTEGER N + 1+countLength(pub_array.length) + pub_array.length + // INTEGER pub + 1+countLength(prv_array.length) + prv_array.length+ // INTEGER prv + 1+countLength(p_array.length) + p_array.length+ // INTEGER p + 1+countLength(q_array.length) + q_array.length+ // INTEGER q + 1+countLength(ep_array.length) + ep_array.length+ // INTEGER ep + 1+countLength(eq_array.length) + eq_array.length+ // INTEGER eq + 1+countLength(c_array.length) + c_array.length; // INTEGER c + + int total= + 1+countLength(content)+content; // SEQUENCE + + byte[] plain=new byte[total]; + int index=0; + index=writeSEQUENCE(plain, index, content); + index=writeINTEGER(plain, index, new byte[1]); // 0 + index=writeINTEGER(plain, index, n_array); + index=writeINTEGER(plain, index, pub_array); + index=writeINTEGER(plain, index, prv_array); + index=writeINTEGER(plain, index, p_array); + index=writeINTEGER(plain, index, q_array); + index=writeINTEGER(plain, index, ep_array); + index=writeINTEGER(plain, index, eq_array); + index=writeINTEGER(plain, index, c_array); + return plain; + } + + boolean parse(byte [] plain){ + /* + byte[] p_array; + byte[] q_array; + byte[] dmp1_array; + byte[] dmq1_array; + byte[] iqmp_array; + */ + try{ + int index=0; + int length=0; + + if(vendor==VENDOR_FSECURE){ + if(plain[index]!=0x30){ // FSecure + Buffer buf=new Buffer(plain); + pub_array=buf.getMPIntBits(); + prv_array=buf.getMPIntBits(); + n_array=buf.getMPIntBits(); + byte[] u_array=buf.getMPIntBits(); + p_array=buf.getMPIntBits(); + q_array=buf.getMPIntBits(); + return true; + } + return false; + } + + index++; // SEQUENCE + length=plain[index++]&0xff; + if((length&0x80)!=0){ + int foo=length&0x7f; length=0; + while(foo-->0){ length=(length<<8)+(plain[index++]&0xff); } + } + + if(plain[index]!=0x02)return false; + index++; // INTEGER + length=plain[index++]&0xff; + if((length&0x80)!=0){ + int foo=length&0x7f; length=0; + while(foo-->0){ length=(length<<8)+(plain[index++]&0xff); } + } + index+=length; + +//System.err.println("int: len="+length); +//System.err.print(Integer.toHexString(plain[index-1]&0xff)+":"); +//System.err.println(""); + + index++; + length=plain[index++]&0xff; + if((length&0x80)!=0){ + int foo=length&0x7f; length=0; + while(foo-->0){ length=(length<<8)+(plain[index++]&0xff); } + } + n_array=new byte[length]; + System.arraycopy(plain, index, n_array, 0, length); + index+=length; +/* +System.err.println("int: N len="+length); +for(int i=0; i0){ length=(length<<8)+(plain[index++]&0xff); } + } + pub_array=new byte[length]; + System.arraycopy(plain, index, pub_array, 0, length); + index+=length; +/* +System.err.println("int: E len="+length); +for(int i=0; i0){ length=(length<<8)+(plain[index++]&0xff); } + } + prv_array=new byte[length]; + System.arraycopy(plain, index, prv_array, 0, length); + index+=length; +/* +System.err.println("int: prv len="+length); +for(int i=0; i0){ length=(length<<8)+(plain[index++]&0xff); } + } + p_array=new byte[length]; + System.arraycopy(plain, index, p_array, 0, length); + index+=length; +/* +System.err.println("int: P len="+length); +for(int i=0; i0){ length=(length<<8)+(plain[index++]&0xff); } + } + q_array=new byte[length]; + System.arraycopy(plain, index, q_array, 0, length); + index+=length; +/* +System.err.println("int: q len="+length); +for(int i=0; i0){ length=(length<<8)+(plain[index++]&0xff); } + } + ep_array=new byte[length]; + System.arraycopy(plain, index, ep_array, 0, length); + index+=length; +/* +System.err.println("int: ep len="+length); +for(int i=0; i0){ length=(length<<8)+(plain[index++]&0xff); } + } + eq_array=new byte[length]; + System.arraycopy(plain, index, eq_array, 0, length); + index+=length; +/* +System.err.println("int: eq len="+length); +for(int i=0; i0){ length=(length<<8)+(plain[index++]&0xff); } + } + c_array=new byte[length]; + System.arraycopy(plain, index, c_array, 0, length); + index+=length; +/* +System.err.println("int: c len="+length); +for(int i=0; i1024*10) break; // too long... + byte[] newbuf=new byte[buf.length*2]; + System.arraycopy(buf, 0, newbuf, 0, buf.length); + buf=newbuf; + } + buf[bufl++]=(byte)j; + } + + j=0; + while(j=bufl){ + addInvalidLine(Util.byte2str(buf, 0, bufl)); + continue loop; + } + + sb.setLength(0); + while(j=bufl || host.length()==0){ + addInvalidLine(Util.byte2str(buf, 0, bufl)); + continue loop; + } + + sb.setLength(0); + type=-1; + while(j=bufl){ + addInvalidLine(Util.byte2str(buf, 0, bufl)); + continue loop; + } + + sb.setLength(0); + while(j1 + ){ + return check(host.substring(1, host.indexOf("]:")), key); + } + + return result; + } + public void add(HostKey hostkey, UserInfo userinfo){ + int type=hostkey.type; + String host=hostkey.getHost(); + byte[] key=hostkey.key; + + HostKey hk=null; + synchronized(pool){ + for(int i=0; i0){ + String data=this.host.substring(HASH_MAGIC.length()); + String _salt=data.substring(0, data.indexOf(HASH_DELIM)); + String _hash=data.substring(data.indexOf(HASH_DELIM)+1); + salt=Util.fromBase64(Util.str2byte(_salt), 0, _salt.length()); + hash=Util.fromBase64(Util.str2byte(_hash), 0, _hash.length()); + if(salt.length!=20 || // block size of hmac-sha1 + hash.length!=20){ + salt=null; + hash=null; + return; + } + hashed=true; + } + } + + boolean isMatched(String _host){ + if(!hashed){ + return super.isMatched(_host); + } + MAC macsha1=getHMACSHA1(); + try{ + synchronized(macsha1){ + macsha1.init(salt); + byte[] foo=Util.str2byte(_host); + macsha1.update(foo, 0, foo.length); + byte[] bar=new byte[macsha1.getBlockSize()]; + macsha1.doFinal(bar, 0); + return Util.array_equals(hash, bar); + } + } + catch(Exception e){ + System.out.println(e); + } + return false; + } + + boolean isHashed(){ + return hashed; + } + + void hash(){ + if(hashed) + return; + MAC macsha1=getHMACSHA1(); + if(salt==null){ + Random random=Session.random; + synchronized(random){ + salt=new byte[macsha1.getBlockSize()]; + random.fill(salt, 0, salt.length); + } + } + try{ + synchronized(macsha1){ + macsha1.init(salt); + byte[] foo=Util.str2byte(host); + macsha1.update(foo, 0, foo.length); + hash=new byte[macsha1.getBlockSize()]; + macsha1.doFinal(hash, 0); + } + } + catch(Exception e){ + } + host=HASH_MAGIC+Util.byte2str(Util.toBase64(salt, 0, salt.length))+ + HASH_DELIM+Util.byte2str(Util.toBase64(hash, 0, hash.length)); + hashed=true; + } + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/Logger.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/Logger.java new file mode 100644 index 000000000..46df2efa3 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/Logger.java @@ -0,0 +1,54 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2006-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +public interface Logger{ + + public final int DEBUG=0; + public final int INFO=1; + public final int WARN=2; + public final int ERROR=3; + public final int FATAL=4; + + public boolean isEnabled(int level); + + public void log(int level, String message); + + /* + public final Logger SIMPLE_LOGGER=new Logger(){ + public boolean isEnabled(int level){return true;} + public void log(int level, String message){System.err.println(message);} + }; + final Logger DEVNULL=new Logger(){ + public boolean isEnabled(int level){return false;} + public void log(int level, String message){} + }; + */ +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/MAC.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/MAC.java new file mode 100644 index 000000000..d71c69ab3 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/MAC.java @@ -0,0 +1,39 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +public interface MAC{ + String getName(); + int getBlockSize(); + void init(byte[] key) throws Exception; + void update(byte[] foo, int start, int len); + void update(int foo); + void doFinal(byte[] buf, int offset); +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/Packet.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/Packet.java new file mode 100644 index 000000000..011fcbaad --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/Packet.java @@ -0,0 +1,115 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +public class Packet{ + + private static Random random=null; + static void setRandom(Random foo){ random=foo;} + + Buffer buffer; + byte[] ba4=new byte[4]; + public Packet(Buffer buffer){ + this.buffer=buffer; + } + public void reset(){ + buffer.index=5; + } + void padding(int bsize){ + int len=buffer.index; + int pad=(-len)&(bsize-1); + if(pad>>24); + ba4[1]=(byte)(len>>>16); + ba4[2]=(byte)(len>>>8); + ba4[3]=(byte)(len); + System.arraycopy(ba4, 0, buffer.buffer, 0, 4); + buffer.buffer[4]=(byte)pad; + synchronized(random){ + random.fill(buffer.buffer, buffer.index, pad); + } + buffer.skip(pad); + //buffer.putPad(pad); +/* +for(int i=0; i0){ + socket.setSoTimeout(timeout); + } + socket.setTcpNoDelay(true); + + out.write(Util.str2byte("CONNECT "+host+":"+port+" HTTP/1.0\r\n")); + + if(user!=null && passwd!=null){ + byte[] code=Util.str2byte(user+":"+passwd); + code=Util.toBase64(code, 0, code.length); + out.write(Util.str2byte("Proxy-Authorization: Basic ")); + out.write(code); + out.write(Util.str2byte("\r\n")); + } + + out.write(Util.str2byte("\r\n")); + out.flush(); + + int foo=0; + + StringBuffer sb=new StringBuffer(); + while(foo>=0){ + foo=in.read(); if(foo!=13){sb.append((char)foo); continue;} + foo=in.read(); if(foo!=10){continue;} + break; + } + if(foo<0){ + throw new IOException(); + } + + String response=sb.toString(); + String reason="Unknow reason"; + int code=-1; + try{ + foo=response.indexOf(' '); + int bar=response.indexOf(' ', foo+1); + code=Integer.parseInt(response.substring(foo+1, bar)); + reason=response.substring(bar+1); + } + catch(Exception e){ + } + if(code!=200){ + throw new IOException("proxy error: "+reason); + } + + /* + while(foo>=0){ + foo=in.read(); if(foo!=13) continue; + foo=in.read(); if(foo!=10) continue; + foo=in.read(); if(foo!=13) continue; + foo=in.read(); if(foo!=10) continue; + break; + } + */ + + int count=0; + while(true){ + count=0; + while(foo>=0){ + foo=in.read(); if(foo!=13){count++; continue;} + foo=in.read(); if(foo!=10){continue;} + break; + } + if(foo<0){ + throw new IOException(); + } + if(count==0)break; + } + } + catch(RuntimeException e){ + throw e; + } + catch(Exception e){ + try{ if(socket!=null)socket.close(); } + catch(Exception eee){ + } + String message="ProxyHTTP: "+e.toString(); + if(e instanceof Throwable) + throw new JSchException(message, (Throwable)e); + throw new JSchException(message); + } + } + public InputStream getInputStream(){ return in; } + public OutputStream getOutputStream(){ return out; } + public Socket getSocket(){ return socket; } + public void close(){ + try{ + if(in!=null)in.close(); + if(out!=null)out.close(); + if(socket!=null)socket.close(); + } + catch(Exception e){ + } + in=null; + out=null; + socket=null; + } + public static int getDefaultPort(){ + return DEFAULTPORT; + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ProxySOCKS4.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ProxySOCKS4.java new file mode 100644 index 000000000..f80bce37e --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ProxySOCKS4.java @@ -0,0 +1,212 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2006-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + This file depends on following documents, + - SOCKS: A protocol for TCP proxy across firewalls, Ying-Da Lee + http://www.socks.nec.com/protocol/socks4.protocol + */ + +package com.jcraft.jsch; + +import java.io.*; +import java.net.*; + +public class ProxySOCKS4 implements Proxy{ + private static int DEFAULTPORT=1080; + private String proxy_host; + private int proxy_port; + private InputStream in; + private OutputStream out; + private Socket socket; + private String user; + private String passwd; + + public ProxySOCKS4(String proxy_host){ + int port=DEFAULTPORT; + String host=proxy_host; + if(proxy_host.indexOf(':')!=-1){ + try{ + host=proxy_host.substring(0, proxy_host.indexOf(':')); + port=Integer.parseInt(proxy_host.substring(proxy_host.indexOf(':')+1)); + } + catch(Exception e){ + } + } + this.proxy_host=host; + this.proxy_port=port; + } + public ProxySOCKS4(String proxy_host, int proxy_port){ + this.proxy_host=proxy_host; + this.proxy_port=proxy_port; + } + public void setUserPasswd(String user, String passwd){ + this.user=user; + this.passwd=passwd; + } + public void connect(SocketFactory socket_factory, String host, int port, int timeout) throws JSchException{ + try{ + if(socket_factory==null){ + socket=Util.createSocket(proxy_host, proxy_port, timeout); + //socket=new Socket(proxy_host, proxy_port); + in=socket.getInputStream(); + out=socket.getOutputStream(); + } + else{ + socket=socket_factory.createSocket(proxy_host, proxy_port); + in=socket_factory.getInputStream(socket); + out=socket_factory.getOutputStream(socket); + } + if(timeout>0){ + socket.setSoTimeout(timeout); + } + socket.setTcpNoDelay(true); + + byte[] buf=new byte[1024]; + int index=0; + +/* + 1) CONNECT + + The client connects to the SOCKS server and sends a CONNECT request when + it wants to establish a connection to an application server. The client + includes in the request packet the IP address and the port number of the + destination host, and userid, in the following format. + + +----+----+----+----+----+----+----+----+----+----+....+----+ + | VN | CD | DSTPORT | DSTIP | USERID |NULL| + +----+----+----+----+----+----+----+----+----+----+....+----+ + # of bytes: 1 1 2 4 variable 1 + + VN is the SOCKS protocol version number and should be 4. CD is the + SOCKS command code and should be 1 for CONNECT request. NULL is a byte + of all zero bits. +*/ + + index=0; + buf[index++]=4; + buf[index++]=1; + + buf[index++]=(byte)(port>>>8); + buf[index++]=(byte)(port&0xff); + + try{ + InetAddress addr=InetAddress.getByName(host); + byte[] byteAddress = addr.getAddress(); + for (int i = 0; i < byteAddress.length; i++) { + buf[index++]=byteAddress[i]; + } + } + catch(UnknownHostException uhe){ + throw new JSchException("ProxySOCKS4: "+uhe.toString(), uhe); + } + + if(user!=null){ + System.arraycopy(Util.str2byte(user), 0, buf, index, user.length()); + index+=user.length(); + } + buf[index++]=0; + out.write(buf, 0, index); + +/* + The SOCKS server checks to see whether such a request should be granted + based on any combination of source IP address, destination IP address, + destination port number, the userid, and information it may obtain by + consulting IDENT, cf. RFC 1413. If the request is granted, the SOCKS + server makes a connection to the specified port of the destination host. + A reply packet is sent to the client when this connection is established, + or when the request is rejected or the operation fails. + + +----+----+----+----+----+----+----+----+ + | VN | CD | DSTPORT | DSTIP | + +----+----+----+----+----+----+----+----+ + # of bytes: 1 1 2 4 + + VN is the version of the reply code and should be 0. CD is the result + code with one of the following values: + + 90: request granted + 91: request rejected or failed + 92: request rejected becasue SOCKS server cannot connect to + identd on the client + 93: request rejected because the client program and identd + report different user-ids + + The remaining fields are ignored. +*/ + + int len=8; + int s=0; + while(s0){ + socket.setSoTimeout(timeout); + } + socket.setTcpNoDelay(true); + + byte[] buf=new byte[1024]; + int index=0; + +/* + +----+----------+----------+ + |VER | NMETHODS | METHODS | + +----+----------+----------+ + | 1 | 1 | 1 to 255 | + +----+----------+----------+ + + The VER field is set to X'05' for this version of the protocol. The + NMETHODS field contains the number of method identifier octets that + appear in the METHODS field. + + The values currently defined for METHOD are: + + o X'00' NO AUTHENTICATION REQUIRED + o X'01' GSSAPI + o X'02' USERNAME/PASSWORD + o X'03' to X'7F' IANA ASSIGNED + o X'80' to X'FE' RESERVED FOR PRIVATE METHODS + o X'FF' NO ACCEPTABLE METHODS +*/ + + buf[index++]=5; + + buf[index++]=2; + buf[index++]=0; // NO AUTHENTICATION REQUIRED + buf[index++]=2; // USERNAME/PASSWORD + + out.write(buf, 0, index); + +/* + The server selects from one of the methods given in METHODS, and + sends a METHOD selection message: + + +----+--------+ + |VER | METHOD | + +----+--------+ + | 1 | 1 | + +----+--------+ +*/ + //in.read(buf, 0, 2); + fill(in, buf, 2); + + boolean check=false; + switch((buf[1])&0xff){ + case 0: // NO AUTHENTICATION REQUIRED + check=true; + break; + case 2: // USERNAME/PASSWORD + if(user==null || passwd==null)break; + +/* + Once the SOCKS V5 server has started, and the client has selected the + Username/Password Authentication protocol, the Username/Password + subnegotiation begins. This begins with the client producing a + Username/Password request: + + +----+------+----------+------+----------+ + |VER | ULEN | UNAME | PLEN | PASSWD | + +----+------+----------+------+----------+ + | 1 | 1 | 1 to 255 | 1 | 1 to 255 | + +----+------+----------+------+----------+ + + The VER field contains the current version of the subnegotiation, + which is X'01'. The ULEN field contains the length of the UNAME field + that follows. The UNAME field contains the username as known to the + source operating system. The PLEN field contains the length of the + PASSWD field that follows. The PASSWD field contains the password + association with the given UNAME. +*/ + index=0; + buf[index++]=1; + buf[index++]=(byte)(user.length()); + System.arraycopy(Util.str2byte(user), 0, buf, index, user.length()); + index+=user.length(); + buf[index++]=(byte)(passwd.length()); + System.arraycopy(Util.str2byte(passwd), 0, buf, index, passwd.length()); + index+=passwd.length(); + + out.write(buf, 0, index); + +/* + The server verifies the supplied UNAME and PASSWD, and sends the + following response: + + +----+--------+ + |VER | STATUS | + +----+--------+ + | 1 | 1 | + +----+--------+ + + A STATUS field of X'00' indicates success. If the server returns a + `failure' (STATUS value other than X'00') status, it MUST close the + connection. +*/ + //in.read(buf, 0, 2); + fill(in, buf, 2); + if(buf[1]==0) + check=true; + break; + default: + } + + if(!check){ + try{ socket.close(); } + catch(Exception eee){ + } + throw new JSchException("fail in SOCKS5 proxy"); + } + +/* + The SOCKS request is formed as follows: + + +----+-----+-------+------+----------+----------+ + |VER | CMD | RSV | ATYP | DST.ADDR | DST.PORT | + +----+-----+-------+------+----------+----------+ + | 1 | 1 | X'00' | 1 | Variable | 2 | + +----+-----+-------+------+----------+----------+ + + Where: + + o VER protocol version: X'05' + o CMD + o CONNECT X'01' + o BIND X'02' + o UDP ASSOCIATE X'03' + o RSV RESERVED + o ATYP address type of following address + o IP V4 address: X'01' + o DOMAINNAME: X'03' + o IP V6 address: X'04' + o DST.ADDR desired destination address + o DST.PORT desired destination port in network octet + order +*/ + + index=0; + buf[index++]=5; + buf[index++]=1; // CONNECT + buf[index++]=0; + + byte[] hostb=Util.str2byte(host); + int len=hostb.length; + buf[index++]=3; // DOMAINNAME + buf[index++]=(byte)(len); + System.arraycopy(hostb, 0, buf, index, len); + index+=len; + buf[index++]=(byte)(port>>>8); + buf[index++]=(byte)(port&0xff); + + out.write(buf, 0, index); + +/* + The SOCKS request information is sent by the client as soon as it has + established a connection to the SOCKS server, and completed the + authentication negotiations. The server evaluates the request, and + returns a reply formed as follows: + + +----+-----+-------+------+----------+----------+ + |VER | REP | RSV | ATYP | BND.ADDR | BND.PORT | + +----+-----+-------+------+----------+----------+ + | 1 | 1 | X'00' | 1 | Variable | 2 | + +----+-----+-------+------+----------+----------+ + + Where: + + o VER protocol version: X'05' + o REP Reply field: + o X'00' succeeded + o X'01' general SOCKS server failure + o X'02' connection not allowed by ruleset + o X'03' Network unreachable + o X'04' Host unreachable + o X'05' Connection refused + o X'06' TTL expired + o X'07' Command not supported + o X'08' Address type not supported + o X'09' to X'FF' unassigned + o RSV RESERVED + o ATYP address type of following address + o IP V4 address: X'01' + o DOMAINNAME: X'03' + o IP V6 address: X'04' + o BND.ADDR server bound address + o BND.PORT server bound port in network octet order +*/ + + //in.read(buf, 0, 4); + fill(in, buf, 4); + + if(buf[1]!=0){ + try{ socket.close(); } + catch(Exception eee){ + } + throw new JSchException("ProxySOCKS5: server returns "+buf[1]); + } + + switch(buf[3]&0xff){ + case 1: + //in.read(buf, 0, 6); + fill(in, buf, 6); + break; + case 3: + //in.read(buf, 0, 1); + fill(in, buf, 1); + //in.read(buf, 0, buf[0]+2); + fill(in, buf, (buf[0]&0xff)+2); + break; + case 4: + //in.read(buf, 0, 18); + fill(in, buf, 18); + break; + default: + } + } + catch(RuntimeException e){ + throw e; + } + catch(Exception e){ + try{ if(socket!=null)socket.close(); } + catch(Exception eee){ + } + String message="ProxySOCKS5: "+e.toString(); + if(e instanceof Throwable) + throw new JSchException(message, (Throwable)e); + throw new JSchException(message); + } + } + public InputStream getInputStream(){ return in; } + public OutputStream getOutputStream(){ return out; } + public Socket getSocket(){ return socket; } + public void close(){ + try{ + if(in!=null)in.close(); + if(out!=null)out.close(); + if(socket!=null)socket.close(); + } + catch(Exception e){ + } + in=null; + out=null; + socket=null; + } + public static int getDefaultPort(){ + return DEFAULTPORT; + } + private void fill(InputStream in, byte[] buf, int len) throws JSchException, IOException{ + int s=0; + while(s0){ + setReply(true); + } + } + boolean waitForReply(){ return reply; } + void setReply(boolean reply){ this.reply=reply; } + void write(Packet packet) throws Exception{ + if(reply){ + channel.reply=-1; + } + session.write(packet); + if(reply){ + long start=System.currentTimeMillis(); + long timeout=channel.connectTimeout; + while(channel.isConnected() && channel.reply==-1){ + try{Thread.sleep(10);} + catch(Exception ee){ + } + if(timeout>0L && + (System.currentTimeMillis()-start)>timeout){ + channel.reply=0; + throw new JSchException("channel request: timeout"); + } + } + + if(channel.reply==0){ + throw new JSchException("failed to send channel request"); + } + } + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestAgentForwarding.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestAgentForwarding.java new file mode 100644 index 000000000..8d30fc7a8 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestAgentForwarding.java @@ -0,0 +1,53 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2006-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +class RequestAgentForwarding extends Request{ + public void request(Session session, Channel channel) throws Exception{ + super.request(session, channel); + + setReply(false); + + Buffer buf=new Buffer(); + Packet packet=new Packet(buf); + + // byte SSH_MSG_CHANNEL_REQUEST(98) + // uint32 recipient channel + // string request type // "auth-agent-req@openssh.com" + // boolean want reply // 0 + packet.reset(); + buf.putByte((byte) Session.SSH_MSG_CHANNEL_REQUEST); + buf.putInt(channel.getRecipient()); + buf.putString(Util.str2byte("auth-agent-req@openssh.com")); + buf.putByte((byte)(waitForReply() ? 1 : 0)); + write(packet); + session.agent_forwarding=true; + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestEnv.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestEnv.java new file mode 100644 index 000000000..0375a557e --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestEnv.java @@ -0,0 +1,54 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +class RequestEnv extends Request{ + byte[] name=new byte[0]; + byte[] value=new byte[0]; + void setEnv(byte[] name, byte[] value){ + this.name=name; + this.value=value; + } + public void request(Session session, Channel channel) throws Exception{ + super.request(session, channel); + + Buffer buf=new Buffer(); + Packet packet=new Packet(buf); + + packet.reset(); + buf.putByte((byte) Session.SSH_MSG_CHANNEL_REQUEST); + buf.putInt(channel.getRecipient()); + buf.putString(Util.str2byte("env")); + buf.putByte((byte)(waitForReply() ? 1 : 0)); + buf.putString(name); + buf.putString(value); + write(packet); + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestExec.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestExec.java new file mode 100644 index 000000000..d9b89f6ae --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestExec.java @@ -0,0 +1,58 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +class RequestExec extends Request{ + private byte[] command=new byte[0]; + RequestExec(byte[] command){ + this.command=command; + } + public void request(Session session, Channel channel) throws Exception{ + super.request(session, channel); + + Buffer buf=new Buffer(); + Packet packet=new Packet(buf); + + // send + // byte SSH_MSG_CHANNEL_REQUEST(98) + // uint32 recipient channel + // string request type // "exec" + // boolean want reply // 0 + // string command + packet.reset(); + buf.putByte((byte) Session.SSH_MSG_CHANNEL_REQUEST); + buf.putInt(channel.getRecipient()); + buf.putString(Util.str2byte("exec")); + buf.putByte((byte)(waitForReply() ? 1 : 0)); + buf.checkFreeSize(4+command.length); + buf.putString(command); + write(packet); + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestPtyReq.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestPtyReq.java new file mode 100644 index 000000000..8e440559f --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestPtyReq.java @@ -0,0 +1,78 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +class RequestPtyReq extends Request{ + private String ttype="vt100"; + private int tcol=80; + private int trow=24; + private int twp=640; + private int thp=480; + + private byte[] terminal_mode=Util.empty; + + void setCode(String cookie){ + } + + void setTType(String ttype){ + this.ttype=ttype; + } + + void setTerminalMode(byte[] terminal_mode){ + this.terminal_mode=terminal_mode; + } + + void setTSize(int tcol, int trow, int twp, int thp){ + this.tcol=tcol; + this.trow=trow; + this.twp=twp; + this.thp=thp; + } + + public void request(Session session, Channel channel) throws Exception{ + super.request(session, channel); + + Buffer buf=new Buffer(); + Packet packet=new Packet(buf); + + packet.reset(); + buf.putByte((byte) Session.SSH_MSG_CHANNEL_REQUEST); + buf.putInt(channel.getRecipient()); + buf.putString(Util.str2byte("pty-req")); + buf.putByte((byte)(waitForReply() ? 1 : 0)); + buf.putString(Util.str2byte(ttype)); + buf.putInt(tcol); + buf.putInt(trow); + buf.putInt(twp); + buf.putInt(thp); + buf.putString(terminal_mode); + write(packet); + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestSftp.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestSftp.java new file mode 100644 index 000000000..d0197ec61 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestSftp.java @@ -0,0 +1,49 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +public class RequestSftp extends Request{ + RequestSftp(){ + setReply(true); + } + public void request(Session session, Channel channel) throws Exception{ + super.request(session, channel); + + Buffer buf=new Buffer(); + Packet packet=new Packet(buf); + packet.reset(); + buf.putByte((byte)Session.SSH_MSG_CHANNEL_REQUEST); + buf.putInt(channel.getRecipient()); + buf.putString(Util.str2byte("subsystem")); + buf.putByte((byte)(waitForReply() ? 1 : 0)); + buf.putString(Util.str2byte("sftp")); + write(packet); + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestShell.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestShell.java new file mode 100644 index 000000000..5192c83db --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestShell.java @@ -0,0 +1,51 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +class RequestShell extends Request{ + public void request(Session session, Channel channel) throws Exception{ + super.request(session, channel); + + Buffer buf=new Buffer(); + Packet packet=new Packet(buf); + + // send + // byte SSH_MSG_CHANNEL_REQUEST(98) + // uint32 recipient channel + // string request type // "shell" + // boolean want reply // 0 + packet.reset(); + buf.putByte((byte) Session.SSH_MSG_CHANNEL_REQUEST); + buf.putInt(channel.getRecipient()); + buf.putString(Util.str2byte("shell")); + buf.putByte((byte)(waitForReply() ? 1 : 0)); + write(packet); + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestSignal.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestSignal.java new file mode 100644 index 000000000..b40e403e0 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestSignal.java @@ -0,0 +1,49 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +class RequestSignal extends Request{ + private String signal="KILL"; + public void setSignal(String foo){ signal=foo; } + public void request(Session session, Channel channel) throws Exception{ + super.request(session, channel); + + Buffer buf=new Buffer(); + Packet packet=new Packet(buf); + + packet.reset(); + buf.putByte((byte) Session.SSH_MSG_CHANNEL_REQUEST); + buf.putInt(channel.getRecipient()); + buf.putString(Util.str2byte("signal")); + buf.putByte((byte)(waitForReply() ? 1 : 0)); + buf.putString(Util.str2byte(signal)); + write(packet); + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestSubsystem.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestSubsystem.java new file mode 100644 index 000000000..becce1001 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestSubsystem.java @@ -0,0 +1,53 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2005-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +public class RequestSubsystem extends Request{ + private String subsystem=null; + public void request(Session session, Channel channel, String subsystem, boolean want_reply) throws Exception{ + setReply(want_reply); + this.subsystem=subsystem; + this.request(session, channel); + } + public void request(Session session, Channel channel) throws Exception{ + super.request(session, channel); + + Buffer buf=new Buffer(); + Packet packet=new Packet(buf); + + packet.reset(); + buf.putByte((byte)Session.SSH_MSG_CHANNEL_REQUEST); + buf.putInt(channel.getRecipient()); + buf.putString(Util.str2byte("subsystem")); + buf.putByte((byte)(waitForReply() ? 1 : 0)); + buf.putString(Util.str2byte(subsystem)); + write(packet); + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestWindowChange.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestWindowChange.java new file mode 100644 index 000000000..150a86d1f --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestWindowChange.java @@ -0,0 +1,68 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +class RequestWindowChange extends Request{ + int width_columns=80; + int height_rows=24; + int width_pixels=640; + int height_pixels=480; + void setSize(int col, int row, int wp, int hp){ + this.width_columns=col; + this.height_rows=row; + this.width_pixels=wp; + this.height_pixels=hp; + } + public void request(Session session, Channel channel) throws Exception{ + super.request(session, channel); + + Buffer buf=new Buffer(); + Packet packet=new Packet(buf); + + //byte SSH_MSG_CHANNEL_REQUEST + //uint32 recipient_channel + //string "window-change" + //boolean FALSE + //uint32 terminal width, columns + //uint32 terminal height, rows + //uint32 terminal width, pixels + //uint32 terminal height, pixels + packet.reset(); + buf.putByte((byte) Session.SSH_MSG_CHANNEL_REQUEST); + buf.putInt(channel.getRecipient()); + buf.putString(Util.str2byte("window-change")); + buf.putByte((byte)(waitForReply() ? 1 : 0)); + buf.putInt(width_columns); + buf.putInt(height_rows); + buf.putInt(width_pixels); + buf.putInt(height_pixels); + write(packet); + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestX11.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestX11.java new file mode 100644 index 000000000..c9a01499f --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/RequestX11.java @@ -0,0 +1,63 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +class RequestX11 extends Request{ + public void setCookie(String cookie){ + ChannelX11.cookie=Util.str2byte(cookie); + } + public void request(Session session, Channel channel) throws Exception{ + super.request(session, channel); + + Buffer buf=new Buffer(); + Packet packet=new Packet(buf); + + // byte SSH_MSG_CHANNEL_REQUEST(98) + // uint32 recipient channel + // string request type // "x11-req" + // boolean want reply // 0 + // boolean single connection + // string x11 authentication protocol // "MIT-MAGIC-COOKIE-1". + // string x11 authentication cookie + // uint32 x11 screen number + packet.reset(); + buf.putByte((byte) Session.SSH_MSG_CHANNEL_REQUEST); + buf.putInt(channel.getRecipient()); + buf.putString(Util.str2byte("x11-req")); + buf.putByte((byte)(waitForReply() ? 1 : 0)); + buf.putByte((byte)0); + buf.putString(Util.str2byte("MIT-MAGIC-COOKIE-1")); + buf.putString(ChannelX11.getFakedCookie(session)); + buf.putInt(0); + write(packet); + + session.x11_forwarding=true; + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ServerSocketFactory.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ServerSocketFactory.java new file mode 100644 index 000000000..a8286d538 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/ServerSocketFactory.java @@ -0,0 +1,37 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +import java.net.*; +import java.io.*; + +public interface ServerSocketFactory{ + public ServerSocket createServerSocket(int port, int backlog, InetAddress bindAddr) throws IOException; +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/Session.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/Session.java new file mode 100644 index 000000000..b43e01e6e --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/Session.java @@ -0,0 +1,2030 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +import java.io.*; +import java.net.*; + +public class Session implements Runnable{ + static private final String version="JSCH-0.1.45"; + + // http://ietf.org/internet-drafts/draft-ietf-secsh-assignednumbers-01.txt + static final int SSH_MSG_DISCONNECT= 1; + static final int SSH_MSG_IGNORE= 2; + static final int SSH_MSG_UNIMPLEMENTED= 3; + static final int SSH_MSG_DEBUG= 4; + static final int SSH_MSG_SERVICE_REQUEST= 5; + static final int SSH_MSG_SERVICE_ACCEPT= 6; + static final int SSH_MSG_KEXINIT= 20; + static final int SSH_MSG_NEWKEYS= 21; + static final int SSH_MSG_KEXDH_INIT= 30; + static final int SSH_MSG_KEXDH_REPLY= 31; + static final int SSH_MSG_KEX_DH_GEX_GROUP= 31; + static final int SSH_MSG_KEX_DH_GEX_INIT= 32; + static final int SSH_MSG_KEX_DH_GEX_REPLY= 33; + static final int SSH_MSG_KEX_DH_GEX_REQUEST= 34; + static final int SSH_MSG_GLOBAL_REQUEST= 80; + static final int SSH_MSG_REQUEST_SUCCESS= 81; + static final int SSH_MSG_REQUEST_FAILURE= 82; + static final int SSH_MSG_CHANNEL_OPEN= 90; + static final int SSH_MSG_CHANNEL_OPEN_CONFIRMATION= 91; + static final int SSH_MSG_CHANNEL_OPEN_FAILURE= 92; + static final int SSH_MSG_CHANNEL_WINDOW_ADJUST= 93; + static final int SSH_MSG_CHANNEL_DATA= 94; + static final int SSH_MSG_CHANNEL_EXTENDED_DATA= 95; + static final int SSH_MSG_CHANNEL_EOF= 96; + static final int SSH_MSG_CHANNEL_CLOSE= 97; + static final int SSH_MSG_CHANNEL_REQUEST= 98; + static final int SSH_MSG_CHANNEL_SUCCESS= 99; + static final int SSH_MSG_CHANNEL_FAILURE= 100; + + private static final int PACKET_MAX_SIZE = 256 * 1024; + + private byte[] V_S; // server version + private byte[] V_C=Util.str2byte("SSH-2.0-"+version); // client version + + private byte[] I_C; // the payload of the client's SSH_MSG_KEXINIT + private byte[] I_S; // the payload of the server's SSH_MSG_KEXINIT + private byte[] K_S; // the host key + + private byte[] session_id; + + private byte[] IVc2s; + private byte[] IVs2c; + private byte[] Ec2s; + private byte[] Es2c; + private byte[] MACc2s; + private byte[] MACs2c; + + private int seqi=0; + private int seqo=0; + + String[] guess=null; + private Cipher s2ccipher; + private Cipher c2scipher; + private MAC s2cmac; + private MAC c2smac; + //private byte[] mac_buf; + private byte[] s2cmac_result1; + private byte[] s2cmac_result2; + + private Compression deflater; + private Compression inflater; + + private IO io; + private Socket socket; + private int timeout=0; + + private volatile boolean isConnected=false; + + private boolean isAuthed=false; + + private Thread connectThread=null; + private Object lock=new Object(); + + boolean x11_forwarding=false; + boolean agent_forwarding=false; + + InputStream in=null; + OutputStream out=null; + + static Random random; + + Buffer buf; + Packet packet; + + SocketFactory socket_factory=null; + + static final int buffer_margin = 32 + // maximum padding length + 20 + // maximum mac length + 32; // margin for deflater; deflater may inflate data + + private java.util.Hashtable config=null; + + private Proxy proxy=null; + private UserInfo userinfo; + + private String hostKeyAlias=null; + private int serverAliveInterval=0; + private int serverAliveCountMax=1; + + protected boolean daemon_thread=false; + + private long kex_start_time=0L; + + String host="127.0.0.1"; + int port=22; + + String username=null; + byte[] password=null; + + JSch jsch; + + Session(JSch jsch) throws JSchException{ + super(); + this.jsch=jsch; + buf=new Buffer(); + packet=new Packet(buf); + } + + public void connect() throws JSchException{ + connect(timeout); + } + + public void connect(int connectTimeout) throws JSchException{ + if(isConnected){ + throw new JSchException("session is already connected"); + } + + io=new IO(); + if(random==null){ + try{ + Class c=Class.forName(getConfig("random")); + random=(Random)(c.newInstance()); + } + catch(Exception e){ + throw new JSchException(e.toString(), e); + } + } + Packet.setRandom(random); + + if(JSch.getLogger().isEnabled(Logger.INFO)){ + JSch.getLogger().log(Logger.INFO, + "Connecting to "+host+" port "+port); + } + + try { + int i, j; + + if(proxy==null){ + InputStream in; + OutputStream out; + if(socket_factory==null){ + socket=Util.createSocket(host, port, connectTimeout); + in=socket.getInputStream(); + out=socket.getOutputStream(); + } + else{ + socket=socket_factory.createSocket(host, port); + in=socket_factory.getInputStream(socket); + out=socket_factory.getOutputStream(socket); + } + //if(timeout>0){ socket.setSoTimeout(timeout); } + socket.setTcpNoDelay(true); + io.setInputStream(in); + io.setOutputStream(out); + } + else{ + synchronized(proxy){ + proxy.connect(socket_factory, host, port, connectTimeout); + io.setInputStream(proxy.getInputStream()); + io.setOutputStream(proxy.getOutputStream()); + socket=proxy.getSocket(); + } + } + + if(connectTimeout>0 && socket!=null){ + socket.setSoTimeout(connectTimeout); + } + + isConnected=true; + + if(JSch.getLogger().isEnabled(Logger.INFO)){ + JSch.getLogger().log(Logger.INFO, + "Connection established"); + } + + jsch.addSession(this); + + { + // Some Cisco devices will miss to read '\n' if it is sent separately. + byte[] foo=new byte[V_C.length+1]; + System.arraycopy(V_C, 0, foo, 0, V_C.length); + foo[foo.length-1]=(byte)'\n'; + io.put(foo, 0, foo.length); + } + + while(true){ + i=0; + j=0; + while(i0 && buf.buffer[i-1]==13){ // 0x0d + i--; + } + } + + if(i<=3 || + ((i!=buf.buffer.length) && + (buf.buffer[0]!='S'||buf.buffer[1]!='S'|| + buf.buffer[2]!='H'||buf.buffer[3]!='-'))){ + // It must not start with 'SSH-' + //System.err.println(new String(buf.buffer, 0, i); + continue; + } + + if(i==buf.buffer.length || + i<7 || // SSH-1.99 or SSH-2.0 + (buf.buffer[4]=='1' && buf.buffer[6]!='9') // SSH-1.5 + ){ + throw new JSchException("invalid server's version string"); + } + break; + } + + V_S=new byte[i]; System.arraycopy(buf.buffer, 0, V_S, 0, i); + //System.err.println("V_S: ("+i+") ["+new String(V_S)+"]"); + + if(JSch.getLogger().isEnabled(Logger.INFO)){ + JSch.getLogger().log(Logger.INFO, + "Remote version string: "+Util.byte2str(V_S)); + JSch.getLogger().log(Logger.INFO, + "Local version string: "+Util.byte2str(V_C)); + } + + send_kexinit(); + + buf=read(buf); + if(buf.getCommand()!=SSH_MSG_KEXINIT){ + in_kex=false; + throw new JSchException("invalid protocol: "+buf.getCommand()); + } + + if(JSch.getLogger().isEnabled(Logger.INFO)){ + JSch.getLogger().log(Logger.INFO, + "SSH_MSG_KEXINIT received"); + } + + KeyExchange kex=receive_kexinit(buf); + + while(true){ + buf=read(buf); + if(kex.getState()==buf.getCommand()){ + kex_start_time=System.currentTimeMillis(); + boolean result=kex.next(buf); + if(!result){ + //System.err.println("verify: "+result); + in_kex=false; + throw new JSchException("verify: "+result); + } + } + else{ + in_kex=false; + throw new JSchException("invalid protocol(kex): "+buf.getCommand()); + } + if(kex.getState()==KeyExchange.STATE_END){ + break; + } + } + + try{ checkHost(host, port, kex); } + catch(JSchException ee){ + in_kex=false; + throw ee; + } + + send_newkeys(); + + // receive SSH_MSG_NEWKEYS(21) + buf=read(buf); + //System.err.println("read: 21 ? "+buf.getCommand()); + if(buf.getCommand()==SSH_MSG_NEWKEYS){ + + if(JSch.getLogger().isEnabled(Logger.INFO)){ + JSch.getLogger().log(Logger.INFO, + "SSH_MSG_NEWKEYS received"); + } + + receive_newkeys(buf, kex); + } + else{ + in_kex=false; + throw new JSchException("invalid protocol(newkyes): "+buf.getCommand()); + } + + boolean auth=false; + boolean auth_cancel=false; + + UserAuth ua=null; + try{ + Class c=Class.forName(getConfig("userauth.none")); + ua=(UserAuth)(c.newInstance()); + } + catch(Exception e){ + throw new JSchException(e.toString(), e); + } + + auth=ua.start(this); + + String cmethods=getConfig("PreferredAuthentications"); + + String[] cmethoda=Util.split(cmethods, ","); + + String smethods=null; + if(!auth){ + smethods=((UserAuthNone)ua).getMethods(); + if(smethods!=null){ + smethods=smethods.toLowerCase(); + } + else{ + // methods: publickey,password,keyboard-interactive + //smethods="publickey,password,keyboard-interactive"; + smethods=cmethods; + } + } + + String[] smethoda=Util.split(smethods, ","); + + int methodi=0; + + loop: + while(true){ + + while(!auth && + cmethoda!=null && methodi0 || timeout>0){ + socket.setSoTimeout(timeout); + } + + isAuthed=true; + + synchronized(lock){ + if(isConnected){ + connectThread=new Thread(this); + connectThread.setName("Connect thread "+host+" session"); + if(daemon_thread){ + connectThread.setDaemon(daemon_thread); + } + connectThread.start(); + } + else{ + // The session has been already down and + // we don't have to start new thread. + } + } + } + catch(Exception e) { + in_kex=false; + if(isConnected){ + try{ + packet.reset(); + buf.putByte((byte)SSH_MSG_DISCONNECT); + buf.putInt(3); + buf.putString(Util.str2byte(e.toString())); + buf.putString(Util.str2byte("en")); + write(packet); + disconnect(); + } + catch(Exception ee){ + } + } + isConnected=false; + //e.printStackTrace(); + if(e instanceof RuntimeException) throw (RuntimeException)e; + if(e instanceof JSchException) throw (JSchException)e; + throw new JSchException("Session.connect: "+e); + } + finally{ + Util.bzero(this.password); + this.password=null; + } + } + + private KeyExchange receive_kexinit(Buffer buf) throws Exception { + int j=buf.getInt(); + if(j!=buf.getLength()){ // packet was compressed and + buf.getByte(); // j is the size of deflated packet. + I_S=new byte[buf.index-5]; + } + else{ + I_S=new byte[j-1-buf.getByte()]; + } + System.arraycopy(buf.buffer, buf.s, I_S, 0, I_S.length); + + if(!in_kex){ // We are in rekeying activated by the remote! + send_kexinit(); + } + + guess=KeyExchange.guess(I_S, I_C); + if(guess==null){ + throw new JSchException("Algorithm negotiation fail"); + } + + if(!isAuthed && + (guess[KeyExchange.PROPOSAL_ENC_ALGS_CTOS].equals("none") || + (guess[KeyExchange.PROPOSAL_ENC_ALGS_STOC].equals("none")))){ + throw new JSchException("NONE Cipher should not be chosen before authentification is successed."); + } + + KeyExchange kex=null; + try{ + Class c=Class.forName(getConfig(guess[KeyExchange.PROPOSAL_KEX_ALGS])); + kex=(KeyExchange)(c.newInstance()); + } + catch(Exception e){ + throw new JSchException(e.toString(), e); + } + + kex.init(this, V_S, V_C, I_S, I_C); + return kex; + } + + private boolean in_kex=false; + public void rekey() throws Exception { + send_kexinit(); + } + private void send_kexinit() throws Exception { + if(in_kex) + return; + + String cipherc2s=getConfig("cipher.c2s"); + String ciphers2c=getConfig("cipher.s2c"); + + String[] not_available_ciphers=checkCiphers(getConfig("CheckCiphers")); + if(not_available_ciphers!=null && not_available_ciphers.length>0){ + cipherc2s=Util.diffString(cipherc2s, not_available_ciphers); + ciphers2c=Util.diffString(ciphers2c, not_available_ciphers); + if(cipherc2s==null || ciphers2c==null){ + throw new JSchException("There are not any available ciphers."); + } + } + + String kex=getConfig("kex"); + String[] not_available_kexes=checkKexes(getConfig("CheckKexes")); + if(not_available_kexes!=null && not_available_kexes.length>0){ + kex=Util.diffString(kex, not_available_kexes); + if(kex==null){ + throw new JSchException("There are not any available kexes."); + } + } + + in_kex=true; + kex_start_time=System.currentTimeMillis(); + + // byte SSH_MSG_KEXINIT(20) + // byte[16] cookie (random bytes) + // string kex_algorithms + // string server_host_key_algorithms + // string encryption_algorithms_client_to_server + // string encryption_algorithms_server_to_client + // string mac_algorithms_client_to_server + // string mac_algorithms_server_to_client + // string compression_algorithms_client_to_server + // string compression_algorithms_server_to_client + // string languages_client_to_server + // string languages_server_to_client + Buffer buf = new Buffer(); // send_kexinit may be invoked + Packet packet = new Packet(buf); // by user thread. + packet.reset(); + buf.putByte((byte) SSH_MSG_KEXINIT); + synchronized(random){ + random.fill(buf.buffer, buf.index, 16); buf.skip(16); + } + buf.putString(Util.str2byte(kex)); + buf.putString(Util.str2byte(getConfig("server_host_key"))); + buf.putString(Util.str2byte(cipherc2s)); + buf.putString(Util.str2byte(ciphers2c)); + buf.putString(Util.str2byte(getConfig("mac.c2s"))); + buf.putString(Util.str2byte(getConfig("mac.s2c"))); + buf.putString(Util.str2byte(getConfig("compression.c2s"))); + buf.putString(Util.str2byte(getConfig("compression.s2c"))); + buf.putString(Util.str2byte(getConfig("lang.c2s"))); + buf.putString(Util.str2byte(getConfig("lang.s2c"))); + buf.putByte((byte)0); + buf.putInt(0); + + buf.setOffSet(5); + I_C=new byte[buf.getLength()]; + buf.getByte(I_C); + + write(packet); + + if(JSch.getLogger().isEnabled(Logger.INFO)){ + JSch.getLogger().log(Logger.INFO, + "SSH_MSG_KEXINIT sent"); + } + } + + private void send_newkeys() throws Exception { + // send SSH_MSG_NEWKEYS(21) + packet.reset(); + buf.putByte((byte)SSH_MSG_NEWKEYS); + write(packet); + + if(JSch.getLogger().isEnabled(Logger.INFO)){ + JSch.getLogger().log(Logger.INFO, + "SSH_MSG_NEWKEYS sent"); + } + } + + private void checkHost(String chost, int port, KeyExchange kex) throws JSchException { + String shkc=getConfig("StrictHostKeyChecking"); + + if(hostKeyAlias!=null){ + chost=hostKeyAlias; + } + + //System.err.println("shkc: "+shkc); + + byte[] K_S=kex.getHostKey(); + String key_type=kex.getKeyType(); + String key_fprint=kex.getFingerPrint(); + + if(hostKeyAlias==null && port!=22){ + chost=("["+chost+"]:"+port); + } + +// hostkey=new HostKey(chost, K_S); + + HostKeyRepository hkr=jsch.getHostKeyRepository(); + int i=0; + synchronized(hkr){ + i=hkr.check(chost, K_S); + } + + boolean insert=false; + + if((shkc.equals("ask") || shkc.equals("yes")) && + i==HostKeyRepository.CHANGED){ + String file=null; + synchronized(hkr){ + file=hkr.getKnownHostsRepositoryID(); + } + if(file==null){file="known_hosts";} + + boolean b=false; + + if(userinfo!=null){ + String message= +"WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!\n"+ +"IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\n"+ +"Someone could be eavesdropping on you right now (man-in-the-middle attack)!\n"+ +"It is also possible that the "+key_type+" host key has just been changed.\n"+ +"The fingerprint for the "+key_type+" key sent by the remote host is\n"+ +key_fprint+".\n"+ +"Please contact your system administrator.\n"+ +"Add correct host key in "+file+" to get rid of this message."; + + if(shkc.equals("ask")){ + b=userinfo.promptYesNo(message+ + "\nDo you want to delete the old key and insert the new key?"); + } + else{ // shkc.equals("yes") + userinfo.showMessage(message); + } + } + + if(!b){ + throw new JSchException("HostKey has been changed: "+chost); + } + + synchronized(hkr){ + hkr.remove(chost, + (key_type.equals("DSA") ? "ssh-dss" : "ssh-rsa"), + null); + insert=true; + } + } + + if((shkc.equals("ask") || shkc.equals("yes")) && + (i!=HostKeyRepository.OK) && !insert){ + if(shkc.equals("yes")){ + throw new JSchException("reject HostKey: "+host); + } + //System.err.println("finger-print: "+key_fprint); + if(userinfo!=null){ + boolean foo=userinfo.promptYesNo( +"The authenticity of host '"+host+"' can't be established.\n"+ +key_type+" key fingerprint is "+key_fprint+".\n"+ +"Are you sure you want to continue connecting?" + ); + if(!foo){ + throw new JSchException("reject HostKey: "+host); + } + insert=true; + } + else{ + if(i==HostKeyRepository.NOT_INCLUDED) + throw new JSchException("UnknownHostKey: "+host+". "+key_type+" key fingerprint is "+key_fprint); + else + throw new JSchException("HostKey has been changed: "+host); + } + } + + if(shkc.equals("no") && + HostKeyRepository.NOT_INCLUDED==i){ + insert=true; + } + + if(i==HostKeyRepository.OK && + JSch.getLogger().isEnabled(Logger.INFO)){ + JSch.getLogger().log(Logger.INFO, + "Host '"+host+"' is known and mathces the "+key_type+" host key"); + } + + if(insert && + JSch.getLogger().isEnabled(Logger.WARN)){ + JSch.getLogger().log(Logger.WARN, + "Permanently added '"+host+"' ("+key_type+") to the list of known hosts."); + } + + String hkh=getConfig("HashKnownHosts"); + if(hkh.equals("yes") && (hkr instanceof KnownHosts)){ + hostkey=((KnownHosts)hkr).createHashedHostKey(chost, K_S); + } + else{ + hostkey=new HostKey(chost, K_S); + } + + if(insert){ + synchronized(hkr){ + hkr.add(hostkey, userinfo); + } + + } + + } + +//public void start(){ (new Thread(this)).start(); } + + public Channel openChannel(String type) throws JSchException{ + if(!isConnected){ + throw new JSchException("session is down"); + } + try{ + Channel channel=Channel.getChannel(type); + addChannel(channel); + channel.init(); + return channel; + } + catch(Exception e){ + //e.printStackTrace(); + } + return null; + } + + // encode will bin invoked in write with synchronization. + public void encode(Packet packet) throws Exception{ +//System.err.println("encode: "+packet.buffer.getCommand()); +//System.err.println(" "+packet.buffer.index); +//if(packet.buffer.getCommand()==96){ +//Thread.dumpStack(); +//} + if(deflater!=null){ + compress_len[0]=packet.buffer.index; + packet.buffer.buffer=deflater.compress(packet.buffer.buffer, + 5, compress_len); + packet.buffer.index=compress_len[0]; + } + if(c2scipher!=null){ + //packet.padding(c2scipher.getIVSize()); + packet.padding(c2scipher_size); + int pad=packet.buffer.buffer[4]; + synchronized(random){ + random.fill(packet.buffer.buffer, packet.buffer.index-pad, pad); + } + } + else{ + packet.padding(8); + } + + if(c2smac!=null){ + c2smac.update(seqo); + c2smac.update(packet.buffer.buffer, 0, packet.buffer.index); + c2smac.doFinal(packet.buffer.buffer, packet.buffer.index); + } + if(c2scipher!=null){ + byte[] buf=packet.buffer.buffer; + c2scipher.update(buf, 0, packet.buffer.index, buf, 0); + } + if(c2smac!=null){ + packet.buffer.skip(c2smac.getBlockSize()); + } + } + + int[] uncompress_len=new int[1]; + int[] compress_len=new int[1]; + + private int s2ccipher_size=8; + private int c2scipher_size=8; + public Buffer read(Buffer buf) throws Exception{ + int j=0; + while(true){ + buf.reset(); + io.getByte(buf.buffer, buf.index, s2ccipher_size); + buf.index+=s2ccipher_size; + if(s2ccipher!=null){ + s2ccipher.update(buf.buffer, 0, s2ccipher_size, buf.buffer, 0); + } + j=((buf.buffer[0]<<24)&0xff000000)| + ((buf.buffer[1]<<16)&0x00ff0000)| + ((buf.buffer[2]<< 8)&0x0000ff00)| + ((buf.buffer[3] )&0x000000ff); + // RFC 4253 6.1. Maximum Packet Length + if(j<5 || j>PACKET_MAX_SIZE){ + start_discard(buf, s2ccipher, s2cmac, j, PACKET_MAX_SIZE); + } + int need = j+4-s2ccipher_size; + //if(need<0){ + // throw new IOException("invalid data"); + //} + if((buf.index+need)>buf.buffer.length){ + byte[] foo=new byte[buf.index+need]; + System.arraycopy(buf.buffer, 0, foo, 0, buf.index); + buf.buffer=foo; + } + + if((need%s2ccipher_size)!=0){ + String message="Bad packet length "+need; + if(JSch.getLogger().isEnabled(Logger.FATAL)){ + JSch.getLogger().log(Logger.FATAL, message); + } + start_discard(buf, s2ccipher, s2cmac, j, PACKET_MAX_SIZE-s2ccipher_size); + } + + if(need>0){ + io.getByte(buf.buffer, buf.index, need); buf.index+=(need); + if(s2ccipher!=null){ + s2ccipher.update(buf.buffer, s2ccipher_size, need, buf.buffer, s2ccipher_size); + } + } + + if(s2cmac!=null){ + s2cmac.update(seqi); + s2cmac.update(buf.buffer, 0, buf.index); + + s2cmac.doFinal(s2cmac_result1, 0); + io.getByte(s2cmac_result2, 0, s2cmac_result2.length); + if(!java.util.Arrays.equals(s2cmac_result1, s2cmac_result2)){ + if(need > PACKET_MAX_SIZE){ + throw new IOException("MAC Error"); + } + start_discard(buf, s2ccipher, s2cmac, j, PACKET_MAX_SIZE-need); + continue; + } + } + + seqi++; + + if(inflater!=null){ + //inflater.uncompress(buf); + int pad=buf.buffer[4]; + uncompress_len[0]=buf.index-5-pad; + byte[] foo=inflater.uncompress(buf.buffer, 5, uncompress_len); + if(foo!=null){ + buf.buffer=foo; + buf.index=5+uncompress_len[0]; + } + else{ + System.err.println("fail in inflater"); + break; + } + } + + int type=buf.getCommand()&0xff; + //System.err.println("read: "+type); + if(type==SSH_MSG_DISCONNECT){ + buf.rewind(); + buf.getInt();buf.getShort(); + int reason_code=buf.getInt(); + byte[] description=buf.getString(); + byte[] language_tag=buf.getString(); + throw new JSchException("SSH_MSG_DISCONNECT: "+ + reason_code+ + " "+Util.byte2str(description)+ + " "+Util.byte2str(language_tag)); + //break; + } + else if(type==SSH_MSG_IGNORE){ + } + else if(type==SSH_MSG_UNIMPLEMENTED){ + buf.rewind(); + buf.getInt();buf.getShort(); + int reason_id=buf.getInt(); + if(JSch.getLogger().isEnabled(Logger.INFO)){ + JSch.getLogger().log(Logger.INFO, + "Received SSH_MSG_UNIMPLEMENTED for "+reason_id); + } + } + else if(type==SSH_MSG_DEBUG){ + buf.rewind(); + buf.getInt();buf.getShort(); +/* + byte always_display=(byte)buf.getByte(); + byte[] message=buf.getString(); + byte[] language_tag=buf.getString(); + System.err.println("SSH_MSG_DEBUG:"+ + " "+Util.byte2str(message)+ + " "+Util.byte2str(language_tag)); +*/ + } + else if(type==SSH_MSG_CHANNEL_WINDOW_ADJUST){ + buf.rewind(); + buf.getInt();buf.getShort(); + Channel c=Channel.getChannel(buf.getInt(), this); + if(c==null){ + } + else{ + c.addRemoteWindowSize(buf.getInt()); + } + } + else if(type==UserAuth.SSH_MSG_USERAUTH_SUCCESS){ + isAuthed=true; + if(inflater==null && deflater==null){ + String method; + method=guess[KeyExchange.PROPOSAL_COMP_ALGS_CTOS]; + initDeflater(method); + method=guess[KeyExchange.PROPOSAL_COMP_ALGS_STOC]; + initInflater(method); + } + break; + } + else{ + break; + } + } + buf.rewind(); + return buf; + } + + private void start_discard(Buffer buf, Cipher cipher, MAC mac, + int packet_length, int discard) throws JSchException, IOException{ + MAC discard_mac = null; + + if(!cipher.isCBC()){ + throw new JSchException("Packet corrupt"); + } + + if(packet_length!=PACKET_MAX_SIZE && mac != null){ + discard_mac = mac; + } + + discard -= buf.index; + + while(discard>0){ + buf.reset(); + int len = discard>buf.buffer.length ? buf.buffer.length : discard; + io.getByte(buf.buffer, 0, len); + if(discard_mac!=null){ + discard_mac.update(buf.buffer, 0, len); + } + discard -= len; + } + + if(discard_mac!=null){ + discard_mac.doFinal(buf.buffer, 0); + } + + throw new JSchException("Packet corrupt"); + } + + byte[] getSessionId(){ + return session_id; + } + + private void receive_newkeys(Buffer buf, KeyExchange kex) throws Exception { + updateKeys(kex); + in_kex=false; + } + private void updateKeys(KeyExchange kex) throws Exception{ + byte[] K=kex.getK(); + byte[] H=kex.getH(); + HASH hash=kex.getHash(); + +// String[] guess=kex.guess; + + if(session_id==null){ + session_id=new byte[H.length]; + System.arraycopy(H, 0, session_id, 0, H.length); + } + + /* + Initial IV client to server: HASH (K || H || "A" || session_id) + Initial IV server to client: HASH (K || H || "B" || session_id) + Encryption key client to server: HASH (K || H || "C" || session_id) + Encryption key server to client: HASH (K || H || "D" || session_id) + Integrity key client to server: HASH (K || H || "E" || session_id) + Integrity key server to client: HASH (K || H || "F" || session_id) + */ + + buf.reset(); + buf.putMPInt(K); + buf.putByte(H); + buf.putByte((byte)0x41); + buf.putByte(session_id); + hash.update(buf.buffer, 0, buf.index); + IVc2s=hash.digest(); + + int j=buf.index-session_id.length-1; + + buf.buffer[j]++; + hash.update(buf.buffer, 0, buf.index); + IVs2c=hash.digest(); + + buf.buffer[j]++; + hash.update(buf.buffer, 0, buf.index); + Ec2s=hash.digest(); + + buf.buffer[j]++; + hash.update(buf.buffer, 0, buf.index); + Es2c=hash.digest(); + + buf.buffer[j]++; + hash.update(buf.buffer, 0, buf.index); + MACc2s=hash.digest(); + + buf.buffer[j]++; + hash.update(buf.buffer, 0, buf.index); + MACs2c=hash.digest(); + + try{ + Class c; + String method; + + method=guess[KeyExchange.PROPOSAL_ENC_ALGS_STOC]; + c=Class.forName(getConfig(method)); + s2ccipher=(Cipher)(c.newInstance()); + while(s2ccipher.getBlockSize()>Es2c.length){ + buf.reset(); + buf.putMPInt(K); + buf.putByte(H); + buf.putByte(Es2c); + hash.update(buf.buffer, 0, buf.index); + byte[] foo=hash.digest(); + byte[] bar=new byte[Es2c.length+foo.length]; + System.arraycopy(Es2c, 0, bar, 0, Es2c.length); + System.arraycopy(foo, 0, bar, Es2c.length, foo.length); + Es2c=bar; + } + s2ccipher.init(Cipher.DECRYPT_MODE, Es2c, IVs2c); + s2ccipher_size=s2ccipher.getIVSize(); + + method=guess[KeyExchange.PROPOSAL_MAC_ALGS_STOC]; + c=Class.forName(getConfig(method)); + s2cmac=(MAC)(c.newInstance()); + s2cmac.init(MACs2c); + //mac_buf=new byte[s2cmac.getBlockSize()]; + s2cmac_result1=new byte[s2cmac.getBlockSize()]; + s2cmac_result2=new byte[s2cmac.getBlockSize()]; + + method=guess[KeyExchange.PROPOSAL_ENC_ALGS_CTOS]; + c=Class.forName(getConfig(method)); + c2scipher=(Cipher)(c.newInstance()); + while(c2scipher.getBlockSize()>Ec2s.length){ + buf.reset(); + buf.putMPInt(K); + buf.putByte(H); + buf.putByte(Ec2s); + hash.update(buf.buffer, 0, buf.index); + byte[] foo=hash.digest(); + byte[] bar=new byte[Ec2s.length+foo.length]; + System.arraycopy(Ec2s, 0, bar, 0, Ec2s.length); + System.arraycopy(foo, 0, bar, Ec2s.length, foo.length); + Ec2s=bar; + } + c2scipher.init(Cipher.ENCRYPT_MODE, Ec2s, IVc2s); + c2scipher_size=c2scipher.getIVSize(); + + method=guess[KeyExchange.PROPOSAL_MAC_ALGS_CTOS]; + c=Class.forName(getConfig(method)); + c2smac=(MAC)(c.newInstance()); + c2smac.init(MACc2s); + + method=guess[KeyExchange.PROPOSAL_COMP_ALGS_CTOS]; + initDeflater(method); + + method=guess[KeyExchange.PROPOSAL_COMP_ALGS_STOC]; + initInflater(method); + } + catch(Exception e){ + if(e instanceof JSchException) + throw e; + throw new JSchException(e.toString(), e); + //System.err.println("updatekeys: "+e); + } + } + + /*public*/ /*synchronized*/ void write(Packet packet, Channel c, int length) throws Exception{ + long t = getTimeout(); + while(true){ + if(in_kex){ + if(t>0L && (System.currentTimeMillis()-kex_start_time)>t){ + throw new JSchException("timeout in wating for rekeying process."); + } + try{Thread.sleep(10);} + catch(java.lang.InterruptedException e){}; + continue; + } + synchronized(c){ + + if(c.rwsize=length){ + c.rwsize-=length; + break; + } + + } + if(c.close || !c.isConnected()){ + throw new IOException("channel is broken"); + } + + boolean sendit=false; + int s=0; + byte command=0; + int recipient=-1; + synchronized(c){ + if(c.rwsize>0){ + long len=c.rwsize; + if(len>length){ + len=length; + } + if(len!=length){ + s=packet.shift((int)len, + (c2scipher!=null ? c2scipher_size : 8), + (c2smac!=null ? c2smac.getBlockSize() : 0)); + } + command=packet.buffer.getCommand(); + recipient=c.getRecipient(); + length-=len; + c.rwsize-=len; + sendit=true; + } + } + if(sendit){ + _write(packet); + if(length==0){ + return; + } + packet.unshift(command, recipient, s, length); + } + + synchronized(c){ + if(in_kex){ + continue; + } + if(c.rwsize>=length){ + c.rwsize-=length; + break; + } + + //try{ + //System.out.println("1wait: "+c.rwsize); + // c.notifyme++; + // c.wait(100); + //} + //catch(java.lang.InterruptedException e){ + //} + //finally{ + // c.notifyme--; + //} + } + } + _write(packet); + } + + public void write(Packet packet) throws Exception{ + // System.err.println("in_kex="+in_kex+" "+(packet.buffer.getCommand())); + long t = getTimeout(); + while(in_kex){ + if(t>0L && (System.currentTimeMillis()-kex_start_time)>t){ + throw new JSchException("timeout in wating for rekeying process."); + } + byte command=packet.buffer.getCommand(); + //System.err.println("command: "+command); + if(command==SSH_MSG_KEXINIT || + command==SSH_MSG_NEWKEYS || + command==SSH_MSG_KEXDH_INIT || + command==SSH_MSG_KEXDH_REPLY || + command==SSH_MSG_KEX_DH_GEX_GROUP || + command==SSH_MSG_KEX_DH_GEX_INIT || + command==SSH_MSG_KEX_DH_GEX_REPLY || + command==SSH_MSG_KEX_DH_GEX_REQUEST || + command==SSH_MSG_DISCONNECT){ + break; + } + try{Thread.sleep(10);} + catch(java.lang.InterruptedException e){}; + } + _write(packet); + } + + private void _write(Packet packet) throws Exception{ + synchronized(lock){ + encode(packet); + if(io!=null){ + io.put(packet); + seqo++; + } + } + } + + Runnable thread; + public void run(){ + thread=this; + + byte[] foo; + Buffer buf=new Buffer(); + Packet packet=new Packet(buf); + int i=0; + Channel channel; + int[] start=new int[1]; + int[] length=new int[1]; + KeyExchange kex=null; + + int stimeout=0; + try{ + while(isConnected && + thread!=null){ + try{ + buf=read(buf); + stimeout=0; + } + catch(InterruptedIOException/*SocketTimeoutException*/ ee){ + if(!in_kex && stimeout0){ + attr.extended=new String[count*2]; + for(int i=0; i0){ + for(int i=0; i0){ + for(int i=0; i0 + ||(name.length()>0 || instruction.length()>0) + ){ + if(userinfo!=null){ + UIKeyboardInteractive kbi=(UIKeyboardInteractive)userinfo; + String[] _response=kbi.promptKeyboardInteractive(dest, + name, + instruction, + prompt, + echo); + if(_response!=null){ + response=new byte[_response.length][]; + for(int i=0; i<_response.length; i++){ + response[i]=Util.str2byte(_response[i]); + } + } + } + } + + // byte SSH_MSG_USERAUTH_INFO_RESPONSE(61) + // int num-responses + // string response[1] (ISO-10646 UTF-8) + // ... + // string response[num-responses] (ISO-10646 UTF-8) + packet.reset(); + buf.putByte((byte)SSH_MSG_USERAUTH_INFO_RESPONSE); + if(num>0 && + (response==null || // cancel + num!=response.length)){ + + if(response==null){ + // working around the bug in OpenSSH ;-< + buf.putInt(num); + for(int i=0; i>>24); + tmp[1]=(byte)(sidlen>>>16); + tmp[2]=(byte)(sidlen>>>8); + tmp[3]=(byte)(sidlen); + System.arraycopy(sid, 0, tmp, 4, sidlen); + System.arraycopy(buf.buffer, 5, tmp, 4+sidlen, buf.index-5); + byte[] signature=identity.getSignature(tmp); + if(signature==null){ // for example, too long key length. + break; + } + buf.putString(signature); + session.write(packet); + + loop2: + while(true){ + buf=session.read(buf); + command=buf.getCommand()&0xff; + + if(command==SSH_MSG_USERAUTH_SUCCESS){ + return true; + } + else if(command==SSH_MSG_USERAUTH_BANNER){ + buf.getInt(); buf.getByte(); buf.getByte(); + byte[] _message=buf.getString(); + byte[] lang=buf.getString(); + String message=Util.byte2str(_message); + if(userinfo!=null){ + userinfo.showMessage(message); + } + continue loop2; + } + else if(command==SSH_MSG_USERAUTH_FAILURE){ + buf.getInt(); buf.getByte(); buf.getByte(); + byte[] foo=buf.getString(); + int partial_success=buf.getByte(); + //System.err.println(new String(foo)+ + // " partial_success:"+(partial_success!=0)); + if(partial_success!=0){ + throw new JSchPartialAuthException(Util.byte2str(foo)); + } + break; + } + //System.err.println("USERAUTH fail ("+command+")"); + //throw new JSchException("USERAUTH fail ("+command+")"); + break; + } + } + } + return false; + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/UserInfo.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/UserInfo.java new file mode 100644 index 000000000..bd3646127 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/UserInfo.java @@ -0,0 +1,39 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; + +public interface UserInfo{ + String getPassphrase(); + String getPassword(); + boolean promptPassword(String message); + boolean promptPassphrase(String message); + boolean promptYesNo(String message); + void showMessage(String message); +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/Util.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/Util.java new file mode 100644 index 000000000..d8a0285d2 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/Util.java @@ -0,0 +1,474 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch; +import java.net.Socket; + +class Util{ + + private static final byte[] b64 =Util.str2byte("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="); + private static byte val(byte foo){ + if(foo == '=') return 0; + for(int j=0; j>>4)); + if(buf[i+2]==(byte)'='){ j++; break;} + foo[j+1]=(byte)(((val(buf[i+1])&0x0f)<<4)|((val(buf[i+2])&0x3c)>>>2)); + if(buf[i+3]==(byte)'='){ j+=2; break;} + foo[j+2]=(byte)(((val(buf[i+2])&0x03)<<6)|(val(buf[i+3])&0x3f)); + j+=3; + } + byte[] bar=new byte[j]; + System.arraycopy(foo, 0, bar, 0, j); + return bar; + } + static byte[] toBase64(byte[] buf, int start, int length){ + + byte[] tmp=new byte[length*2]; + int i,j,k; + + int foo=(length/3)*3+start; + i=0; + for(j=start; j>>2)&0x3f; + tmp[i++]=b64[k]; + k=(buf[j]&0x03)<<4|(buf[j+1]>>>4)&0x0f; + tmp[i++]=b64[k]; + k=(buf[j+1]&0x0f)<<2|(buf[j+2]>>>6)&0x03; + tmp[i++]=b64[k]; + k=buf[j+2]&0x3f; + tmp[i++]=b64[k]; + } + + foo=(start+length)-foo; + if(foo==1){ + k=(buf[j]>>>2)&0x3f; + tmp[i++]=b64[k]; + k=((buf[j]&0x03)<<4)&0x3f; + tmp[i++]=b64[k]; + tmp[i++]=(byte)'='; + tmp[i++]=(byte)'='; + } + else if(foo==2){ + k=(buf[j]>>>2)&0x3f; + tmp[i++]=b64[k]; + k=(buf[j]&0x03)<<4|(buf[j+1]>>>4)&0x0f; + tmp[i++]=b64[k]; + k=((buf[j+1]&0x0f)<<2)&0x3f; + tmp[i++]=b64[k]; + tmp[i++]=(byte)'='; + } + byte[] bar=new byte[i]; + System.arraycopy(tmp, 0, bar, 0, i); + return bar; + +// return sun.misc.BASE64Encoder().encode(buf); + } + + static String[] split(String foo, String split){ + if(foo==null) + return null; + byte[] buf=Util.str2byte(foo); + java.util.Vector bar=new java.util.Vector(); + int start=0; + int index; + while(true){ + index=foo.indexOf(split, start); + if(index>=0){ + bar.addElement(Util.byte2str(buf, start, index-start)); + start=index+1; + continue; + } + bar.addElement(Util.byte2str(buf, start, buf.length-start)); + break; + } + String[] result=new String[bar.size()]; + for(int i=0; i0 && name[0]=='.'){ + if(pattern.length>0 && pattern[0]=='.'){ + if(pattern.length==2 && pattern[1]=='*') return true; + return glob(pattern, pattern_index+1, name, name_index+1); + } + return false; + } + return glob(pattern, pattern_index, name, name_index); + } + static private boolean glob(byte[] pattern, int pattern_index, + byte[] name, int name_index){ + //System.err.println("glob: "+new String(pattern)+", "+pattern_index+" "+new String(name)+", "+name_index); + + int patternlen=pattern.length; + if(patternlen==0) + return false; + + int namelen=name.length; + int i=pattern_index; + int j=name_index; + + while(i>>4)&0xf]); + sb.append(chars[(bar)&0xf]); + if(i+1>>8); + bar[j++]=(byte)foo[i]; + } + } + return bar; + } + */ + static void bzero(byte[] foo){ + if(foo==null) + return; + for(int i=0; iivsize){ + tmp=new byte[ivsize]; + System.arraycopy(iv, 0, tmp, 0, tmp.length); + iv=tmp; + } + if(key.length>bsize){ + tmp=new byte[bsize]; + System.arraycopy(key, 0, tmp, 0, tmp.length); + key=tmp; + } + + try{ + SecretKeySpec keyspec=new SecretKeySpec(key, "AES"); + cipher=javax.crypto.Cipher.getInstance("AES/CBC/"+pad); + cipher.init((mode==ENCRYPT_MODE? + javax.crypto.Cipher.ENCRYPT_MODE: + javax.crypto.Cipher.DECRYPT_MODE), + keyspec, new IvParameterSpec(iv)); + } + catch(Exception e){ + cipher=null; + throw e; + } + } + public void update(byte[] foo, int s1, int len, byte[] bar, int s2) throws Exception{ + cipher.update(foo, s1, len, bar, s2); + } + + public boolean isCBC(){return true; } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/AES128CTR.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/AES128CTR.java new file mode 100644 index 000000000..b66e6e948 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/AES128CTR.java @@ -0,0 +1,73 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2008-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jce; + +import com.jcraft.jsch.Cipher; +import javax.crypto.spec.*; + +public class AES128CTR implements Cipher{ + private static final int ivsize=16; + private static final int bsize=16; + private javax.crypto.Cipher cipher; + public int getIVSize(){return ivsize;} + public int getBlockSize(){return bsize;} + public void init(int mode, byte[] key, byte[] iv) throws Exception{ + String pad="NoPadding"; + byte[] tmp; + if(iv.length>ivsize){ + tmp=new byte[ivsize]; + System.arraycopy(iv, 0, tmp, 0, tmp.length); + iv=tmp; + } + if(key.length>bsize){ + tmp=new byte[bsize]; + System.arraycopy(key, 0, tmp, 0, tmp.length); + key=tmp; + } + + try{ + SecretKeySpec keyspec=new SecretKeySpec(key, "AES"); + cipher=javax.crypto.Cipher.getInstance("AES/CTR/"+pad); + cipher.init((mode==ENCRYPT_MODE? + javax.crypto.Cipher.ENCRYPT_MODE: + javax.crypto.Cipher.DECRYPT_MODE), + keyspec, new IvParameterSpec(iv)); + } + catch(Exception e){ + cipher=null; + throw e; + } + } + public void update(byte[] foo, int s1, int len, byte[] bar, int s2) throws Exception{ + cipher.update(foo, s1, len, bar, s2); + } + + public boolean isCBC(){return false; } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/AES192CBC.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/AES192CBC.java new file mode 100644 index 000000000..68ff52b1a --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/AES192CBC.java @@ -0,0 +1,71 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2005-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jce; + +import com.jcraft.jsch.Cipher; +import javax.crypto.spec.*; + +public class AES192CBC implements Cipher{ + private static final int ivsize=16; + private static final int bsize=24; + private javax.crypto.Cipher cipher; + public int getIVSize(){return ivsize;} + public int getBlockSize(){return bsize;} + public void init(int mode, byte[] key, byte[] iv) throws Exception{ + String pad="NoPadding"; + byte[] tmp; + if(iv.length>ivsize){ + tmp=new byte[ivsize]; + System.arraycopy(iv, 0, tmp, 0, tmp.length); + iv=tmp; + } + if(key.length>bsize){ + tmp=new byte[bsize]; + System.arraycopy(key, 0, tmp, 0, tmp.length); + key=tmp; + } + try{ + SecretKeySpec keyspec=new SecretKeySpec(key, "AES"); + cipher=javax.crypto.Cipher.getInstance("AES/CBC/"+pad); + cipher.init((mode==ENCRYPT_MODE? + javax.crypto.Cipher.ENCRYPT_MODE: + javax.crypto.Cipher.DECRYPT_MODE), + keyspec, new IvParameterSpec(iv)); + } + catch(Exception e){ + cipher=null; + throw e; + } + } + public void update(byte[] foo, int s1, int len, byte[] bar, int s2) throws Exception{ + cipher.update(foo, s1, len, bar, s2); + } + public boolean isCBC(){return true; } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/AES192CTR.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/AES192CTR.java new file mode 100644 index 000000000..7a204c6e2 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/AES192CTR.java @@ -0,0 +1,71 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2008-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jce; + +import com.jcraft.jsch.Cipher; +import javax.crypto.spec.*; + +public class AES192CTR implements Cipher{ + private static final int ivsize=16; + private static final int bsize=24; + private javax.crypto.Cipher cipher; + public int getIVSize(){return ivsize;} + public int getBlockSize(){return bsize;} + public void init(int mode, byte[] key, byte[] iv) throws Exception{ + String pad="NoPadding"; + byte[] tmp; + if(iv.length>ivsize){ + tmp=new byte[ivsize]; + System.arraycopy(iv, 0, tmp, 0, tmp.length); + iv=tmp; + } + if(key.length>bsize){ + tmp=new byte[bsize]; + System.arraycopy(key, 0, tmp, 0, tmp.length); + key=tmp; + } + try{ + SecretKeySpec keyspec=new SecretKeySpec(key, "AES"); + cipher=javax.crypto.Cipher.getInstance("AES/CTR/"+pad); + cipher.init((mode==ENCRYPT_MODE? + javax.crypto.Cipher.ENCRYPT_MODE: + javax.crypto.Cipher.DECRYPT_MODE), + keyspec, new IvParameterSpec(iv)); + } + catch(Exception e){ + cipher=null; + throw e; + } + } + public void update(byte[] foo, int s1, int len, byte[] bar, int s2) throws Exception{ + cipher.update(foo, s1, len, bar, s2); + } + public boolean isCBC(){return false; } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/AES256CBC.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/AES256CBC.java new file mode 100644 index 000000000..55f61713c --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/AES256CBC.java @@ -0,0 +1,71 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2005-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jce; + +import com.jcraft.jsch.Cipher; +import javax.crypto.spec.*; + +public class AES256CBC implements Cipher{ + private static final int ivsize=16; + private static final int bsize=32; + private javax.crypto.Cipher cipher; + public int getIVSize(){return ivsize;} + public int getBlockSize(){return bsize;} + public void init(int mode, byte[] key, byte[] iv) throws Exception{ + String pad="NoPadding"; + byte[] tmp; + if(iv.length>ivsize){ + tmp=new byte[ivsize]; + System.arraycopy(iv, 0, tmp, 0, tmp.length); + iv=tmp; + } + if(key.length>bsize){ + tmp=new byte[bsize]; + System.arraycopy(key, 0, tmp, 0, tmp.length); + key=tmp; + } + try{ + SecretKeySpec keyspec=new SecretKeySpec(key, "AES"); + cipher=javax.crypto.Cipher.getInstance("AES/CBC/"+pad); + cipher.init((mode==ENCRYPT_MODE? + javax.crypto.Cipher.ENCRYPT_MODE: + javax.crypto.Cipher.DECRYPT_MODE), + keyspec, new IvParameterSpec(iv)); + } + catch(Exception e){ + cipher=null; + throw e; + } + } + public void update(byte[] foo, int s1, int len, byte[] bar, int s2) throws Exception{ + cipher.update(foo, s1, len, bar, s2); + } + public boolean isCBC(){return true; } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/AES256CTR.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/AES256CTR.java new file mode 100644 index 000000000..7bb6c2d79 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/AES256CTR.java @@ -0,0 +1,71 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2008-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jce; + +import com.jcraft.jsch.Cipher; +import javax.crypto.spec.*; + +public class AES256CTR implements Cipher{ + private static final int ivsize=16; + private static final int bsize=32; + private javax.crypto.Cipher cipher; + public int getIVSize(){return ivsize;} + public int getBlockSize(){return bsize;} + public void init(int mode, byte[] key, byte[] iv) throws Exception{ + String pad="NoPadding"; + byte[] tmp; + if(iv.length>ivsize){ + tmp=new byte[ivsize]; + System.arraycopy(iv, 0, tmp, 0, tmp.length); + iv=tmp; + } + if(key.length>bsize){ + tmp=new byte[bsize]; + System.arraycopy(key, 0, tmp, 0, tmp.length); + key=tmp; + } + try{ + SecretKeySpec keyspec=new SecretKeySpec(key, "AES"); + cipher=javax.crypto.Cipher.getInstance("AES/CTR/"+pad); + cipher.init((mode==ENCRYPT_MODE? + javax.crypto.Cipher.ENCRYPT_MODE: + javax.crypto.Cipher.DECRYPT_MODE), + keyspec, new IvParameterSpec(iv)); + } + catch(Exception e){ + cipher=null; + throw e; + } + } + public void update(byte[] foo, int s1, int len, byte[] bar, int s2) throws Exception{ + cipher.update(foo, s1, len, bar, s2); + } + public boolean isCBC(){return false; } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/ARCFOUR.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/ARCFOUR.java new file mode 100644 index 000000000..e2640a5b3 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/ARCFOUR.java @@ -0,0 +1,68 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2008-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jce; + +import com.jcraft.jsch.Cipher; +import javax.crypto.*; +import javax.crypto.spec.*; + +public class ARCFOUR implements Cipher{ + private static final int ivsize=8; + private static final int bsize=16; + private javax.crypto.Cipher cipher; + public int getIVSize(){return ivsize;} + public int getBlockSize(){return bsize;} + public void init(int mode, byte[] key, byte[] iv) throws Exception{ + String pad="NoPadding"; + byte[] tmp; + if(key.length>bsize){ + tmp=new byte[bsize]; + System.arraycopy(key, 0, tmp, 0, tmp.length); + key=tmp; + } + + try{ + cipher=javax.crypto.Cipher.getInstance("RC4"); + SecretKeySpec _key = new SecretKeySpec(key, "RC4"); + cipher.init((mode==ENCRYPT_MODE? + javax.crypto.Cipher.ENCRYPT_MODE: + javax.crypto.Cipher.DECRYPT_MODE), + _key); + } + catch(Exception e){ + cipher=null; + throw e; + } + } + public void update(byte[] foo, int s1, int len, byte[] bar, int s2) throws Exception{ + cipher.update(foo, s1, len, bar, s2); + } + public boolean isCBC(){return false; } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/ARCFOUR128.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/ARCFOUR128.java new file mode 100644 index 000000000..1b59f320e --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/ARCFOUR128.java @@ -0,0 +1,71 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2008-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jce; + +import com.jcraft.jsch.Cipher; +import javax.crypto.*; +import javax.crypto.spec.*; + +public class ARCFOUR128 implements Cipher{ + private static final int ivsize=8; + private static final int bsize=16; + private static final int skip=1536; + private javax.crypto.Cipher cipher; + public int getIVSize(){return ivsize;} + public int getBlockSize(){return bsize;} + public void init(int mode, byte[] key, byte[] iv) throws Exception{ + byte[] tmp; + if(key.length>bsize){ + tmp=new byte[bsize]; + System.arraycopy(key, 0, tmp, 0, tmp.length); + key=tmp; + } + try{ + cipher=javax.crypto.Cipher.getInstance("RC4"); + SecretKeySpec _key = new SecretKeySpec(key, "RC4"); + cipher.init((mode==ENCRYPT_MODE? + javax.crypto.Cipher.ENCRYPT_MODE: + javax.crypto.Cipher.DECRYPT_MODE), + _key); + byte[] foo=new byte[1]; + for(int i=0; ibsize){ + tmp=new byte[bsize]; + System.arraycopy(key, 0, tmp, 0, tmp.length); + key=tmp; + } + try{ + cipher=javax.crypto.Cipher.getInstance("RC4"); + SecretKeySpec _key = new SecretKeySpec(key, "RC4"); + cipher.init((mode==ENCRYPT_MODE? + javax.crypto.Cipher.ENCRYPT_MODE: + javax.crypto.Cipher.DECRYPT_MODE), + _key); + byte[] foo=new byte[1]; + for(int i=0; iivsize){ + tmp=new byte[ivsize]; + System.arraycopy(iv, 0, tmp, 0, tmp.length); + iv=tmp; + } + if(key.length>bsize){ + tmp=new byte[bsize]; + System.arraycopy(key, 0, tmp, 0, tmp.length); + key=tmp; + } + try{ + SecretKeySpec skeySpec = new SecretKeySpec(key, "Blowfish"); + cipher=javax.crypto.Cipher.getInstance("Blowfish/CBC/"+pad); + cipher.init((mode==ENCRYPT_MODE? + javax.crypto.Cipher.ENCRYPT_MODE: + javax.crypto.Cipher.DECRYPT_MODE), + skeySpec, new IvParameterSpec(iv)); + } + catch(Exception e){ + throw e; + } + } + public void update(byte[] foo, int s1, int len, byte[] bar, int s2) throws Exception{ + cipher.update(foo, s1, len, bar, s2); + } + public boolean isCBC(){return true; } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/DH.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/DH.java new file mode 100644 index 000000000..f28146cf4 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/DH.java @@ -0,0 +1,91 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jce; + +import java.math.BigInteger; +import java.security.*; +import javax.crypto.*; +import javax.crypto.spec.*; + +public class DH implements com.jcraft.jsch.DH{ + BigInteger p; + BigInteger g; + BigInteger e; // my public key + byte[] e_array; + BigInteger f; // your public key + BigInteger K; // shared secret key + byte[] K_array; + + private KeyPairGenerator myKpairGen; + private KeyAgreement myKeyAgree; + public void init() throws Exception{ + myKpairGen=KeyPairGenerator.getInstance("DH"); +// myKpairGen=KeyPairGenerator.getInstance("DiffieHellman"); + myKeyAgree=KeyAgreement.getInstance("DH"); +// myKeyAgree=KeyAgreement.getInstance("DiffieHellman"); + } + public byte[] getE() throws Exception{ + if(e==null){ + DHParameterSpec dhSkipParamSpec=new DHParameterSpec(p, g); + myKpairGen.initialize(dhSkipParamSpec); + KeyPair myKpair=myKpairGen.generateKeyPair(); + myKeyAgree.init(myKpair.getPrivate()); +// BigInteger x=((javax.crypto.interfaces.DHPrivateKey)(myKpair.getPrivate())).getX(); + byte[] myPubKeyEnc=myKpair.getPublic().getEncoded(); + e=((javax.crypto.interfaces.DHPublicKey)(myKpair.getPublic())).getY(); + e_array=e.toByteArray(); + } + return e_array; + } + public byte[] getK() throws Exception{ + if(K==null){ + KeyFactory myKeyFac=KeyFactory.getInstance("DH"); + DHPublicKeySpec keySpec=new DHPublicKeySpec(f, p, g); + PublicKey yourPubKey=myKeyFac.generatePublic(keySpec); + myKeyAgree.doPhase(yourPubKey, true); + byte[] mySharedSecret=myKeyAgree.generateSecret(); + K=new BigInteger(mySharedSecret); + K_array=K.toByteArray(); + +//System.err.println("K.signum(): "+K.signum()+ +// " "+Integer.toHexString(mySharedSecret[0]&0xff)+ +// " "+Integer.toHexString(K_array[0]&0xff)); + + K_array=mySharedSecret; + } + return K_array; + } + public void setP(byte[] p){ setP(new BigInteger(p)); } + public void setG(byte[] g){ setG(new BigInteger(g)); } + public void setF(byte[] f){ setF(new BigInteger(f)); } + void setP(BigInteger p){this.p=p;} + void setG(BigInteger g){this.g=g;} + void setF(BigInteger f){this.f=f;} +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/HMACMD5.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/HMACMD5.java new file mode 100644 index 000000000..78e1cf0e4 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/HMACMD5.java @@ -0,0 +1,75 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jce; + +import com.jcraft.jsch.MAC; +import javax.crypto.*; +import javax.crypto.spec.*; + +public class HMACMD5 implements MAC{ + private static final String name="hmac-md5"; + private static final int BSIZE=16; + private Mac mac; + public int getBlockSize(){return BSIZE;}; + public void init(byte[] key) throws Exception{ + if(key.length>BSIZE){ + byte[] tmp=new byte[BSIZE]; + System.arraycopy(key, 0, tmp, 0, BSIZE); + key=tmp; + } + + SecretKeySpec skey=new SecretKeySpec(key, "HmacMD5"); + mac=Mac.getInstance("HmacMD5"); + mac.init(skey); + } + + private final byte[] tmp=new byte[4]; + public void update(int i){ + tmp[0]=(byte)(i>>>24); + tmp[1]=(byte)(i>>>16); + tmp[2]=(byte)(i>>>8); + tmp[3]=(byte)i; + update(tmp, 0, 4); + } + public void update(byte foo[], int s, int l){ + mac.update(foo, s, l); + } + public void doFinal(byte[] buf, int offset){ + try{ + mac.doFinal(buf, offset); + } + catch(ShortBufferException e){ + } + } + + public String getName(){ + return name; + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/HMACMD596.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/HMACMD596.java new file mode 100644 index 000000000..dd5bb9404 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/HMACMD596.java @@ -0,0 +1,77 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jce; + +import com.jcraft.jsch.MAC; +import javax.crypto.*; +import javax.crypto.spec.*; + +public class HMACMD596 implements MAC{ + private static final String name="hmac-md5-96"; + private static final int bsize=12; + private Mac mac; + public int getBlockSize(){return bsize;}; + public void init(byte[] key) throws Exception{ + if(key.length>16){ + byte[] tmp=new byte[16]; + System.arraycopy(key, 0, tmp, 0, 16); + key=tmp; + } + SecretKeySpec skey=new SecretKeySpec(key, "HmacMD5"); + mac=Mac.getInstance("HmacMD5"); + mac.init(skey); + } + private final byte[] tmp=new byte[4]; + public void update(int i){ + tmp[0]=(byte)(i>>>24); + tmp[1]=(byte)(i>>>16); + tmp[2]=(byte)(i>>>8); + tmp[3]=(byte)i; + update(tmp, 0, 4); + } + + public void update(byte foo[], int s, int l){ + mac.update(foo, s, l); + } + + private final byte[] _buf16=new byte[16]; + public void doFinal(byte[] buf, int offset){ + try{ + mac.doFinal(_buf16, 0); + } + catch(ShortBufferException e){ + } + System.arraycopy(_buf16, 0, buf, offset, 12); + } + + public String getName(){ + return name; + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/HMACSHA1.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/HMACSHA1.java new file mode 100644 index 000000000..d0cd418fb --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/HMACSHA1.java @@ -0,0 +1,75 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jce; + +import com.jcraft.jsch.MAC; +import javax.crypto.*; +import javax.crypto.spec.*; + +public class HMACSHA1 implements MAC{ + private static final String name="hmac-sha1"; + private static final int bsize=20; + private Mac mac; + public int getBlockSize(){return bsize;}; + public void init(byte[] key) throws Exception{ + if(key.length>bsize){ + byte[] tmp=new byte[bsize]; + System.arraycopy(key, 0, tmp, 0, bsize); + key=tmp; + } + SecretKeySpec skey=new SecretKeySpec(key, "HmacSHA1"); + mac=Mac.getInstance("HmacSHA1"); + mac.init(skey); + } + private final byte[] tmp=new byte[4]; + public void update(int i){ + tmp[0]=(byte)(i>>>24); + tmp[1]=(byte)(i>>>16); + tmp[2]=(byte)(i>>>8); + tmp[3]=(byte)i; + update(tmp, 0, 4); + } + + public void update(byte foo[], int s, int l){ + mac.update(foo, s, l); + } + + public void doFinal(byte[] buf, int offset){ + try{ + mac.doFinal(buf, offset); + } + catch(ShortBufferException e){ + } + } + + public String getName(){ + return name; + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/HMACSHA196.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/HMACSHA196.java new file mode 100644 index 000000000..d0e8256f9 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/HMACSHA196.java @@ -0,0 +1,76 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jce; + +import com.jcraft.jsch.MAC; +import javax.crypto.*; +import javax.crypto.spec.*; + +public class HMACSHA196 implements MAC{ + private static final String name="hmac-sha1-96"; + private static final int bsize=12; + private Mac mac; + public int getBlockSize(){return bsize;}; + public void init(byte[] key) throws Exception{ + if(key.length>20){ + byte[] tmp=new byte[20]; + System.arraycopy(key, 0, tmp, 0, 20); + key=tmp; + } + SecretKeySpec skey=new SecretKeySpec(key, "HmacSHA1"); + mac=Mac.getInstance("HmacSHA1"); + mac.init(skey); + } + private final byte[] tmp=new byte[4]; + public void update(int i){ + tmp[0]=(byte)(i>>>24); + tmp[1]=(byte)(i>>>16); + tmp[2]=(byte)(i>>>8); + tmp[3]=(byte)i; + update(tmp, 0, 4); + } + public void update(byte foo[], int s, int l){ + mac.update(foo, s, l); + } + + private final byte[] _buf20=new byte[20]; + public void doFinal(byte[] buf, int offset){ + try{ + mac.doFinal(_buf20, 0); + } + catch(ShortBufferException e){ + } + System.arraycopy(_buf20, 0, buf, offset, 12); + } + + public String getName(){ + return name; + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/KeyPairGenDSA.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/KeyPairGenDSA.java new file mode 100644 index 000000000..6c25d5a0e --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/KeyPairGenDSA.java @@ -0,0 +1,62 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jce; + +import java.security.*; +import java.security.interfaces.*; + +public class KeyPairGenDSA implements com.jcraft.jsch.KeyPairGenDSA{ + byte[] x; // private + byte[] y; // public + byte[] p; + byte[] q; + byte[] g; + + public void init(int key_size) throws Exception{ + KeyPairGenerator keyGen = KeyPairGenerator.getInstance("DSA"); + keyGen.initialize(key_size, new SecureRandom()); + KeyPair pair = keyGen.generateKeyPair(); + PublicKey pubKey=pair.getPublic(); + PrivateKey prvKey=pair.getPrivate(); + + x=((DSAPrivateKey)prvKey).getX().toByteArray(); + y=((DSAPublicKey)pubKey).getY().toByteArray(); + + DSAParams params=((DSAKey)prvKey).getParams(); + p=params.getP().toByteArray(); + q=params.getQ().toByteArray(); + g=params.getG().toByteArray(); + } + public byte[] getX(){return x;} + public byte[] getY(){return y;} + public byte[] getP(){return p;} + public byte[] getQ(){return q;} + public byte[] getG(){return g;} +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/KeyPairGenRSA.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/KeyPairGenRSA.java new file mode 100644 index 000000000..552470c51 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/KeyPairGenRSA.java @@ -0,0 +1,72 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jce; + +import java.security.*; +import java.security.interfaces.*; + +public class KeyPairGenRSA implements com.jcraft.jsch.KeyPairGenRSA{ + byte[] d; // private + byte[] e; // public + byte[] n; + + byte[] c; // coefficient + byte[] ep; // exponent p + byte[] eq; // exponent q + byte[] p; // prime p + byte[] q; // prime q + + public void init(int key_size) throws Exception{ + KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA"); + keyGen.initialize(key_size, new SecureRandom()); + KeyPair pair = keyGen.generateKeyPair(); + + PublicKey pubKey=pair.getPublic(); + PrivateKey prvKey=pair.getPrivate(); + + d=((RSAPrivateKey)prvKey).getPrivateExponent().toByteArray(); + e=((RSAPublicKey)pubKey).getPublicExponent().toByteArray(); + n=((RSAPrivateKey)prvKey).getModulus().toByteArray(); + + c=((RSAPrivateCrtKey)prvKey).getCrtCoefficient().toByteArray(); + ep=((RSAPrivateCrtKey)prvKey).getPrimeExponentP().toByteArray(); + eq=((RSAPrivateCrtKey)prvKey).getPrimeExponentQ().toByteArray(); + p=((RSAPrivateCrtKey)prvKey).getPrimeP().toByteArray(); + q=((RSAPrivateCrtKey)prvKey).getPrimeQ().toByteArray(); + } + public byte[] getD(){return d;} + public byte[] getE(){return e;} + public byte[] getN(){return n;} + public byte[] getC(){return c;} + public byte[] getEP(){return ep;} + public byte[] getEQ(){return eq;} + public byte[] getP(){return p;} + public byte[] getQ(){return q;} +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/MD5.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/MD5.java new file mode 100644 index 000000000..99f351a7c --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/MD5.java @@ -0,0 +1,51 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jce; + +import com.jcraft.jsch.HASH; + +import java.security.*; + +public class MD5 implements HASH{ + MessageDigest md; + public int getBlockSize(){return 16;} + public void init() throws Exception{ + try{ md=MessageDigest.getInstance("MD5"); } + catch(Exception e){ + System.err.println(e); + } + } + public void update(byte[] foo, int start, int len) throws Exception{ + md.update(foo, start, len); + } + public byte[] digest() throws Exception{ + return md.digest(); + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/Random.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/Random.java new file mode 100644 index 000000000..1b396f8bd --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/Random.java @@ -0,0 +1,81 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jce; + +import java.security.SecureRandom; + +public class Random implements com.jcraft.jsch.Random{ + private byte[] tmp=new byte[16]; + private SecureRandom random=null; + public Random(){ + + // We hope that 'new SecureRandom()' will use NativePRNG algorithm + // on Sun's Java5 for GNU/Linux and Solaris. + // It seems NativePRNG refers to /dev/urandom and it must not be blocked, + // but NativePRNG is slower than SHA1PRNG ;-< + // TIPS: By adding option '-Djava.security.egd=file:/dev/./urandom' + // SHA1PRNG will be used instead of NativePRNG. + // On MacOSX, 'new SecureRandom()' will use NativePRNG algorithm and + // it is also slower than SHA1PRNG. + // On Windows, 'new SecureRandom()' will use SHA1PRNG algorithm. + random=new SecureRandom(); + + /* + try{ + random=SecureRandom.getInstance("SHA1PRNG"); + return; + } + catch(java.security.NoSuchAlgorithmException e){ + // System.err.println(e); + } + + // The following code is for IBM's JCE + try{ + random=SecureRandom.getInstance("IBMSecureRandom"); + return; + } + catch(java.security.NoSuchAlgorithmException ee){ + //System.err.println(ee); + } + */ + } + public void fill(byte[] foo, int start, int len){ + /* + // This case will not become true in our usage. + if(start==0 && foo.length==len){ + random.nextBytes(foo); + return; + } + */ + if(len>tmp.length){ tmp=new byte[len]; } + random.nextBytes(tmp); + System.arraycopy(tmp, 0, foo, start, len); + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/SHA1.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/SHA1.java new file mode 100644 index 000000000..bca67093e --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/SHA1.java @@ -0,0 +1,51 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jce; + +import com.jcraft.jsch.HASH; + +import java.security.*; + +public class SHA1 implements HASH{ + MessageDigest md; + public int getBlockSize(){return 20;} + public void init() throws Exception{ + try{ md=MessageDigest.getInstance("SHA-1"); } + catch(Exception e){ + System.err.println(e); + } + } + public void update(byte[] foo, int start, int len) throws Exception{ + md.update(foo, start, len); + } + public byte[] digest() throws Exception{ + return md.digest(); + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/SignatureDSA.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/SignatureDSA.java new file mode 100644 index 000000000..69b1d530d --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/SignatureDSA.java @@ -0,0 +1,147 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jce; + +import java.math.BigInteger; +import java.security.*; +import java.security.spec.*; + +public class SignatureDSA implements com.jcraft.jsch.SignatureDSA{ + + java.security.Signature signature; + KeyFactory keyFactory; + + public void init() throws Exception{ + signature=java.security.Signature.getInstance("SHA1withDSA"); + keyFactory=KeyFactory.getInstance("DSA"); + } + public void setPubKey(byte[] y, byte[] p, byte[] q, byte[] g) throws Exception{ + DSAPublicKeySpec dsaPubKeySpec = + new DSAPublicKeySpec(new BigInteger(y), + new BigInteger(p), + new BigInteger(q), + new BigInteger(g)); + PublicKey pubKey=keyFactory.generatePublic(dsaPubKeySpec); + signature.initVerify(pubKey); + } + public void setPrvKey(byte[] x, byte[] p, byte[] q, byte[] g) throws Exception{ + DSAPrivateKeySpec dsaPrivKeySpec = + new DSAPrivateKeySpec(new BigInteger(x), + new BigInteger(p), + new BigInteger(q), + new BigInteger(g)); + PrivateKey prvKey = keyFactory.generatePrivate(dsaPrivKeySpec); + signature.initSign(prvKey); + } + public byte[] sign() throws Exception{ + byte[] sig=signature.sign(); +/* +System.err.print("sign["+sig.length+"] "); +for(int i=0; iivsize){ + tmp=new byte[ivsize]; + System.arraycopy(iv, 0, tmp, 0, tmp.length); + iv=tmp; + } + if(key.length>bsize){ + tmp=new byte[bsize]; + System.arraycopy(key, 0, tmp, 0, tmp.length); + key=tmp; + } + + try{ + cipher=javax.crypto.Cipher.getInstance("DESede/CBC/"+pad); +/* + // The following code does not work on IBM's JDK 1.4.1 + SecretKeySpec skeySpec = new SecretKeySpec(key, "DESede"); + cipher.init((mode==ENCRYPT_MODE? + javax.crypto.Cipher.ENCRYPT_MODE: + javax.crypto.Cipher.DECRYPT_MODE), + skeySpec, new IvParameterSpec(iv)); +*/ + DESedeKeySpec keyspec=new DESedeKeySpec(key); + SecretKeyFactory keyfactory=SecretKeyFactory.getInstance("DESede"); + SecretKey _key=keyfactory.generateSecret(keyspec); + cipher.init((mode==ENCRYPT_MODE? + javax.crypto.Cipher.ENCRYPT_MODE: + javax.crypto.Cipher.DECRYPT_MODE), + _key, new IvParameterSpec(iv)); + } + catch(Exception e){ + cipher=null; + throw e; + } + } + public void update(byte[] foo, int s1, int len, byte[] bar, int s2) throws Exception{ + cipher.update(foo, s1, len, bar, s2); + } + public boolean isCBC(){return true; } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/TripleDESCTR.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/TripleDESCTR.java new file mode 100644 index 000000000..67e431d36 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jce/TripleDESCTR.java @@ -0,0 +1,84 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2008-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jce; + +import com.jcraft.jsch.Cipher; +import javax.crypto.*; +import javax.crypto.spec.*; + +public class TripleDESCTR implements Cipher{ + private static final int ivsize=8; + private static final int bsize=24; + private javax.crypto.Cipher cipher; + public int getIVSize(){return ivsize;} + public int getBlockSize(){return bsize;} + public void init(int mode, byte[] key, byte[] iv) throws Exception{ + String pad="NoPadding"; + //if(padding) pad="PKCS5Padding"; + byte[] tmp; + if(iv.length>ivsize){ + tmp=new byte[ivsize]; + System.arraycopy(iv, 0, tmp, 0, tmp.length); + iv=tmp; + } + if(key.length>bsize){ + tmp=new byte[bsize]; + System.arraycopy(key, 0, tmp, 0, tmp.length); + key=tmp; + } + + try{ + cipher=javax.crypto.Cipher.getInstance("DESede/CTR/"+pad); +/* + // The following code does not work on IBM's JDK 1.4.1 + SecretKeySpec skeySpec = new SecretKeySpec(key, "DESede"); + cipher.init((mode==ENCRYPT_MODE? + javax.crypto.Cipher.ENCRYPT_MODE: + javax.crypto.Cipher.DECRYPT_MODE), + skeySpec, new IvParameterSpec(iv)); +*/ + DESedeKeySpec keyspec=new DESedeKeySpec(key); + SecretKeyFactory keyfactory=SecretKeyFactory.getInstance("DESede"); + SecretKey _key=keyfactory.generateSecret(keyspec); + cipher.init((mode==ENCRYPT_MODE? + javax.crypto.Cipher.ENCRYPT_MODE: + javax.crypto.Cipher.DECRYPT_MODE), + _key, new IvParameterSpec(iv)); + } + catch(Exception e){ + cipher=null; + throw e; + } + } + public void update(byte[] foo, int s1, int len, byte[] bar, int s2) throws Exception{ + cipher.update(foo, s1, len, bar, s2); + } + public boolean isCBC(){return false; } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jcraft/Compression.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jcraft/Compression.java new file mode 100644 index 000000000..6ba89c14b --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jcraft/Compression.java @@ -0,0 +1,140 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2002-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jcraft; +import com.jcraft.jzlib.*; +import com.jcraft.jsch.*; + +public class Compression implements com.jcraft.jsch.Compression { + static private final int BUF_SIZE=4096; + private final int buffer_margin=32+20; // AES256 + HMACSHA1 + private int type; + private ZStream stream; + private byte[] tmpbuf=new byte[BUF_SIZE]; + + public Compression(){ + stream=new ZStream(); + } + + public void init(int type, int level){ + if(type==DEFLATER){ + stream.deflateInit(level); + this.type=DEFLATER; + } + else if(type==INFLATER){ + stream.inflateInit(); + inflated_buf=new byte[BUF_SIZE]; + this.type=INFLATER; + } + } + + private byte[] inflated_buf; + + public byte[] compress(byte[] buf, int start, int[] len){ + stream.next_in=buf; + stream.next_in_index=start; + stream.avail_in=len[0]-start; + int status; + int outputlen=start; + byte[] outputbuf=buf; + int tmp=0; + + do{ + stream.next_out=tmpbuf; + stream.next_out_index=0; + stream.avail_out=BUF_SIZE; + status=stream.deflate(JZlib.Z_PARTIAL_FLUSH); + switch(status){ + case JZlib.Z_OK: + tmp=BUF_SIZE-stream.avail_out; + if(outputbuf.lengthbuffer.length-start){ + byte[] foo=new byte[inflated_end+start]; + System.arraycopy(buffer, 0, foo, 0, start); + System.arraycopy(inflated_buf, 0, foo, start, inflated_end); + buffer=foo; + } + else{ + System.arraycopy(inflated_buf, 0, buffer, start, inflated_end); + } + length[0]=inflated_end; + return buffer; + default: + System.err.println("uncompress: inflate returnd "+status); + return null; + } + } + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jcraft/HMAC.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jcraft/HMAC.java new file mode 100644 index 000000000..b5c8a9ef7 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jcraft/HMAC.java @@ -0,0 +1,107 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2006-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jcraft; + +import java.security.*; + +class HMAC{ + + /* + * Refer to RFC2104. + * + * H(K XOR opad, H(K XOR ipad, text)) + * + * where K is an n byte key + * ipad is the byte 0x36 repeated 64 times + * opad is the byte 0x5c repeated 64 times + * and text is the data being protected + */ + private static final int B=64; + private byte[] k_ipad=null; + private byte[] k_opad=null; + + private MessageDigest md=null; + + private int bsize=0; + + protected void setH(MessageDigest md){ + this.md=md; + bsize=md.getDigestLength(); + } + + public int getBlockSize(){return bsize;}; + public void init(byte[] key) throws Exception{ + if(key.length>bsize){ + byte[] tmp=new byte[bsize]; + System.arraycopy(key, 0, tmp, 0, bsize); + key=tmp; + } + + /* if key is longer than B bytes reset it to key=MD5(key) */ + if(key.length>B){ + md.update(key, 0, key.length); + key=md.digest(); + } + + k_ipad=new byte[B]; + System.arraycopy(key, 0, k_ipad, 0, key.length); + k_opad=new byte[B]; + System.arraycopy(key, 0, k_opad, 0, key.length); + + /* XOR key with ipad and opad values */ + for(int i=0; i>>24); + tmp[1]=(byte)(i>>>16); + tmp[2]=(byte)(i>>>8); + tmp[3]=(byte)i; + update(tmp, 0, 4); + } + + public void update(byte foo[], int s, int l){ + md.update(foo, s, l); + } + + public void doFinal(byte[] buf, int offset){ + byte[] result=md.digest(); + md.update(k_opad, 0, B); + md.update(result, 0, bsize); + try{md.digest(buf, offset, bsize);}catch(Exception e){} + md.update(k_ipad, 0, B); + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jcraft/HMACMD5.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jcraft/HMACMD5.java new file mode 100644 index 000000000..b43d35d93 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jcraft/HMACMD5.java @@ -0,0 +1,51 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2006-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jcraft; + +import com.jcraft.jsch.MAC; +import java.security.*; + +public class HMACMD5 extends HMAC implements MAC{ + private static final String name="hmac-md5"; + + public HMACMD5(){ + super(); + MessageDigest md=null; + try{ md=MessageDigest.getInstance("MD5"); } + catch(Exception e){ + System.err.println(e); + } + setH(md); + } + + public String getName(){ + return name; + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jcraft/HMACMD596.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jcraft/HMACMD596.java new file mode 100644 index 000000000..ec7b691a6 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jcraft/HMACMD596.java @@ -0,0 +1,50 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2006-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jcraft; + +import com.jcraft.jsch.MAC; + +public class HMACMD596 extends HMACMD5{ + + private static final String name="hmac-md5-96"; + private static final int BSIZE=12; + + public int getBlockSize(){return BSIZE;}; + + private final byte[] _buf16=new byte[16]; + public void doFinal(byte[] buf, int offset){ + super.doFinal(_buf16, 0); + System.arraycopy(_buf16, 0, buf, offset, BSIZE); + } + + public String getName(){ + return name; + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jcraft/HMACSHA1.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jcraft/HMACSHA1.java new file mode 100644 index 000000000..a43572443 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jcraft/HMACSHA1.java @@ -0,0 +1,51 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2006-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jcraft; + +import com.jcraft.jsch.MAC; +import java.security.*; + +public class HMACSHA1 extends HMAC implements MAC{ + private static final String name="hmac-sha1"; + + public HMACSHA1(){ + super(); + MessageDigest md=null; + try{ md=MessageDigest.getInstance("SHA-1"); } + catch(Exception e){ + System.err.println(e); + } + setH(md); + } + + public String getName(){ + return name; + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jcraft/HMACSHA196.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jcraft/HMACSHA196.java new file mode 100644 index 000000000..735998c03 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jcraft/HMACSHA196.java @@ -0,0 +1,50 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2006-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jcraft; + +import com.jcraft.jsch.MAC; + +public class HMACSHA196 extends HMACSHA1{ + + private static final String name="hmac-sha1-96"; + private static final int BSIZE=12; + + public int getBlockSize(){return BSIZE;}; + + private final byte[] _buf16=new byte[20]; + public void doFinal(byte[] buf, int offset){ + super.doFinal(_buf16, 0); + System.arraycopy(_buf16, 0, buf, offset, BSIZE); + } + + public String getName(){ + return name; + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jgss/GSSContextKrb5.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jgss/GSSContextKrb5.java new file mode 100644 index 000000000..bc005f442 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jsch/jgss/GSSContextKrb5.java @@ -0,0 +1,177 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2006-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +package com.jcraft.jsch.jgss; + +import com.jcraft.jsch.JSchException; + +import java.net.InetAddress; +import java.net.UnknownHostException; +import org.ietf.jgss.GSSContext; +import org.ietf.jgss.GSSCredential; +import org.ietf.jgss.GSSException; +import org.ietf.jgss.GSSManager; +import org.ietf.jgss.GSSName; +import org.ietf.jgss.MessageProp; +import org.ietf.jgss.Oid; + +public class GSSContextKrb5 implements com.jcraft.jsch.GSSContext{ + + private static final String pUseSubjectCredsOnly = + "javax.security.auth.useSubjectCredsOnly"; + private static String useSubjectCredsOnly = + getSystemProperty(pUseSubjectCredsOnly); + + private GSSContext context=null; + public void create(String user, String host) throws JSchException{ + try{ + // RFC 1964 + Oid krb5=new Oid("1.2.840.113554.1.2.2"); + // Kerberos Principal Name Form + Oid principalName=new Oid("1.2.840.113554.1.2.2.1"); + + GSSManager mgr=GSSManager.getInstance(); + + GSSCredential crd=null; + /* + try{ + GSSName _user=mgr.createName(user, principalName); + crd=mgr.createCredential(_user, + GSSCredential.DEFAULT_LIFETIME, + krb5, + GSSCredential.INITIATE_ONLY); + } + catch(GSSException crdex){ + } + */ + + String cname=host; + try{ + cname=InetAddress.getByName(cname).getCanonicalHostName(); + } + catch(UnknownHostException e){ + } + GSSName _host=mgr.createName("host/"+cname, principalName); + + context=mgr.createContext(_host, + krb5, + crd, + GSSContext.DEFAULT_LIFETIME); + + // RFC4462 3.4. GSS-API Session + // + // When calling GSS_Init_sec_context(), the client MUST set + // integ_req_flag to "true" to request that per-message integrity + // protection be supported for this context. In addition, + // deleg_req_flag MAY be set to "true" to request access delegation, if + // requested by the user. + // + // Since the user authentication process by its nature authenticates + // only the client, the setting of mutual_req_flag is not needed for + // this process. This flag SHOULD be set to "false". + + // TODO: OpenSSH's sshd does accepts 'false' for mutual_req_flag + //context.requestMutualAuth(false); + context.requestMutualAuth(true); + context.requestConf(true); + context.requestInteg(true); // for MIC + context.requestCredDeleg(true); + context.requestAnonymity(false); + + return; + } + catch(GSSException ex){ + throw new JSchException(ex.toString()); + } + } + + public boolean isEstablished(){ + return context.isEstablished(); + } + + public byte[] init(byte[] token, int s, int l) throws JSchException { + try{ + // Without setting "javax.security.auth.useSubjectCredsOnly" to "false", + // Sun's JVM for Un*x will show messages to stderr in + // processing context.initSecContext(). + // This hack is not thread safe ;-<. + // If that property is explicitly given as "true" or "false", + // this hack must not be invoked. + if(useSubjectCredsOnly==null){ + setSystemProperty(pUseSubjectCredsOnly, "false"); + } + return context.initSecContext(token, 0, l); + } + catch(GSSException ex){ + throw new JSchException(ex.toString()); + } + catch(java.lang.SecurityException ex){ + throw new JSchException(ex.toString()); + } + finally{ + if(useSubjectCredsOnly==null){ + // By the default, it must be "true". + setSystemProperty(pUseSubjectCredsOnly, "true"); + } + } + } + + public byte[] getMIC(byte[] message, int s, int l){ + try{ + MessageProp prop = new MessageProp(0, true); + return context.getMIC(message, s, l, prop); + } + catch(GSSException ex){ + return null; + } + } + + public void dispose(){ + try{ + context.dispose(); + } + catch(GSSException ex){ + } + } + + private static String getSystemProperty(String key){ + try{ return System.getProperty(key); } + catch(Exception e){ + // We are not allowed to get the System properties. + return null; + } + } + + private static void setSystemProperty(String key, String value){ + try{ System.setProperty(key, value); } + catch(Exception e){ + // We are not allowed to set the System properties. + } + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/Adler32.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/Adler32.java new file mode 100644 index 000000000..1aaa6d696 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/Adler32.java @@ -0,0 +1,121 @@ +/* -*-mode:java; c-basic-offset:2; -*- */ +/* +Copyright (c) 2000-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * This program is based on zlib-1.1.3, so all credit should go authors + * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) + * and contributors of zlib. + */ + +package com.jcraft.jzlib; + +final class Adler32 implements Checksum { + + // largest prime smaller than 65536 + static final private int BASE=65521; + // NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 + static final private int NMAX=5552; + + private long adler=1L; + + public void reset(long init){ + adler=init; + } + + public void reset(){ + adler=1L; + } + + public long getValue(){ + return adler; + } + + public void update(byte[] buf, int index, int len){ + long s1=adler&0xffff; + long s2=(adler>>16)&0xffff; + + while(len>0) { + int k=len0){ + s1+=buf[index++]&0xff; s2+=s1; + } + s1%=BASE; + s2%=BASE; + } + adler=(s2<<16)|s1; + } + + public Adler32 copy(){ + Adler32 foo = new Adler32(); + foo.adler = this.adler; + return foo; + } + + // The following logic has come from zlib.1.2. + static long combine(long adler1, long adler2, long len2){ + long BASEL = (long)BASE; + long sum1; + long sum2; + long rem; // unsigned int + + rem = len2 % BASEL; + sum1 = adler1 & 0xffffL; + sum2 = rem * sum1; + sum2 %= BASEL; // MOD(sum2); + sum1 += (adler2 & 0xffffL) + BASEL - 1; + sum2 += ((adler1 >> 16) & 0xffffL) + ((adler2 >> 16) & 0xffffL) + BASEL - rem; + if (sum1 >= BASEL) sum1 -= BASEL; + if (sum1 >= BASEL) sum1 -= BASEL; + if (sum2 >= (BASEL << 1)) sum2 -= (BASEL << 1); + if (sum2 >= BASEL) sum2 -= BASEL; + return sum1 | (sum2 << 16); + } + + /* + private java.util.zip.Adler32 adler=new java.util.zip.Adler32(); + void adler32(byte[] buf, int index, int len){ + if(buf==null) {adler.reset();} + else{adler.update(buf, index, len);} + } + void reset(){ + adler.reset(); + } + void reset(long init){ + if(init==1L){ + adler.reset(); + } + else{ + System.err.println("unsupported operation"); + } + } + long getValue(){ + return adler.getValue(); + } + */ +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/CRC32.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/CRC32.java new file mode 100644 index 000000000..20b478e96 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/CRC32.java @@ -0,0 +1,174 @@ +/* -*-mode:java; c-basic-offset:2; -*- */ +/* +Copyright (c) 2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * This program is based on zlib-1.1.3, so all credit should go authors + * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) + * and contributors of zlib. + */ + +package com.jcraft.jzlib; + +final class CRC32 implements Checksum, Cloneable { + + /* + * The following logic has come from RFC1952. + */ + private int v = 0; + private static int[] crc_table = null; + static { + crc_table = new int[256]; + for (int n = 0; n < 256; n++) { + int c = n; + for (int k = 8; --k >= 0; ) { + if ((c & 1) != 0) + c = 0xedb88320 ^ (c >>> 1); + else + c = c >>> 1; + } + crc_table[n] = c; + } + } + + public void update (byte[] buf, int index, int len) { + int c = ~v; + while (--len >= 0) + c = crc_table[(c^buf[index++])&0xff]^(c >>> 8); + v = ~c; + } + + public void reset(){ + v = 0; + } + + public void reset(long vv){ + v = (int)(vv&0xffffffffL); + } + + public long getValue(){ + return (long)(v&0xffffffffL); + } + + // The following logic has come from zlib.1.2. + private static final int GF2_DIM = 32; + static long combine(long crc1, long crc2, long len2){ + long row; + long[] even = new long[GF2_DIM]; + long[] odd = new long[GF2_DIM]; + + // degenerate case (also disallow negative lengths) + if (len2 <= 0) + return crc1; + + // put operator for one zero bit in odd + odd[0] = 0xedb88320L; // CRC-32 polynomial + row = 1; + for (int n = 1; n < GF2_DIM; n++) { + odd[n] = row; + row <<= 1; + } + + // put operator for two zero bits in even + gf2_matrix_square(even, odd); + + // put operator for four zero bits in odd + gf2_matrix_square(odd, even); + + // apply len2 zeros to crc1 (first square will put the operator for one + // zero byte, eight zero bits, in even) + do { + // apply zeros operator for this bit of len2 + gf2_matrix_square(even, odd); + if ((len2 & 1)!=0) + crc1 = gf2_matrix_times(even, crc1); + len2 >>= 1; + + // if no more bits set, then done + if (len2 == 0) + break; + + // another iteration of the loop with odd and even swapped + gf2_matrix_square(odd, even); + if ((len2 & 1)!=0) + crc1 = gf2_matrix_times(odd, crc1); + len2 >>= 1; + + // if no more bits set, then done + } while (len2 != 0); + + /* return combined crc */ + crc1 ^= crc2; + return crc1; + } + + private static long gf2_matrix_times(long[] mat, long vec){ + long sum = 0; + int index = 0; + while (vec!=0) { + if ((vec & 1)!=0) + sum ^= mat[index]; + vec >>= 1; + index++; + } + return sum; + } + + static final void gf2_matrix_square(long[] square, long[] mat) { + for (int n = 0; n < GF2_DIM; n++) + square[n] = gf2_matrix_times(mat, mat[n]); + } + + /* + private java.util.zip.CRC32 crc32 = new java.util.zip.CRC32(); + + public void update(byte[] buf, int index, int len){ + if(buf==null) {crc32.reset();} + else{crc32.update(buf, index, len);} + } + public void reset(){ + crc32.reset(); + } + public void reset(long init){ + if(init==0L){ + crc32.reset(); + } + else{ + System.err.println("unsupported operation"); + } + } + public long getValue(){ + return crc32.getValue(); + } +*/ + public CRC32 copy(){ + CRC32 foo = new CRC32(); + foo.v = this.v; + return foo; + } + +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/Checksum.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/Checksum.java new file mode 100644 index 000000000..1139093c8 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/Checksum.java @@ -0,0 +1,43 @@ +/* -*-mode:java; c-basic-offset:2; -*- */ +/* +Copyright (c) 2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * This program is based on zlib-1.1.3, so all credit should go authors + * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) + * and contributors of zlib. + */ + +package com.jcraft.jzlib; + +interface Checksum { + void update(byte[] buf, int index, int len); + void reset(); + void reset(long init); + long getValue(); + Checksum copy(); +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/Deflate.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/Deflate.java new file mode 100644 index 000000000..8264a4a1c --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/Deflate.java @@ -0,0 +1,1751 @@ +/* -*-mode:java; c-basic-offset:2; -*- */ +/* +Copyright (c) 2000-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * This program is based on zlib-1.1.3, so all credit should go authors + * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) + * and contributors of zlib. + */ + +package com.jcraft.jzlib; + +public +final class Deflate implements Cloneable { + + static final private int MAX_MEM_LEVEL=9; + + static final private int Z_DEFAULT_COMPRESSION=-1; + + static final private int MAX_WBITS=15; // 32K LZ77 window + static final private int DEF_MEM_LEVEL=8; + + static class Config{ + int good_length; // reduce lazy search above this match length + int max_lazy; // do not perform lazy search above this match length + int nice_length; // quit search above this match length + int max_chain; + int func; + Config(int good_length, int max_lazy, + int nice_length, int max_chain, int func){ + this.good_length=good_length; + this.max_lazy=max_lazy; + this.nice_length=nice_length; + this.max_chain=max_chain; + this.func=func; + } + } + + static final private int STORED=0; + static final private int FAST=1; + static final private int SLOW=2; + static final private Config[] config_table; + static{ + config_table=new Config[10]; + // good lazy nice chain + config_table[0]=new Config(0, 0, 0, 0, STORED); + config_table[1]=new Config(4, 4, 8, 4, FAST); + config_table[2]=new Config(4, 5, 16, 8, FAST); + config_table[3]=new Config(4, 6, 32, 32, FAST); + + config_table[4]=new Config(4, 4, 16, 16, SLOW); + config_table[5]=new Config(8, 16, 32, 32, SLOW); + config_table[6]=new Config(8, 16, 128, 128, SLOW); + config_table[7]=new Config(8, 32, 128, 256, SLOW); + config_table[8]=new Config(32, 128, 258, 1024, SLOW); + config_table[9]=new Config(32, 258, 258, 4096, SLOW); + } + + static final private String[] z_errmsg = { + "need dictionary", // Z_NEED_DICT 2 + "stream end", // Z_STREAM_END 1 + "", // Z_OK 0 + "file error", // Z_ERRNO (-1) + "stream error", // Z_STREAM_ERROR (-2) + "data error", // Z_DATA_ERROR (-3) + "insufficient memory", // Z_MEM_ERROR (-4) + "buffer error", // Z_BUF_ERROR (-5) + "incompatible version",// Z_VERSION_ERROR (-6) + "" + }; + + // block not completed, need more input or more output + static final private int NeedMore=0; + + // block flush performed + static final private int BlockDone=1; + + // finish started, need only more output at next deflate + static final private int FinishStarted=2; + + // finish done, accept no more input or output + static final private int FinishDone=3; + + // preset dictionary flag in zlib header + static final private int PRESET_DICT=0x20; + + static final private int Z_FILTERED=1; + static final private int Z_HUFFMAN_ONLY=2; + static final private int Z_DEFAULT_STRATEGY=0; + + static final private int Z_NO_FLUSH=0; + static final private int Z_PARTIAL_FLUSH=1; + static final private int Z_SYNC_FLUSH=2; + static final private int Z_FULL_FLUSH=3; + static final private int Z_FINISH=4; + + static final private int Z_OK=0; + static final private int Z_STREAM_END=1; + static final private int Z_NEED_DICT=2; + static final private int Z_ERRNO=-1; + static final private int Z_STREAM_ERROR=-2; + static final private int Z_DATA_ERROR=-3; + static final private int Z_MEM_ERROR=-4; + static final private int Z_BUF_ERROR=-5; + static final private int Z_VERSION_ERROR=-6; + + static final private int INIT_STATE=42; + static final private int BUSY_STATE=113; + static final private int FINISH_STATE=666; + + // The deflate compression method + static final private int Z_DEFLATED=8; + + static final private int STORED_BLOCK=0; + static final private int STATIC_TREES=1; + static final private int DYN_TREES=2; + + // The three kinds of block type + static final private int Z_BINARY=0; + static final private int Z_ASCII=1; + static final private int Z_UNKNOWN=2; + + static final private int Buf_size=8*2; + + // repeat previous bit length 3-6 times (2 bits of repeat count) + static final private int REP_3_6=16; + + // repeat a zero length 3-10 times (3 bits of repeat count) + static final private int REPZ_3_10=17; + + // repeat a zero length 11-138 times (7 bits of repeat count) + static final private int REPZ_11_138=18; + + static final private int MIN_MATCH=3; + static final private int MAX_MATCH=258; + static final private int MIN_LOOKAHEAD=(MAX_MATCH+MIN_MATCH+1); + + static final private int MAX_BITS=15; + static final private int D_CODES=30; + static final private int BL_CODES=19; + static final private int LENGTH_CODES=29; + static final private int LITERALS=256; + static final private int L_CODES=(LITERALS+1+LENGTH_CODES); + static final private int HEAP_SIZE=(2*L_CODES+1); + + static final private int END_BLOCK=256; + + ZStream strm; // pointer back to this zlib stream + int status; // as the name implies + byte[] pending_buf; // output still pending + int pending_buf_size; // size of pending_buf + int pending_out; // next pending byte to output to the stream + int pending; // nb of bytes in the pending buffer + int wrap = 1; + byte data_type; // UNKNOWN, BINARY or ASCII + byte method; // STORED (for zip only) or DEFLATED + int last_flush; // value of flush param for previous deflate call + + int w_size; // LZ77 window size (32K by default) + int w_bits; // log2(w_size) (8..16) + int w_mask; // w_size - 1 + + byte[] window; + // Sliding window. Input bytes are read into the second half of the window, + // and move to the first half later to keep a dictionary of at least wSize + // bytes. With this organization, matches are limited to a distance of + // wSize-MAX_MATCH bytes, but this ensures that IO is always + // performed with a length multiple of the block size. Also, it limits + // the window size to 64K, which is quite useful on MSDOS. + // To do: use the user input buffer as sliding window. + + int window_size; + // Actual size of window: 2*wSize, except when the user input buffer + // is directly used as sliding window. + + short[] prev; + // Link to older string with same hash index. To limit the size of this + // array to 64K, this link is maintained only for the last 32K strings. + // An index in this array is thus a window index modulo 32K. + + short[] head; // Heads of the hash chains or NIL. + + int ins_h; // hash index of string to be inserted + int hash_size; // number of elements in hash table + int hash_bits; // log2(hash_size) + int hash_mask; // hash_size-1 + + // Number of bits by which ins_h must be shifted at each input + // step. It must be such that after MIN_MATCH steps, the oldest + // byte no longer takes part in the hash key, that is: + // hash_shift * MIN_MATCH >= hash_bits + int hash_shift; + + // Window position at the beginning of the current output block. Gets + // negative when the window is moved backwards. + + int block_start; + + int match_length; // length of best match + int prev_match; // previous match + int match_available; // set if previous match exists + int strstart; // start of string to insert + int match_start; // start of matching string + int lookahead; // number of valid bytes ahead in window + + // Length of the best match at previous step. Matches not greater than this + // are discarded. This is used in the lazy match evaluation. + int prev_length; + + // To speed up deflation, hash chains are never searched beyond this + // length. A higher limit improves compression ratio but degrades the speed. + int max_chain_length; + + // Attempt to find a better match only when the current match is strictly + // smaller than this value. This mechanism is used only for compression + // levels >= 4. + int max_lazy_match; + + // Insert new strings in the hash table only if the match length is not + // greater than this length. This saves time but degrades compression. + // max_insert_length is used only for compression levels <= 3. + + int level; // compression level (1..9) + int strategy; // favor or force Huffman coding + + // Use a faster search when the previous match is longer than this + int good_match; + + // Stop searching when current match exceeds this + int nice_match; + + short[] dyn_ltree; // literal and length tree + short[] dyn_dtree; // distance tree + short[] bl_tree; // Huffman tree for bit lengths + + Tree l_desc=new Tree(); // desc for literal tree + Tree d_desc=new Tree(); // desc for distance tree + Tree bl_desc=new Tree(); // desc for bit length tree + + // number of codes at each bit length for an optimal tree + short[] bl_count=new short[MAX_BITS+1]; + + // heap used to build the Huffman trees + int[] heap=new int[2*L_CODES+1]; + + int heap_len; // number of elements in the heap + int heap_max; // element of largest frequency + // The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. + // The same heap array is used to build all trees. + + // Depth of each subtree used as tie breaker for trees of equal frequency + byte[] depth=new byte[2*L_CODES+1]; + + int l_buf; // index for literals or lengths */ + + // Size of match buffer for literals/lengths. There are 4 reasons for + // limiting lit_bufsize to 64K: + // - frequencies can be kept in 16 bit counters + // - if compression is not successful for the first block, all input + // data is still in the window so we can still emit a stored block even + // when input comes from standard input. (This can also be done for + // all blocks if lit_bufsize is not greater than 32K.) + // - if compression is not successful for a file smaller than 64K, we can + // even emit a stored file instead of a stored block (saving 5 bytes). + // This is applicable only for zip (not gzip or zlib). + // - creating new Huffman trees less frequently may not provide fast + // adaptation to changes in the input data statistics. (Take for + // example a binary file with poorly compressible code followed by + // a highly compressible string table.) Smaller buffer sizes give + // fast adaptation but have of course the overhead of transmitting + // trees more frequently. + // - I can't count above 4 + int lit_bufsize; + + int last_lit; // running index in l_buf + + // Buffer for distances. To simplify the code, d_buf and l_buf have + // the same number of elements. To use different lengths, an extra flag + // array would be necessary. + + int d_buf; // index of pendig_buf + + int opt_len; // bit length of current block with optimal trees + int static_len; // bit length of current block with static trees + int matches; // number of string matches in current block + int last_eob_len; // bit length of EOB code for last block + + // Output buffer. bits are inserted starting at the bottom (least + // significant bits). + short bi_buf; + + // Number of valid bits in bi_buf. All bits above the last valid bit + // are always zero. + int bi_valid; + + GZIPHeader gheader = null; + + Deflate(ZStream strm){ + this.strm=strm; + dyn_ltree=new short[HEAP_SIZE*2]; + dyn_dtree=new short[(2*D_CODES+1)*2]; // distance tree + bl_tree=new short[(2*BL_CODES+1)*2]; // Huffman tree for bit lengths + } + + void lm_init() { + window_size=2*w_size; + + head[hash_size-1]=0; + for(int i=0; i= 3; max_blindex--) { + if (bl_tree[Tree.bl_order[max_blindex]*2+1] != 0) break; + } + // Update opt_len to include the bit length tree and counts + opt_len += 3*(max_blindex+1) + 5+5+4; + + return max_blindex; + } + + + // Send the header for a block using dynamic Huffman trees: the counts, the + // lengths of the bit length codes, the literal tree and the distance tree. + // IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. + void send_all_trees(int lcodes, int dcodes, int blcodes){ + int rank; // index in bl_order + + send_bits(lcodes-257, 5); // not +255 as stated in appnote.txt + send_bits(dcodes-1, 5); + send_bits(blcodes-4, 4); // not -3 as stated in appnote.txt + for (rank = 0; rank < blcodes; rank++) { + send_bits(bl_tree[Tree.bl_order[rank]*2+1], 3); + } + send_tree(dyn_ltree, lcodes-1); // literal tree + send_tree(dyn_dtree, dcodes-1); // distance tree + } + + // Send a literal or distance tree in compressed form, using the codes in + // bl_tree. + void send_tree (short[] tree,// the tree to be sent + int max_code // and its largest code of non zero frequency + ){ + int n; // iterates over all tree elements + int prevlen = -1; // last emitted length + int curlen; // length of current code + int nextlen = tree[0*2+1]; // length of next code + int count = 0; // repeat count of the current code + int max_count = 7; // max repeat count + int min_count = 4; // min repeat count + + if (nextlen == 0){ max_count = 138; min_count = 3; } + + for (n = 0; n <= max_code; n++) { + curlen = nextlen; nextlen = tree[(n+1)*2+1]; + if(++count < max_count && curlen == nextlen) { + continue; + } + else if(count < min_count) { + do { send_code(curlen, bl_tree); } while (--count != 0); + } + else if(curlen != 0){ + if(curlen != prevlen){ + send_code(curlen, bl_tree); count--; + } + send_code(REP_3_6, bl_tree); + send_bits(count-3, 2); + } + else if(count <= 10){ + send_code(REPZ_3_10, bl_tree); + send_bits(count-3, 3); + } + else{ + send_code(REPZ_11_138, bl_tree); + send_bits(count-11, 7); + } + count = 0; prevlen = curlen; + if(nextlen == 0){ + max_count = 138; min_count = 3; + } + else if(curlen == nextlen){ + max_count = 6; min_count = 3; + } + else{ + max_count = 7; min_count = 4; + } + } + } + + // Output a byte on the stream. + // IN assertion: there is enough room in pending_buf. + final void put_byte(byte[] p, int start, int len){ + System.arraycopy(p, start, pending_buf, pending, len); + pending+=len; + } + + final void put_byte(byte c){ + pending_buf[pending++]=c; + } + final void put_short(int w) { + put_byte((byte)(w/*&0xff*/)); + put_byte((byte)(w>>>8)); + } + final void putShortMSB(int b){ + put_byte((byte)(b>>8)); + put_byte((byte)(b/*&0xff*/)); + } + + final void send_code(int c, short[] tree){ + int c2=c*2; + send_bits((tree[c2]&0xffff), (tree[c2+1]&0xffff)); + } + + void send_bits(int value, int length){ + int len = length; + if (bi_valid > (int)Buf_size - len) { + int val = value; +// bi_buf |= (val << bi_valid); + bi_buf |= ((val << bi_valid)&0xffff); + put_short(bi_buf); + bi_buf = (short)(val >>> (Buf_size - bi_valid)); + bi_valid += len - Buf_size; + } else { +// bi_buf |= (value) << bi_valid; + bi_buf |= (((value) << bi_valid)&0xffff); + bi_valid += len; + } + } + + // Send one empty static block to give enough lookahead for inflate. + // This takes 10 bits, of which 7 may remain in the bit buffer. + // The current inflate code requires 9 bits of lookahead. If the + // last two codes for the previous block (real code plus EOB) were coded + // on 5 bits or less, inflate may have only 5+3 bits of lookahead to decode + // the last real code. In this case we send two empty static blocks instead + // of one. (There are no problems if the previous block is stored or fixed.) + // To simplify the code, we assume the worst case of last real code encoded + // on one bit only. + void _tr_align(){ + send_bits(STATIC_TREES<<1, 3); + send_code(END_BLOCK, StaticTree.static_ltree); + + bi_flush(); + + // Of the 10 bits for the empty block, we have already sent + // (10 - bi_valid) bits. The lookahead for the last real code (before + // the EOB of the previous block) was thus at least one plus the length + // of the EOB plus what we have just sent of the empty static block. + if (1 + last_eob_len + 10 - bi_valid < 9) { + send_bits(STATIC_TREES<<1, 3); + send_code(END_BLOCK, StaticTree.static_ltree); + bi_flush(); + } + last_eob_len = 7; + } + + + // Save the match info and tally the frequency counts. Return true if + // the current block must be flushed. + boolean _tr_tally (int dist, // distance of matched string + int lc // match length-MIN_MATCH or unmatched char (if dist==0) + ){ + + pending_buf[d_buf+last_lit*2] = (byte)(dist>>>8); + pending_buf[d_buf+last_lit*2+1] = (byte)dist; + + pending_buf[l_buf+last_lit] = (byte)lc; last_lit++; + + if (dist == 0) { + // lc is the unmatched char + dyn_ltree[lc*2]++; + } + else { + matches++; + // Here, lc is the match length - MIN_MATCH + dist--; // dist = match distance - 1 + dyn_ltree[(Tree._length_code[lc]+LITERALS+1)*2]++; + dyn_dtree[Tree.d_code(dist)*2]++; + } + + if ((last_lit & 0x1fff) == 0 && level > 2) { + // Compute an upper bound for the compressed length + int out_length = last_lit*8; + int in_length = strstart - block_start; + int dcode; + for (dcode = 0; dcode < D_CODES; dcode++) { + out_length += (int)dyn_dtree[dcode*2] * + (5L+Tree.extra_dbits[dcode]); + } + out_length >>>= 3; + if ((matches < (last_lit/2)) && out_length < in_length/2) return true; + } + + return (last_lit == lit_bufsize-1); + // We avoid equality with lit_bufsize because of wraparound at 64K + // on 16 bit machines and because stored blocks are restricted to + // 64K-1 bytes. + } + + // Send the block data compressed using the given Huffman trees + void compress_block(short[] ltree, short[] dtree){ + int dist; // distance of matched string + int lc; // match length or unmatched char (if dist == 0) + int lx = 0; // running index in l_buf + int code; // the code to send + int extra; // number of extra bits to send + + if (last_lit != 0){ + do{ + dist=((pending_buf[d_buf+lx*2]<<8)&0xff00)| + (pending_buf[d_buf+lx*2+1]&0xff); + lc=(pending_buf[l_buf+lx])&0xff; lx++; + + if(dist == 0){ + send_code(lc, ltree); // send a literal byte + } + else{ + // Here, lc is the match length - MIN_MATCH + code = Tree._length_code[lc]; + + send_code(code+LITERALS+1, ltree); // send the length code + extra = Tree.extra_lbits[code]; + if(extra != 0){ + lc -= Tree.base_length[code]; + send_bits(lc, extra); // send the extra length bits + } + dist--; // dist is now the match distance - 1 + code = Tree.d_code(dist); + + send_code(code, dtree); // send the distance code + extra = Tree.extra_dbits[code]; + if (extra != 0) { + dist -= Tree.base_dist[code]; + send_bits(dist, extra); // send the extra distance bits + } + } // literal or match pair ? + + // Check that the overlay between pending_buf and d_buf+l_buf is ok: + } + while (lx < last_lit); + } + + send_code(END_BLOCK, ltree); + last_eob_len = ltree[END_BLOCK*2+1]; + } + + // Set the data type to ASCII or BINARY, using a crude approximation: + // binary if more than 20% of the bytes are <= 6 or >= 128, ascii otherwise. + // IN assertion: the fields freq of dyn_ltree are set and the total of all + // frequencies does not exceed 64K (to fit in an int on 16 bit machines). + void set_data_type(){ + int n = 0; + int ascii_freq = 0; + int bin_freq = 0; + while(n<7){ bin_freq += dyn_ltree[n*2]; n++;} + while(n<128){ ascii_freq += dyn_ltree[n*2]; n++;} + while(n (ascii_freq >>> 2) ? Z_BINARY : Z_ASCII); + } + + // Flush the bit buffer, keeping at most 7 bits in it. + void bi_flush(){ + if (bi_valid == 16) { + put_short(bi_buf); + bi_buf=0; + bi_valid=0; + } + else if (bi_valid >= 8) { + put_byte((byte)bi_buf); + bi_buf>>>=8; + bi_valid-=8; + } + } + + // Flush the bit buffer and align the output on a byte boundary + void bi_windup(){ + if (bi_valid > 8) { + put_short(bi_buf); + } else if (bi_valid > 0) { + put_byte((byte)bi_buf); + } + bi_buf = 0; + bi_valid = 0; + } + + // Copy a stored block, storing first the length and its + // one's complement if requested. + void copy_block(int buf, // the input data + int len, // its length + boolean header // true if block header must be written + ){ + int index=0; + bi_windup(); // align on byte boundary + last_eob_len = 8; // enough lookahead for inflate + + if (header) { + put_short((short)len); + put_short((short)~len); + } + + // while(len--!=0) { + // put_byte(window[buf+index]); + // index++; + // } + put_byte(window, buf, len); + } + + void flush_block_only(boolean eof){ + _tr_flush_block(block_start>=0 ? block_start : -1, + strstart-block_start, + eof); + block_start=strstart; + strm.flush_pending(); + } + + // Copy without compression as much as possible from the input stream, return + // the current block state. + // This function does not insert new strings in the dictionary since + // uncompressible data is probably not useful. This function is used + // only for the level=0 compression option. + // NOTE: this function should be optimized to avoid extra copying from + // window to pending_buf. + int deflate_stored(int flush){ + // Stored blocks are limited to 0xffff bytes, pending_buf is limited + // to pending_buf_size, and each stored block has a 5 byte header: + + int max_block_size = 0xffff; + int max_start; + + if(max_block_size > pending_buf_size - 5) { + max_block_size = pending_buf_size - 5; + } + + // Copy as much as possible from input to output: + while(true){ + // Fill the window as much as possible: + if(lookahead<=1){ + fill_window(); + if(lookahead==0 && flush==Z_NO_FLUSH) return NeedMore; + if(lookahead==0) break; // flush the current block + } + + strstart+=lookahead; + lookahead=0; + + // Emit a stored block if pending_buf will be full: + max_start=block_start+max_block_size; + if(strstart==0|| strstart>=max_start) { + // strstart == 0 is possible when wraparound on 16-bit machine + lookahead = (int)(strstart-max_start); + strstart = (int)max_start; + + flush_block_only(false); + if(strm.avail_out==0) return NeedMore; + + } + + // Flush if we may have to slide, otherwise block_start may become + // negative and the data will be gone: + if(strstart-block_start >= w_size-MIN_LOOKAHEAD) { + flush_block_only(false); + if(strm.avail_out==0) return NeedMore; + } + } + + flush_block_only(flush == Z_FINISH); + if(strm.avail_out==0) + return (flush == Z_FINISH) ? FinishStarted : NeedMore; + + return flush == Z_FINISH ? FinishDone : BlockDone; + } + + // Send a stored block + void _tr_stored_block(int buf, // input block + int stored_len, // length of input block + boolean eof // true if this is the last block for a file + ){ + send_bits((STORED_BLOCK<<1)+(eof?1:0), 3); // send block type + copy_block(buf, stored_len, true); // with header + } + + // Determine the best encoding for the current block: dynamic trees, static + // trees or store, and output the encoded block to the zip file. + void _tr_flush_block(int buf, // input block, or NULL if too old + int stored_len, // length of input block + boolean eof // true if this is the last block for a file + ) { + int opt_lenb, static_lenb;// opt_len and static_len in bytes + int max_blindex = 0; // index of last bit length code of non zero freq + + // Build the Huffman trees unless a stored block is forced + if(level > 0) { + // Check if the file is ascii or binary + if(data_type == Z_UNKNOWN) set_data_type(); + + // Construct the literal and distance trees + l_desc.build_tree(this); + + d_desc.build_tree(this); + + // At this point, opt_len and static_len are the total bit lengths of + // the compressed block data, excluding the tree representations. + + // Build the bit length tree for the above two trees, and get the index + // in bl_order of the last bit length code to send. + max_blindex=build_bl_tree(); + + // Determine the best encoding. Compute first the block length in bytes + opt_lenb=(opt_len+3+7)>>>3; + static_lenb=(static_len+3+7)>>>3; + + if(static_lenb<=opt_lenb) opt_lenb=static_lenb; + } + else { + opt_lenb=static_lenb=stored_len+5; // force a stored block + } + + if(stored_len+4<=opt_lenb && buf != -1){ + // 4: two words for the lengths + // The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. + // Otherwise we can't have processed more than WSIZE input bytes since + // the last block flush, because compression would have been + // successful. If LIT_BUFSIZE <= WSIZE, it is never too late to + // transform a block into a stored block. + _tr_stored_block(buf, stored_len, eof); + } + else if(static_lenb == opt_lenb){ + send_bits((STATIC_TREES<<1)+(eof?1:0), 3); + compress_block(StaticTree.static_ltree, StaticTree.static_dtree); + } + else{ + send_bits((DYN_TREES<<1)+(eof?1:0), 3); + send_all_trees(l_desc.max_code+1, d_desc.max_code+1, max_blindex+1); + compress_block(dyn_ltree, dyn_dtree); + } + + // The above check is made mod 2^32, for files larger than 512 MB + // and uLong implemented on 32 bits. + + init_block(); + + if(eof){ + bi_windup(); + } + } + + // Fill the window when the lookahead becomes insufficient. + // Updates strstart and lookahead. + // + // IN assertion: lookahead < MIN_LOOKAHEAD + // OUT assertions: strstart <= window_size-MIN_LOOKAHEAD + // At least one byte has been read, or avail_in == 0; reads are + // performed for at least two bytes (required for the zip translate_eol + // option -- not supported here). + void fill_window(){ + int n, m; + int p; + int more; // Amount of free space at the end of the window. + + do{ + more = (window_size-lookahead-strstart); + + // Deal with !@#$% 64K limit: + if(more==0 && strstart==0 && lookahead==0){ + more = w_size; + } + else if(more==-1) { + // Very unlikely, but possible on 16 bit machine if strstart == 0 + // and lookahead == 1 (input done one byte at time) + more--; + + // If the window is almost full and there is insufficient lookahead, + // move the upper half to the lower one to make room in the upper half. + } + else if(strstart >= w_size+ w_size-MIN_LOOKAHEAD) { + System.arraycopy(window, w_size, window, 0, w_size); + match_start-=w_size; + strstart-=w_size; // we now have strstart >= MAX_DIST + block_start-=w_size; + + // Slide the hash table (could be avoided with 32 bit values + // at the expense of memory usage). We slide even when level == 0 + // to keep the hash table consistent if we switch back to level > 0 + // later. (Using level 0 permanently is not an optimal usage of + // zlib, so we don't care about this pathological case.) + + n = hash_size; + p=n; + do { + m = (head[--p]&0xffff); + head[p]=(m>=w_size ? (short)(m-w_size) : 0); + } + while (--n != 0); + + n = w_size; + p = n; + do { + m = (prev[--p]&0xffff); + prev[p] = (m >= w_size ? (short)(m-w_size) : 0); + // If n is not on any hash chain, prev[n] is garbage but + // its value will never be used. + } + while (--n!=0); + more += w_size; + } + + if (strm.avail_in == 0) return; + + // If there was no sliding: + // strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && + // more == window_size - lookahead - strstart + // => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) + // => more >= window_size - 2*WSIZE + 2 + // In the BIG_MEM or MMAP case (not yet supported), + // window_size == input_size + MIN_LOOKAHEAD && + // strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. + // Otherwise, window_size == 2*WSIZE so more >= 2. + // If there was sliding, more >= WSIZE. So in all cases, more >= 2. + + n = strm.read_buf(window, strstart + lookahead, more); + lookahead += n; + + // Initialize the hash value now that we have some input: + if(lookahead >= MIN_MATCH) { + ins_h = window[strstart]&0xff; + ins_h=(((ins_h)<= MIN_MATCH){ + ins_h=(((ins_h)<=MIN_MATCH){ + // check_match(strstart, match_start, match_length); + + bflush=_tr_tally(strstart-match_start, match_length-MIN_MATCH); + + lookahead -= match_length; + + // Insert new strings in the hash table only if the match length + // is not too large. This saves time but degrades compression. + if(match_length <= max_lazy_match && + lookahead >= MIN_MATCH) { + match_length--; // string at strstart already in hash table + do{ + strstart++; + + ins_h=((ins_h<= MIN_MATCH) { + ins_h=(((ins_h)< 4096))) { + + // If prev_match is also MIN_MATCH, match_start is garbage + // but we will ignore the current match anyway. + match_length = MIN_MATCH-1; + } + } + + // If there was a match at the previous step and the current + // match is not better, output the previous match: + if(prev_length >= MIN_MATCH && match_length <= prev_length) { + int max_insert = strstart + lookahead - MIN_MATCH; + // Do not insert strings in hash table beyond this. + + // check_match(strstart-1, prev_match, prev_length); + + bflush=_tr_tally(strstart-1-prev_match, prev_length - MIN_MATCH); + + // Insert in hash table all strings up to the end of the match. + // strstart-1 and strstart are already inserted. If there is not + // enough lookahead, the last two strings are not inserted in + // the hash table. + lookahead -= prev_length-1; + prev_length -= 2; + do{ + if(++strstart <= max_insert) { + ins_h=(((ins_h)<(w_size-MIN_LOOKAHEAD) ? + strstart-(w_size-MIN_LOOKAHEAD) : 0; + int nice_match=this.nice_match; + + // Stop when cur_match becomes <= limit. To simplify the code, + // we prevent matches with the string of window index 0. + + int wmask = w_mask; + + int strend = strstart + MAX_MATCH; + byte scan_end1 = window[scan+best_len-1]; + byte scan_end = window[scan+best_len]; + + // The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. + // It is easy to get rid of this optimization if necessary. + + // Do not waste too much time if we already have a good match: + if (prev_length >= good_match) { + chain_length >>= 2; + } + + // Do not look for matches beyond the end of the input. This is necessary + // to make deflate deterministic. + if (nice_match > lookahead) nice_match = lookahead; + + do { + match = cur_match; + + // Skip to next match if the match length cannot increase + // or if the match length is less than 2: + if (window[match+best_len] != scan_end || + window[match+best_len-1] != scan_end1 || + window[match] != window[scan] || + window[++match] != window[scan+1]) continue; + + // The check at best_len-1 can be removed because it will be made + // again later. (This heuristic is not always a win.) + // It is not necessary to compare scan[2] and match[2] since they + // are always equal when the other bytes match, given that + // the hash keys are equal and that HASH_BITS >= 8. + scan += 2; match++; + + // We check for insufficient lookahead only every 8th comparison; + // the 256th check will be made at strstart+258. + do { + } while (window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + window[++scan] == window[++match] && + scan < strend); + + len = MAX_MATCH - (int)(strend - scan); + scan = strend - MAX_MATCH; + + if(len>best_len) { + match_start = cur_match; + best_len = len; + if (len >= nice_match) break; + scan_end1 = window[scan+best_len-1]; + scan_end = window[scan+best_len]; + } + + } while ((cur_match = (prev[cur_match & wmask]&0xffff)) > limit + && --chain_length != 0); + + if (best_len <= lookahead) return best_len; + return lookahead; + } + + int deflateInit(int level, int bits, int memlevel){ + return deflateInit(level, Z_DEFLATED, bits, memlevel, + Z_DEFAULT_STRATEGY); + } + + int deflateInit(int level, int bits){ + return deflateInit(level, Z_DEFLATED, bits, DEF_MEM_LEVEL, + Z_DEFAULT_STRATEGY); + } + int deflateInit(int level){ + return deflateInit(level, MAX_WBITS); + } + private int deflateInit(int level, int method, int windowBits, + int memLevel, int strategy){ + int wrap = 1; + // byte[] my_version=ZLIB_VERSION; + + // + // if (version == null || version[0] != my_version[0] + // || stream_size != sizeof(z_stream)) { + // return Z_VERSION_ERROR; + // } + + strm.msg = null; + + if (level == Z_DEFAULT_COMPRESSION) level = 6; + + if (windowBits < 0) { // undocumented feature: suppress zlib header + wrap = 0; + windowBits = -windowBits; + } + else if(windowBits > 15){ + wrap = 2; + windowBits -= 16; + strm.adler=new CRC32(); + } + + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || + method != Z_DEFLATED || + windowBits < 9 || windowBits > 15 || level < 0 || level > 9 || + strategy < 0 || strategy > Z_HUFFMAN_ONLY) { + return Z_STREAM_ERROR; + } + + strm.dstate = (Deflate)this; + + this.wrap = wrap; + w_bits = windowBits; + w_size = 1 << w_bits; + w_mask = w_size - 1; + + hash_bits = memLevel + 7; + hash_size = 1 << hash_bits; + hash_mask = hash_size - 1; + hash_shift = ((hash_bits+MIN_MATCH-1)/MIN_MATCH); + + window = new byte[w_size*2]; + prev = new short[w_size]; + head = new short[hash_size]; + + lit_bufsize = 1 << (memLevel + 6); // 16K elements by default + + // We overlay pending_buf and d_buf+l_buf. This works since the average + // output size for (length,distance) codes is <= 24 bits. + pending_buf = new byte[lit_bufsize*4]; + pending_buf_size = lit_bufsize*4; + + d_buf = lit_bufsize/2; + l_buf = (1+2)*lit_bufsize; + + this.level = level; + + this.strategy = strategy; + this.method = (byte)method; + + return deflateReset(); + } + + int deflateReset(){ + strm.total_in = strm.total_out = 0; + strm.msg = null; // + strm.data_type = Z_UNKNOWN; + + pending = 0; + pending_out = 0; + + if(wrap < 0){ + wrap = -wrap; + } + status = (wrap==0) ? BUSY_STATE : INIT_STATE; + strm.adler.reset(); + + last_flush = Z_NO_FLUSH; + + tr_init(); + lm_init(); + return Z_OK; + } + + int deflateEnd(){ + if(status!=INIT_STATE && status!=BUSY_STATE && status!=FINISH_STATE){ + return Z_STREAM_ERROR; + } + // Deallocate in reverse order of allocations: + pending_buf=null; + head=null; + prev=null; + window=null; + // free + // dstate=null; + return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK; + } + + int deflateParams(int _level, int _strategy){ + int err=Z_OK; + + if(_level == Z_DEFAULT_COMPRESSION){ + _level = 6; + } + if(_level < 0 || _level > 9 || + _strategy < 0 || _strategy > Z_HUFFMAN_ONLY) { + return Z_STREAM_ERROR; + } + + if(config_table[level].func!=config_table[_level].func && + strm.total_in != 0) { + // Flush the last buffer: + err = strm.deflate(Z_PARTIAL_FLUSH); + } + + if(level != _level) { + level = _level; + max_lazy_match = config_table[level].max_lazy; + good_match = config_table[level].good_length; + nice_match = config_table[level].nice_length; + max_chain_length = config_table[level].max_chain; + } + strategy = _strategy; + return err; + } + + int deflateSetDictionary (byte[] dictionary, int dictLength){ + int length = dictLength; + int index=0; + + if(dictionary == null || status != INIT_STATE) + return Z_STREAM_ERROR; + + strm.adler.update(dictionary, 0, dictLength); + + if(length < MIN_MATCH) return Z_OK; + if(length > w_size-MIN_LOOKAHEAD){ + length = w_size-MIN_LOOKAHEAD; + index=dictLength-length; // use the tail of the dictionary + } + System.arraycopy(dictionary, index, window, 0, length); + strstart = length; + block_start = length; + + // Insert all strings in the hash table (except for the last two bytes). + // s->lookahead stays null, so s->ins_h will be recomputed at the next + // call of fill_window. + + ins_h = window[0]&0xff; + ins_h=(((ins_h)<Z_FINISH || flush<0){ + return Z_STREAM_ERROR; + } + + if(strm.next_out == null || + (strm.next_in == null && strm.avail_in != 0) || + (status == FINISH_STATE && flush != Z_FINISH)) { + strm.msg=z_errmsg[Z_NEED_DICT-(Z_STREAM_ERROR)]; + return Z_STREAM_ERROR; + } + if(strm.avail_out == 0){ + strm.msg=z_errmsg[Z_NEED_DICT-(Z_BUF_ERROR)]; + return Z_BUF_ERROR; + } + + old_flush = last_flush; + last_flush = flush; + + // Write the zlib header + if(status == INIT_STATE) { + if(wrap == 2){ + getGZIPHeader().put(this); + status=BUSY_STATE; + strm.adler.reset(); + } + else{ + int header = (Z_DEFLATED+((w_bits-8)<<4))<<8; + int level_flags=((level-1)&0xff)>>1; + + if(level_flags>3) level_flags=3; + header |= (level_flags<<6); + if(strstart!=0) header |= PRESET_DICT; + header+=31-(header % 31); + + status=BUSY_STATE; + putShortMSB(header); + + + // Save the adler32 of the preset dictionary: + if(strstart!=0){ + long adler=strm.adler.getValue(); + putShortMSB((int)(adler>>>16)); + putShortMSB((int)(adler&0xffff)); + } + strm.adler.reset(); + } + } + + // Flush as much pending output as possible + if(pending != 0) { + strm.flush_pending(); + if(strm.avail_out == 0) { + // Since avail_out is 0, deflate will be called again with + // more output space, but possibly with both pending and + // avail_in equal to zero. There won't be anything to do, + // but this is not an error situation so make sure we + // return OK instead of BUF_ERROR at next call of deflate: + last_flush = -1; + return Z_OK; + } + + // Make sure there is something to do and avoid duplicate consecutive + // flushes. For repeated and useless calls with Z_FINISH, we keep + // returning Z_STREAM_END instead of Z_BUFF_ERROR. + } + else if(strm.avail_in==0 && flush <= old_flush && + flush != Z_FINISH) { + strm.msg=z_errmsg[Z_NEED_DICT-(Z_BUF_ERROR)]; + return Z_BUF_ERROR; + } + + // User must not provide more input after the first FINISH: + if(status == FINISH_STATE && strm.avail_in != 0) { + strm.msg=z_errmsg[Z_NEED_DICT-(Z_BUF_ERROR)]; + return Z_BUF_ERROR; + } + + // Start a new block or continue the current one. + if(strm.avail_in!=0 || lookahead!=0 || + (flush != Z_NO_FLUSH && status != FINISH_STATE)) { + int bstate=-1; + switch(config_table[level].func){ + case STORED: + bstate = deflate_stored(flush); + break; + case FAST: + bstate = deflate_fast(flush); + break; + case SLOW: + bstate = deflate_slow(flush); + break; + default: + } + + if (bstate==FinishStarted || bstate==FinishDone) { + status = FINISH_STATE; + } + if (bstate==NeedMore || bstate==FinishStarted) { + if(strm.avail_out == 0) { + last_flush = -1; // avoid BUF_ERROR next call, see above + } + return Z_OK; + // If flush != Z_NO_FLUSH && avail_out == 0, the next call + // of deflate should use the same flush parameter to make sure + // that the flush is complete. So we don't have to output an + // empty block here, this will be done at next call. This also + // ensures that for a very small output buffer, we emit at most + // one empty block. + } + + if (bstate==BlockDone) { + if(flush == Z_PARTIAL_FLUSH) { + _tr_align(); + } + else { // FULL_FLUSH or SYNC_FLUSH + _tr_stored_block(0, 0, false); + // For a full flush, this empty block will be recognized + // as a special marker by inflate_sync(). + if(flush == Z_FULL_FLUSH) { + //state.head[s.hash_size-1]=0; + for(int i=0; i>8)&0xff)); + put_byte((byte)((adler>>16)&0xff)); + put_byte((byte)((adler>>24)&0xff)); + put_byte((byte)(strm.total_in&0xff)); + put_byte((byte)((strm.total_in>>8)&0xff)); + put_byte((byte)((strm.total_in>>16)&0xff)); + put_byte((byte)((strm.total_in>>24)&0xff)); + + getGZIPHeader().setCRC(adler); + } + else{ + // Write the zlib trailer (adler32) + long adler=strm.adler.getValue(); + putShortMSB((int)(adler>>>16)); + putShortMSB((int)(adler&0xffff)); + } + + strm.flush_pending(); + + // If avail_out is zero, the application will call deflate again + // to flush the rest. + + if(wrap > 0) wrap = -wrap; // write the trailer only once! + return pending != 0 ? Z_OK : Z_STREAM_END; + } + + static int deflateCopy(ZStream dest, ZStream src){ + + if(src.dstate == null){ + return Z_STREAM_ERROR; + } + + if(src.next_in!=null){ + dest.next_in = new byte[src.next_in.length]; + System.arraycopy(src.next_in, 0, dest.next_in, 0, src.next_in.length); + } + dest.next_in_index = src.next_in_index; + dest.avail_in = src.avail_in; + dest.total_in = src.total_in; + + if(src.next_out!=null){ + dest.next_out = new byte[src.next_out.length]; + System.arraycopy(src.next_out, 0, dest.next_out ,0 , src.next_out.length); + } + + dest.next_out_index = src.next_out_index; + dest.avail_out = src.avail_out; + dest.total_out = src.total_out; + + dest.msg = src.msg; + dest.data_type = src.data_type; + dest.adler = src.adler.copy(); + + try{ + dest.dstate = (Deflate)src.dstate.clone(); + dest.dstate.strm = dest; + } + catch(CloneNotSupportedException e){ + // + } + return Z_OK; + } + + public Object clone() throws CloneNotSupportedException { + Deflate dest = (Deflate)super.clone(); + + dest.pending_buf = dup(dest.pending_buf); + dest.window = dup(dest.window); + + dest.prev = dup(dest.prev); + dest.head = dup(dest.head); + dest.dyn_ltree = dup(dest.dyn_ltree); + dest.dyn_dtree = dup(dest.dyn_dtree); + dest.bl_tree = dup(dest.bl_tree); + + dest.bl_count = dup(dest.bl_count); + dest.heap = dup(dest.heap); + dest.depth = dup(dest.depth); + + dest.l_desc.dyn_tree = dest.dyn_ltree; + dest.d_desc.dyn_tree = dest.dyn_dtree; + dest.bl_desc.dyn_tree = dest.bl_tree; + + /* + dest.l_desc.stat_desc = StaticTree.static_l_desc; + dest.d_desc.stat_desc = StaticTree.static_d_desc; + dest.bl_desc.stat_desc = StaticTree.static_bl_desc; + */ + + if(dest.gheader!=null){ + dest.gheader = (GZIPHeader)dest.gheader.clone(); + } + + return dest; + } + + private byte[] dup(byte[] buf){ + byte[] foo = new byte[buf.length]; + System.arraycopy(buf, 0, foo, 0, foo.length); + return foo; + } + private short[] dup(short[] buf){ + short[] foo = new short[buf.length]; + System.arraycopy(buf, 0, foo, 0, foo.length); + return foo; + } + private int[] dup(int[] buf){ + int[] foo = new int[buf.length]; + System.arraycopy(buf, 0, foo, 0, foo.length); + return foo; + } + + synchronized GZIPHeader getGZIPHeader(){ + if(gheader==null){ + gheader = new GZIPHeader(); + } + return gheader; + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/Deflater.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/Deflater.java new file mode 100644 index 000000000..98a71401a --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/Deflater.java @@ -0,0 +1,147 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * This program is based on zlib-1.1.3, so all credit should go authors + * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) + * and contributors of zlib. + */ + +package com.jcraft.jzlib; + +final public class Deflater extends ZStream{ + + static final private int MAX_WBITS=15; // 32K LZ77 window + static final private int DEF_WBITS=MAX_WBITS; + + static final private int Z_NO_FLUSH=0; + static final private int Z_PARTIAL_FLUSH=1; + static final private int Z_SYNC_FLUSH=2; + static final private int Z_FULL_FLUSH=3; + static final private int Z_FINISH=4; + + static final private int MAX_MEM_LEVEL=9; + + static final private int Z_OK=0; + static final private int Z_STREAM_END=1; + static final private int Z_NEED_DICT=2; + static final private int Z_ERRNO=-1; + static final private int Z_STREAM_ERROR=-2; + static final private int Z_DATA_ERROR=-3; + static final private int Z_MEM_ERROR=-4; + static final private int Z_BUF_ERROR=-5; + static final private int Z_VERSION_ERROR=-6; + + private boolean finished = false; + + public Deflater(){ + super(); + } + + public Deflater(int level) throws GZIPException { + this(level, MAX_WBITS); + } + + public Deflater(int level, boolean nowrap) throws GZIPException { + this(level, MAX_WBITS, nowrap); + } + + public Deflater(int level, int bits) throws GZIPException { + this(level, bits, false); + } + + public Deflater(int level, int bits, boolean nowrap) throws GZIPException { + super(); + int ret = init(level, bits, nowrap); + if(ret!=Z_OK) + throw new GZIPException(ret+": "+msg); + } + + public Deflater(int level, int bits, int memlevel) throws GZIPException { + super(); + int ret = init(level, bits, memlevel); + if(ret!=Z_OK) + throw new GZIPException(ret+": "+msg); + } + + public int init(int level){ + return init(level, MAX_WBITS); + } + public int init(int level, boolean nowrap){ + return init(level, MAX_WBITS, nowrap); + } + public int init(int level, int bits){ + return init(level, bits, false); + } + public int init(int level, int bits, int memlevel){ + finished = false; + dstate=new Deflate(this); + return dstate.deflateInit(level, bits, memlevel); + } + public int init(int level, int bits, boolean nowrap){ + finished = false; + dstate=new Deflate(this); + return dstate.deflateInit(level, nowrap?-bits:bits); + } + + public int deflate(int flush){ + if(dstate==null){ + return Z_STREAM_ERROR; + } + int ret = dstate.deflate(flush); + if(ret == Z_STREAM_END) + finished = true; + return ret; + } + public int end(){ + finished = true; + if(dstate==null) return Z_STREAM_ERROR; + int ret=dstate.deflateEnd(); + dstate=null; + free(); + return ret; + } + public int params(int level, int strategy){ + if(dstate==null) return Z_STREAM_ERROR; + return dstate.deflateParams(level, strategy); + } + public int setDictionary (byte[] dictionary, int dictLength){ + if(dstate == null) + return Z_STREAM_ERROR; + return dstate.deflateSetDictionary(dictionary, dictLength); + } + + public boolean finished(){ + return finished; + } + + public int copy(Deflater src){ + this.finished = src.finished; + return Deflate.deflateCopy(this, src); + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/DeflaterOutputStream.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/DeflaterOutputStream.java new file mode 100644 index 000000000..378a0e1d9 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/DeflaterOutputStream.java @@ -0,0 +1,181 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.jcraft.jzlib; +import java.io.*; + +public class DeflaterOutputStream extends FilterOutputStream { + + protected final Deflater deflater; + + protected byte[] buffer; + + private boolean closed = false; + + private boolean syncFlush = false; + + private final byte[] buf1 = new byte[1]; + + protected boolean mydeflater = false; + + private boolean close_out = true; + + protected static final int DEFAULT_BUFSIZE = 512; + + public DeflaterOutputStream(OutputStream out) throws IOException { + this(out, + new Deflater(JZlib.Z_DEFAULT_COMPRESSION), + DEFAULT_BUFSIZE, true); + mydeflater = true; + } + + public DeflaterOutputStream(OutputStream out, Deflater def) throws IOException { + this(out, def, DEFAULT_BUFSIZE, true); + } + + public DeflaterOutputStream(OutputStream out, + Deflater deflater, + int size) throws IOException { + this(out, deflater, size, true); + } + public DeflaterOutputStream(OutputStream out, + Deflater deflater, + int size, + boolean close_out) throws IOException { + super(out); + if (out == null || deflater == null) { + throw new NullPointerException(); + } + else if (size <= 0) { + throw new IllegalArgumentException("buffer size must be greater than 0"); + } + this.deflater = deflater; + buffer = new byte[size]; + this.close_out = close_out; + } + + public void write(int b) throws IOException { + buf1[0] = (byte)(b & 0xff); + write(buf1, 0, 1); + } + + public void write(byte[] b, int off, int len) throws IOException { + if (deflater.finished()) { + throw new IOException("finished"); + } + else if (off<0 | b.length<=off | off+len>b.length) { + throw new IndexOutOfBoundsException(); + } + else if (len == 0) { + return; + } + else { + int flush = syncFlush ? JZlib.Z_SYNC_FLUSH : JZlib.Z_NO_FLUSH; + deflater.setInput(b, off, len, true); + while (deflater.avail_in>0) { + int err = deflate(flush); + if (err == JZlib.Z_STREAM_END) + break; + } + } + } + + public void finish() throws IOException { + while (!deflater.finished()) { + deflate(JZlib.Z_FINISH); + } + } + + public void close() throws IOException { + if (!closed) { + finish(); + if (mydeflater){ + deflater.end(); + } + if(close_out) + out.close(); + closed = true; + } + } + + protected int deflate(int flush) throws IOException { + deflater.setOutput(buffer, 0, buffer.length); + int err = deflater.deflate(flush); + switch(err) { + case JZlib.Z_OK: + case JZlib.Z_STREAM_END: + break; + case JZlib.Z_BUF_ERROR: + if(deflater.avail_in<=0 && flush!=JZlib.Z_FINISH){ + // flush() without any data + break; + } + default: + throw new IOException("failed to deflate"); + } + int len = deflater.next_out_index; + if (len > 0) { + out.write(buffer, 0, len); + } + return err; + } + + public void flush() throws IOException { + if (syncFlush && !deflater.finished()) { + while (true) { + int err = deflate(JZlib.Z_SYNC_FLUSH); + if (deflater.next_out_index < buffer.length) + break; + if (err == JZlib.Z_STREAM_END) + break; + } + } + out.flush(); + } + + public long getTotalIn() { + return deflater.getTotalIn(); + } + + public long getTotalOut() { + return deflater.getTotalOut(); + } + + public void setSyncFlush(boolean syncFlush){ + this.syncFlush = syncFlush; + } + + public boolean getSyncFlush(){ + return this.syncFlush; + } + + public Deflater getDeflater(){ + return deflater; + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/GZIPException.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/GZIPException.java new file mode 100644 index 000000000..0beef40df --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/GZIPException.java @@ -0,0 +1,44 @@ +/* -*-mode:java; c-basic-offset:2; -*- */ +/* +Copyright (c) 2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * This program is based on zlib-1.1.3, so all credit should go authors + * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) + * and contributors of zlib. + */ + +package com.jcraft.jzlib; + +public class GZIPException extends java.io.IOException { + public GZIPException() { + super(); + } + public GZIPException(String s) { + super(s); + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/GZIPHeader.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/GZIPHeader.java new file mode 100644 index 000000000..d35f62bb2 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/GZIPHeader.java @@ -0,0 +1,184 @@ +/* -*-mode:java; c-basic-offset:2; -*- */ +/* +Copyright (c) 2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * This program is based on zlib-1.1.3, so all credit should go authors + * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) + * and contributors of zlib. + */ + +package com.jcraft.jzlib; + +import java.io.UnsupportedEncodingException; + +public class GZIPHeader implements Cloneable { + boolean text = false; + private boolean fhcrc = false; + long time; + int xflags; + int os = 255; + byte[] extra; + byte[] name; + byte[] comment; + int hcrc; + long crc; + boolean done = false; + long mtime = 0; + + public void setModifiedTime(long mtime) { + this.mtime = mtime; + } + + public long getModifiedTime() { + return mtime; + } + + public void setOS(int os) { + if((0<=os && os <=13) | os==255){ + this.os=os; + } + else + throw new IllegalArgumentException("os: "+os); + } + + public int getOS(){ + return os; + } + + public void setName(String name) { + try{ + this.name=name.getBytes("ISO-8859-1"); + } + catch(UnsupportedEncodingException e){ + throw new IllegalArgumentException("name must be in ISO-8859-1 "+name); + } + } + + public String getName(){ + if(name==null) return ""; + return new String(name); + } + + public void setComment(String comment) { + try{ + this.comment=comment.getBytes("ISO-8859-1"); + } + catch(UnsupportedEncodingException e){ + throw new IllegalArgumentException("comment must be in ISO-8859-1 "+name); + } + } + + public String getComment(){ + if(comment==null) return ""; + return new String(comment); + } + + public void setCRC(long crc){ + this.crc = crc; + } + + public long getCRC(){ + return crc; + } + + void put(Deflate d){ + int flag = 0; + if(text){ + flag |= 1; // FTEXT + } + if(fhcrc){ + flag |= 2; // FHCRC + } + if(extra!=null){ + flag |= 4; // FHCRC + } + if(name!=null){ + flag |= 8; // FNAME + } + if(comment!=null){ + flag |= 16; // FCOMMENT + } + int xfl = 0; + if(d.level == JZlib.Z_BEST_SPEED){ + xfl |= 4; + } + else if (d.level == JZlib.Z_BEST_COMPRESSION){ + xfl |= 2; + } + + d.put_short((short)0x8b1f); // ID1 ID2 + d.put_byte((byte)8); // CM(Compression Method) + d.put_byte((byte)flag); + d.put_byte((byte)mtime); + d.put_byte((byte)(mtime>>8)); + d.put_byte((byte)(mtime>>16)); + d.put_byte((byte)(mtime>>24)); + d.put_byte((byte)xfl); + d.put_byte((byte)os); + + if(extra!=null){ + d.put_byte((byte)extra.length); + d.put_byte((byte)(extra.length>>8)); + d.put_byte(extra, 0, extra.length); + } + + if(name!=null){ + d.put_byte(name, 0, name.length); + d.put_byte((byte)0); + } + + if(comment!=null){ + d.put_byte(comment, 0, comment.length); + d.put_byte((byte)0); + } + } + + public Object clone() throws CloneNotSupportedException { + GZIPHeader gheader = (GZIPHeader)super.clone(); + byte[] tmp; + if(gheader.extra!=null){ + tmp=new byte[gheader.extra.length]; + System.arraycopy(gheader.extra, 0, tmp, 0, tmp.length); + gheader.extra = tmp; + } + + if(gheader.name!=null){ + tmp=new byte[gheader.name.length]; + System.arraycopy(gheader.name, 0, tmp, 0, tmp.length); + gheader.name = tmp; + } + + if(gheader.comment!=null){ + tmp=new byte[gheader.comment.length]; + System.arraycopy(gheader.comment, 0, tmp, 0, tmp.length); + gheader.comment = tmp; + } + + return gheader; + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/GZIPInputStream.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/GZIPInputStream.java new file mode 100644 index 000000000..5d29dca72 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/GZIPInputStream.java @@ -0,0 +1,145 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.jcraft.jzlib; +import java.io.*; + +public class GZIPInputStream extends InflaterInputStream { + + public GZIPInputStream(InputStream in) throws IOException { + this(in, DEFAULT_BUFSIZE, true); + } + + public GZIPInputStream(InputStream in, + int size, + boolean close_in) throws IOException { + this(in, new Inflater(15+16), size, close_in); + myinflater = true; + } + + public GZIPInputStream(InputStream in, + Inflater inflater, + int size, + boolean close_in) throws IOException { + super(in, inflater, size, close_in); + } + + public long getModifiedtime() { + return inflater.istate.getGZIPHeader().getModifiedTime(); + } + + public int getOS() { + return inflater.istate.getGZIPHeader().getOS(); + } + + public String getName() { + return inflater.istate.getGZIPHeader().getName(); + } + + public String getComment() { + return inflater.istate.getGZIPHeader().getComment(); + } + + public long getCRC() throws GZIPException { + if(inflater.istate.mode != 12 /*DONE*/) + throw new GZIPException("checksum is not calculated yet."); + return inflater.istate.getGZIPHeader().getCRC(); + } + + public void readHeader() throws IOException { + + byte[] empty = "".getBytes(); + inflater.setOutput(empty, 0, 0); + inflater.setInput(empty, 0, 0, false); + + byte[] b = new byte[10]; + + int n = fill(b); + if(n!=10){ + if(n>0){ + inflater.setInput(b, 0, n, false); + //inflater.next_in_index = n; + inflater.next_in_index = 0; + inflater.avail_in = n; + } + throw new IOException("no input"); + } + + inflater.setInput(b, 0, n, false); + + byte[] b1 = new byte[1]; + do{ + if(inflater.avail_in<=0){ + int i = in.read(b1); + if(i<=0) + throw new IOException("no input"); + inflater.setInput(b1, 0, 1, true); + } + + int err = inflater.inflate(JZlib.Z_NO_FLUSH); + + if(err!=0/*Z_OK*/){ + int len = 2048-inflater.next_in.length; + if(len>0){ + byte[] tmp = new byte[len]; + n = fill(tmp); + if(n>0){ + inflater.avail_in += inflater.next_in_index; + inflater.next_in_index = 0; + inflater.setInput(tmp, 0, n, true); + } + } + //inflater.next_in_index = inflater.next_in.length; + inflater.avail_in += inflater.next_in_index; + inflater.next_in_index = 0; + throw new IOException(inflater.msg); + } + } + while(inflater.istate.inParsingHeader()); + } + + private int fill(byte[] buf) { + int len = buf.length; + int n = 0; + do{ + int i = -1; + try { + i = in.read(buf, n, buf.length - n); + } + catch(IOException e){ + } + if(i == -1){ + break; + } + n+=i; + } + while(n>> 1){ + case 0: // stored + {b>>>=(3);k-=(3);} + t = k & 7; // go to byte boundary + + {b>>>=(t);k-=(t);} + mode = LENS; // get length of stored block + break; + case 1: // fixed + { + int[] bl=new int[1]; + int[] bd=new int[1]; + int[][] tl=new int[1][]; + int[][] td=new int[1][]; + + InfTree.inflate_trees_fixed(bl, bd, tl, td, z); + codes.init(bl[0], bd[0], tl[0], 0, td[0], 0, z); + } + + {b>>>=(3);k-=(3);} + + mode = CODES; + break; + case 2: // dynamic + + {b>>>=(3);k-=(3);} + + mode = TABLE; + break; + case 3: // illegal + + {b>>>=(3);k-=(3);} + mode = BAD; + z.msg = "invalid block type"; + r = Z_DATA_ERROR; + + bitb=b; bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + return inflate_flush(z,r); + } + break; + case LENS: + + while(k<(32)){ + if(n!=0){ + r=Z_OK; + } + else{ + bitb=b; bitk=k; + z.avail_in=n; + z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + return inflate_flush(z,r); + }; + n--; + b|=(z.next_in[p++]&0xff)<>> 16) & 0xffff) != (b & 0xffff)){ + mode = BAD; + z.msg = "invalid stored block lengths"; + r = Z_DATA_ERROR; + + bitb=b; bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + return inflate_flush(z,r); + } + left = (b & 0xffff); + b = k = 0; // dump bits + mode = left!=0 ? STORED : (last!=0 ? DRY : TYPE); + break; + case STORED: + if (n == 0){ + bitb=b; bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + return inflate_flush(z,r); + } + + if(m==0){ + if(q==end&&read!=0){ + q=0; m=(int)(qn) t = n; + if(t>m) t = m; + System.arraycopy(z.next_in, p, window, q, t); + p += t; n -= t; + q += t; m -= t; + if ((left -= t) != 0) + break; + mode = last!=0 ? DRY : TYPE; + break; + case TABLE: + + while(k<(14)){ + if(n!=0){ + r=Z_OK; + } + else{ + bitb=b; bitk=k; + z.avail_in=n; + z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + return inflate_flush(z,r); + }; + n--; + b|=(z.next_in[p++]&0xff)< 29 || ((t >> 5) & 0x1f) > 29) + { + mode = BAD; + z.msg = "too many length or distance symbols"; + r = Z_DATA_ERROR; + + bitb=b; bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + return inflate_flush(z,r); + } + t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f); + if(blens==null || blens.length>>=(14);k-=(14);} + + index = 0; + mode = BTREE; + case BTREE: + while (index < 4 + (table >>> 10)){ + while(k<(3)){ + if(n!=0){ + r=Z_OK; + } + else{ + bitb=b; bitk=k; + z.avail_in=n; + z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + return inflate_flush(z,r); + }; + n--; + b|=(z.next_in[p++]&0xff)<>>=(3);k-=(3);} + } + + while(index < 19){ + blens[border[index++]] = 0; + } + + bb[0] = 7; + t = inftree.inflate_trees_bits(blens, bb, tb, hufts, z); + if (t != Z_OK){ + r = t; + if (r == Z_DATA_ERROR){ + blens=null; + mode = BAD; + } + + bitb=b; bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + return inflate_flush(z,r); + } + + index = 0; + mode = DTREE; + case DTREE: + while (true){ + t = table; + if(!(index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))){ + break; + } + + int[] h; + int i, j, c; + + t = bb[0]; + + while(k<(t)){ + if(n!=0){ + r=Z_OK; + } + else{ + bitb=b; bitk=k; + z.avail_in=n; + z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + return inflate_flush(z,r); + }; + n--; + b|=(z.next_in[p++]&0xff)<>>=(t);k-=(t); + blens[index++] = c; + } + else { // c == 16..18 + i = c == 18 ? 7 : c - 14; + j = c == 18 ? 11 : 3; + + while(k<(t+i)){ + if(n!=0){ + r=Z_OK; + } + else{ + bitb=b; bitk=k; + z.avail_in=n; + z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + return inflate_flush(z,r); + }; + n--; + b|=(z.next_in[p++]&0xff)<>>=(t);k-=(t); + + j += (b & inflate_mask[i]); + + b>>>=(i);k-=(i); + + i = index; + t = table; + if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) || + (c == 16 && i < 1)){ + blens=null; + mode = BAD; + z.msg = "invalid bit length repeat"; + r = Z_DATA_ERROR; + + bitb=b; bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + return inflate_flush(z,r); + } + + c = c == 16 ? blens[i-1] : 0; + do{ + blens[i++] = c; + } + while (--j!=0); + index = i; + } + } + + tb[0]=-1; + { + int[] bl=new int[1]; + int[] bd=new int[1]; + int[] tl=new int[1]; + int[] td=new int[1]; + bl[0] = 9; // must be <= 9 for lookahead assumptions + bd[0] = 6; // must be <= 9 for lookahead assumptions + + t = table; + t = inftree.inflate_trees_dynamic(257 + (t & 0x1f), + 1 + ((t >> 5) & 0x1f), + blens, bl, bd, tl, td, hufts, z); + + if (t != Z_OK){ + if (t == Z_DATA_ERROR){ + blens=null; + mode = BAD; + } + r = t; + + bitb=b; bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + return inflate_flush(z,r); + } + codes.init(bl[0], bd[0], hufts, tl[0], hufts, td[0], z); + } + mode = CODES; + case CODES: + bitb=b; bitk=k; + z.avail_in=n; z.total_in+=p-z.next_in_index;z.next_in_index=p; + write=q; + + if ((r = codes.proc(this, z, r)) != Z_STREAM_END){ + return inflate_flush(z, r); + } + r = Z_OK; + codes.free(z); + + p=z.next_in_index; n=z.avail_in;b=bitb;k=bitk; + q=write;m=(int)(q z.avail_out) n = z.avail_out; + if (n!=0 && r == Z_BUF_ERROR) r = Z_OK; + + // update counters + z.avail_out -= n; + z.total_out += n; + + // update check information + if(check){ + z.adler.update(window, q, n); + } + + // copy as far as end of window + System.arraycopy(window, q, z.next_out, p, n); + p += n; + q += n; + + // see if more to copy at beginning of window + if (q == end){ + // wrap pointers + q = 0; + if (write == end) + write = 0; + + // compute bytes to copy + n = write - q; + if (n > z.avail_out) n = z.avail_out; + if (n!=0 && r == Z_BUF_ERROR) r = Z_OK; + + // update counters + z.avail_out -= n; + z.total_out += n; + + // update check information + if(check){ + z.adler.update(window, q, n); + } + + // copy + System.arraycopy(window, q, z.next_out, p, n); + p += n; + q += n; + } + + // update pointers + z.next_out_index = p; + read = q; + + // done + return r; + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/InfCodes.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/InfCodes.java new file mode 100644 index 000000000..c768fb1cb --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/InfCodes.java @@ -0,0 +1,605 @@ +/* -*-mode:java; c-basic-offset:2; -*- */ +/* +Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * This program is based on zlib-1.1.3, so all credit should go authors + * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) + * and contributors of zlib. + */ + +package com.jcraft.jzlib; + +final class InfCodes{ + + static final private int[] inflate_mask = { + 0x00000000, 0x00000001, 0x00000003, 0x00000007, 0x0000000f, + 0x0000001f, 0x0000003f, 0x0000007f, 0x000000ff, 0x000001ff, + 0x000003ff, 0x000007ff, 0x00000fff, 0x00001fff, 0x00003fff, + 0x00007fff, 0x0000ffff + }; + + static final private int Z_OK=0; + static final private int Z_STREAM_END=1; + static final private int Z_NEED_DICT=2; + static final private int Z_ERRNO=-1; + static final private int Z_STREAM_ERROR=-2; + static final private int Z_DATA_ERROR=-3; + static final private int Z_MEM_ERROR=-4; + static final private int Z_BUF_ERROR=-5; + static final private int Z_VERSION_ERROR=-6; + + // waiting for "i:"=input, + // "o:"=output, + // "x:"=nothing + static final private int START=0; // x: set up for LEN + static final private int LEN=1; // i: get length/literal/eob next + static final private int LENEXT=2; // i: getting length extra (have base) + static final private int DIST=3; // i: get distance next + static final private int DISTEXT=4;// i: getting distance extra + static final private int COPY=5; // o: copying bytes in window, waiting for space + static final private int LIT=6; // o: got literal, waiting for output space + static final private int WASH=7; // o: got eob, possibly still output waiting + static final private int END=8; // x: got eob and all data flushed + static final private int BADCODE=9;// x: got error + + int mode; // current inflate_codes mode + + // mode dependent information + int len; + + int[] tree; // pointer into tree + int tree_index=0; + int need; // bits needed + + int lit; + + // if EXT or COPY, where and how much + int get; // bits to get for extra + int dist; // distance back to copy from + + byte lbits; // ltree bits decoded per branch + byte dbits; // dtree bits decoder per branch + int[] ltree; // literal/length/eob tree + int ltree_index; // literal/length/eob tree + int[] dtree; // distance tree + int dtree_index; // distance tree + + InfCodes(){ + } + void init(int bl, int bd, + int[] tl, int tl_index, + int[] td, int td_index, ZStream z){ + mode=START; + lbits=(byte)bl; + dbits=(byte)bd; + ltree=tl; + ltree_index=tl_index; + dtree = td; + dtree_index=td_index; + tree=null; + } + + int proc(InfBlocks s, ZStream z, int r){ + int j; // temporary storage + int[] t; // temporary pointer + int tindex; // temporary pointer + int e; // extra bits or operation + int b=0; // bit buffer + int k=0; // bits in bit buffer + int p=0; // input data pointer + int n; // bytes available there + int q; // output window write pointer + int m; // bytes to end of window or read pointer + int f; // pointer to copy strings from + + // copy input/output information to locals (UPDATE macro restores) + p=z.next_in_index;n=z.avail_in;b=s.bitb;k=s.bitk; + q=s.write;m=q= 258 && n >= 10){ + + s.bitb=b;s.bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + s.write=q; + r = inflate_fast(lbits, dbits, + ltree, ltree_index, + dtree, dtree_index, + s, z); + + p=z.next_in_index;n=z.avail_in;b=s.bitb;k=s.bitk; + q=s.write;m=q>>=(tree[tindex+1]); + k-=(tree[tindex+1]); + + e=tree[tindex]; + + if(e == 0){ // literal + lit = tree[tindex+2]; + mode = LIT; + break; + } + if((e & 16)!=0 ){ // length + get = e & 15; + len = tree[tindex+2]; + mode = LENEXT; + break; + } + if ((e & 64) == 0){ // next table + need = e; + tree_index = tindex/3+tree[tindex+2]; + break; + } + if ((e & 32)!=0){ // end of block + mode = WASH; + break; + } + mode = BADCODE; // invalid code + z.msg = "invalid literal/length code"; + r = Z_DATA_ERROR; + + s.bitb=b;s.bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + s.write=q; + return s.inflate_flush(z,r); + + case LENEXT: // i: getting length extra (have base) + j = get; + + while(k<(j)){ + if(n!=0)r=Z_OK; + else{ + + s.bitb=b;s.bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + s.write=q; + return s.inflate_flush(z,r); + } + n--; b|=(z.next_in[p++]&0xff)<>=j; + k-=j; + + need = dbits; + tree = dtree; + tree_index=dtree_index; + mode = DIST; + case DIST: // i: get distance next + j = need; + + while(k<(j)){ + if(n!=0)r=Z_OK; + else{ + + s.bitb=b;s.bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + s.write=q; + return s.inflate_flush(z,r); + } + n--; b|=(z.next_in[p++]&0xff)<>=tree[tindex+1]; + k-=tree[tindex+1]; + + e = (tree[tindex]); + if((e & 16)!=0){ // distance + get = e & 15; + dist = tree[tindex+2]; + mode = DISTEXT; + break; + } + if ((e & 64) == 0){ // next table + need = e; + tree_index = tindex/3 + tree[tindex+2]; + break; + } + mode = BADCODE; // invalid code + z.msg = "invalid distance code"; + r = Z_DATA_ERROR; + + s.bitb=b;s.bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + s.write=q; + return s.inflate_flush(z,r); + + case DISTEXT: // i: getting distance extra + j = get; + + while(k<(j)){ + if(n!=0)r=Z_OK; + else{ + + s.bitb=b;s.bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + s.write=q; + return s.inflate_flush(z,r); + } + n--; b|=(z.next_in[p++]&0xff)<>=j; + k-=j; + + mode = COPY; + case COPY: // o: copying bytes in window, waiting for space + f = q - dist; + while(f < 0){ // modulo window size-"while" instead + f += s.end; // of "if" handles invalid distances + } + while (len!=0){ + + if(m==0){ + if(q==s.end&&s.read!=0){q=0;m=q 7){ // return unused byte, if any + k -= 8; + n++; + p--; // can always return one + } + + s.write=q; r=s.inflate_flush(z,r); + q=s.write;m=q= 258 && n >= 10 + // get literal/length code + while(k<(20)){ // max bits for literal/length code + n--; + b|=(z.next_in[p++]&0xff)<>=(tp[tp_index_t_3+1]); k-=(tp[tp_index_t_3+1]); + + s.window[q++] = (byte)tp[tp_index_t_3+2]; + m--; + continue; + } + do { + + b>>=(tp[tp_index_t_3+1]); k-=(tp[tp_index_t_3+1]); + + if((e&16)!=0){ + e &= 15; + c = tp[tp_index_t_3+2] + ((int)b & inflate_mask[e]); + + b>>=e; k-=e; + + // decode distance base of block to copy + while(k<(15)){ // max bits for distance code + n--; + b|=(z.next_in[p++]&0xff)<>=(tp[tp_index_t_3+1]); k-=(tp[tp_index_t_3+1]); + + if((e&16)!=0){ + // get extra bits to add to distance base + e &= 15; + while(k<(e)){ // get extra bits (up to 13) + n--; + b|=(z.next_in[p++]&0xff)<>=(e); k-=(e); + + // do the copy + m -= c; + if (q >= d){ // offset before dest + // just copy + r=q-d; + if(q-r>0 && 2>(q-r)){ + s.window[q++]=s.window[r++]; // minimum count is three, + s.window[q++]=s.window[r++]; // so unroll loop a little + c-=2; + } + else{ + System.arraycopy(s.window, r, s.window, q, 2); + q+=2; r+=2; c-=2; + } + } + else{ // else offset after destination + r=q-d; + do{ + r+=s.end; // force pointer in window + }while(r<0); // covers invalid distances + e=s.end-r; + if(c>e){ // if source crosses, + c-=e; // wrapped copy + if(q-r>0 && e>(q-r)){ + do{s.window[q++] = s.window[r++];} + while(--e!=0); + } + else{ + System.arraycopy(s.window, r, s.window, q, e); + q+=e; r+=e; e=0; + } + r = 0; // copy rest from start of window + } + + } + + // copy all or what's left + if(q-r>0 && c>(q-r)){ + do{s.window[q++] = s.window[r++];} + while(--c!=0); + } + else{ + System.arraycopy(s.window, r, s.window, q, c); + q+=c; r+=c; c=0; + } + break; + } + else if((e&64)==0){ + t+=tp[tp_index_t_3+2]; + t+=(b&inflate_mask[e]); + tp_index_t_3=(tp_index+t)*3; + e=tp[tp_index_t_3]; + } + else{ + z.msg = "invalid distance code"; + + c=z.avail_in-n;c=(k>>3)>3:c;n+=c;p-=c;k-=c<<3; + + s.bitb=b;s.bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + s.write=q; + + return Z_DATA_ERROR; + } + } + while(true); + break; + } + + if((e&64)==0){ + t+=tp[tp_index_t_3+2]; + t+=(b&inflate_mask[e]); + tp_index_t_3=(tp_index+t)*3; + if((e=tp[tp_index_t_3])==0){ + + b>>=(tp[tp_index_t_3+1]); k-=(tp[tp_index_t_3+1]); + + s.window[q++]=(byte)tp[tp_index_t_3+2]; + m--; + break; + } + } + else if((e&32)!=0){ + + c=z.avail_in-n;c=(k>>3)>3:c;n+=c;p-=c;k-=c<<3; + + s.bitb=b;s.bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + s.write=q; + + return Z_STREAM_END; + } + else{ + z.msg="invalid literal/length code"; + + c=z.avail_in-n;c=(k>>3)>3:c;n+=c;p-=c;k-=c<<3; + + s.bitb=b;s.bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + s.write=q; + + return Z_DATA_ERROR; + } + } + while(true); + } + while(m>=258 && n>= 10); + + // not enough input or output--restore pointers and return + c=z.avail_in-n;c=(k>>3)>3:c;n+=c;p-=c;k-=c<<3; + + s.bitb=b;s.bitk=k; + z.avail_in=n;z.total_in+=p-z.next_in_index;z.next_in_index=p; + s.write=q; + + return Z_OK; + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/InfTree.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/InfTree.java new file mode 100644 index 000000000..cbca43667 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/InfTree.java @@ -0,0 +1,520 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * This program is based on zlib-1.1.3, so all credit should go authors + * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) + * and contributors of zlib. + */ + +package com.jcraft.jzlib; + +final class InfTree{ + + static final private int MANY=1440; + + static final private int Z_OK=0; + static final private int Z_STREAM_END=1; + static final private int Z_NEED_DICT=2; + static final private int Z_ERRNO=-1; + static final private int Z_STREAM_ERROR=-2; + static final private int Z_DATA_ERROR=-3; + static final private int Z_MEM_ERROR=-4; + static final private int Z_BUF_ERROR=-5; + static final private int Z_VERSION_ERROR=-6; + + static final int fixed_bl = 9; + static final int fixed_bd = 5; + + static final int[] fixed_tl = { + 96,7,256, 0,8,80, 0,8,16, 84,8,115, + 82,7,31, 0,8,112, 0,8,48, 0,9,192, + 80,7,10, 0,8,96, 0,8,32, 0,9,160, + 0,8,0, 0,8,128, 0,8,64, 0,9,224, + 80,7,6, 0,8,88, 0,8,24, 0,9,144, + 83,7,59, 0,8,120, 0,8,56, 0,9,208, + 81,7,17, 0,8,104, 0,8,40, 0,9,176, + 0,8,8, 0,8,136, 0,8,72, 0,9,240, + 80,7,4, 0,8,84, 0,8,20, 85,8,227, + 83,7,43, 0,8,116, 0,8,52, 0,9,200, + 81,7,13, 0,8,100, 0,8,36, 0,9,168, + 0,8,4, 0,8,132, 0,8,68, 0,9,232, + 80,7,8, 0,8,92, 0,8,28, 0,9,152, + 84,7,83, 0,8,124, 0,8,60, 0,9,216, + 82,7,23, 0,8,108, 0,8,44, 0,9,184, + 0,8,12, 0,8,140, 0,8,76, 0,9,248, + 80,7,3, 0,8,82, 0,8,18, 85,8,163, + 83,7,35, 0,8,114, 0,8,50, 0,9,196, + 81,7,11, 0,8,98, 0,8,34, 0,9,164, + 0,8,2, 0,8,130, 0,8,66, 0,9,228, + 80,7,7, 0,8,90, 0,8,26, 0,9,148, + 84,7,67, 0,8,122, 0,8,58, 0,9,212, + 82,7,19, 0,8,106, 0,8,42, 0,9,180, + 0,8,10, 0,8,138, 0,8,74, 0,9,244, + 80,7,5, 0,8,86, 0,8,22, 192,8,0, + 83,7,51, 0,8,118, 0,8,54, 0,9,204, + 81,7,15, 0,8,102, 0,8,38, 0,9,172, + 0,8,6, 0,8,134, 0,8,70, 0,9,236, + 80,7,9, 0,8,94, 0,8,30, 0,9,156, + 84,7,99, 0,8,126, 0,8,62, 0,9,220, + 82,7,27, 0,8,110, 0,8,46, 0,9,188, + 0,8,14, 0,8,142, 0,8,78, 0,9,252, + 96,7,256, 0,8,81, 0,8,17, 85,8,131, + 82,7,31, 0,8,113, 0,8,49, 0,9,194, + 80,7,10, 0,8,97, 0,8,33, 0,9,162, + 0,8,1, 0,8,129, 0,8,65, 0,9,226, + 80,7,6, 0,8,89, 0,8,25, 0,9,146, + 83,7,59, 0,8,121, 0,8,57, 0,9,210, + 81,7,17, 0,8,105, 0,8,41, 0,9,178, + 0,8,9, 0,8,137, 0,8,73, 0,9,242, + 80,7,4, 0,8,85, 0,8,21, 80,8,258, + 83,7,43, 0,8,117, 0,8,53, 0,9,202, + 81,7,13, 0,8,101, 0,8,37, 0,9,170, + 0,8,5, 0,8,133, 0,8,69, 0,9,234, + 80,7,8, 0,8,93, 0,8,29, 0,9,154, + 84,7,83, 0,8,125, 0,8,61, 0,9,218, + 82,7,23, 0,8,109, 0,8,45, 0,9,186, + 0,8,13, 0,8,141, 0,8,77, 0,9,250, + 80,7,3, 0,8,83, 0,8,19, 85,8,195, + 83,7,35, 0,8,115, 0,8,51, 0,9,198, + 81,7,11, 0,8,99, 0,8,35, 0,9,166, + 0,8,3, 0,8,131, 0,8,67, 0,9,230, + 80,7,7, 0,8,91, 0,8,27, 0,9,150, + 84,7,67, 0,8,123, 0,8,59, 0,9,214, + 82,7,19, 0,8,107, 0,8,43, 0,9,182, + 0,8,11, 0,8,139, 0,8,75, 0,9,246, + 80,7,5, 0,8,87, 0,8,23, 192,8,0, + 83,7,51, 0,8,119, 0,8,55, 0,9,206, + 81,7,15, 0,8,103, 0,8,39, 0,9,174, + 0,8,7, 0,8,135, 0,8,71, 0,9,238, + 80,7,9, 0,8,95, 0,8,31, 0,9,158, + 84,7,99, 0,8,127, 0,8,63, 0,9,222, + 82,7,27, 0,8,111, 0,8,47, 0,9,190, + 0,8,15, 0,8,143, 0,8,79, 0,9,254, + 96,7,256, 0,8,80, 0,8,16, 84,8,115, + 82,7,31, 0,8,112, 0,8,48, 0,9,193, + + 80,7,10, 0,8,96, 0,8,32, 0,9,161, + 0,8,0, 0,8,128, 0,8,64, 0,9,225, + 80,7,6, 0,8,88, 0,8,24, 0,9,145, + 83,7,59, 0,8,120, 0,8,56, 0,9,209, + 81,7,17, 0,8,104, 0,8,40, 0,9,177, + 0,8,8, 0,8,136, 0,8,72, 0,9,241, + 80,7,4, 0,8,84, 0,8,20, 85,8,227, + 83,7,43, 0,8,116, 0,8,52, 0,9,201, + 81,7,13, 0,8,100, 0,8,36, 0,9,169, + 0,8,4, 0,8,132, 0,8,68, 0,9,233, + 80,7,8, 0,8,92, 0,8,28, 0,9,153, + 84,7,83, 0,8,124, 0,8,60, 0,9,217, + 82,7,23, 0,8,108, 0,8,44, 0,9,185, + 0,8,12, 0,8,140, 0,8,76, 0,9,249, + 80,7,3, 0,8,82, 0,8,18, 85,8,163, + 83,7,35, 0,8,114, 0,8,50, 0,9,197, + 81,7,11, 0,8,98, 0,8,34, 0,9,165, + 0,8,2, 0,8,130, 0,8,66, 0,9,229, + 80,7,7, 0,8,90, 0,8,26, 0,9,149, + 84,7,67, 0,8,122, 0,8,58, 0,9,213, + 82,7,19, 0,8,106, 0,8,42, 0,9,181, + 0,8,10, 0,8,138, 0,8,74, 0,9,245, + 80,7,5, 0,8,86, 0,8,22, 192,8,0, + 83,7,51, 0,8,118, 0,8,54, 0,9,205, + 81,7,15, 0,8,102, 0,8,38, 0,9,173, + 0,8,6, 0,8,134, 0,8,70, 0,9,237, + 80,7,9, 0,8,94, 0,8,30, 0,9,157, + 84,7,99, 0,8,126, 0,8,62, 0,9,221, + 82,7,27, 0,8,110, 0,8,46, 0,9,189, + 0,8,14, 0,8,142, 0,8,78, 0,9,253, + 96,7,256, 0,8,81, 0,8,17, 85,8,131, + 82,7,31, 0,8,113, 0,8,49, 0,9,195, + 80,7,10, 0,8,97, 0,8,33, 0,9,163, + 0,8,1, 0,8,129, 0,8,65, 0,9,227, + 80,7,6, 0,8,89, 0,8,25, 0,9,147, + 83,7,59, 0,8,121, 0,8,57, 0,9,211, + 81,7,17, 0,8,105, 0,8,41, 0,9,179, + 0,8,9, 0,8,137, 0,8,73, 0,9,243, + 80,7,4, 0,8,85, 0,8,21, 80,8,258, + 83,7,43, 0,8,117, 0,8,53, 0,9,203, + 81,7,13, 0,8,101, 0,8,37, 0,9,171, + 0,8,5, 0,8,133, 0,8,69, 0,9,235, + 80,7,8, 0,8,93, 0,8,29, 0,9,155, + 84,7,83, 0,8,125, 0,8,61, 0,9,219, + 82,7,23, 0,8,109, 0,8,45, 0,9,187, + 0,8,13, 0,8,141, 0,8,77, 0,9,251, + 80,7,3, 0,8,83, 0,8,19, 85,8,195, + 83,7,35, 0,8,115, 0,8,51, 0,9,199, + 81,7,11, 0,8,99, 0,8,35, 0,9,167, + 0,8,3, 0,8,131, 0,8,67, 0,9,231, + 80,7,7, 0,8,91, 0,8,27, 0,9,151, + 84,7,67, 0,8,123, 0,8,59, 0,9,215, + 82,7,19, 0,8,107, 0,8,43, 0,9,183, + 0,8,11, 0,8,139, 0,8,75, 0,9,247, + 80,7,5, 0,8,87, 0,8,23, 192,8,0, + 83,7,51, 0,8,119, 0,8,55, 0,9,207, + 81,7,15, 0,8,103, 0,8,39, 0,9,175, + 0,8,7, 0,8,135, 0,8,71, 0,9,239, + 80,7,9, 0,8,95, 0,8,31, 0,9,159, + 84,7,99, 0,8,127, 0,8,63, 0,9,223, + 82,7,27, 0,8,111, 0,8,47, 0,9,191, + 0,8,15, 0,8,143, 0,8,79, 0,9,255 + }; + static final int[] fixed_td = { + 80,5,1, 87,5,257, 83,5,17, 91,5,4097, + 81,5,5, 89,5,1025, 85,5,65, 93,5,16385, + 80,5,3, 88,5,513, 84,5,33, 92,5,8193, + 82,5,9, 90,5,2049, 86,5,129, 192,5,24577, + 80,5,2, 87,5,385, 83,5,25, 91,5,6145, + 81,5,7, 89,5,1537, 85,5,97, 93,5,24577, + 80,5,4, 88,5,769, 84,5,49, 92,5,12289, + 82,5,13, 90,5,3073, 86,5,193, 192,5,24577 + }; + + // Tables for deflate from PKZIP's appnote.txt. + static final int[] cplens = { // Copy lengths for literal codes 257..285 + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 + }; + + // see note #13 above about 258 + static final int[] cplext = { // Extra bits for literal codes 257..285 + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112 // 112==invalid + }; + + static final int[] cpdist = { // Copy offsets for distance codes 0..29 + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577 + }; + + static final int[] cpdext = { // Extra bits for distance codes + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, + 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, + 12, 12, 13, 13}; + + // If BMAX needs to be larger than 16, then h and x[] should be uLong. + static final int BMAX=15; // maximum bit length of any code + + int[] hn = null; // hufts used in space + int[] v = null; // work area for huft_build + int[] c = null; // bit length count table + int[] r = null; // table entry for structure assignment + int[] u = null; // table stack + int[] x = null; // bit offsets, then code stack + + private int huft_build(int[] b, // code lengths in bits (all assumed <= BMAX) + int bindex, + int n, // number of codes (assumed <= 288) + int s, // number of simple-valued codes (0..s-1) + int[] d, // list of base values for non-simple codes + int[] e, // list of extra bits for non-simple codes + int[] t, // result: starting table + int[] m, // maximum lookup bits, returns actual + int[] hp,// space for trees + int[] hn,// hufts used in space + int[] v // working area: values in order of bit length + ){ + // Given a list of code lengths and a maximum table size, make a set of + // tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR + // if the given code set is incomplete (the tables are still built in this + // case), Z_DATA_ERROR if the input is invalid (an over-subscribed set of + // lengths), or Z_MEM_ERROR if not enough memory. + + int a; // counter for codes of length k + int f; // i repeats in table every f entries + int g; // maximum code length + int h; // table level + int i; // counter, current code + int j; // counter + int k; // number of bits in current code + int l; // bits per table (returned in m) + int mask; // (1 << w) - 1, to avoid cc -O bug on HP + int p; // pointer into c[], b[], or v[] + int q; // points to current table + int w; // bits before this table == (l * h) + int xp; // pointer into x + int y; // number of dummy codes added + int z; // number of entries in current table + + // Generate counts for each bit length + + p = 0; i = n; + do { + c[b[bindex+p]]++; p++; i--; // assume all entries <= BMAX + }while(i!=0); + + if(c[0] == n){ // null input--all zero length codes + t[0] = -1; + m[0] = 0; + return Z_OK; + } + + // Find minimum and maximum length, bound *m by those + l = m[0]; + for (j = 1; j <= BMAX; j++) + if(c[j]!=0) break; + k = j; // minimum code length + if(l < j){ + l = j; + } + for (i = BMAX; i!=0; i--){ + if(c[i]!=0) break; + } + g = i; // maximum code length + if(l > i){ + l = i; + } + m[0] = l; + + // Adjust last length count to fill out codes, if needed + for (y = 1 << j; j < i; j++, y <<= 1){ + if ((y -= c[j]) < 0){ + return Z_DATA_ERROR; + } + } + if ((y -= c[i]) < 0){ + return Z_DATA_ERROR; + } + c[i] += y; + + // Generate starting offsets into the value table for each length + x[1] = j = 0; + p = 1; xp = 2; + while (--i!=0) { // note that i == g from above + x[xp] = (j += c[p]); + xp++; + p++; + } + + // Make a table of values in order of bit lengths + i = 0; p = 0; + do { + if ((j = b[bindex+p]) != 0){ + v[x[j]++] = i; + } + p++; + } + while (++i < n); + n = x[g]; // set n to length of v + + // Generate the Huffman codes and for each, make the table entries + x[0] = i = 0; // first Huffman code is zero + p = 0; // grab values in bit order + h = -1; // no tables yet--level -1 + w = -l; // bits decoded == (l * h) + u[0] = 0; // just to keep compilers happy + q = 0; // ditto + z = 0; // ditto + + // go through the bit lengths (k already is bits in shortest code) + for (; k <= g; k++){ + a = c[k]; + while (a--!=0){ + // here i is the Huffman code of length k bits for value *p + // make tables up to required level + while (k > w + l){ + h++; + w += l; // previous table always l bits + // compute minimum size table less than or equal to l bits + z = g - w; + z = (z > l) ? l : z; // table size upper limit + if((f=1<<(j=k-w))>a+1){ // try a k-w bit table + // too few codes for k-w bit table + f -= a + 1; // deduct codes from patterns left + xp = k; + if(j < z){ + while (++j < z){ // try smaller tables up to z bits + if((f <<= 1) <= c[++xp]) + break; // enough codes to use up j bits + f -= c[xp]; // else deduct codes from patterns + } + } + } + z = 1 << j; // table entries for j-bit table + + // allocate new table + if (hn[0] + z > MANY){ // (note: doesn't matter for fixed) + return Z_DATA_ERROR; // overflow of MANY + } + u[h] = q = /*hp+*/ hn[0]; // DEBUG + hn[0] += z; + + // connect to last table, if there is one + if(h!=0){ + x[h]=i; // save pattern for backing up + r[0]=(byte)j; // bits in this table + r[1]=(byte)l; // bits to dump before this table + j=i>>>(w - l); + r[2] = (int)(q - u[h-1] - j); // offset to this table + System.arraycopy(r, 0, hp, (u[h-1]+j)*3, 3); // connect to last table + } + else{ + t[0] = q; // first table is returned result + } + } + + // set up table entry in r + r[1] = (byte)(k - w); + if (p >= n){ + r[0] = 128 + 64; // out of values--invalid code + } + else if (v[p] < s){ + r[0] = (byte)(v[p] < 256 ? 0 : 32 + 64); // 256 is end-of-block + r[2] = v[p++]; // simple code is just the value + } + else{ + r[0]=(byte)(e[v[p]-s]+16+64); // non-simple--look up in lists + r[2]=d[v[p++] - s]; + } + + // fill code-like entries with r + f=1<<(k-w); + for (j=i>>>w;j>>= 1){ + i ^= j; + } + i ^= j; + + // backup over finished tables + mask = (1 << w) - 1; // needed on HP, cc -O bug + while ((i & mask) != x[h]){ + h--; // don't need to update q + w -= l; + mask = (1 << w) - 1; + } + } + } + // Return Z_BUF_ERROR if we were given an incomplete table + return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK; + } + + int inflate_trees_bits(int[] c, // 19 code lengths + int[] bb, // bits tree desired/actual depth + int[] tb, // bits tree result + int[] hp, // space for trees + ZStream z // for messages + ){ + int result; + initWorkArea(19); + hn[0]=0; + result = huft_build(c, 0, 19, 19, null, null, tb, bb, hp, hn, v); + + if(result == Z_DATA_ERROR){ + z.msg = "oversubscribed dynamic bit lengths tree"; + } + else if(result == Z_BUF_ERROR || bb[0] == 0){ + z.msg = "incomplete dynamic bit lengths tree"; + result = Z_DATA_ERROR; + } + return result; + } + + int inflate_trees_dynamic(int nl, // number of literal/length codes + int nd, // number of distance codes + int[] c, // that many (total) code lengths + int[] bl, // literal desired/actual bit depth + int[] bd, // distance desired/actual bit depth + int[] tl, // literal/length tree result + int[] td, // distance tree result + int[] hp, // space for trees + ZStream z // for messages + ){ + int result; + + // build literal/length tree + initWorkArea(288); + hn[0]=0; + result = huft_build(c, 0, nl, 257, cplens, cplext, tl, bl, hp, hn, v); + if (result != Z_OK || bl[0] == 0){ + if(result == Z_DATA_ERROR){ + z.msg = "oversubscribed literal/length tree"; + } + else if (result != Z_MEM_ERROR){ + z.msg = "incomplete literal/length tree"; + result = Z_DATA_ERROR; + } + return result; + } + + // build distance tree + initWorkArea(288); + result = huft_build(c, nl, nd, 0, cpdist, cpdext, td, bd, hp, hn, v); + + if (result != Z_OK || (bd[0] == 0 && nl > 257)){ + if (result == Z_DATA_ERROR){ + z.msg = "oversubscribed distance tree"; + } + else if (result == Z_BUF_ERROR) { + z.msg = "incomplete distance tree"; + result = Z_DATA_ERROR; + } + else if (result != Z_MEM_ERROR){ + z.msg = "empty distance tree with lengths"; + result = Z_DATA_ERROR; + } + return result; + } + + return Z_OK; + } + + static int inflate_trees_fixed(int[] bl, //literal desired/actual bit depth + int[] bd, //distance desired/actual bit depth + int[][] tl,//literal/length tree result + int[][] td,//distance tree result + ZStream z //for memory allocation + ){ + bl[0]=fixed_bl; + bd[0]=fixed_bd; + tl[0]=fixed_tl; + td[0]=fixed_td; + return Z_OK; + } + + private void initWorkArea(int vsize){ + if(hn==null){ + hn=new int[1]; + v=new int[vsize]; + c=new int[BMAX+1]; + r=new int[3]; + u=new int[BMAX]; + x=new int[BMAX+1]; + } + if(v.length> 4) + 1; + if(w < 48) + w &= 15; + } + + if(w<8 ||w>15){ + inflateEnd(); + return Z_STREAM_ERROR; + } + if(blocks != null && wbits != w){ + blocks.free(z); + blocks=null; + } + + // set window size + wbits=w; + + this.blocks=new InfBlocks(z, 1<>8))&0xff; + + if((wrap&1)==0 || // check if zlib header allowed + (((this.method << 8)+b) % 31)!=0){ + this.mode = BAD; + z.msg = "incorrect header check"; + // since zlib 1.2, it is allowted to inflateSync for this case. + /* + this.marker = 5; // can't try inflateSync + */ + break; + } + + if((this.method&0xf)!=Z_DEFLATED){ + this.mode = BAD; + z.msg="unknown compression method"; + // since zlib 1.2, it is allowted to inflateSync for this case. + /* + this.marker = 5; // can't try inflateSync + */ + break; + } + + if((this.method>>4)+8>this.wbits){ + this.mode = BAD; + z.msg="invalid window size"; + // since zlib 1.2, it is allowted to inflateSync for this case. + /* + this.marker = 5; // can't try inflateSync + */ + break; + } + + z.adler=new Adler32(); + + if((b&PRESET_DICT)==0){ + this.mode = BLOCKS; + break; + } + this.mode = DICT4; + case DICT4: + + if(z.avail_in==0)return r;r=f; + + z.avail_in--; z.total_in++; + this.need=((z.next_in[z.next_in_index++]&0xff)<<24)&0xff000000L; + this.mode=DICT3; + case DICT3: + + if(z.avail_in==0)return r;r=f; + + z.avail_in--; z.total_in++; + this.need+=((z.next_in[z.next_in_index++]&0xff)<<16)&0xff0000L; + this.mode=DICT2; + case DICT2: + + if(z.avail_in==0)return r;r=f; + + z.avail_in--; z.total_in++; + this.need+=((z.next_in[z.next_in_index++]&0xff)<<8)&0xff00L; + this.mode=DICT1; + case DICT1: + + if(z.avail_in==0)return r;r=f; + + z.avail_in--; z.total_in++; + this.need += (z.next_in[z.next_in_index++]&0xffL); + z.adler.reset(this.need); + this.mode = DICT0; + return Z_NEED_DICT; + case DICT0: + this.mode = BAD; + z.msg = "need dictionary"; + this.marker = 0; // can try inflateSync + return Z_STREAM_ERROR; + case BLOCKS: + r = this.blocks.proc(z, r); + if(r == Z_DATA_ERROR){ + this.mode = BAD; + this.marker = 0; // can try inflateSync + break; + } + if(r == Z_OK){ + r = f; + } + if(r != Z_STREAM_END){ + return r; + } + r = f; + this.was=z.adler.getValue(); + this.blocks.reset(z); + if(this.wrap==0){ + this.mode=DONE; + break; + } + this.mode=CHECK4; + case CHECK4: + + if(z.avail_in==0)return r;r=f; + + z.avail_in--; z.total_in++; + this.need=((z.next_in[z.next_in_index++]&0xff)<<24)&0xff000000L; + this.mode=CHECK3; + case CHECK3: + + if(z.avail_in==0)return r;r=f; + + z.avail_in--; z.total_in++; + this.need+=((z.next_in[z.next_in_index++]&0xff)<<16)&0xff0000L; + this.mode = CHECK2; + case CHECK2: + + if(z.avail_in==0)return r;r=f; + + z.avail_in--; z.total_in++; + this.need+=((z.next_in[z.next_in_index++]&0xff)<<8)&0xff00L; + this.mode = CHECK1; + case CHECK1: + + if(z.avail_in==0)return r;r=f; + + z.avail_in--; z.total_in++; + this.need+=(z.next_in[z.next_in_index++]&0xffL); + + if(flags!=0){ // gzip + this.need = ((this.need&0xff000000)>>24 | + (this.need&0x00ff0000)>>8 | + (this.need&0x0000ff00)<<8 | + (this.need&0x0000ffff)<<24)&0xffffffffL; + } + + if(((int)(this.was)) != ((int)(this.need))){ + z.msg = "incorrect data check"; + // chack is delayed + /* + this.mode = BAD; + this.marker = 5; // can't try inflateSync + break; + */ + } + else if(flags!=0 && gheader!=null){ + gheader.crc = this.need; + } + + this.mode = LENGTH; + case LENGTH: + if (wrap!=0 && flags!=0) { + + try { r=readBytes(z, 4, r, f); } + catch(Return e){ return e.r; } + + if(z.msg!=null && z.msg.equals("incorrect data check")){ + this.mode = BAD; + this.marker = 5; // can't try inflateSync + break; + } + + if (this.need != (z.total_out & 0xffffffffL)) { + z.msg = "incorrect length check"; + this.mode = BAD; + break; + } + z.msg = null; + } + else { + if(z.msg!=null && z.msg.equals("incorrect data check")){ + this.mode = BAD; + this.marker = 5; // can't try inflateSync + break; + } + } + + this.mode = DONE; + case DONE: + return Z_STREAM_END; + case BAD: + return Z_DATA_ERROR; + + case FLAGS: + + try { r=readBytes(z, 2, r, f); } + catch(Return e){ return e.r; } + + flags = ((int)this.need)&0xffff; + + if ((flags & 0xff) != Z_DEFLATED) { + z.msg = "unknown compression method"; + this.mode = BAD; + break; + } + if ((flags & 0xe000)!=0) { + z.msg = "unknown header flags set"; + this.mode = BAD; + break; + } + + if ((flags & 0x0200)!=0){ + checksum(2, this.need); + } + + this.mode = TIME; + + case TIME: + try { r=readBytes(z, 4, r, f); } + catch(Return e){ return e.r; } + if(gheader!=null) + gheader.time = this.need; + if ((flags & 0x0200)!=0){ + checksum(4, this.need); + } + this.mode = OS; + case OS: + try { r=readBytes(z, 2, r, f); } + catch(Return e){ return e.r; } + if(gheader!=null){ + gheader.xflags = ((int)this.need)&0xff; + gheader.os = (((int)this.need)>>8)&0xff; + } + if ((flags & 0x0200)!=0){ + checksum(2, this.need); + } + this.mode = EXLEN; + case EXLEN: + if ((flags & 0x0400)!=0) { + try { r=readBytes(z, 2, r, f); } + catch(Return e){ return e.r; } + if(gheader!=null){ + gheader.extra = new byte[((int)this.need)&0xffff]; + } + if ((flags & 0x0200)!=0){ + checksum(2, this.need); + } + } + else if(gheader!=null){ + gheader.extra=null; + } + this.mode = EXTRA; + + case EXTRA: + if ((flags & 0x0400)!=0) { + try { + r=readBytes(z, r, f); + if(gheader!=null){ + byte[] foo = tmp_string.toByteArray(); + tmp_string=null; + if(foo.length == gheader.extra.length){ + System.arraycopy(foo, 0, gheader.extra, 0, foo.length); + } + else{ + z.msg = "bad extra field length"; + this.mode = BAD; + break; + } + } + } + catch(Return e){ return e.r; } + } + else if(gheader!=null){ + gheader.extra=null; + } + this.mode = NAME; + case NAME: + if ((flags & 0x0800)!=0) { + try { + r=readString(z, r, f); + if(gheader!=null){ + gheader.name=tmp_string.toByteArray(); + } + tmp_string=null; + } + catch(Return e){ return e.r; } + } + else if(gheader!=null){ + gheader.name=null; + } + this.mode = COMMENT; + case COMMENT: + if ((flags & 0x1000)!=0) { + try { + r=readString(z, r, f); + if(gheader!=null){ + gheader.comment=tmp_string.toByteArray(); + } + tmp_string=null; + } + catch(Return e){ return e.r; } + } + else if(gheader!=null){ + gheader.comment=null; + } + this.mode = HCRC; + case HCRC: + if ((flags & 0x0200)!=0) { + try { r=readBytes(z, 2, r, f); } + catch(Return e){ return e.r; } + if(gheader!=null){ + gheader.hcrc=(int)(this.need&0xffff); + } + if(this.need != (z.adler.getValue()&0xffffL)){ + this.mode = BAD; + z.msg = "header crc mismatch"; + this.marker = 5; // can't try inflateSync + break; + } + } + z.adler = new CRC32(); + + this.mode = BLOCKS; + break; + default: + return Z_STREAM_ERROR; + } + } + } + + int inflateSetDictionary(byte[] dictionary, int dictLength){ + if(z==null || (this.mode != DICT0 && this.wrap != 0)){ + return Z_STREAM_ERROR; + } + + int index=0; + int length = dictLength; + + if(this.mode==DICT0){ + long adler_need=z.adler.getValue(); + z.adler.reset(); + z.adler.update(dictionary, 0, dictLength); + if(z.adler.getValue()!=adler_need){ + return Z_DATA_ERROR; + } + } + + z.adler.reset(); + + if(length >= (1<0){ + if(z.avail_in==0){ throw new Return(r); }; r=f; + z.avail_in--; z.total_in++; + this.need = this.need | + ((z.next_in[z.next_in_index++]&0xff)<<((n-need_bytes)*8)); + need_bytes--; + } + if(n==2){ + this.need&=0xffffL; + } + else if(n==4) { + this.need&=0xffffffffL; + } + need_bytes=-1; + return r; + } + class Return extends Exception{ + int r; + Return(int r){this.r=r; } + } + + private java.io.ByteArrayOutputStream tmp_string = null; + private int readString(ZStream z, int r, int f) throws Return{ + if(tmp_string == null){ + tmp_string=new java.io.ByteArrayOutputStream(); + } + int b=0; + do { + if(z.avail_in==0){ throw new Return(r); }; r=f; + z.avail_in--; z.total_in++; + b = z.next_in[z.next_in_index]; + if(b!=0) tmp_string.write(z.next_in, z.next_in_index, 1); + z.adler.update(z.next_in, z.next_in_index, 1); + z.next_in_index++; + }while(b!=0); + return r; + } + + private int readBytes(ZStream z, int r, int f) throws Return{ + if(tmp_string == null){ + tmp_string=new java.io.ByteArrayOutputStream(); + } + int b=0; + while(this.need>0){ + if(z.avail_in==0){ throw new Return(r); }; r=f; + z.avail_in--; z.total_in++; + b = z.next_in[z.next_in_index]; + tmp_string.write(z.next_in, z.next_in_index, 1); + z.adler.update(z.next_in, z.next_in_index, 1); + z.next_in_index++; + this.need--; + } + return r; + } + + private void checksum(int n, long v){ + for(int i=0; i>=8; + } + z.adler.update(crcbuf, 0, n); + } + + public GZIPHeader getGZIPHeader(){ + return gheader; + } + + boolean inParsingHeader(){ + switch(mode){ + case HEAD: + case DICT4: + case DICT3: + case DICT2: + case DICT1: + case FLAGS: + case TIME: + case OS: + case EXLEN: + case EXTRA: + case NAME: + case COMMENT: + case HCRC: + return true; + default: + return false; + } + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/Inflater.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/Inflater.java new file mode 100644 index 000000000..79f39a760 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/Inflater.java @@ -0,0 +1,133 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * This program is based on zlib-1.1.3, so all credit should go authors + * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) + * and contributors of zlib. + */ + +package com.jcraft.jzlib; + +final public class Inflater extends ZStream{ + + static final private int MAX_WBITS=15; // 32K LZ77 window + static final private int DEF_WBITS=MAX_WBITS; + + static final private int Z_NO_FLUSH=0; + static final private int Z_PARTIAL_FLUSH=1; + static final private int Z_SYNC_FLUSH=2; + static final private int Z_FULL_FLUSH=3; + static final private int Z_FINISH=4; + + static final private int MAX_MEM_LEVEL=9; + + static final private int Z_OK=0; + static final private int Z_STREAM_END=1; + static final private int Z_NEED_DICT=2; + static final private int Z_ERRNO=-1; + static final private int Z_STREAM_ERROR=-2; + static final private int Z_DATA_ERROR=-3; + static final private int Z_MEM_ERROR=-4; + static final private int Z_BUF_ERROR=-5; + static final private int Z_VERSION_ERROR=-6; + + public Inflater() { + super(); + init(); + } + + public Inflater(int w) throws GZIPException { + this(w, false); + } + + public Inflater(int w, boolean nowrap) throws GZIPException { + super(); + int ret = init(w, nowrap); + if(ret!=Z_OK) + throw new GZIPException(ret+": "+msg); + } + + private boolean finished = false; + + public int init(){ + return init(DEF_WBITS); + } + + public int init(boolean nowrap){ + return init(DEF_WBITS, nowrap); + } + + public int init(int w){ + return init(w, false); + } + + public int init(int w, boolean nowrap){ + finished = false; + istate=new Inflate(this); + return istate.inflateInit(nowrap?-w:w); + } + + public int inflate(int f){ + if(istate==null) return Z_STREAM_ERROR; + int ret = istate.inflate(f); + if(ret == Z_STREAM_END) + finished = true; + return ret; + } + + public int end(){ + finished = true; + if(istate==null) return Z_STREAM_ERROR; + int ret=istate.inflateEnd(); +// istate = null; + return ret; + } + + public int sync(){ + if(istate == null) + return Z_STREAM_ERROR; + return istate.inflateSync(); + } + + public int syncPoint(){ + if(istate == null) + return Z_STREAM_ERROR; + return istate.inflateSyncPoint(); + } + + public int setDictionary(byte[] dictionary, int dictLength){ + if(istate == null) + return Z_STREAM_ERROR; + return istate.inflateSetDictionary(dictionary, dictLength); + } + + public boolean finished(){ + return istate.mode==12 /*DONE*/; + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/InflaterInputStream.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/InflaterInputStream.java new file mode 100644 index 000000000..5407017ff --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/InflaterInputStream.java @@ -0,0 +1,238 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.jcraft.jzlib; +import java.io.*; + +public class InflaterInputStream extends FilterInputStream { + protected final Inflater inflater; + protected byte[] buf; + + private boolean closed = false; + + private boolean eof = false; + + private boolean close_in = true; + + protected static final int DEFAULT_BUFSIZE = 512; + + public InflaterInputStream(InputStream in) throws IOException { + this(in, new Inflater()); + myinflater = true; + } + + public InflaterInputStream(InputStream in, Inflater inflater) throws IOException { + this(in, inflater, DEFAULT_BUFSIZE); + } + + public InflaterInputStream(InputStream in, + Inflater inflater, int size) throws IOException { + this(in, inflater, size, true); + } + + public InflaterInputStream(InputStream in, + Inflater inflater, + int size, boolean close_in) throws IOException { + super(in); + if (in == null || inflater == null) { + throw new NullPointerException(); + } + else if (size <= 0) { + throw new IllegalArgumentException("buffer size must be greater than 0"); + } + this.inflater = inflater; + buf = new byte[size]; + this.close_in = close_in; + } + + protected boolean myinflater = false; + + private byte[] byte1 = new byte[1]; + + public int read() throws IOException { + if (closed) { throw new IOException("Stream closed"); } + return read(byte1, 0, 1) == -1 ? -1 : byte1[0] & 0xff; + } + + public int read(byte[] b, int off, int len) throws IOException { + if (closed) { throw new IOException("Stream closed"); } + if (b == null) { + throw new NullPointerException(); + } + else if (off < 0 || len < 0 || len > b.length - off) { + throw new IndexOutOfBoundsException(); + } + else if (len == 0) { + return 0; + } + else if (eof) { + return -1; + } + + int n = 0; + inflater.setOutput(b, off, len); + while(!eof) { + if(inflater.avail_in==0) + fill(); + int err = inflater.inflate(JZlib.Z_NO_FLUSH); + n += inflater.next_out_index - off; + off = inflater.next_out_index; + switch(err) { + case JZlib.Z_DATA_ERROR: + throw new IOException(inflater.msg); + case JZlib.Z_STREAM_END: + case JZlib.Z_NEED_DICT: + eof = true; + if(err == JZlib.Z_NEED_DICT) + return -1; + break; + default: + } + if(inflater.avail_out==0) + break; + } + return n; + } + + public int available() throws IOException { + if (closed) { throw new IOException("Stream closed"); } + if (eof) { + return 0; + } + else { + return 1; + } + } + + private byte[] b = new byte[512]; + + public long skip(long n) throws IOException { + if (n < 0) { + throw new IllegalArgumentException("negative skip length"); + } + + if (closed) { throw new IOException("Stream closed"); } + + int max = (int)Math.min(n, Integer.MAX_VALUE); + int total = 0; + while (total < max) { + int len = max - total; + if (len > b.length) { + len = b.length; + } + len = read(b, 0, len); + if (len == -1) { + eof = true; + break; + } + total += len; + } + return total; + } + + public void close() throws IOException { + if (!closed) { + if (myinflater) + inflater.end(); + if(close_in) + in.close(); + closed = true; + } + } + + protected void fill() throws IOException { + if (closed) { throw new IOException("Stream closed"); } + int len = in.read(buf, 0, buf.length); + if (len == -1) { + if(inflater.istate.was != -1){ // in reading trailer + throw new IOException("footer is not found"); + } + else{ + throw new EOFException("Unexpected end of ZLIB input stream"); + } + } + inflater.setInput(buf, 0, len, true); + } + + public boolean markSupported() { + return false; + } + + public synchronized void mark(int readlimit) { + } + + public synchronized void reset() throws IOException { + throw new IOException("mark/reset not supported"); + } + + public long getTotalIn() { + return inflater.getTotalIn(); + } + + public long getTotalOut() { + return inflater.getTotalOut(); + } + + public byte[] getAvailIn() { + if(inflater.avail_in<=0) + return null; + byte[] tmp = new byte[inflater.avail_in]; + System.arraycopy(inflater.next_in, inflater.next_in_index, + tmp, 0, inflater.avail_in); + return tmp; + } + + public void readHeader() throws IOException { + + byte[] empty = "".getBytes(); + inflater.setInput(empty, 0, 0, false); + inflater.setOutput(empty, 0, 0); + + int err = inflater.inflate(JZlib.Z_NO_FLUSH); + if(!inflater.istate.inParsingHeader()){ + return; + } + + byte[] b1 = new byte[1]; + do{ + int i = in.read(b1); + if(i<=0) + throw new IOException("no input"); + inflater.setInput(b1); + err = inflater.inflate(JZlib.Z_NO_FLUSH); + if(err!=0/*Z_OK*/) + throw new IOException(inflater.msg); + } + while(inflater.istate.inParsingHeader()); + } + + public Inflater getInflater(){ + return inflater; + } +} \ No newline at end of file diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/JZlib.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/JZlib.java new file mode 100644 index 000000000..5c7eecf4a --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/JZlib.java @@ -0,0 +1,78 @@ +/* -*-mode:java; c-basic-offset:2; -*- */ +/* +Copyright (c) 2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * This program is based on zlib-1.1.3, so all credit should go authors + * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) + * and contributors of zlib. + */ + +package com.jcraft.jzlib; + +final public class JZlib{ + private static final String version="1.1.0"; + public static String version(){return version;} + + static final public int MAX_WBITS=15; // 32K LZ77 window + static final public int DEF_WBITS=MAX_WBITS; + + // compression levels + static final public int Z_NO_COMPRESSION=0; + static final public int Z_BEST_SPEED=1; + static final public int Z_BEST_COMPRESSION=9; + static final public int Z_DEFAULT_COMPRESSION=(-1); + + // compression strategy + static final public int Z_FILTERED=1; + static final public int Z_HUFFMAN_ONLY=2; + static final public int Z_DEFAULT_STRATEGY=0; + + static final public int Z_NO_FLUSH=0; + static final public int Z_PARTIAL_FLUSH=1; + static final public int Z_SYNC_FLUSH=2; + static final public int Z_FULL_FLUSH=3; + static final public int Z_FINISH=4; + + static final public int Z_OK=0; + static final public int Z_STREAM_END=1; + static final public int Z_NEED_DICT=2; + static final public int Z_ERRNO=-1; + static final public int Z_STREAM_ERROR=-2; + static final public int Z_DATA_ERROR=-3; + static final public int Z_MEM_ERROR=-4; + static final public int Z_BUF_ERROR=-5; + static final public int Z_VERSION_ERROR=-6; + + public static long adler32_combine(long adler1, long adler2, long len2){ + return Adler32.combine(adler1, adler2, len2); + } + + public static long crc32_combine(long crc1, long crc2, long len2){ + return CRC32.combine(crc1, crc2, len2); + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/StaticTree.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/StaticTree.java new file mode 100644 index 000000000..0f7f57790 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/StaticTree.java @@ -0,0 +1,149 @@ +/* -*-mode:java; c-basic-offset:2; -*- */ +/* +Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * This program is based on zlib-1.1.3, so all credit should go authors + * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) + * and contributors of zlib. + */ + +package com.jcraft.jzlib; + +final class StaticTree{ + static final private int MAX_BITS=15; + + static final private int BL_CODES=19; + static final private int D_CODES=30; + static final private int LITERALS=256; + static final private int LENGTH_CODES=29; + static final private int L_CODES=(LITERALS+1+LENGTH_CODES); + + // Bit length codes must not exceed MAX_BL_BITS bits + static final int MAX_BL_BITS=7; + + static final short[] static_ltree = { + 12, 8, 140, 8, 76, 8, 204, 8, 44, 8, + 172, 8, 108, 8, 236, 8, 28, 8, 156, 8, + 92, 8, 220, 8, 60, 8, 188, 8, 124, 8, + 252, 8, 2, 8, 130, 8, 66, 8, 194, 8, + 34, 8, 162, 8, 98, 8, 226, 8, 18, 8, + 146, 8, 82, 8, 210, 8, 50, 8, 178, 8, + 114, 8, 242, 8, 10, 8, 138, 8, 74, 8, + 202, 8, 42, 8, 170, 8, 106, 8, 234, 8, + 26, 8, 154, 8, 90, 8, 218, 8, 58, 8, + 186, 8, 122, 8, 250, 8, 6, 8, 134, 8, + 70, 8, 198, 8, 38, 8, 166, 8, 102, 8, + 230, 8, 22, 8, 150, 8, 86, 8, 214, 8, + 54, 8, 182, 8, 118, 8, 246, 8, 14, 8, + 142, 8, 78, 8, 206, 8, 46, 8, 174, 8, + 110, 8, 238, 8, 30, 8, 158, 8, 94, 8, + 222, 8, 62, 8, 190, 8, 126, 8, 254, 8, + 1, 8, 129, 8, 65, 8, 193, 8, 33, 8, + 161, 8, 97, 8, 225, 8, 17, 8, 145, 8, + 81, 8, 209, 8, 49, 8, 177, 8, 113, 8, + 241, 8, 9, 8, 137, 8, 73, 8, 201, 8, + 41, 8, 169, 8, 105, 8, 233, 8, 25, 8, + 153, 8, 89, 8, 217, 8, 57, 8, 185, 8, + 121, 8, 249, 8, 5, 8, 133, 8, 69, 8, + 197, 8, 37, 8, 165, 8, 101, 8, 229, 8, + 21, 8, 149, 8, 85, 8, 213, 8, 53, 8, + 181, 8, 117, 8, 245, 8, 13, 8, 141, 8, + 77, 8, 205, 8, 45, 8, 173, 8, 109, 8, + 237, 8, 29, 8, 157, 8, 93, 8, 221, 8, + 61, 8, 189, 8, 125, 8, 253, 8, 19, 9, + 275, 9, 147, 9, 403, 9, 83, 9, 339, 9, + 211, 9, 467, 9, 51, 9, 307, 9, 179, 9, + 435, 9, 115, 9, 371, 9, 243, 9, 499, 9, + 11, 9, 267, 9, 139, 9, 395, 9, 75, 9, + 331, 9, 203, 9, 459, 9, 43, 9, 299, 9, + 171, 9, 427, 9, 107, 9, 363, 9, 235, 9, + 491, 9, 27, 9, 283, 9, 155, 9, 411, 9, + 91, 9, 347, 9, 219, 9, 475, 9, 59, 9, + 315, 9, 187, 9, 443, 9, 123, 9, 379, 9, + 251, 9, 507, 9, 7, 9, 263, 9, 135, 9, + 391, 9, 71, 9, 327, 9, 199, 9, 455, 9, + 39, 9, 295, 9, 167, 9, 423, 9, 103, 9, + 359, 9, 231, 9, 487, 9, 23, 9, 279, 9, + 151, 9, 407, 9, 87, 9, 343, 9, 215, 9, + 471, 9, 55, 9, 311, 9, 183, 9, 439, 9, + 119, 9, 375, 9, 247, 9, 503, 9, 15, 9, + 271, 9, 143, 9, 399, 9, 79, 9, 335, 9, + 207, 9, 463, 9, 47, 9, 303, 9, 175, 9, + 431, 9, 111, 9, 367, 9, 239, 9, 495, 9, + 31, 9, 287, 9, 159, 9, 415, 9, 95, 9, + 351, 9, 223, 9, 479, 9, 63, 9, 319, 9, + 191, 9, 447, 9, 127, 9, 383, 9, 255, 9, + 511, 9, 0, 7, 64, 7, 32, 7, 96, 7, + 16, 7, 80, 7, 48, 7, 112, 7, 8, 7, + 72, 7, 40, 7, 104, 7, 24, 7, 88, 7, + 56, 7, 120, 7, 4, 7, 68, 7, 36, 7, + 100, 7, 20, 7, 84, 7, 52, 7, 116, 7, + 3, 8, 131, 8, 67, 8, 195, 8, 35, 8, + 163, 8, 99, 8, 227, 8 + }; + + static final short[] static_dtree = { + 0, 5, 16, 5, 8, 5, 24, 5, 4, 5, + 20, 5, 12, 5, 28, 5, 2, 5, 18, 5, + 10, 5, 26, 5, 6, 5, 22, 5, 14, 5, + 30, 5, 1, 5, 17, 5, 9, 5, 25, 5, + 5, 5, 21, 5, 13, 5, 29, 5, 3, 5, + 19, 5, 11, 5, 27, 5, 7, 5, 23, 5 + }; + + static StaticTree static_l_desc = + new StaticTree(static_ltree, Tree.extra_lbits, + LITERALS+1, L_CODES, MAX_BITS); + + static StaticTree static_d_desc = + new StaticTree(static_dtree, Tree.extra_dbits, + 0, D_CODES, MAX_BITS); + + static StaticTree static_bl_desc = + new StaticTree(null, Tree.extra_blbits, + 0, BL_CODES, MAX_BL_BITS); + + short[] static_tree; // static tree or null + int[] extra_bits; // extra bits for each code or null + int extra_base; // base index for extra_bits + int elems; // max number of elements in the tree + int max_length; // max bit length for the codes + + StaticTree(short[] static_tree, + int[] extra_bits, + int extra_base, + int elems, + int max_length + ){ + this.static_tree=static_tree; + this.extra_bits=extra_bits; + this.extra_base=extra_base; + this.elems=elems; + this.max_length=max_length; + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/Tree.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/Tree.java new file mode 100644 index 000000000..81038978d --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/Tree.java @@ -0,0 +1,365 @@ +/* -*-mode:java; c-basic-offset:2; -*- */ +/* +Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * This program is based on zlib-1.1.3, so all credit should go authors + * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) + * and contributors of zlib. + */ + +package com.jcraft.jzlib; + +final class Tree{ + static final private int MAX_BITS=15; + static final private int BL_CODES=19; + static final private int D_CODES=30; + static final private int LITERALS=256; + static final private int LENGTH_CODES=29; + static final private int L_CODES=(LITERALS+1+LENGTH_CODES); + static final private int HEAP_SIZE=(2*L_CODES+1); + + // Bit length codes must not exceed MAX_BL_BITS bits + static final int MAX_BL_BITS=7; + + // end of block literal code + static final int END_BLOCK=256; + + // repeat previous bit length 3-6 times (2 bits of repeat count) + static final int REP_3_6=16; + + // repeat a zero length 3-10 times (3 bits of repeat count) + static final int REPZ_3_10=17; + + // repeat a zero length 11-138 times (7 bits of repeat count) + static final int REPZ_11_138=18; + + // extra bits for each length code + static final int[] extra_lbits={ + 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0 + }; + + // extra bits for each distance code + static final int[] extra_dbits={ + 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13 + }; + + // extra bits for each bit length code + static final int[] extra_blbits={ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7 + }; + + static final byte[] bl_order={ + 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15}; + + + // The lengths of the bit length codes are sent in order of decreasing + // probability, to avoid transmitting the lengths for unused bit + // length codes. + + static final int Buf_size=8*2; + + // see definition of array dist_code below + static final int DIST_CODE_LEN=512; + + static final byte[] _dist_code = { + 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, + 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17, + 18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, + 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29 + }; + + static final byte[] _length_code={ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, + 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, + 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, + 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28 + }; + + static final int[] base_length = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, + 64, 80, 96, 112, 128, 160, 192, 224, 0 + }; + + static final int[] base_dist = { + 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, + 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, + 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576 + }; + + // Mapping from a distance to a distance code. dist is the distance - 1 and + // must not have side effects. _dist_code[256] and _dist_code[257] are never + // used. + static int d_code(int dist){ + return ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>>7)]); + } + + short[] dyn_tree; // the dynamic tree + int max_code; // largest code with non zero frequency + StaticTree stat_desc; // the corresponding static tree + + // Compute the optimal bit lengths for a tree and update the total bit length + // for the current block. + // IN assertion: the fields freq and dad are set, heap[heap_max] and + // above are the tree nodes sorted by increasing frequency. + // OUT assertions: the field len is set to the optimal bit length, the + // array bl_count contains the frequencies for each bit length. + // The length opt_len is updated; static_len is also updated if stree is + // not null. + void gen_bitlen(Deflate s){ + short[] tree = dyn_tree; + short[] stree = stat_desc.static_tree; + int[] extra = stat_desc.extra_bits; + int base = stat_desc.extra_base; + int max_length = stat_desc.max_length; + int h; // heap index + int n, m; // iterate over the tree elements + int bits; // bit length + int xbits; // extra bits + short f; // frequency + int overflow = 0; // number of elements with bit length too large + + for (bits = 0; bits <= MAX_BITS; bits++) s.bl_count[bits] = 0; + + // In a first pass, compute the optimal bit lengths (which may + // overflow in the case of the bit length tree). + tree[s.heap[s.heap_max]*2+1] = 0; // root of the heap + + for(h=s.heap_max+1; h max_length){ bits = max_length; overflow++; } + tree[n*2+1] = (short)bits; + // We overwrite tree[n*2+1] which is no longer needed + + if (n > max_code) continue; // not a leaf node + + s.bl_count[bits]++; + xbits = 0; + if (n >= base) xbits = extra[n-base]; + f = tree[n*2]; + s.opt_len += f * (bits + xbits); + if (stree!=null) s.static_len += f * (stree[n*2+1] + xbits); + } + if (overflow == 0) return; + + // This happens for example on obj2 and pic of the Calgary corpus + // Find the first bit length which could increase: + do { + bits = max_length-1; + while(s.bl_count[bits]==0) bits--; + s.bl_count[bits]--; // move one leaf down the tree + s.bl_count[bits+1]+=2; // move one overflow item as its brother + s.bl_count[max_length]--; + // The brother of the overflow item also moves one step up, + // but this does not affect bl_count[max_length] + overflow -= 2; + } + while (overflow > 0); + + for (bits = max_length; bits != 0; bits--) { + n = s.bl_count[bits]; + while (n != 0) { + m = s.heap[--h]; + if (m > max_code) continue; + if (tree[m*2+1] != bits) { + s.opt_len += ((long)bits - (long)tree[m*2+1])*(long)tree[m*2]; + tree[m*2+1] = (short)bits; + } + n--; + } + } + } + + // Construct one Huffman tree and assigns the code bit strings and lengths. + // Update the total bit length for the current block. + // IN assertion: the field freq is set for all tree elements. + // OUT assertions: the fields len and code are set to the optimal bit length + // and corresponding code. The length opt_len is updated; static_len is + // also updated if stree is not null. The field max_code is set. + void build_tree(Deflate s){ + short[] tree=dyn_tree; + short[] stree=stat_desc.static_tree; + int elems=stat_desc.elems; + int n, m; // iterate over heap elements + int max_code=-1; // largest code with non zero frequency + int node; // new node being created + + // Construct the initial heap, with least frequent element in + // heap[1]. The sons of heap[n] are heap[2*n] and heap[2*n+1]. + // heap[0] is not used. + s.heap_len = 0; + s.heap_max = HEAP_SIZE; + + for(n=0; n=1; n--) + s.pqdownheap(tree, n); + + // Construct the Huffman tree by repeatedly combining the least two + // frequent nodes. + + node=elems; // next internal node of the tree + do{ + // n = node of least frequency + n=s.heap[1]; + s.heap[1]=s.heap[s.heap_len--]; + s.pqdownheap(tree, 1); + m=s.heap[1]; // m = node of next least frequency + + s.heap[--s.heap_max] = n; // keep the nodes sorted by frequency + s.heap[--s.heap_max] = m; + + // Create a new node father of n and m + tree[node*2] = (short)(tree[n*2] + tree[m*2]); + s.depth[node] = (byte)(Math.max(s.depth[n],s.depth[m])+1); + tree[n*2+1] = tree[m*2+1] = (short)node; + + // and insert the new node in the heap + s.heap[1] = node++; + s.pqdownheap(tree, 1); + } + while(s.heap_len>=2); + + s.heap[--s.heap_max] = s.heap[1]; + + // At this point, the fields freq and dad are set. We can now + // generate the bit lengths. + + gen_bitlen(s); + + // The field len is now set, we can generate the bit codes + gen_codes(tree, max_code, s.bl_count); + } + + // Generate the codes for a given tree and bit counts (which need not be + // optimal). + // IN assertion: the array bl_count contains the bit length statistics for + // the given tree and the field len is set for all tree elements. + // OUT assertion: the field code is set for all tree elements of non + // zero code length. + static void gen_codes(short[] tree, // the tree to decorate + int max_code, // largest code with non zero frequency + short[] bl_count // number of codes at each bit length + ){ + short[] next_code=new short[MAX_BITS+1]; // next code value for each bit length + short code = 0; // running code value + int bits; // bit index + int n; // code index + + // The distribution counts are first used to generate the code values + // without bit reversal. + for (bits = 1; bits <= MAX_BITS; bits++) { + next_code[bits] = code = (short)((code + bl_count[bits-1]) << 1); + } + + // Check that the bit counts in bl_count are consistent. The last code + // must be all ones. + //Assert (code + bl_count[MAX_BITS]-1 == (1<>>=1; + res<<=1; + } + while(--len>0); + return res>>>1; + } +} + diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/ZInputStream.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/ZInputStream.java new file mode 100644 index 000000000..0054645e5 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/ZInputStream.java @@ -0,0 +1,126 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.jcraft.jzlib; +import java.io.*; + +/** + * ZInputStream + * + * @deprecated use DeflaterOutputStream or InflaterInputStream + */ +@Deprecated +public class ZInputStream extends FilterInputStream { + + protected int flush=JZlib.Z_NO_FLUSH; + protected boolean compress; + protected InputStream in=null; + + protected Deflater deflater; + protected InflaterInputStream iis; + + public ZInputStream(InputStream in) throws IOException { + this(in, false); + } + public ZInputStream(InputStream in, boolean nowrap) throws IOException { + super(in); + iis = new InflaterInputStream(in); + compress=false; + } + + public ZInputStream(InputStream in, int level) throws IOException { + super(in); + this.in=in; + deflater = new Deflater(); + deflater.init(level); + compress=true; + } + + private byte[] buf1 = new byte[1]; + public int read() throws IOException { + if(read(buf1, 0, 1)==-1) return -1; + return(buf1[0]&0xFF); + } + + private byte[] buf = new byte[512]; + + public int read(byte[] b, int off, int len) throws IOException { + if(compress){ + deflater.setOutput(b, off, len); + while(true){ + int datalen = in.read(buf, 0, buf.length); + if(datalen == -1) return -1; + deflater.setInput(buf, 0, datalen, true); + int err = deflater.deflate(flush); + if(deflater.next_out_index>0) + return deflater.next_out_index; + if(err == JZlib.Z_STREAM_END) + return 0; + if(err == JZlib.Z_STREAM_ERROR || + err == JZlib.Z_DATA_ERROR){ + throw new ZStreamException("deflating: "+deflater.msg); + } + } + } + else{ + return iis.read(b, off, len); + } + } + + public long skip(long n) throws IOException { + int len=512; + if(n0){ + inflater.setOutput(buf, 0, buf.length); + err = inflater.inflate(flush); + if(inflater.next_out_index>0) + out.write(buf, 0, inflater.next_out_index); + if(err != JZlib.Z_OK) + break; + } + if(err != JZlib.Z_OK) + throw new ZStreamException("inflating: "+inflater.msg); + return; + } + } + + public int getFlushMode() { + return flush; + } + + public void setFlushMode(int flush) { + this.flush=flush; + } + + public void finish() throws IOException { + int err; + if(compress){ + int tmp = flush; + int flush = JZlib.Z_FINISH; + try{ + write("".getBytes(), 0, 0); + } + finally { flush = tmp; } + } + else{ + dos.finish(); + } + flush(); + } + public synchronized void end() { + if(end) return; + if(compress){ + try { dos.finish(); } catch(Exception e){} + } + else{ + inflater.end(); + } + end=true; + } + public void close() throws IOException { + try{ + try{finish();} + catch (IOException ignored) {} + } + finally{ + end(); + out.close(); + out=null; + } + } + + public long getTotalIn() { + if(compress) return dos.getTotalIn(); + else return inflater.total_in; + } + + public long getTotalOut() { + if(compress) return dos.getTotalOut(); + else return inflater.total_out; + } + + public void flush() throws IOException { + out.flush(); + } + +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/ZStream.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/ZStream.java new file mode 100644 index 000000000..e310e691d --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/ZStream.java @@ -0,0 +1,336 @@ +/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */ +/* +Copyright (c) 2000-2011 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * This program is based on zlib-1.1.3, so all credit should go authors + * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) + * and contributors of zlib. + */ + +package com.jcraft.jzlib; + +/** + * ZStream + * + * @deprecated Not for public use in the future. + */ +@Deprecated +public class ZStream{ + + static final private int MAX_WBITS=15; // 32K LZ77 window + static final private int DEF_WBITS=MAX_WBITS; + + static final private int Z_NO_FLUSH=0; + static final private int Z_PARTIAL_FLUSH=1; + static final private int Z_SYNC_FLUSH=2; + static final private int Z_FULL_FLUSH=3; + static final private int Z_FINISH=4; + + static final private int MAX_MEM_LEVEL=9; + + static final private int Z_OK=0; + static final private int Z_STREAM_END=1; + static final private int Z_NEED_DICT=2; + static final private int Z_ERRNO=-1; + static final private int Z_STREAM_ERROR=-2; + static final private int Z_DATA_ERROR=-3; + static final private int Z_MEM_ERROR=-4; + static final private int Z_BUF_ERROR=-5; + static final private int Z_VERSION_ERROR=-6; + + public byte[] next_in; // next input byte + public int next_in_index; + public int avail_in; // number of bytes available at next_in + public long total_in; // total nb of input bytes read so far + + public byte[] next_out; // next output byte should be put there + public int next_out_index; + public int avail_out; // remaining free space at next_out + public long total_out; // total nb of bytes output so far + + public String msg; + + Deflate dstate; + Inflate istate; + + int data_type; // best guess about the data type: ascii or binary + + Checksum adler; + + public ZStream(){ + this(new Adler32()); + } + + public ZStream(Checksum adler){ + this.adler=adler; + } + + public int inflateInit(){ + return inflateInit(DEF_WBITS); + } + public int inflateInit(boolean nowrap){ + return inflateInit(DEF_WBITS, nowrap); + } + public int inflateInit(int w){ + return inflateInit(w, false); + } + + public int inflateInit(int w, boolean nowrap){ + istate=new Inflate(this); + return istate.inflateInit(nowrap?-w:w); + } + + public int inflate(int f){ + if(istate==null) return Z_STREAM_ERROR; + return istate.inflate(f); + } + public int inflateEnd(){ + if(istate==null) return Z_STREAM_ERROR; + int ret=istate.inflateEnd(); +// istate = null; + return ret; + } + public int inflateSync(){ + if(istate == null) + return Z_STREAM_ERROR; + return istate.inflateSync(); + } + public int inflateSyncPoint(){ + if(istate == null) + return Z_STREAM_ERROR; + return istate.inflateSyncPoint(); + } + public int inflateSetDictionary(byte[] dictionary, int dictLength){ + if(istate == null) + return Z_STREAM_ERROR; + return istate.inflateSetDictionary(dictionary, dictLength); + } + public boolean inflateFinished(){ + return istate.mode==12 /*DONE*/; + } + + public int deflateInit(int level){ + return deflateInit(level, MAX_WBITS); + } + public int deflateInit(int level, boolean nowrap){ + return deflateInit(level, MAX_WBITS, nowrap); + } + public int deflateInit(int level, int bits){ + return deflateInit(level, bits, false); + } + public int deflateInit(int level, int bits, int memlevel){ + dstate=new Deflate(this); + return dstate.deflateInit(level, bits, memlevel); + } + public int deflateInit(int level, int bits, boolean nowrap){ + dstate=new Deflate(this); + return dstate.deflateInit(level, nowrap?-bits:bits); + } + public int deflate(int flush){ + if(dstate==null){ + return Z_STREAM_ERROR; + } + return dstate.deflate(flush); + } + public int deflateEnd(){ + if(dstate==null) return Z_STREAM_ERROR; + int ret=dstate.deflateEnd(); + dstate=null; + return ret; + } + public int deflateParams(int level, int strategy){ + if(dstate==null) return Z_STREAM_ERROR; + return dstate.deflateParams(level, strategy); + } + public int deflateSetDictionary (byte[] dictionary, int dictLength){ + if(dstate == null) + return Z_STREAM_ERROR; + return dstate.deflateSetDictionary(dictionary, dictLength); + } + + // Flush as much pending output as possible. All deflate() output goes + // through this function so some applications may wish to modify it + // to avoid allocating a large strm->next_out buffer and copying into it. + // (See also read_buf()). + void flush_pending(){ + int len=dstate.pending; + + if(len>avail_out) len=avail_out; + if(len==0) return; + + if(dstate.pending_buf.length<=dstate.pending_out || + next_out.length<=next_out_index || + dstate.pending_buf.length<(dstate.pending_out+len) || + next_out.length<(next_out_index+len)){ + //System.out.println(dstate.pending_buf.length+", "+dstate.pending_out+ + // ", "+next_out.length+", "+next_out_index+", "+len); + //System.out.println("avail_out="+avail_out); + } + + System.arraycopy(dstate.pending_buf, dstate.pending_out, + next_out, next_out_index, len); + + next_out_index+=len; + dstate.pending_out+=len; + total_out+=len; + avail_out-=len; + dstate.pending-=len; + if(dstate.pending==0){ + dstate.pending_out=0; + } + } + + // Read a new buffer from the current input stream, update the adler32 + // and total number of bytes read. All deflate() input goes through + // this function so some applications may wish to modify it to avoid + // allocating a large strm->next_in buffer and copying from it. + // (See also flush_pending()). + int read_buf(byte[] buf, int start, int size) { + int len=avail_in; + + if(len>size) len=size; + if(len==0) return 0; + + avail_in-=len; + + if(dstate.wrap!=0) { + adler.update(next_in, next_in_index, len); + } + System.arraycopy(next_in, next_in_index, buf, start, len); + next_in_index += len; + total_in += len; + return len; + } + + public long getAdler(){ + return adler.getValue(); + } + + public void free(){ + next_in=null; + next_out=null; + msg=null; + } + + public void setOutput(byte[] buf){ + setOutput(buf, 0, buf.length); + } + + public void setOutput(byte[] buf, int off, int len){ + next_out = buf; + next_out_index = off; + avail_out = len; + } + + public void setInput(byte[] buf){ + setInput(buf, 0, buf.length, false); + } + + public void setInput(byte[] buf, boolean append){ + setInput(buf, 0, buf.length, append); + } + + public void setInput(byte[] buf, int off, int len, boolean append){ + if(len<=0 && append && next_in!=null) return; + + if(avail_in>0 && append){ + byte[] tmp = new byte[avail_in+len]; + System.arraycopy(next_in, next_in_index, tmp, 0, avail_in); + System.arraycopy(buf, off, tmp, avail_in, len); + next_in=tmp; + next_in_index=0; + avail_in+=len; + } + else{ + next_in=buf; + next_in_index=off; + avail_in=len; + } + } + + public byte[] getNextIn(){ + return next_in; + } + + public void setNextIn(byte[] next_in){ + this.next_in = next_in; + } + + public int getNextInIndex(){ + return next_in_index; + } + + public void setNextInIndex(int next_in_index){ + this.next_in_index = next_in_index; + } + + public int getAvailIn(){ + return avail_in; + } + + public void setAvailIn(int avail_in){ + this.avail_in = avail_in; + } + + public byte[] getNextOut(){ + return next_out; + } + + public void setNextOut(byte[] next_out){ + this.next_out = next_out; + } + + public int getNextOutIndex(){ + return next_out_index; + } + + public void setNextOutIndex(int next_out_index){ + this.next_out_index = next_out_index; + } + + public int getAvailOut(){ + return avail_out; + + } + + public void setAvailOut(int avail_out){ + this.avail_out = avail_out; + } + + public long getTotalOut(){ + return total_out; + } + + public long getTotalIn(){ + return total_in; + } + + public String getMessage(){ + return msg; + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/ZStreamException.java b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/ZStreamException.java new file mode 100644 index 000000000..424b74b78 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/com/jcraft/jzlib/ZStreamException.java @@ -0,0 +1,44 @@ +/* -*-mode:java; c-basic-offset:2; -*- */ +/* +Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + + 3. The names of the authors may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT, +INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * This program is based on zlib-1.1.3, so all credit should go authors + * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) + * and contributors of zlib. + */ + +package com.jcraft.jzlib; + +public class ZStreamException extends java.io.IOException { + public ZStreamException() { + super(); + } + public ZStreamException(String s) { + super(s); + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/es/virtualcable/sshtunnel/Laucher.java b/ssh-tunnel/tunnelLaucher/src/es/virtualcable/sshtunnel/Laucher.java new file mode 100644 index 000000000..a30b6c170 --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/es/virtualcable/sshtunnel/Laucher.java @@ -0,0 +1,302 @@ +/** + * + */ +package es.virtualcable.sshtunnel; + +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.UnsupportedEncodingException; +import java.net.InetAddress; +import java.net.ServerSocket; +import java.net.Socket; +import java.util.Map; + +import javax.swing.*; +import java.awt.*; + +import com.jcraft.jsch.*; + +/** + * @author dkmaster + * + */ + +public class Laucher { + + private static final String ENV_PARAMS = "TPARAMS"; + private static final String ENV_LISTEN = "TLISTEN"; + + public static long allowConnectionsForTime = -1; + /** + * @param args + */ + public static void main(String[] args) { + + // Environment variable TPARAMS contains, separated by spaces: + // 1º user for SSH server + // 2º password for SSH server + // 3º remote ssh host + // 4º remote ssh port + // 5º remote redirected host + // 6º remote redirected port + // 7º If != 0, uses compression specified (1-9) (server to client), do not use else + // 8º (optional). Indicates the number of seconds to allow new incoming connections to tunneler + // Arguments needed: + // 1º local listening port (always at localhost) + // 2º and next: remote command & params + if( args.length < 1 || System.getenv(ENV_PARAMS) == null ) + { + System.err.println("Need all parameters and " + ENV_PARAMS + " environment var."); + return; // Can't exec without all params + } + + String params[] = System.getenv(ENV_PARAMS).split(" "); + if( params.length < 7 ) + { + System.err.println( ENV_PARAMS + " environment variable seems incorrect."); + return; + } + + String user; + String pass; + try { + user = java.net.URLDecoder.decode(params[0], "UTF-8"); + pass = java.net.URLDecoder.decode(params[1], "UTF-8"); + } catch (UnsupportedEncodingException e) { + System.err.println("Caugth exception: " + e); + return; + } + String remoteServer = params[2]; + int remotePort = Integer.parseInt(params[3]); + String targetHost = params[4]; + int targetPort = Integer.parseInt(params[5]); + String compressionLevel = params[6]; + if( params.length == 8 ) + { + allowConnectionsForTime = Long.parseLong(params[7]); + System.out.println("Allow connections for a while " + allowConnectionsForTime); + } + + int localPort = Integer.parseInt(args[0]); + + String[] cmdArray = new String[args.length-1]; + + for(int i = 1; i < args.length; i++ ) + cmdArray[i-1] = args[i]; + + JSch jsch = new JSch(); + Session session = null; + try { + session = jsch.getSession(user, remoteServer, remotePort); + session.setUserInfo(new PassProvider(pass)); + if( !compressionLevel.equals("0") ) + { + System.out.println("Using compression"); + session.setConfig("compression.s2c", "zlib@openssh.com,zlib,none"); + session.setConfig("compression.c2s", "none"); + session.setConfig("compression_level", compressionLevel); + } + else + { + System.out.println("No compression used"); + session.setConfig("compression.s2c", "none"); + session.setConfig("compression.c2s", "none"); + } + + session.connect(); + + session.setPortForwardingL("127.0.0.1", localPort, targetHost, targetPort, new SSFactory()); + System.out.println("Listening at " + localPort); + + /*// Used for debugging + FileOutputStream out = new FileOutputStream("/tmp/out.txt"); + + + for(String s: cmdArray) { + out.write( s.getBytes() ); + out.write( '\n' ); + }*/ + try { + // We will copy input stream to forked child + ProcessBuilder pb = new ProcessBuilder(cmdArray); + Map env = pb.environment(); + // Remove variables + env.remove(ENV_PARAMS); + env.put(ENV_LISTEN, Integer.toString(localPort)); + + Process p = pb.start(); + pipein(System.in, p.getOutputStream()); + pipe(p.getErrorStream(), System.out); + pipe(p.getInputStream(), System.err); + //p.waitFor(); + //System.out.println(p.exitValue()); + } catch (IOException e) { + System.out.println(e); + } + // We will wait max of 30 seconds for a connection to tunnel, if not used in that interval, it will get closed + // And program will finish + int counter = 30; + while( SerSocket.socket == null && --counter > 0) { + Thread.sleep(1000); + } + if( counter <= 0 ) + { + System.out.println("Connection timed out"); + javax.swing.JOptionPane.showMessageDialog(null, "Tunneled expired (client not connected)"); + throw new InterruptedException("Connection timed out"); + } + System.out.println("Tunnel connected"); + // Now we wait for tunnel closing + while( SerSocket.socket.isClosed() == false ) + Thread.sleep(1000); + System.out.println("Tunnel disconnected"); + session.disconnect(); + + } catch (JSchException e) { + javax.swing.JOptionPane.showMessageDialog(null, "Can't contact remote tunneler server:" + remoteServer + ":" + remotePort); + System.err.println(e); + } catch (InterruptedException e) { + if( session.isConnected() ) + session.disconnect(); + System.err.println(e); + } catch( Exception e ) { + if( session.isConnected() ) + session.disconnect(); + System.err.println(e); + } + + System.exit(0); + } + + public static class PassProvider implements UserInfo { + + private String pass; + + PassProvider(String password) + { + super(); + this.pass = password; + } + + @Override + public String getPassphrase() { + return null; + } + + @Override + public String getPassword() { + return this.pass; + } + + @Override + public boolean promptPassphrase(String arg0) { + return true; + } + + @Override + public boolean promptPassword(String arg0) { + return true; + } + + @Override + public boolean promptYesNo(String arg0) { + return true; + } + + @Override + public void showMessage(String arg0) { + System.out.println(arg0); + + } + + } + + private static void pipein(final InputStream src, final OutputStream dest) { + + new Thread(new Runnable() { + public void run() { + try { + int ret = -1; + while ((ret = src.read()) != -1) { + dest.write(ret); + dest.flush(); + } + } catch (IOException e) { // just exit + } + } + }).start(); + + } + + private static void pipe(final InputStream src, final OutputStream dest) { + new Thread(new Runnable() { + public void run() { + try { + byte[] buffer = new byte[1024]; + for (int n = 0; n != -1; n = src.read(buffer)) { + dest.write(buffer, 0, n); + } + } catch (IOException e) { // just exit + } + } + }).start(); + } + + + private static class SerSocket extends ServerSocket { + + public static Socket socket = null; + public static long firstConnectionTime; + + public SerSocket(int port, int backlog, InetAddress bindAddr) + throws IOException { + super(port, backlog, bindAddr); + } + + @Override + public Socket accept() throws IOException + { + while( true ) + { + Socket so = super.accept(); + if( socket == null ) + { + socket = so; + firstConnectionTime = System.currentTimeMillis(); + } + else + { + if( Laucher.allowConnectionsForTime == -1 ) + { + so.close(); // Second connections not allowed + continue; + } + + if( (System.currentTimeMillis() - firstConnectionTime) > Laucher.allowConnectionsForTime*1000) + { + System.out.println("No se permiten mas conexiones"); + so.close(); + continue; + } + + // Allow connection, but keep an eye on first connection + } + + return so; + } + } + + } + + private static class SSFactory implements ServerSocketFactory { + + @Override + public ServerSocket createServerSocket(int port, int backlog, + InetAddress bindAddr) throws IOException { + return new SerSocket(port, backlog, bindAddr); + } + + } +} diff --git a/ssh-tunnel/tunnelLaucher/src/manifest b/ssh-tunnel/tunnelLaucher/src/manifest new file mode 100644 index 000000000..cb34fe1ea --- /dev/null +++ b/ssh-tunnel/tunnelLaucher/src/manifest @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Sealed: true +Main-Class: es.virtualcable.sshtunnel.Laucher + diff --git a/udsService/installer/USDActorInstaller/.project b/udsService/installer/USDActorInstaller/.project new file mode 100644 index 000000000..1355b6eeb --- /dev/null +++ b/udsService/installer/USDActorInstaller/.project @@ -0,0 +1,11 @@ + + + USDActorInstaller + + + + + + + + diff --git a/udsService/installer/USDActorInstaller/UDSActorSetup.exe b/udsService/installer/USDActorInstaller/UDSActorSetup.exe new file mode 100644 index 000000000..37b29f82a Binary files /dev/null and b/udsService/installer/USDActorInstaller/UDSActorSetup.exe differ diff --git a/udsService/installer/USDActorInstaller/license.txt b/udsService/installer/USDActorInstaller/license.txt new file mode 100644 index 000000000..985b510fc --- /dev/null +++ b/udsService/installer/USDActorInstaller/license.txt @@ -0,0 +1,27 @@ +Copyright (c) 2012 Virtual Cable S.L. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Virtual Cable S.L. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/udsService/installer/USDActorInstaller/udsactor.nsi b/udsService/installer/USDActorInstaller/udsactor.nsi new file mode 100644 index 000000000..11b65dd52 --- /dev/null +++ b/udsService/installer/USDActorInstaller/udsactor.nsi @@ -0,0 +1,188 @@ +# Auto-generated by EclipseNSIS Script Wizard +# 23-oct-2011 23:38:18 + +Name "UDS Actor" + +# General Symbol Definitions +!define REGKEY "SOFTWARE\$(^Name)" +!define VERSION 1.0 +!define COMPANY "Virtual Cable S.L." +!define URL http://www.virtualcable.com + +# MultiUser Symbol Definitions +!define MULTIUSER_EXECUTIONLEVEL Admin +!define MULTIUSER_INSTALLMODE_DEFAULT_CURRENTUSER +!define MULTIUSER_INSTALLMODE_COMMANDLINE +!define MULTIUSER_INSTALLMODE_INSTDIR UDSActor +!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "${REGKEY}" +!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUE "Path" + +# MUI Symbol Definitions +!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico" +!define MUI_FINISHPAGE_NOAUTOCLOSE +!define MUI_FINISHPAGE_RUN $INSTDIR\udsService.exe +!define MUI_FINISHPAGE_RUN_PARAMETERS -c +!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico" +!define MUI_UNFINISHPAGE_NOAUTOCLOSE +!define MUI_LANGDLL_REGISTRY_ROOT HKLM +!define MUI_LANGDLL_REGISTRY_KEY ${REGKEY} +!define MUI_LANGDLL_REGISTRY_VALUENAME InstallerLanguage + +# Included files +!include MultiUser.nsh +!include Sections.nsh +!include MUI2.nsh + +# Reserved Files +!insertmacro MUI_RESERVEFILE_LANGDLL + +# Variables +Var StartMenuGroup + +# Installer pages +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_LICENSE license.txt +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_INSTFILES +!insertmacro MUI_PAGE_FINISH +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES + +# Installer languages +!insertmacro MUI_LANGUAGE English +!insertmacro MUI_LANGUAGE Spanish +!insertmacro MUI_LANGUAGE French +!insertmacro MUI_LANGUAGE German + +# Installer attributes +OutFile UDSActorSetup.exe +InstallDir UDSActor +CRCCheck on +XPStyle on +ShowInstDetails hide +VIProductVersion 1.0.0.0 +VIAddVersionKey /LANG=${LANG_ENGLISH} ProductName "UDS Actor" +VIAddVersionKey /LANG=${LANG_ENGLISH} ProductVersion "${VERSION}" +VIAddVersionKey /LANG=${LANG_ENGLISH} CompanyName "${COMPANY}" +VIAddVersionKey /LANG=${LANG_ENGLISH} CompanyWebsite "${URL}" +VIAddVersionKey /LANG=${LANG_ENGLISH} FileVersion "${VERSION}" +VIAddVersionKey /LANG=${LANG_ENGLISH} FileDescription "" +VIAddVersionKey /LANG=${LANG_ENGLISH} LegalCopyright "" +InstallDirRegKey HKLM "${REGKEY}" Path +ShowUninstDetails show + +# Installer sections +Section -Main SEC0000 + SetOutPath $INSTDIR + SetOverwrite on + File ..\..\udsService\bin\Release\CookComputing.XmlRpcV2.dll + File ..\..\udsService\bin\Release\Interop.EventSystemLib.dll + File ..\..\udsService\bin\Release\Interop.SensEvents.dll + File ..\..\udsService\bin\Release\log4net.dll + File ..\..\udsService\bin\Release\udsgui.dll + File ..\..\udsService\bin\Release\logging.cfg + File ..\..\udsService\bin\Release\udsService.exe + File ..\..\udsService\bin\Release\udsService.exe.config + File ..\..\udsService\bin\Release\udstools.dll + SetOutPath $INSTDIR\es + File ..\..\udsService\bin\Release\es\udsgui.resources.dll + SetOutPath $INSTDIR\fr + File ..\..\udsService\bin\Release\fr\udsgui.resources.dll + SetOutPath $INSTDIR\de + File ..\..\udsService\bin\Release\de\udsgui.resources.dll + WriteRegStr HKLM "${REGKEY}\Components" Main 1 +SectionEnd + +Section -post SEC0001 + WriteRegStr HKLM "${REGKEY}" Path $INSTDIR + SetOutPath $INSTDIR + WriteUninstaller $INSTDIR\udsuninstall.exe + SetOutPath $SMPROGRAMS\$StartMenuGroup + CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^UninstallLink).lnk" $INSTDIR\udsuninstall.exe + CreateShortcut "$SMPROGRAMS\$StartMenuGroup\UDS Actor Configuration.lnk" $INSTDIR\udsService.exe -c + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "${VERSION}" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Publisher "${COMPANY}" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\udsuninstall.exe + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\udsuninstall.exe + WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1 + WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1 + nsExec::Exec /OEM "$INSTDIR\udsService.exe -i" # Add service after installation +SectionEnd + +# Macro for selecting uninstaller sections +!macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID + Push $R0 + ReadRegStr $R0 HKLM "${REGKEY}\Components" "${SECTION_NAME}" + StrCmp $R0 1 0 next${UNSECTION_ID} + !insertmacro SelectSection "${UNSECTION_ID}" + GoTo done${UNSECTION_ID} +next${UNSECTION_ID}: + !insertmacro UnselectSection "${UNSECTION_ID}" +done${UNSECTION_ID}: + Pop $R0 +!macroend + +# Uninstaller sections +Section /o -un.Main UNSEC0000 + nsExec::Exec /OEM "$INSTDIR\udsService.exe -u" # Removes the service prior uninstall :-) + Delete /REBOOTOK $INSTDIR\es\udsgui.resources.dll + Delete /REBOOTOK $INSTDIR\fr\udsgui.resources.dll + Delete /REBOOTOK $INSTDIR\de\udsgui.resources.dll + Delete /REBOOTOK $INSTDIR\udstools.dll + Delete /REBOOTOK $INSTDIR\udsService.exe.config + Delete /REBOOTOK $INSTDIR\udsService.exe + Delete /REBOOTOK $INSTDIR\udsgui.dll + Delete /REBOOTOK $INSTDIR\logging.cfg + Delete /REBOOTOK $INSTDIR\log4net.dll + Delete /REBOOTOK $INSTDIR\Interop.SensEvents.dll + Delete /REBOOTOK $INSTDIR\Interop.EventSystemLib.dll + Delete /REBOOTOK $INSTDIR\CookComputing.XmlRpcV2.dll + DeleteRegValue HKLM "${REGKEY}\Components" Main +SectionEnd + +Section -un.post UNSEC0001 + DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$(^UninstallLink).lnk" + Delete /REBOOTOK $INSTDIR\udsuninstall.exe + DeleteRegValue HKLM "${REGKEY}" Path + DeleteRegKey /IfEmpty HKLM "${REGKEY}\Components" + DeleteRegKey /IfEmpty HKLM "${REGKEY}" + RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup + RmDir /REBOOTOK $INSTDIR +SectionEnd + +# Installer functions +Function .onInit + InitPluginsDir + StrCpy $StartMenuGroup "Virtual Cable\UDS Actor" + + ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" SP + ${if} $0 != 1 + MessageBox MB_OK "$(^NoDotNet)" + Abort + ${EndIf} + + !insertmacro MUI_LANGDLL_DISPLAY + !insertmacro MULTIUSER_INIT +FunctionEnd + +# Uninstaller functions +Function un.onInit + StrCpy $StartMenuGroup "Virtual Cable\UDS Actor" + !insertmacro MUI_UNGETLANGUAGE + !insertmacro MULTIUSER_UNINIT + !insertmacro SELECT_UNSECTION Main ${UNSEC0000} +FunctionEnd + +# Installer Language Strings +LangString ^NoDotNet ${LANG_ENGLISH} ".NET 3.5 sp1 Required.$\nPlease, install it to proceed" +LangString ^NoDotNet ${LANG_SPANISH} "Se requiere .NET 3.5 sp1.$\nPor favor, instalelo para proceder" +LangString ^NoDotNet ${LANG_FRENCH} ".NET Framework 3.5 SP1 requis.$\nVeuillez, installez-le de procder" +LangString ^NoDotNet ${LANG_GERMAN} "Erforderlich ist. NET 3.5 sp1.$\nPor Bitte installieren Sie es, um fortzufahren" + +LangString ^UninstallLink ${LANG_ENGLISH} "Uninstall $(^Name)" +LangString ^UninstallLink ${LANG_SPANISH} "Desinstalar $(^Name)" +LangString ^UninstallLink ${LANG_FRENCH} "Dsinstaller $(^Name)" +LangString ^UninstallLink ${LANG_GERMAN} "deinstallieren $(^Name)" diff --git a/udsService/log4net/2.0/log4net.dll b/udsService/log4net/2.0/log4net.dll new file mode 100644 index 000000000..2a56a3ed0 Binary files /dev/null and b/udsService/log4net/2.0/log4net.dll differ diff --git a/udsService/log4net/2.0/log4net.xml b/udsService/log4net/2.0/log4net.xml new file mode 100644 index 000000000..de8317a32 --- /dev/null +++ b/udsService/log4net/2.0/log4net.xml @@ -0,0 +1,30205 @@ + + + + log4net + + + + + Appender that logs to a database. + + + + appends logging events to a table within a + database. The appender can be configured to specify the connection + string by setting the property. + The connection type (provider) can be specified by setting the + property. For more information on database connection strings for + your specific database see http://www.connectionstrings.com/. + + + Records are written into the database either using a prepared + statement or a stored procedure. The property + is set to (System.Data.CommandType.Text) to specify a prepared statement + or to (System.Data.CommandType.StoredProcedure) to specify a stored + procedure. + + + The prepared statement text or the name of the stored procedure + must be set in the property. + + + The prepared statement or stored procedure can take a number + of parameters. Parameters are added using the + method. This adds a single to the + ordered list of parameters. The + type may be subclassed if required to provide database specific + functionality. The specifies + the parameter name, database type, size, and how the value should + be generated using a . + + + + An example of a SQL Server table that could be logged to: + + CREATE TABLE [dbo].[Log] ( + [ID] [int] IDENTITY (1, 1) NOT NULL , + [Date] [datetime] NOT NULL , + [Thread] [varchar] (255) NOT NULL , + [Level] [varchar] (20) NOT NULL , + [Logger] [varchar] (255) NOT NULL , + [Message] [varchar] (4000) NOT NULL + ) ON [PRIMARY] + + + + An example configuration to log to the above table: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Julian Biddle + Nicko Cadell + Gert Driesen + Lance Nehring + + + + Abstract base class implementation of that + buffers events in a fixed size buffer. + + + + This base class should be used by appenders that need to buffer a + number of events before logging them. For example the + buffers events and then submits the entire contents of the buffer to + the underlying database in one go. + + + Subclasses should override the + method to deliver the buffered events. + + The BufferingAppenderSkeleton maintains a fixed size cyclic + buffer of events. The size of the buffer is set using + the property. + + A is used to inspect + each event as it arrives in the appender. If the + triggers, then the current buffer is sent immediately + (see ). Otherwise the event + is stored in the buffer. For example, an evaluator can be used to + deliver the events immediately when an ERROR event arrives. + + + The buffering appender can be configured in a mode. + By default the appender is NOT lossy. When the buffer is full all + the buffered events are sent with . + If the property is set to true then the + buffer will not be sent when it is full, and new events arriving + in the appender will overwrite the oldest event in the buffer. + In lossy mode the buffer will only be sent when the + triggers. This can be useful behavior when you need to know about + ERROR events but not about events with a lower level, configure an + evaluator that will trigger when an ERROR event arrives, the whole + buffer will be sent which gives a history of events leading up to + the ERROR event. + + + Nicko Cadell + Gert Driesen + + + + Abstract base class implementation of . + + + + This class provides the code for common functionality, such + as support for threshold filtering and support for general filters. + + + Appenders can also implement the interface. Therefore + they would require that the method + be called after the appenders properties have been configured. + + + Nicko Cadell + Gert Driesen + + + + Implement this interface for your own strategies for printing log statements. + + + + Implementors should consider extending the + class which provides a default implementation of this interface. + + + Appenders can also implement the interface. Therefore + they would require that the method + be called after the appenders properties have been configured. + + + Nicko Cadell + Gert Driesen + + + + Closes the appender and releases resources. + + + + Releases any resources allocated within the appender such as file handles, + network connections, etc. + + + It is a programming error to append to a closed appender. + + + + + + Log the logging event in Appender specific way. + + The event to log + + + This method is called to log a message into this appender. + + + + + + Gets or sets the name of this appender. + + The name of the appender. + + The name uniquely identifies the appender. + + + + + Interface for appenders that support bulk logging. + + + + This interface extends the interface to + support bulk logging of objects. Appenders + should only implement this interface if they can bulk log efficiently. + + + Nicko Cadell + + + + Log the array of logging events in Appender specific way. + + The events to log + + + This method is called to log an array of events into this appender. + + + + + + Interface used to delay activate a configured object. + + + + This allows an object to defer activation of its options until all + options have been set. This is required for components which have + related options that remain ambiguous until all are set. + + + If a component implements this interface then the method + must be called by the container after its all the configured properties have been set + and before the component can be used. + + + Nicko Cadell + + + + Activate the options that were previously set with calls to properties. + + + + This allows an object to defer activation of its options until all + options have been set. This is required for components which have + related options that remain ambiguous until all are set. + + + If a component implements this interface then this method must be called + after its properties have been set before the component can be used. + + + + + + Initial buffer size + + + + + Maximum buffer size before it is recycled + + + + + Default constructor + + + Empty default constructor + + + + + Finalizes this appender by calling the implementation's + method. + + + + If this appender has not been closed then the Finalize method + will call . + + + + + + Initialize the appender based on the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Closes the appender and release resources. + + + + Release any resources allocated within the appender such as file handles, + network connections, etc. + + + It is a programming error to append to a closed appender. + + + This method cannot be overridden by subclasses. This method + delegates the closing of the appender to the + method which must be overridden in the subclass. + + + + + + Performs threshold checks and invokes filters before + delegating actual logging to the subclasses specific + method. + + The event to log. + + + This method cannot be overridden by derived classes. A + derived class should override the method + which is called by this method. + + + The implementation of this method is as follows: + + + + + + Checks that the severity of the + is greater than or equal to the of this + appender. + + + + Checks that the chain accepts the + . + + + + + Calls and checks that + it returns true. + + + + + If all of the above steps succeed then the + will be passed to the abstract method. + + + + + + Performs threshold checks and invokes filters before + delegating actual logging to the subclasses specific + method. + + The array of events to log. + + + This method cannot be overridden by derived classes. A + derived class should override the method + which is called by this method. + + + The implementation of this method is as follows: + + + + + + Checks that the severity of the + is greater than or equal to the of this + appender. + + + + Checks that the chain accepts the + . + + + + + Calls and checks that + it returns true. + + + + + If all of the above steps succeed then the + will be passed to the method. + + + + + + Test if the logging event should we output by this appender + + the event to test + true if the event should be output, false if the event should be ignored + + + This method checks the logging event against the threshold level set + on this appender and also against the filters specified on this + appender. + + + The implementation of this method is as follows: + + + + + + Checks that the severity of the + is greater than or equal to the of this + appender. + + + + Checks that the chain accepts the + . + + + + + + + + + Adds a filter to the end of the filter chain. + + the filter to add to this appender + + + The Filters are organized in a linked list. + + + Setting this property causes the new filter to be pushed onto the + back of the filter chain. + + + + + + Clears the filter list for this appender. + + + + Clears the filter list for this appender. + + + + + + Checks if the message level is below this appender's threshold. + + to test against. + + + If there is no threshold set, then the return value is always true. + + + + true if the meets the + requirements of this appender. + + + + + Is called when the appender is closed. Derived classes should override + this method if resources need to be released. + + + + Releases any resources allocated within the appender such as file handles, + network connections, etc. + + + It is a programming error to append to a closed appender. + + + + + + Subclasses of should implement this method + to perform actual logging. + + The event to append. + + + A subclass must implement this method to perform + logging of the . + + This method will be called by + if all the conditions listed for that method are met. + + + To restrict the logging of events in the appender + override the method. + + + + + + Append a bulk array of logging events. + + the array of logging events + + + This base class implementation calls the + method for each element in the bulk array. + + + A sub class that can better process a bulk array of events should + override this method in addition to . + + + + + + Called before as a precondition. + + + + This method is called by + before the call to the abstract method. + + + This method can be overridden in a subclass to extend the checks + made before the event is passed to the method. + + + A subclass should ensure that they delegate this call to + this base class if it is overridden. + + + true if the call to should proceed. + + + + Renders the to a string. + + The event to render. + The event rendered as a string. + + + Helper method to render a to + a string. This appender must have a + set to render the to + a string. + + If there is exception data in the logging event and + the layout does not process the exception, this method + will append the exception text to the rendered string. + + + Where possible use the alternative version of this method + . + That method streams the rendering onto an existing Writer + which can give better performance if the caller already has + a open and ready for writing. + + + + + + Renders the to a string. + + The event to render. + The TextWriter to write the formatted event to + + + Helper method to render a to + a string. This appender must have a + set to render the to + a string. + + If there is exception data in the logging event and + the layout does not process the exception, this method + will append the exception text to the rendered string. + + + Use this method in preference to + where possible. If, however, the caller needs to render the event + to a string then does + provide an efficient mechanism for doing so. + + + + + + The layout of this appender. + + + See for more information. + + + + + The name of this appender. + + + See for more information. + + + + + The level threshold of this appender. + + + + There is no level threshold filtering by default. + + + See for more information. + + + + + + It is assumed and enforced that errorHandler is never null. + + + + It is assumed and enforced that errorHandler is never null. + + + See for more information. + + + + + + The first filter in the filter chain. + + + + Set to null initially. + + + See for more information. + + + + + + The last filter in the filter chain. + + + See for more information. + + + + + Flag indicating if this appender is closed. + + + See for more information. + + + + + The guard prevents an appender from repeatedly calling its own DoAppend method + + + + + StringWriter used to render events + + + + + The fully qualified type of the AppenderSkeleton class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the threshold of this appender. + + + The threshold of the appender. + + + + All log events with lower level than the threshold level are ignored + by the appender. + + + In configuration files this option is specified by setting the + value of the option to a level + string, such as "DEBUG", "INFO" and so on. + + + + + + Gets or sets the for this appender. + + The of the appender + + + The provides a default + implementation for the property. + + + + + + The filter chain. + + The head of the filter chain filter chain. + + + Returns the head Filter. The Filters are organized in a linked list + and so all Filters on this Appender are available through the result. + + + + + + Gets or sets the for this appender. + + The layout of the appender. + + + See for more information. + + + + + + + Gets or sets the name of this appender. + + The name of the appender. + + + The name uniquely identifies the appender. + + + + + + Tests if this appender requires a to be set. + + + + In the rather exceptional case, where the appender + implementation admits a layout but can also work without it, + then the appender should return true. + + + This default implementation always returns false. + + + + true if the appender requires a layout object, otherwise false. + + + + + The default buffer size. + + + The default size of the cyclic buffer used to store events. + This is set to 512 by default. + + + + + Initializes a new instance of the class. + + + + Protected default constructor to allow subclassing. + + + + + + Initializes a new instance of the class. + + the events passed through this appender must be + fixed by the time that they arrive in the derived class' SendBuffer method. + + + Protected constructor to allow subclassing. + + + The should be set if the subclass + expects the events delivered to be fixed even if the + is set to zero, i.e. when no buffering occurs. + + + + + + Flush the currently buffered events + + + + Flushes any events that have been buffered. + + + If the appender is buffering in mode then the contents + of the buffer will NOT be flushed to the appender. + + + + + + Flush the currently buffered events + + set to true to flush the buffer of lossy events + + + Flushes events that have been buffered. If is + false then events will only be flushed if this buffer is non-lossy mode. + + + If the appender is buffering in mode then the contents + of the buffer will only be flushed if is true. + In this case the contents of the buffer will be tested against the + and if triggering will be output. All other buffered + events will be discarded. + + + If is true then the buffer will always + be emptied by calling this method. + + + + + + Initialize the appender based on the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Close this appender instance. + + + + Close this appender instance. If this appender is marked + as not then the remaining events in + the buffer must be sent when the appender is closed. + + + + + + This method is called by the method. + + the event to log + + + Stores the in the cyclic buffer. + + + The buffer will be sent (i.e. passed to the + method) if one of the following conditions is met: + + + + The cyclic buffer is full and this appender is + marked as not lossy (see ) + + + An is set and + it is triggered for the + specified. + + + + Before the event is stored in the buffer it is fixed + (see ) to ensure that + any data referenced by the event will be valid when the buffer + is processed. + + + + + + Sends the contents of the buffer. + + The first logging event. + The buffer containing the events that need to be send. + + + The subclass must override . + + + + + + Sends the events. + + The events that need to be send. + + + The subclass must override this method to process the buffered events. + + + + + + The size of the cyclic buffer used to hold the logging events. + + + Set to by default. + + + + + The cyclic buffer used to store the logging events. + + + + + The triggering event evaluator that causes the buffer to be sent immediately. + + + The object that is used to determine if an event causes the entire + buffer to be sent immediately. This field can be null, which + indicates that event triggering is not to be done. The evaluator + can be set using the property. If this appender + has the ( property) set to + true then an must be set. + + + + + Indicates if the appender should overwrite events in the cyclic buffer + when it becomes full, or if the buffer should be flushed when the + buffer is full. + + + If this field is set to true then an must + be set. + + + + + The triggering event evaluator filters discarded events. + + + The object that is used to determine if an event that is discarded should + really be discarded or if it should be sent to the appenders. + This field can be null, which indicates that all discarded events will + be discarded. + + + + + Value indicating which fields in the event should be fixed + + + By default all fields are fixed + + + + + The events delivered to the subclass must be fixed. + + + + + Gets or sets a value that indicates whether the appender is lossy. + + + true if the appender is lossy, otherwise false. The default is false. + + + + This appender uses a buffer to store logging events before + delivering them. A triggering event causes the whole buffer + to be send to the remote sink. If the buffer overruns before + a triggering event then logging events could be lost. Set + to false to prevent logging events + from being lost. + + If is set to true then an + must be specified. + + + + + Gets or sets the size of the cyclic buffer used to hold the + logging events. + + + The size of the cyclic buffer used to hold the logging events. + + + + The option takes a positive integer + representing the maximum number of logging events to collect in + a cyclic buffer. When the is reached, + oldest events are deleted as new events are added to the + buffer. By default the size of the cyclic buffer is 512 events. + + + If the is set to a value less than + or equal to 1 then no buffering will occur. The logging event + will be delivered synchronously (depending on the + and properties). Otherwise the event will + be buffered. + + + + + + Gets or sets the that causes the + buffer to be sent immediately. + + + The that causes the buffer to be + sent immediately. + + + + The evaluator will be called for each event that is appended to this + appender. If the evaluator triggers then the current buffer will + immediately be sent (see ). + + If is set to true then an + must be specified. + + + + + Gets or sets the value of the to use. + + + The value of the to use. + + + + The evaluator will be called for each event that is discarded from this + appender. If the evaluator triggers then the current buffer will immediately + be sent (see ). + + + + + + Gets or sets a value indicating if only part of the logging event data + should be fixed. + + + true if the appender should only fix part of the logging event + data, otherwise false. The default is false. + + + + Setting this property to true will cause only part of the + event data to be fixed and serialized. This will improve performance. + + + See for more information. + + + + + + Gets or sets a the fields that will be fixed in the event + + + The event fields that will be fixed before the event is buffered + + + + The logging event needs to have certain thread specific values + captured before it can be buffered. See + for details. + + + + + + + Initializes a new instance of the class. + + + Public default constructor to initialize a new instance of this class. + + + + + Initialize the appender based on the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Override the parent method to close the database + + + + Closes the database command and database connection. + + + + + + Inserts the events into the database. + + The events to insert into the database. + + + Insert all the events specified in the + array into the database. + + + + + + Adds a parameter to the command. + + The parameter to add to the command. + + + Adds a parameter to the ordered list of command parameters. + + + + + + Writes the events to the database using the transaction specified. + + The transaction that the events will be executed under. + The array of events to insert into the database. + + + The transaction argument can be null if the appender has been + configured not to use transactions. See + property for more information. + + + + + + Formats the log message into database statement text. + + The event being logged. + + This method can be overridden by subclasses to provide + more control over the format of the database statement. + + + Text that can be passed to a . + + + + + Creates an instance used to connect to the database. + + + This method is called whenever a new IDbConnection is needed (i.e. when a reconnect is necessary). + + The of the object. + The connectionString output from the ResolveConnectionString method. + An instance with a valid connection string. + + + + Resolves the connection string from the ConnectionString, ConnectionStringName, or AppSettingsKey + property. + + + ConnectiongStringName is only supported on .NET 2.0 and higher. + + Additional information describing the connection string. + A connection string used to connect to the database. + + + + Retrieves the class type of the ADO.NET provider. + + + + Gets the Type of the ADO.NET provider to use to connect to the + database. This method resolves the type specified in the + property. + + + Subclasses can override this method to return a different type + if necessary. + + + The of the ADO.NET provider + + + + Prepares the database command and initialize the parameters. + + + + + Connects to the database. + + + + + Cleanup the existing command. + + + If true, a message will be written using LogLog.Warn if an exception is encountered when calling Dispose. + + + + + Cleanup the existing connection. + + + Calls the IDbConnection's method. + + + + + Flag to indicate if we are using a command object + + + + Set to true when the appender is to use a prepared + statement or stored procedure to insert into the database. + + + + + + The list of objects. + + + + The list of objects. + + + + + + The security context to use for privileged calls + + + + + The that will be used + to insert logging events into a database. + + + + + The database command. + + + + + Database connection string. + + + + + The appSettings key from App.Config that contains the connection string. + + + + + The connectionStrings key from App.Config that contains the connection string. + + + + + String type name of the type name. + + + + + The text of the command. + + + + + The command type. + + + + + Indicates whether to use transactions when writing to the database. + + + + + Indicates whether to use transactions when writing to the database. + + + + + The fully qualified type of the AdoNetAppender class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the database connection string that is used to connect to + the database. + + + The database connection string used to connect to the database. + + + + The connections string is specific to the connection type. + See for more information. + + + Connection string for MS Access via ODBC: + "DSN=MS Access Database;UID=admin;PWD=;SystemDB=C:\data\System.mdw;SafeTransactions = 0;FIL=MS Access;DriverID = 25;DBQ=C:\data\train33.mdb" + + Another connection string for MS Access via ODBC: + "Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\Work\cvs_root\log4net-1.2\access.mdb;UID=;PWD=;" + + Connection string for MS Access via OLE DB: + "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Work\cvs_root\log4net-1.2\access.mdb;User Id=;Password=;" + + + + + The appSettings key from App.Config that contains the connection string. + + + + + The connectionStrings key from App.Config that contains the connection string. + + + This property requires at least .NET 2.0. + + + + + Gets or sets the type name of the connection + that should be created. + + + The type name of the connection. + + + + The type name of the ADO.NET provider to use. + + + The default is to use the OLE DB provider. + + + Use the OLE DB Provider. This is the default value. + System.Data.OleDb.OleDbConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Use the MS SQL Server Provider. + System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Use the ODBC Provider. + Microsoft.Data.Odbc.OdbcConnection,Microsoft.Data.Odbc,version=1.0.3300.0,publicKeyToken=b77a5c561934e089,culture=neutral + This is an optional package that you can download from + http://msdn.microsoft.com/downloads + search for ODBC .NET Data Provider. + + Use the Oracle Provider. + System.Data.OracleClient.OracleConnection, System.Data.OracleClient, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + This is an optional package that you can download from + http://msdn.microsoft.com/downloads + search for .NET Managed Provider for Oracle. + + + + + Gets or sets the command text that is used to insert logging events + into the database. + + + The command text used to insert logging events into the database. + + + + Either the text of the prepared statement or the + name of the stored procedure to execute to write into + the database. + + + The property determines if + this text is a prepared statement or a stored procedure. + + + + + + Gets or sets the command type to execute. + + + The command type to execute. + + + + This value may be either (System.Data.CommandType.Text) to specify + that the is a prepared statement to execute, + or (System.Data.CommandType.StoredProcedure) to specify that the + property is the name of a stored procedure + to execute. + + + The default value is (System.Data.CommandType.Text). + + + + + + Should transactions be used to insert logging events in the database. + + + true if transactions should be used to insert logging events in + the database, otherwise false. The default value is true. + + + + Gets or sets a value that indicates whether transactions should be used + to insert logging events in the database. + + + When set a single transaction will be used to insert the buffered events + into the database. Otherwise each event will be inserted without using + an explicit transaction. + + + + + + Gets or sets the used to call the NetSend method. + + + The used to call the NetSend method. + + + + Unless a specified here for this appender + the is queried for the + security context to use. The default behavior is to use the security context + of the current thread. + + + + + + Should this appender try to reconnect to the database on error. + + + true if the appender should try to reconnect to the database after an + error has occurred, otherwise false. The default value is false, + i.e. not to try to reconnect. + + + + The default behaviour is for the appender not to try to reconnect to the + database if an error occurs. Subsequent logging events are discarded. + + + To force the appender to attempt to reconnect to the database set this + property to true. + + + When the appender attempts to connect to the database there may be a + delay of up to the connection timeout specified in the connection string. + This delay will block the calling application's thread. + Until the connection can be reestablished this potential delay may occur multiple times. + + + + + + Gets or sets the underlying . + + + The underlying . + + + creates a to insert + logging events into a database. Classes deriving from + can use this property to get or set this . Use the + underlying returned from if + you require access beyond that which provides. + + + + + Parameter type used by the . + + + + This class provides the basic database parameter properties + as defined by the interface. + + This type can be subclassed to provide database specific + functionality. The two methods that are called externally are + and . + + + + + + Initializes a new instance of the class. + + + Default constructor for the AdoNetAppenderParameter class. + + + + + Prepare the specified database command object. + + The command to prepare. + + + Prepares the database command object by adding + this parameter to its collection of parameters. + + + + + + Renders the logging event and set the parameter value in the command. + + The command containing the parameter. + The event to be rendered. + + + Renders the logging event using this parameters layout + object. Sets the value of the parameter on the command object. + + + + + + The name of this parameter. + + + + + The database type for this parameter. + + + + + Flag to infer type rather than use the DbType + + + + + The precision for this parameter. + + + + + The scale for this parameter. + + + + + The size for this parameter. + + + + + The to use to render the + logging event into an object for this parameter. + + + + + Gets or sets the name of this parameter. + + + The name of this parameter. + + + + The name of this parameter. The parameter name + must match up to a named parameter to the SQL stored procedure + or prepared statement. + + + + + + Gets or sets the database type for this parameter. + + + The database type for this parameter. + + + + The database type for this parameter. This property should + be set to the database type from the + enumeration. See . + + + This property is optional. If not specified the ADO.NET provider + will attempt to infer the type from the value. + + + + + + + Gets or sets the precision for this parameter. + + + The precision for this parameter. + + + + The maximum number of digits used to represent the Value. + + + This property is optional. If not specified the ADO.NET provider + will attempt to infer the precision from the value. + + + + + + + Gets or sets the scale for this parameter. + + + The scale for this parameter. + + + + The number of decimal places to which Value is resolved. + + + This property is optional. If not specified the ADO.NET provider + will attempt to infer the scale from the value. + + + + + + + Gets or sets the size for this parameter. + + + The size for this parameter. + + + + The maximum size, in bytes, of the data within the column. + + + This property is optional. If not specified the ADO.NET provider + will attempt to infer the size from the value. + + + + + + + Gets or sets the to use to + render the logging event into an object for this + parameter. + + + The used to render the + logging event into an object for this parameter. + + + + The that renders the value for this + parameter. + + + The can be used to adapt + any into a + for use in the property. + + + + + + Appends logging events to the terminal using ANSI color escape sequences. + + + + AnsiColorTerminalAppender appends log events to the standard output stream + or the error output stream using a layout specified by the + user. It also allows the color of a specific level of message to be set. + + + This appender expects the terminal to understand the VT100 control set + in order to interpret the color codes. If the terminal or console does not + understand the control codes the behavior is not defined. + + + By default, all output is written to the console's standard output stream. + The property can be set to direct the output to the + error stream. + + + NOTE: This appender writes each message to the System.Console.Out or + System.Console.Error that is set at the time the event is appended. + Therefore it is possible to programmatically redirect the output of this appender + (for example NUnit does this to capture program output). While this is the desired + behavior of this appender it may have security implications in your application. + + + When configuring the ANSI colored terminal appender, a mapping should be + specified to map a logging level to a color. For example: + + + + + + + + + + + + + + + The Level is the standard log4net logging level and ForeColor and BackColor can be any + of the following values: + + Blue + Green + Red + White + Yellow + Purple + Cyan + + These color values cannot be combined together to make new colors. + + + The attributes can be any combination of the following: + + Brightforeground is brighter + Dimforeground is dimmer + Underscoremessage is underlined + Blinkforeground is blinking (does not work on all terminals) + Reverseforeground and background are reversed + Hiddenoutput is hidden + Strikethroughmessage has a line through it + + While any of these attributes may be combined together not all combinations + work well together, for example setting both Bright and Dim attributes makes + no sense. + + + Patrick Wagstrom + Nicko Cadell + + + + The to use when writing to the Console + standard output stream. + + + + The to use when writing to the Console + standard output stream. + + + + + + The to use when writing to the Console + standard error output stream. + + + + The to use when writing to the Console + standard error output stream. + + + + + + Ansi code to reset terminal + + + + + Initializes a new instance of the class. + + + The instance of the class is set up to write + to the standard output stream. + + + + + Add a mapping of level to color + + The mapping to add + + + Add a mapping to this appender. + Each mapping defines the foreground and background colours + for a level. + + + + + + This method is called by the method. + + The event to log. + + + Writes the event to the console. + + + The format of the output will depend on the appender's layout. + + + + + + Initialize the options for this appender + + + + Initialize the level to color mappings set on this appender. + + + + + + Flag to write output to the error stream rather than the standard output stream + + + + + Mapping from level object to color value + + + + + Target is the value of the console output stream. + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + The enum of possible display attributes + + + + The following flags can be combined together to + form the ANSI color attributes. + + + + + + + text is bright + + + + + text is dim + + + + + text is underlined + + + + + text is blinking + + + Not all terminals support this attribute + + + + + text and background colors are reversed + + + + + text is hidden + + + + + text is displayed with a strikethrough + + + + + The enum of possible foreground or background color values for + use with the color mapping method + + + + The output can be in one for the following ANSI colors. + + + + + + + color is black + + + + + color is red + + + + + color is green + + + + + color is yellow + + + + + color is blue + + + + + color is magenta + + + + + color is cyan + + + + + color is white + + + + + A class to act as a mapping between the level that a logging call is made at and + the color it should be displayed as. + + + + Defines the mapping between a level and the color it should be displayed in. + + + + + + An entry in the + + + + This is an abstract base class for types that are stored in the + object. + + + Nicko Cadell + + + + Default protected constructor + + + + Default protected constructor + + + + + + Initialize any options defined on this entry + + + + Should be overridden by any classes that need to initialise based on their options + + + + + + The level that is the key for this mapping + + + The that is the key for this mapping + + + + Get or set the that is the key for this + mapping subclass. + + + + + + Initialize the options for the object + + + + Combine the and together + and append the attributes. + + + + + + The mapped foreground color for the specified level + + + + Required property. + The mapped foreground color for the specified level + + + + + + The mapped background color for the specified level + + + + Required property. + The mapped background color for the specified level + + + + + + The color attributes for the specified level + + + + Required property. + The color attributes for the specified level + + + + + + The combined , and + suitable for setting the ansi terminal color. + + + + + A strongly-typed collection of objects. + + Nicko Cadell + + + + Creates a read-only wrapper for a AppenderCollection instance. + + list to create a readonly wrapper arround + + An AppenderCollection wrapper that is read-only. + + + + + An empty readonly static AppenderCollection + + + + + Initializes a new instance of the AppenderCollection class + that is empty and has the default initial capacity. + + + + + Initializes a new instance of the AppenderCollection class + that has the specified initial capacity. + + + The number of elements that the new AppenderCollection is initially capable of storing. + + + + + Initializes a new instance of the AppenderCollection class + that contains elements copied from the specified AppenderCollection. + + The AppenderCollection whose elements are copied to the new collection. + + + + Initializes a new instance of the AppenderCollection class + that contains elements copied from the specified array. + + The array whose elements are copied to the new list. + + + + Initializes a new instance of the AppenderCollection class + that contains elements copied from the specified collection. + + The collection whose elements are copied to the new list. + + + + Allow subclasses to avoid our default constructors + + + + + + + Copies the entire AppenderCollection to a one-dimensional + array. + + The one-dimensional array to copy to. + + + + Copies the entire AppenderCollection to a one-dimensional + array, starting at the specified index of the target array. + + The one-dimensional array to copy to. + The zero-based index in at which copying begins. + + + + Adds a to the end of the AppenderCollection. + + The to be added to the end of the AppenderCollection. + The index at which the value has been added. + + + + Removes all elements from the AppenderCollection. + + + + + Creates a shallow copy of the . + + A new with a shallow copy of the collection data. + + + + Determines whether a given is in the AppenderCollection. + + The to check for. + true if is found in the AppenderCollection; otherwise, false. + + + + Returns the zero-based index of the first occurrence of a + in the AppenderCollection. + + The to locate in the AppenderCollection. + + The zero-based index of the first occurrence of + in the entire AppenderCollection, if found; otherwise, -1. + + + + + Inserts an element into the AppenderCollection at the specified index. + + The zero-based index at which should be inserted. + The to insert. + + is less than zero + -or- + is equal to or greater than . + + + + + Removes the first occurrence of a specific from the AppenderCollection. + + The to remove from the AppenderCollection. + + The specified was not found in the AppenderCollection. + + + + + Removes the element at the specified index of the AppenderCollection. + + The zero-based index of the element to remove. + + is less than zero + -or- + is equal to or greater than . + + + + + Returns an enumerator that can iterate through the AppenderCollection. + + An for the entire AppenderCollection. + + + + Adds the elements of another AppenderCollection to the current AppenderCollection. + + The AppenderCollection whose elements should be added to the end of the current AppenderCollection. + The new of the AppenderCollection. + + + + Adds the elements of a array to the current AppenderCollection. + + The array whose elements should be added to the end of the AppenderCollection. + The new of the AppenderCollection. + + + + Adds the elements of a collection to the current AppenderCollection. + + The collection whose elements should be added to the end of the AppenderCollection. + The new of the AppenderCollection. + + + + Sets the capacity to the actual number of elements. + + + + + Return the collection elements as an array + + the array + + + + is less than zero + -or- + is equal to or greater than . + + + + + is less than zero + -or- + is equal to or greater than . + + + + + Gets the number of elements actually contained in the AppenderCollection. + + + + + Gets a value indicating whether access to the collection is synchronized (thread-safe). + + true if access to the ICollection is synchronized (thread-safe); otherwise, false. + + + + Gets an object that can be used to synchronize access to the collection. + + + + + Gets or sets the at the specified index. + + The zero-based index of the element to get or set. + + is less than zero + -or- + is equal to or greater than . + + + + + Gets a value indicating whether the collection has a fixed size. + + true if the collection has a fixed size; otherwise, false. The default is false + + + + Gets a value indicating whether the IList is read-only. + + true if the collection is read-only; otherwise, false. The default is false + + + + Gets or sets the number of elements the AppenderCollection can contain. + + + + + Supports type-safe iteration over a . + + + + + + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + Gets the current element in the collection. + + + + + Type visible only to our subclasses + Used to access protected constructor + + + + + + A value + + + + + Supports simple iteration over a . + + + + + + Initializes a new instance of the Enumerator class. + + + + + + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + Gets the current element in the collection. + + + + + + + + + Appends log events to the ASP.NET system. + + + + + Diagnostic information and tracing messages that you specify are appended to the output + of the page that is sent to the requesting browser. Optionally, you can view this information + from a separate trace viewer (Trace.axd) that displays trace information for every page in a + given application. + + + Trace statements are processed and displayed only when tracing is enabled. You can control + whether tracing is displayed to a page, to the trace viewer, or both. + + + The logging event is passed to the or + method depending on the level of the logging event. + The event's logger name is the default value for the category parameter of the Write/Warn method. + + + Nicko Cadell + Gert Driesen + Ron Grabowski + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Write the logging event to the ASP.NET trace + + the event to log + + + Write the logging event to the ASP.NET trace + HttpContext.Current.Trace + (). + + + + + + Defaults to %logger + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + The category parameter sent to the Trace method. + + + + Defaults to %logger which will use the logger name of the current + as the category parameter. + + + + + + + + Buffers events and then forwards them to attached appenders. + + + + The events are buffered in this appender until conditions are + met to allow the appender to deliver the events to the attached + appenders. See for the + conditions that cause the buffer to be sent. + + The forwarding appender can be used to specify different + thresholds and filters for the same appender at different locations + within the hierarchy. + + + Nicko Cadell + Gert Driesen + + + + Interface for attaching appenders to objects. + + + + Interface for attaching, removing and retrieving appenders. + + + Nicko Cadell + Gert Driesen + + + + Attaches an appender. + + The appender to add. + + + Add the specified appender. The implementation may + choose to allow or deny duplicate appenders. + + + + + + Gets an attached appender with the specified name. + + The name of the appender to get. + + The appender with the name specified, or null if no appender with the + specified name is found. + + + + Returns an attached appender with the specified. + If no appender with the specified name is found null will be + returned. + + + + + + Removes all attached appenders. + + + + Removes and closes all attached appenders + + + + + + Removes the specified appender from the list of attached appenders. + + The appender to remove. + The appender removed from the list + + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + + Removes the appender with the specified name from the list of appenders. + + The name of the appender to remove. + The appender removed from the list + + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + + Gets all attached appenders. + + + A collection of attached appenders. + + + + Gets a collection of attached appenders. + If there are no attached appenders the + implementation should return an empty + collection rather than null. + + + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Closes the appender and releases resources. + + + + Releases any resources allocated within the appender such as file handles, + network connections, etc. + + + It is a programming error to append to a closed appender. + + + + + + Send the events. + + The events that need to be send. + + + Forwards the events to the attached appenders. + + + + + + Adds an to the list of appenders of this + instance. + + The to add to this appender. + + + If the specified is already in the list of + appenders, then it won't be added again. + + + + + + Looks for the appender with the specified name. + + The name of the appender to lookup. + + The appender with the specified name, or null. + + + + Get the named appender attached to this buffering appender. + + + + + + Removes all previously added appenders from this appender. + + + + This is useful when re-reading configuration information. + + + + + + Removes the specified appender from the list of appenders. + + The appender to remove. + The appender removed from the list + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + Removes the appender with the specified name from the list of appenders. + + The name of the appender to remove. + The appender removed from the list + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + Implementation of the interface + + + + + Gets the appenders contained in this appender as an + . + + + If no appenders can be found, then an + is returned. + + + A collection of the appenders in this appender. + + + + + Appends logging events to the console. + + + + ColoredConsoleAppender appends log events to the standard output stream + or the error output stream using a layout specified by the + user. It also allows the color of a specific type of message to be set. + + + By default, all output is written to the console's standard output stream. + The property can be set to direct the output to the + error stream. + + + NOTE: This appender writes directly to the application's attached console + not to the System.Console.Out or System.Console.Error TextWriter. + The System.Console.Out and System.Console.Error streams can be + programmatically redirected (for example NUnit does this to capture program output). + This appender will ignore these redirections because it needs to use Win32 + API calls to colorize the output. To respect these redirections the + must be used. + + + When configuring the colored console appender, mapping should be + specified to map a logging level to a color. For example: + + + + + + + + + + + + + + The Level is the standard log4net logging level and ForeColor and BackColor can be any + combination of the following values: + + Blue + Green + Red + White + Yellow + Purple + Cyan + HighIntensity + + + + Rick Hobbs + Nicko Cadell + + + + The to use when writing to the Console + standard output stream. + + + + The to use when writing to the Console + standard output stream. + + + + + + The to use when writing to the Console + standard error output stream. + + + + The to use when writing to the Console + standard error output stream. + + + + + + Initializes a new instance of the class. + + + The instance of the class is set up to write + to the standard output stream. + + + + + Initializes a new instance of the class + with the specified layout. + + the layout to use for this appender + + The instance of the class is set up to write + to the standard output stream. + + + + + Initializes a new instance of the class + with the specified layout. + + the layout to use for this appender + flag set to true to write to the console error stream + + When is set to true, output is written to + the standard error output stream. Otherwise, output is written to the standard + output stream. + + + + + Add a mapping of level to color - done by the config file + + The mapping to add + + + Add a mapping to this appender. + Each mapping defines the foreground and background colors + for a level. + + + + + + This method is called by the method. + + The event to log. + + + Writes the event to the console. + + + The format of the output will depend on the appender's layout. + + + + + + Initialize the options for this appender + + + + Initialize the level to color mappings set on this appender. + + + + + + Flag to write output to the error stream rather than the standard output stream + + + + + Mapping from level object to color value + + + + + The console output stream writer to write to + + + + This writer is not thread safe. + + + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + The enum of possible color values for use with the color mapping method + + + + The following flags can be combined together to + form the colors. + + + + + + + color is blue + + + + + color is green + + + + + color is red + + + + + color is white + + + + + color is yellow + + + + + color is purple + + + + + color is cyan + + + + + color is intensified + + + + + A class to act as a mapping between the level that a logging call is made at and + the color it should be displayed as. + + + + Defines the mapping between a level and the color it should be displayed in. + + + + + + Initialize the options for the object + + + + Combine the and together. + + + + + + The mapped foreground color for the specified level + + + + Required property. + The mapped foreground color for the specified level. + + + + + + The mapped background color for the specified level + + + + Required property. + The mapped background color for the specified level. + + + + + + The combined and suitable for + setting the console color. + + + + + Appends logging events to the console. + + + + ConsoleAppender appends log events to the standard output stream + or the error output stream using a layout specified by the + user. + + + By default, all output is written to the console's standard output stream. + The property can be set to direct the output to the + error stream. + + + NOTE: This appender writes each message to the System.Console.Out or + System.Console.Error that is set at the time the event is appended. + Therefore it is possible to programmatically redirect the output of this appender + (for example NUnit does this to capture program output). While this is the desired + behavior of this appender it may have security implications in your application. + + + Nicko Cadell + Gert Driesen + + + + The to use when writing to the Console + standard output stream. + + + + The to use when writing to the Console + standard output stream. + + + + + + The to use when writing to the Console + standard error output stream. + + + + The to use when writing to the Console + standard error output stream. + + + + + + Initializes a new instance of the class. + + + The instance of the class is set up to write + to the standard output stream. + + + + + Initializes a new instance of the class + with the specified layout. + + the layout to use for this appender + + The instance of the class is set up to write + to the standard output stream. + + + + + Initializes a new instance of the class + with the specified layout. + + the layout to use for this appender + flag set to true to write to the console error stream + + When is set to true, output is written to + the standard error output stream. Otherwise, output is written to the standard + output stream. + + + + + This method is called by the method. + + The event to log. + + + Writes the event to the console. + + + The format of the output will depend on the appender's layout. + + + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Appends log events to the system. + + + + The application configuration file can be used to control what listeners + are actually used. See the MSDN documentation for the + class for details on configuring the + debug system. + + + Events are written using the + method. The event's logger name is passed as the value for the category name to the Write method. + + + Nicko Cadell + + + + Initializes a new instance of the . + + + + Default constructor. + + + + + + Initializes a new instance of the + with a specified layout. + + The layout to use with this appender. + + + Obsolete constructor. + + + + + + Writes the logging event to the system. + + The event to log. + + + Writes the logging event to the system. + If is true then the + is called. + + + + + + Immediate flush means that the underlying writer or output stream + will be flushed at the end of each append operation. + + + + Immediate flush is slower but ensures that each append request is + actually written. If is set to + false, then there is a good chance that the last few + logs events are not actually written to persistent media if and + when the application crashes. + + + The default value is true. + + + + + Gets or sets a value that indicates whether the appender will + flush at the end of each write. + + + The default behavior is to flush at the end of each + write. If the option is set tofalse, then the underlying + stream can defer writing to physical medium to a later time. + + + Avoiding the flush operation at the end of each append results + in a performance gain of 10 to 20 percent. However, there is safety + trade-off involved in skipping flushing. Indeed, when flushing is + skipped, then it is likely that the last few log events will not + be recorded on disk when the application exits. This is a high + price to pay even for a 20% performance gain. + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Writes events to the system event log. + + + + The appender will fail if you try to write using an event source that doesn't exist unless it is running with local administrator privileges. + See also http://logging.apache.org/log4net/release/faq.html#trouble-EventLog + + + The EventID of the event log entry can be + set using the EventID property () + on the . + + + The Category of the event log entry can be + set using the Category property () + on the . + + + There is a limit of 32K characters for an event log message + + + When configuring the EventLogAppender a mapping can be + specified to map a logging level to an event log entry type. For example: + + + <mapping> + <level value="ERROR" /> + <eventLogEntryType value="Error" /> + </mapping> + <mapping> + <level value="DEBUG" /> + <eventLogEntryType value="Information" /> + </mapping> + + + The Level is the standard log4net logging level and eventLogEntryType can be any value + from the enum, i.e.: + + Erroran error event + Warninga warning event + Informationan informational event + + + + Aspi Havewala + Douglas de la Torre + Nicko Cadell + Gert Driesen + Thomas Voss + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Initializes a new instance of the class + with the specified . + + The to use with this appender. + + + Obsolete constructor. + + + + + + Add a mapping of level to - done by the config file + + The mapping to add + + + Add a mapping to this appender. + Each mapping defines the event log entry type for a level. + + + + + + Initialize the appender based on the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Create an event log source + + + Uses different API calls under NET_2_0 + + + + + This method is called by the + method. + + the event to log + + Writes the event to the system event log using the + . + + If the event has an EventID property (see ) + set then this integer will be used as the event log event id. + + + There is a limit of 32K characters for an event log message + + + + + + Get the equivalent for a + + the Level to convert to an EventLogEntryType + The equivalent for a + + Because there are fewer applicable + values to use in logging levels than there are in the + this is a one way mapping. There is + a loss of information during the conversion. + + + + + The log name is the section in the event logs where the messages + are stored. + + + + + Name of the application to use when logging. This appears in the + application column of the event log named by . + + + + + The name of the machine which holds the event log. This is + currently only allowed to be '.' i.e. the current machine. + + + + + Mapping from level object to EventLogEntryType + + + + + The security context to use for privileged calls + + + + + The event ID to use unless one is explicitly specified via the LoggingEvent's properties. + + + + + The event category to use unless one is explicitly specified via the LoggingEvent's properties. + + + + + The fully qualified type of the EventLogAppender class. + + + Used by the internal logger to record the Type of the + log message. + + + + + The name of the log where messages will be stored. + + + The string name of the log where messages will be stored. + + + This is the name of the log as it appears in the Event Viewer + tree. The default value is to log into the Application + log, this is where most applications write their events. However + if you need a separate log for your application (or applications) + then you should set the appropriately. + This should not be used to distinguish your event log messages + from those of other applications, the + property should be used to distinguish events. This property should be + used to group together events into a single log. + + + + + + Property used to set the Application name. This appears in the + event logs when logging. + + + The string used to distinguish events from different sources. + + + Sets the event log source property. + + + + + This property is used to return the name of the computer to use + when accessing the event logs. Currently, this is the current + computer, denoted by a dot "." + + + The string name of the machine holding the event log that + will be logged into. + + + This property cannot be changed. It is currently set to '.' + i.e. the local machine. This may be changed in future. + + + + + Gets or sets the used to write to the EventLog. + + + The used to write to the EventLog. + + + + The system security context used to write to the EventLog. + + + Unless a specified here for this appender + the is queried for the + security context to use. The default behavior is to use the security context + of the current thread. + + + + + + Gets or sets the EventId to use unless one is explicitly specified via the LoggingEvent's properties. + + + + The EventID of the event log entry will normally be + set using the EventID property () + on the . + This property provides the fallback value which defaults to 0. + + + + + + Gets or sets the Category to use unless one is explicitly specified via the LoggingEvent's properties. + + + + The Category of the event log entry will normally be + set using the Category property () + on the . + This property provides the fallback value which defaults to 0. + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + A class to act as a mapping between the level that a logging call is made at and + the color it should be displayed as. + + + + Defines the mapping between a level and its event log entry type. + + + + + + The for this entry + + + + Required property. + The for this entry + + + + + + Appends logging events to a file. + + + + Logging events are sent to the file specified by + the property. + + + The file can be opened in either append or overwrite mode + by specifying the property. + If the file path is relative it is taken as relative from + the application base directory. The file encoding can be + specified by setting the property. + + + The layout's and + values will be written each time the file is opened and closed + respectively. If the property is + then the file may contain multiple copies of the header and footer. + + + This appender will first try to open the file for writing when + is called. This will typically be during configuration. + If the file cannot be opened for writing the appender will attempt + to open the file again each time a message is logged to the appender. + If the file cannot be opened for writing when a message is logged then + the message will be discarded by this appender. + + + The supports pluggable file locking models via + the property. + The default behavior, implemented by + is to obtain an exclusive write lock on the file until this appender is closed. + The alternative models only hold a + write lock while the appender is writing a logging event () + or synchronize by using a named system wide Mutex (). + + + All locking strategies have issues and you should seriously consider using a different strategy that + avoids having multiple processes logging to the same file. + + + Nicko Cadell + Gert Driesen + Rodrigo B. de Oliveira + Douglas de la Torre + Niall Daley + + + + Sends logging events to a . + + + + An Appender that writes to a . + + + This appender may be used stand alone if initialized with an appropriate + writer, however it is typically used as a base class for an appender that + can open a to write to. + + + Nicko Cadell + Gert Driesen + Douglas de la Torre + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Initializes a new instance of the class and + sets the output destination to a new initialized + with the specified . + + The layout to use with this appender. + The to output to. + + + Obsolete constructor. + + + + + + Initializes a new instance of the class and sets + the output destination to the specified . + + The layout to use with this appender + The to output to + + The must have been previously opened. + + + + Obsolete constructor. + + + + + + This method determines if there is a sense in attempting to append. + + + + This method checks if an output target has been set and if a + layout has been set. + + + false if any of the preconditions fail. + + + + This method is called by the + method. + + The event to log. + + + Writes a log statement to the output stream if the output stream exists + and is writable. + + + The format of the output will depend on the appender's layout. + + + + + + This method is called by the + method. + + The array of events to log. + + + This method writes all the bulk logged events to the output writer + before flushing the stream. + + + + + + Close this appender instance. The underlying stream or writer is also closed. + + + Closed appenders cannot be reused. + + + + + Writes the footer and closes the underlying . + + + + Writes the footer and closes the underlying . + + + + + + Closes the underlying . + + + + Closes the underlying . + + + + + + Clears internal references to the underlying + and other variables. + + + + Subclasses can override this method for an alternate closing behavior. + + + + + + Writes a footer as produced by the embedded layout's property. + + + + Writes a footer as produced by the embedded layout's property. + + + + + + Writes a header produced by the embedded layout's property. + + + + Writes a header produced by the embedded layout's property. + + + + + + Called to allow a subclass to lazily initialize the writer + + + + This method is called when an event is logged and the or + have not been set. This allows a subclass to + attempt to initialize the writer multiple times. + + + + + + This is the where logging events + will be written to. + + + + + Immediate flush means that the underlying + or output stream will be flushed at the end of each append operation. + + + + Immediate flush is slower but ensures that each append request is + actually written. If is set to + false, then there is a good chance that the last few + logging events are not actually persisted if and when the application + crashes. + + + The default value is true. + + + + + + The fully qualified type of the TextWriterAppender class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or set whether the appender will flush at the end + of each append operation. + + + + The default behavior is to flush at the end of each + append operation. + + + If this option is set to false, then the underlying + stream can defer persisting the logging event to a later + time. + + + + Avoiding the flush operation at the end of each append results in + a performance gain of 10 to 20 percent. However, there is safety + trade-off involved in skipping flushing. Indeed, when flushing is + skipped, then it is likely that the last few log events will not + be recorded on disk when the application exits. This is a high + price to pay even for a 20% performance gain. + + + + + Sets the where the log output will go. + + + + The specified must be open and writable. + + + The will be closed when the appender + instance is closed. + + + Note: Logging to an unopened will fail. + + + + + + Gets or set the and the underlying + , if any, for this appender. + + + The for this appender. + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Gets or sets the where logging events + will be written to. + + + The where logging events are written. + + + + This is the where logging events + will be written to. + + + + + + Default constructor + + + + Default constructor + + + + + + Construct a new appender using the layout, file and append mode. + + the layout to use with this appender + the full path to the file to write to + flag to indicate if the file should be appended to + + + Obsolete constructor. + + + + + + Construct a new appender using the layout and file specified. + The file will be appended to. + + the layout to use with this appender + the full path to the file to write to + + + Obsolete constructor. + + + + + + Activate the options on the file appender. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + This will cause the file to be opened. + + + + + + Closes any previously opened file and calls the parent's . + + + + Resets the filename and the file stream. + + + + + + Called to initialize the file writer + + + + Will be called for each logged message until the file is + successfully opened. + + + + + + This method is called by the + method. + + The event to log. + + + Writes a log statement to the output stream if the output stream exists + and is writable. + + + The format of the output will depend on the appender's layout. + + + + + + This method is called by the + method. + + The array of events to log. + + + Acquires the output file locks once before writing all the events to + the stream. + + + + + + Writes a footer as produced by the embedded layout's property. + + + + Writes a footer as produced by the embedded layout's property. + + + + + + Writes a header produced by the embedded layout's property. + + + + Writes a header produced by the embedded layout's property. + + + + + + Closes the underlying . + + + + Closes the underlying . + + + + + + Closes the previously opened file. + + + + Writes the to the file and then + closes the file. + + + + + + Sets and opens the file where the log output will go. The specified file must be writable. + + The path to the log file. Must be a fully qualified path. + If true will append to fileName. Otherwise will truncate fileName + + + Calls but guarantees not to throw an exception. + Errors are passed to the . + + + + + + Sets and opens the file where the log output will go. The specified file must be writable. + + The path to the log file. Must be a fully qualified path. + If true will append to fileName. Otherwise will truncate fileName + + + If there was already an opened file, then the previous file + is closed first. + + + This method will ensure that the directory structure + for the specified exists. + + + + + + Sets the quiet writer used for file output + + the file stream that has been opened for writing + + + This implementation of creates a + over the and passes it to the + method. + + + This method can be overridden by sub classes that want to wrap the + in some way, for example to encrypt the output + data using a System.Security.Cryptography.CryptoStream. + + + + + + Sets the quiet writer being used. + + the writer over the file stream that has been opened for writing + + + This method can be overridden by sub classes that want to + wrap the in some way. + + + + + + Convert a path into a fully qualified path. + + The path to convert. + The fully qualified path. + + + Converts the path specified to a fully + qualified path. If the path is relative it is + taken as relative from the application base + directory. + + + + + + Flag to indicate if we should append to the file + or overwrite the file. The default is to append. + + + + + The name of the log file. + + + + + The encoding to use for the file stream. + + + + + The security context to use for privileged calls + + + + + The stream to log to. Has added locking semantics + + + + + The locking model to use + + + + + The fully qualified type of the FileAppender class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the path to the file that logging will be written to. + + + The path to the file that logging will be written to. + + + + If the path is relative it is taken as relative from + the application base directory. + + + + + + Gets or sets a flag that indicates whether the file should be + appended to or overwritten. + + + Indicates whether the file should be appended to or overwritten. + + + + If the value is set to false then the file will be overwritten, if + it is set to true then the file will be appended to. + + The default value is true. + + + + + Gets or sets used to write to the file. + + + The used to write to the file. + + + + The default encoding set is + which is the encoding for the system's current ANSI code page. + + + + + + Gets or sets the used to write to the file. + + + The used to write to the file. + + + + Unless a specified here for this appender + the is queried for the + security context to use. The default behavior is to use the security context + of the current thread. + + + + + + Gets or sets the used to handle locking of the file. + + + The used to lock the file. + + + + Gets or sets the used to handle locking of the file. + + + There are three built in locking models, , and . + The first locks the file from the start of logging to the end, the + second locks only for the minimal amount of time when logging each message + and the last synchronizes processes using a named system wide Mutex. + + + The default locking model is the . + + + + + + Write only that uses the + to manage access to an underlying resource. + + + + + True asynchronous writes are not supported, the implementation forces a synchronous write. + + + + + Exception base type for log4net. + + + + This type extends . It + does not add any new functionality but does differentiate the + type of exception being thrown. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Constructor + + A message to include with the exception. + + + Initializes a new instance of the class with + the specified message. + + + + + + Constructor + + A message to include with the exception. + A nested exception to include. + + + Initializes a new instance of the class + with the specified message and inner exception. + + + + + + Serialization constructor + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + + + Initializes a new instance of the class + with serialized data. + + + + + + Locking model base class + + + + Base class for the locking models available to the derived loggers. + + + + + + Open the output file + + The filename to use + Whether to append to the file, or overwrite + The encoding to use + + + Open the file specified and prepare for logging. + No writes will be made until is called. + Must be called before any calls to , + and . + + + + + + Close the file + + + + Close the file. No further writes will be made. + + + + + + Acquire the lock on the file + + A stream that is ready to be written to. + + + Acquire the lock on the file in preparation for writing to it. + Return a stream pointing to the file. + must be called to release the lock on the output file. + + + + + + Release the lock on the file + + + + Release the lock on the file. No further writes will be made to the + stream until is called again. + + + + + + Helper method that creates a FileStream under CurrentAppender's SecurityContext. + + + + Typically called during OpenFile or AcquireLock. + + + If the directory portion of the does not exist, it is created + via Directory.CreateDirecctory. + + + + + + + + + + Helper method to close under CurrentAppender's SecurityContext. + + + Does not set to null. + + + + + + Gets or sets the for this LockingModel + + + The for this LockingModel + + + + The file appender this locking model is attached to and working on + behalf of. + + + The file appender is used to locate the security context and the error handler to use. + + + The value of this property will be set before is + called. + + + + + + Hold an exclusive lock on the output file + + + + Open the file once for writing and hold it open until is called. + Maintains an exclusive lock on the file during this time. + + + + + + Open the file specified and prepare for logging. + + The filename to use + Whether to append to the file, or overwrite + The encoding to use + + + Open the file specified and prepare for logging. + No writes will be made until is called. + Must be called before any calls to , + and . + + + + + + Close the file + + + + Close the file. No further writes will be made. + + + + + + Acquire the lock on the file + + A stream that is ready to be written to. + + + Does nothing. The lock is already taken + + + + + + Release the lock on the file + + + + Does nothing. The lock will be released when the file is closed. + + + + + + Acquires the file lock for each write + + + + Opens the file once for each / cycle, + thus holding the lock for the minimal amount of time. This method of locking + is considerably slower than but allows + other processes to move/delete the log file whilst logging continues. + + + + + + Prepares to open the file when the first message is logged. + + The filename to use + Whether to append to the file, or overwrite + The encoding to use + + + Open the file specified and prepare for logging. + No writes will be made until is called. + Must be called before any calls to , + and . + + + + + + Close the file + + + + Close the file. No further writes will be made. + + + + + + Acquire the lock on the file + + A stream that is ready to be written to. + + + Acquire the lock on the file in preparation for writing to it. + Return a stream pointing to the file. + must be called to release the lock on the output file. + + + + + + Release the lock on the file + + + + Release the lock on the file. No further writes will be made to the + stream until is called again. + + + + + + Provides cross-process file locking. + + Ron Grabowski + Steve Wranovsky + + + + Open the file specified and prepare for logging. + + The filename to use + Whether to append to the file, or overwrite + The encoding to use + + + Open the file specified and prepare for logging. + No writes will be made until is called. + Must be called before any calls to , + - and . + + + + + + Close the file + + + + Close the file. No further writes will be made. + + + + + + Acquire the lock on the file + + A stream that is ready to be written to. + + + Does nothing. The lock is already taken + + + + + + + + + + + This appender forwards logging events to attached appenders. + + + + The forwarding appender can be used to specify different thresholds + and filters for the same appender at different locations within the hierarchy. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Closes the appender and releases resources. + + + + Releases any resources allocated within the appender such as file handles, + network connections, etc. + + + It is a programming error to append to a closed appender. + + + + + + Forward the logging event to the attached appenders + + The event to log. + + + Delivers the logging event to all the attached appenders. + + + + + + Forward the logging events to the attached appenders + + The array of events to log. + + + Delivers the logging events to all the attached appenders. + + + + + + Adds an to the list of appenders of this + instance. + + The to add to this appender. + + + If the specified is already in the list of + appenders, then it won't be added again. + + + + + + Looks for the appender with the specified name. + + The name of the appender to lookup. + + The appender with the specified name, or null. + + + + Get the named appender attached to this appender. + + + + + + Removes all previously added appenders from this appender. + + + + This is useful when re-reading configuration information. + + + + + + Removes the specified appender from the list of appenders. + + The appender to remove. + The appender removed from the list + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + Removes the appender with the specified name from the list of appenders. + + The name of the appender to remove. + The appender removed from the list + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + Implementation of the interface + + + + + Gets the appenders contained in this appender as an + . + + + If no appenders can be found, then an + is returned. + + + A collection of the appenders in this appender. + + + + + Logs events to a local syslog service. + + + + This appender uses the POSIX libc library functions openlog, syslog, and closelog. + If these functions are not available on the local system then this appender will not work! + + + The functions openlog, syslog, and closelog are specified in SUSv2 and + POSIX 1003.1-2001 standards. These are used to log messages to the local syslog service. + + + This appender talks to a local syslog service. If you need to log to a remote syslog + daemon and you cannot configure your local syslog service to do this you may be + able to use the to log via UDP. + + + Syslog messages must have a facility and and a severity. The severity + is derived from the Level of the logging event. + The facility must be chosen from the set of defined syslog + values. The facilities list is predefined + and cannot be extended. + + + An identifier is specified with each log message. This can be specified + by setting the property. The identity (also know + as the tag) must not contain white space. The default value for the + identity is the application name (from ). + + + Rob Lyon + Nicko Cadell + + + + Initializes a new instance of the class. + + + This instance of the class is set up to write + to a local syslog service. + + + + + Add a mapping of level to severity + + The mapping to add + + + Adds a to this appender. + + + + + + Initialize the appender based on the options set. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + This method is called by the method. + + The event to log. + + + Writes the event to a remote syslog daemon. + + + The format of the output will depend on the appender's layout. + + + + + + Close the syslog when the appender is closed + + + + Close the syslog when the appender is closed + + + + + + Translates a log4net level to a syslog severity. + + A log4net level. + A syslog severity. + + + Translates a log4net level to a syslog severity. + + + + + + Generate a syslog priority. + + The syslog facility. + The syslog severity. + A syslog priority. + + + + The facility. The default facility is . + + + + + The message identity + + + + + Marshaled handle to the identity string. We have to hold on to the + string as the openlog and syslog APIs just hold the + pointer to the ident and dereference it for each log message. + + + + + Mapping from level object to syslog severity + + + + + Open connection to system logger. + + + + + Generate a log message. + + + + The libc syslog method takes a format string and a variable argument list similar + to the classic printf function. As this type of vararg list is not supported + by C# we need to specify the arguments explicitly. Here we have specified the + format string with a single message argument. The caller must set the format + string to "%s". + + + + + + Close descriptor used to write to system logger. + + + + + Message identity + + + + An identifier is specified with each log message. This can be specified + by setting the property. The identity (also know + as the tag) must not contain white space. The default value for the + identity is the application name (from ). + + + + + + Syslog facility + + + Set to one of the values. The list of + facilities is predefined and cannot be extended. The default value + is . + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + syslog severities + + + + The log4net Level maps to a syslog severity using the + method and the + class. The severity is set on . + + + + + + system is unusable + + + + + action must be taken immediately + + + + + critical conditions + + + + + error conditions + + + + + warning conditions + + + + + normal but significant condition + + + + + informational + + + + + debug-level messages + + + + + syslog facilities + + + + The syslog facility defines which subsystem the logging comes from. + This is set on the property. + + + + + + kernel messages + + + + + random user-level messages + + + + + mail system + + + + + system daemons + + + + + security/authorization messages + + + + + messages generated internally by syslogd + + + + + line printer subsystem + + + + + network news subsystem + + + + + UUCP subsystem + + + + + clock (cron/at) daemon + + + + + security/authorization messages (private) + + + + + ftp daemon + + + + + NTP subsystem + + + + + log audit + + + + + log alert + + + + + clock daemon + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + A class to act as a mapping between the level that a logging call is made at and + the syslog severity that is should be logged at. + + + + A class to act as a mapping between the level that a logging call is made at and + the syslog severity that is should be logged at. + + + + + + The mapped syslog severity for the specified level + + + + Required property. + The mapped syslog severity for the specified level + + + + + + Stores logging events in an array. + + + + The memory appender stores all the logging events + that are appended in an in-memory array. + + + Use the method to get + the current list of events that have been appended. + + + Use the method to clear the + current list of events. + + + Julian Biddle + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Gets the events that have been logged. + + The events that have been logged + + + Gets the events that have been logged. + + + + + + This method is called by the method. + + the event to log + + Stores the in the events list. + + + + + Clear the list of events + + + Clear the list of events + + + + + The list of events that have been appended. + + + + + Value indicating which fields in the event should be fixed + + + By default all fields are fixed + + + + + Gets or sets a value indicating whether only part of the logging event + data should be fixed. + + + true if the appender should only fix part of the logging event + data, otherwise false. The default is false. + + + + Setting this property to true will cause only part of the event + data to be fixed and stored in the appender, hereby improving performance. + + + See for more information. + + + + + + Gets or sets the fields that will be fixed in the event + + + + The logging event needs to have certain thread specific values + captured before it can be buffered. See + for details. + + + + + + Logs entries by sending network messages using the + native function. + + + + You can send messages only to names that are active + on the network. If you send the message to a user name, + that user must be logged on and running the Messenger + service to receive the message. + + + The receiver will get a top most window displaying the + messages one at a time, therefore this appender should + not be used to deliver a high volume of messages. + + + The following table lists some possible uses for this appender : + + + + + Action + Property Value(s) + + + Send a message to a user account on the local machine + + + = <name of the local machine> + + + = <user name> + + + + + Send a message to a user account on a remote machine + + + = <name of the remote machine> + + + = <user name> + + + + + Send a message to a domain user account + + + = <name of a domain controller | uninitialized> + + + = <user name> + + + + + Send a message to all the names in a workgroup or domain + + + = <workgroup name | domain name>* + + + + + Send a message from the local machine to a remote machine + + + = <name of the local machine | uninitialized> + + + = <name of the remote machine> + + + + + + + Note : security restrictions apply for sending + network messages, see + for more information. + + + + + An example configuration section to log information + using this appender from the local machine, named + LOCAL_PC, to machine OPERATOR_PC : + + + + + + + + + + Nicko Cadell + Gert Driesen + + + + The DNS or NetBIOS name of the server on which the function is to execute. + + + + + The sender of the network message. + + + + + The message alias to which the message should be sent. + + + + + The security context to use for privileged calls + + + + + Initializes the appender. + + + The default constructor initializes all fields to their default values. + + + + + Initialize the appender based on the options set. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + The appender will be ignored if no was specified. + + + The required property was not specified. + + + + This method is called by the method. + + The event to log. + + + Sends the event using a network message. + + + + + + Sends a buffer of information to a registered message alias. + + The DNS or NetBIOS name of the server on which the function is to execute. + The message alias to which the message buffer should be sent + The originator of the message. + The message text. + The length, in bytes, of the message text. + + + The following restrictions apply for sending network messages: + + + + + Platform + Requirements + + + Windows NT + + + No special group membership is required to send a network message. + + + Admin, Accounts, Print, or Server Operator group membership is required to + successfully send a network message on a remote server. + + + + + Windows 2000 or later + + + If you send a message on a domain controller that is running Active Directory, + access is allowed or denied based on the access control list (ACL) for the securable + object. The default ACL permits only Domain Admins and Account Operators to send a network message. + + + On a member server or workstation, only Administrators and Server Operators can send a network message. + + + + + + + For more information see Security Requirements for the Network Management Functions. + + + + + If the function succeeds, the return value is zero. + + + + + + Gets or sets the sender of the message. + + + The sender of the message. + + + If this property is not specified, the message is sent from the local computer. + + + + + Gets or sets the message alias to which the message should be sent. + + + The recipient of the message. + + + This property should always be specified in order to send a message. + + + + + Gets or sets the DNS or NetBIOS name of the remote server on which the function is to execute. + + + DNS or NetBIOS name of the remote server on which the function is to execute. + + + + For Windows NT 4.0 and earlier, the string should begin with \\. + + + If this property is not specified, the local computer is used. + + + + + + Gets or sets the used to call the NetSend method. + + + The used to call the NetSend method. + + + + Unless a specified here for this appender + the is queried for the + security context to use. The default behavior is to use the security context + of the current thread. + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Appends log events to the OutputDebugString system. + + + + OutputDebugStringAppender appends log events to the + OutputDebugString system. + + + The string is passed to the native OutputDebugString + function. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Write the logging event to the output debug string API + + the event to log + + + Write the logging event to the output debug string API + + + + + + Stub for OutputDebugString native method + + the string to output + + + Stub for OutputDebugString native method + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Logs events to a remote syslog daemon. + + + + The BSD syslog protocol is used to remotely log to + a syslog daemon. The syslogd listens for for messages + on UDP port 514. + + + The syslog UDP protocol is not authenticated. Most syslog daemons + do not accept remote log messages because of the security implications. + You may be able to use the LocalSyslogAppender to talk to a local + syslog service. + + + There is an RFC 3164 that claims to document the BSD Syslog Protocol. + This RFC can be seen here: http://www.faqs.org/rfcs/rfc3164.html. + This appender generates what the RFC calls an "Original Device Message", + i.e. does not include the TIMESTAMP or HOSTNAME fields. By observation + this format of message will be accepted by all current syslog daemon + implementations. The daemon will attach the current time and the source + hostname or IP address to any messages received. + + + Syslog messages must have a facility and and a severity. The severity + is derived from the Level of the logging event. + The facility must be chosen from the set of defined syslog + values. The facilities list is predefined + and cannot be extended. + + + An identifier is specified with each log message. This can be specified + by setting the property. The identity (also know + as the tag) must not contain white space. The default value for the + identity is the application name (from ). + + + Rob Lyon + Nicko Cadell + + + + Sends logging events as connectionless UDP datagrams to a remote host or a + multicast group using an . + + + + UDP guarantees neither that messages arrive, nor that they arrive in the correct order. + + + To view the logging results, a custom application can be developed that listens for logging + events. + + + When decoding events send via this appender remember to use the same encoding + to decode the events as was used to send the events. See the + property to specify the encoding to use. + + + + This example shows how to log receive logging events that are sent + on IP address 244.0.0.1 and port 8080 to the console. The event is + encoded in the packet as a unicode string and it is decoded as such. + + IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Any, 0); + UdpClient udpClient; + byte[] buffer; + string loggingEvent; + + try + { + udpClient = new UdpClient(8080); + + while(true) + { + buffer = udpClient.Receive(ref remoteEndPoint); + loggingEvent = System.Text.Encoding.Unicode.GetString(buffer); + Console.WriteLine(loggingEvent); + } + } + catch(Exception e) + { + Console.WriteLine(e.ToString()); + } + + + Dim remoteEndPoint as IPEndPoint + Dim udpClient as UdpClient + Dim buffer as Byte() + Dim loggingEvent as String + + Try + remoteEndPoint = new IPEndPoint(IPAddress.Any, 0) + udpClient = new UdpClient(8080) + + While True + buffer = udpClient.Receive(ByRef remoteEndPoint) + loggingEvent = System.Text.Encoding.Unicode.GetString(buffer) + Console.WriteLine(loggingEvent) + Wend + Catch e As Exception + Console.WriteLine(e.ToString()) + End Try + + + An example configuration section to log information using this appender to the + IP 224.0.0.1 on port 8080: + + + + + + + + + + Gert Driesen + Nicko Cadell + + + + Initializes a new instance of the class. + + + The default constructor initializes all fields to their default values. + + + + + Initialize the appender based on the options set. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + The appender will be ignored if no was specified or + an invalid remote or local TCP port number was specified. + + + The required property was not specified. + The TCP port number assigned to or is less than or greater than . + + + + This method is called by the method. + + The event to log. + + + Sends the event using an UDP datagram. + + + Exceptions are passed to the . + + + + + + Closes the UDP connection and releases all resources associated with + this instance. + + + + Disables the underlying and releases all managed + and unmanaged resources associated with the . + + + + + + Initializes the underlying connection. + + + + The underlying is initialized and binds to the + port number from which you intend to communicate. + + + Exceptions are passed to the . + + + + + + The IP address of the remote host or multicast group to which + the logging event will be sent. + + + + + The TCP port number of the remote host or multicast group to + which the logging event will be sent. + + + + + The cached remote endpoint to which the logging events will be sent. + + + + + The TCP port number from which the will communicate. + + + + + The instance that will be used for sending the + logging events. + + + + + The encoding to use for the packet. + + + + + Gets or sets the IP address of the remote host or multicast group to which + the underlying should sent the logging event. + + + The IP address of the remote host or multicast group to which the logging event + will be sent. + + + + Multicast addresses are identified by IP class D addresses (in the range 224.0.0.0 to + 239.255.255.255). Multicast packets can pass across different networks through routers, so + it is possible to use multicasts in an Internet scenario as long as your network provider + supports multicasting. + + + Hosts that want to receive particular multicast messages must register their interest by joining + the multicast group. Multicast messages are not sent to networks where no host has joined + the multicast group. Class D IP addresses are used for multicast groups, to differentiate + them from normal host addresses, allowing nodes to easily detect if a message is of interest. + + + Static multicast addresses that are needed globally are assigned by IANA. A few examples are listed in the table below: + + + + + IP Address + Description + + + 224.0.0.1 + + + Sends a message to all system on the subnet. + + + + + 224.0.0.2 + + + Sends a message to all routers on the subnet. + + + + + 224.0.0.12 + + + The DHCP server answers messages on the IP address 224.0.0.12, but only on a subnet. + + + + + + + A complete list of actually reserved multicast addresses and their owners in the ranges + defined by RFC 3171 can be found at the IANA web site. + + + The address range 239.0.0.0 to 239.255.255.255 is reserved for administrative scope-relative + addresses. These addresses can be reused with other local groups. Routers are typically + configured with filters to prevent multicast traffic in this range from flowing outside + of the local network. + + + + + + Gets or sets the TCP port number of the remote host or multicast group to which + the underlying should sent the logging event. + + + An integer value in the range to + indicating the TCP port number of the remote host or multicast group to which the logging event + will be sent. + + + The underlying will send messages to this TCP port number + on the remote host or multicast group. + + The value specified is less than or greater than . + + + + Gets or sets the TCP port number from which the underlying will communicate. + + + An integer value in the range to + indicating the TCP port number from which the underlying will communicate. + + + + The underlying will bind to this port for sending messages. + + + Setting the value to 0 (the default) will cause the udp client not to bind to + a local port. + + + The value specified is less than or greater than . + + + + Gets or sets used to write the packets. + + + The used to write the packets. + + + + The used to write the packets. + + + + + + Gets or sets the underlying . + + + The underlying . + + + creates a to send logging events + over a network. Classes deriving from can use this + property to get or set this . Use the underlying + returned from if you require access beyond that which + provides. + + + + + Gets or sets the cached remote endpoint to which the logging events should be sent. + + + The cached remote endpoint to which the logging events will be sent. + + + The method will initialize the remote endpoint + with the values of the and + properties. + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Syslog port 514 + + + + + Initializes a new instance of the class. + + + This instance of the class is set up to write + to a remote syslog daemon. + + + + + Add a mapping of level to severity + + The mapping to add + + + Add a mapping to this appender. + + + + + + This method is called by the method. + + The event to log. + + + Writes the event to a remote syslog daemon. + + + The format of the output will depend on the appender's layout. + + + + + + Initialize the options for this appender + + + + Initialize the level to syslog severity mappings set on this appender. + + + + + + Translates a log4net level to a syslog severity. + + A log4net level. + A syslog severity. + + + Translates a log4net level to a syslog severity. + + + + + + Generate a syslog priority. + + The syslog facility. + The syslog severity. + A syslog priority. + + + Generate a syslog priority. + + + + + + The facility. The default facility is . + + + + + The message identity + + + + + Mapping from level object to syslog severity + + + + + Message identity + + + + An identifier is specified with each log message. This can be specified + by setting the property. The identity (also know + as the tag) must not contain white space. The default value for the + identity is the application name (from ). + + + + + + Syslog facility + + + Set to one of the values. The list of + facilities is predefined and cannot be extended. The default value + is . + + + + + syslog severities + + + + The syslog severities. + + + + + + system is unusable + + + + + action must be taken immediately + + + + + critical conditions + + + + + error conditions + + + + + warning conditions + + + + + normal but significant condition + + + + + informational + + + + + debug-level messages + + + + + syslog facilities + + + + The syslog facilities + + + + + + kernel messages + + + + + random user-level messages + + + + + mail system + + + + + system daemons + + + + + security/authorization messages + + + + + messages generated internally by syslogd + + + + + line printer subsystem + + + + + network news subsystem + + + + + UUCP subsystem + + + + + clock (cron/at) daemon + + + + + security/authorization messages (private) + + + + + ftp daemon + + + + + NTP subsystem + + + + + log audit + + + + + log alert + + + + + clock daemon + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + A class to act as a mapping between the level that a logging call is made at and + the syslog severity that is should be logged at. + + + + A class to act as a mapping between the level that a logging call is made at and + the syslog severity that is should be logged at. + + + + + + The mapped syslog severity for the specified level + + + + Required property. + The mapped syslog severity for the specified level + + + + + + Delivers logging events to a remote logging sink. + + + + This Appender is designed to deliver events to a remote sink. + That is any object that implements the + interface. It delivers the events using .NET remoting. The + object to deliver events to is specified by setting the + appenders property. + + The RemotingAppender buffers events before sending them. This allows it to + make more efficient use of the remoting infrastructure. + + Once the buffer is full the events are still not sent immediately. + They are scheduled to be sent using a pool thread. The effect is that + the send occurs asynchronously. This is very important for a + number of non obvious reasons. The remoting infrastructure will + flow thread local variables (stored in the ), + if they are marked as , across the + remoting boundary. If the server is not contactable then + the remoting infrastructure will clear the + objects from the . To prevent a logging failure from + having side effects on the calling application the remoting call must be made + from a separate thread to the one used by the application. A + thread is used for this. If no thread is available then + the events will block in the thread pool manager until a thread is available. + + Because the events are sent asynchronously using pool threads it is possible to close + this appender before all the queued events have been sent. + When closing the appender attempts to wait until all the queued events have been sent, but + this will timeout after 30 seconds regardless. + + If this appender is being closed because the + event has fired it may not be possible to send all the queued events. During process + exit the runtime limits the time that a + event handler is allowed to run for. If the runtime terminates the threads before + the queued events have been sent then they will be lost. To ensure that all events + are sent the appender must be closed before the application exits. See + for details on how to shutdown + log4net programmatically. + + + Nicko Cadell + Gert Driesen + Daniel Cazzulino + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Initialize the appender based on the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Send the contents of the buffer to the remote sink. + + + The events are not sent immediately. They are scheduled to be sent + using a pool thread. The effect is that the send occurs asynchronously. + This is very important for a number of non obvious reasons. The remoting + infrastructure will flow thread local variables (stored in the ), + if they are marked as , across the + remoting boundary. If the server is not contactable then + the remoting infrastructure will clear the + objects from the . To prevent a logging failure from + having side effects on the calling application the remoting call must be made + from a separate thread to the one used by the application. A + thread is used for this. If no thread is available then + the events will block in the thread pool manager until a thread is available. + + The events to send. + + + + Override base class close. + + + + This method waits while there are queued work items. The events are + sent asynchronously using work items. These items + will be sent once a thread pool thread is available to send them, therefore + it is possible to close the appender before all the queued events have been + sent. + + This method attempts to wait until all the queued events have been sent, but this + method will timeout after 30 seconds regardless. + + If the appender is being closed because the + event has fired it may not be possible to send all the queued events. During process + exit the runtime limits the time that a + event handler is allowed to run for. + + + + + A work item is being queued into the thread pool + + + + + A work item from the thread pool has completed + + + + + Send the contents of the buffer to the remote sink. + + + This method is designed to be used with the . + This method expects to be passed an array of + objects in the state param. + + the logging events to send + + + + The URL of the remote sink. + + + + + The local proxy (.NET remoting) for the remote logging sink. + + + + + The number of queued callbacks currently waiting or executing + + + + + Event used to signal when there are no queued work items + + + This event is set when there are no queued work items. In this + state it is safe to close the appender. + + + + + Gets or sets the URL of the well-known object that will accept + the logging events. + + + The well-known URL of the remote sink. + + + + The URL of the remoting sink that will accept logging events. + The sink must implement the + interface. + + + + + + Interface used to deliver objects to a remote sink. + + + This interface must be implemented by a remoting sink + if the is to be used + to deliver logging events to the sink. + + + + + Delivers logging events to the remote sink + + Array of events to log. + + + Delivers logging events to the remote sink + + + + + + Appender that rolls log files based on size or date or both. + + + + RollingFileAppender can roll log files based on size or date or both + depending on the setting of the property. + When set to the log file will be rolled + once its size exceeds the . + When set to the log file will be rolled + once the date boundary specified in the property + is crossed. + When set to the log file will be + rolled once the date boundary specified in the property + is crossed, but within a date boundary the file will also be rolled + once its size exceeds the . + When set to the log file will be rolled when + the appender is configured. This effectively means that the log file can be + rolled once per program execution. + + + A of few additional optional features have been added: + + Attach date pattern for current log file + Backup number increments for newer files + Infinite number of backups by file size + + + + + + For large or infinite numbers of backup files a + greater than zero is highly recommended, otherwise all the backup files need + to be renamed each time a new backup is created. + + + When Date/Time based rolling is used setting + to will reduce the number of file renamings to few or none. + + + + + + Changing or without clearing + the log file directory of backup files will cause unexpected and unwanted side effects. + + + + + If Date/Time based rolling is enabled this appender will attempt to roll existing files + in the directory without a Date/Time tag based on the last write date of the base log file. + The appender only rolls the log file when a message is logged. If Date/Time based rolling + is enabled then the appender will not roll the log file at the Date/Time boundary but + at the point when the next message is logged after the boundary has been crossed. + + + + The extends the and + has the same behavior when opening the log file. + The appender will first try to open the file for writing when + is called. This will typically be during configuration. + If the file cannot be opened for writing the appender will attempt + to open the file again each time a message is logged to the appender. + If the file cannot be opened for writing when a message is logged then + the message will be discarded by this appender. + + + When rolling a backup file necessitates deleting an older backup file the + file to be deleted is moved to a temporary name before being deleted. + + + + + A maximum number of backup files when rolling on date/time boundaries is not supported. + + + + Nicko Cadell + Gert Driesen + Aspi Havewala + Douglas de la Torre + Edward Smit + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + The fully qualified type of the RollingFileAppender class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Sets the quiet writer being used. + + + This method can be overridden by sub classes. + + the writer to set + + + + Write out a logging event. + + the event to write to file. + + + Handles append time behavior for RollingFileAppender. This checks + if a roll over either by date (checked first) or time (checked second) + is need and then appends to the file last. + + + + + + Write out an array of logging events. + + the events to write to file. + + + Handles append time behavior for RollingFileAppender. This checks + if a roll over either by date (checked first) or time (checked second) + is need and then appends to the file last. + + + + + + Performs any required rolling before outputting the next event + + + + Handles append time behavior for RollingFileAppender. This checks + if a roll over either by date (checked first) or time (checked second) + is need and then appends to the file last. + + + + + + Creates and opens the file for logging. If + is false then the fully qualified name is determined and used. + + the name of the file to open + true to append to existing file + + This method will ensure that the directory structure + for the specified exists. + + + + + Get the current output file name + + the base file name + the output file name + + The output file name is based on the base fileName specified. + If is set then the output + file name is the same as the base file passed in. Otherwise + the output file depends on the date pattern, on the count + direction or both. + + + + + Determines curSizeRollBackups (only within the current roll point) + + + + + Generates a wildcard pattern that can be used to find all files + that are similar to the base file name. + + + + + + + Builds a list of filenames for all files matching the base filename plus a file + pattern. + + + + + + + Initiates a roll over if needed for crossing a date boundary since the last run. + + + + + Initializes based on existing conditions at time of . + + + + Initializes based on existing conditions at time of . + The following is done + + determine curSizeRollBackups (only within the current roll point) + initiates a roll over if needed for crossing a date boundary since the last run. + + + + + + + Does the work of bumping the 'current' file counter higher + to the highest count when an incremental file name is seen. + The highest count is either the first file (when count direction + is greater than 0) or the last file (when count direction less than 0). + In either case, we want to know the highest count that is present. + + + + + + + Attempts to extract a number from the end of the file name that indicates + the number of the times the file has been rolled over. + + + Certain date pattern extensions like yyyyMMdd will be parsed as valid backup indexes. + + + + + + + Takes a list of files and a base file name, and looks for + 'incremented' versions of the base file. Bumps the max + count up to the highest count seen. + + + + + + + Calculates the RollPoint for the datePattern supplied. + + the date pattern to calculate the check period for + The RollPoint that is most accurate for the date pattern supplied + + Essentially the date pattern is examined to determine what the + most suitable roll point is. The roll point chosen is the roll point + with the smallest period that can be detected using the date pattern + supplied. i.e. if the date pattern only outputs the year, month, day + and hour then the smallest roll point that can be detected would be + and hourly roll point as minutes could not be detected. + + + + + Initialize the appender based on the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + Sets initial conditions including date/time roll over information, first check, + scheduledFilename, and calls to initialize + the current number of backups. + + + + + + + + + .1, .2, .3, etc. + + + + + Rollover the file(s) to date/time tagged file(s). + + set to true if the file to be rolled is currently open + + + Rollover the file(s) to date/time tagged file(s). + Resets curSizeRollBackups. + If fileIsOpen is set then the new file is opened (through SafeOpenFile). + + + + + + Renames file to file . + + Name of existing file to roll. + New name for file. + + + Renames file to file . It + also checks for existence of target file and deletes if it does. + + + + + + Test if a file exists at a specified path + + the path to the file + true if the file exists + + + Test if a file exists at a specified path + + + + + + Deletes the specified file if it exists. + + The file to delete. + + + Delete a file if is exists. + The file is first moved to a new filename then deleted. + This allows the file to be removed even when it cannot + be deleted, but it still can be moved. + + + + + + Implements file roll base on file size. + + + + If the maximum number of size based backups is reached + (curSizeRollBackups == maxSizeRollBackups) then the oldest + file is deleted -- its index determined by the sign of countDirection. + If countDirection < 0, then files + {File.1, ..., File.curSizeRollBackups -1} + are renamed to {File.2, ..., + File.curSizeRollBackups}. Moreover, File is + renamed File.1 and closed. + + + A new file is created to receive further log output. + + + If maxSizeRollBackups is equal to zero, then the + File is truncated with no backup files created. + + + If maxSizeRollBackups < 0, then File is + renamed if needed and no files are deleted. + + + + + + Implements file roll. + + the base name to rename + + + If the maximum number of size based backups is reached + (curSizeRollBackups == maxSizeRollBackups) then the oldest + file is deleted -- its index determined by the sign of countDirection. + If countDirection < 0, then files + {File.1, ..., File.curSizeRollBackups -1} + are renamed to {File.2, ..., + File.curSizeRollBackups}. + + + If maxSizeRollBackups is equal to zero, then the + File is truncated with no backup files created. + + + If maxSizeRollBackups < 0, then File is + renamed if needed and no files are deleted. + + + This is called by to rename the files. + + + + + + Get the start time of the next window for the current rollpoint + + the current date + the type of roll point we are working with + the start time for the next roll point an interval after the currentDateTime date + + + Returns the date of the next roll point after the currentDateTime date passed to the method. + + + The basic strategy is to subtract the time parts that are less significant + than the rollpoint from the current time. This should roll the time back to + the start of the time window for the current rollpoint. Then we add 1 window + worth of time and get the start time of the next window for the rollpoint. + + + + + + This object supplies the current date/time. Allows test code to plug in + a method to control this class when testing date/time based rolling. The default + implementation uses the underlying value of DateTime.Now. + + + + + The date pattern. By default, the pattern is set to ".yyyy-MM-dd" + meaning daily rollover. + + + + + The actual formatted filename that is currently being written to + or will be the file transferred to on roll over + (based on staticLogFileName). + + + + + The timestamp when we shall next recompute the filename. + + + + + Holds date of last roll over + + + + + The type of rolling done + + + + + The default maximum file size is 10MB + + + + + There is zero backup files by default + + + + + How many sized based backups have been made so far + + + + + The rolling file count direction. + + + + + The rolling mode used in this appender. + + + + + Cache flag set if we are rolling by date. + + + + + Cache flag set if we are rolling by size. + + + + + Value indicating whether to always log to the same file. + + + + + Value indicating whether to preserve the file name extension when rolling. + + + + + FileName provided in configuration. Used for rolling properly + + + + + The 1st of January 1970 in UTC + + + + + Gets or sets the strategy for determining the current date and time. The default + implementation is to use LocalDateTime which internally calls through to DateTime.Now. + DateTime.UtcNow may be used on frameworks newer than .NET 1.0 by specifying + . + + + An implementation of the interface which returns the current date and time. + + + + Gets or sets the used to return the current date and time. + + + There are two built strategies for determining the current date and time, + + and . + + + The default strategy is . + + + + + + Gets or sets the date pattern to be used for generating file names + when rolling over on date. + + + The date pattern to be used for generating file names when rolling + over on date. + + + + Takes a string in the same format as expected by + . + + + This property determines the rollover schedule when rolling over + on date. + + + + + + Gets or sets the maximum number of backup files that are kept before + the oldest is erased. + + + The maximum number of backup files that are kept before the oldest is + erased. + + + + If set to zero, then there will be no backup files and the log file + will be truncated when it reaches . + + + If a negative number is supplied then no deletions will be made. Note + that this could result in very slow performance as a large number of + files are rolled over unless is used. + + + The maximum applies to each time based group of files and + not the total. + + + + + + Gets or sets the maximum size that the output file is allowed to reach + before being rolled over to backup files. + + + The maximum size in bytes that the output file is allowed to reach before being + rolled over to backup files. + + + + This property is equivalent to except + that it is required for differentiating the setter taking a + argument from the setter taking a + argument. + + + The default maximum file size is 10MB (10*1024*1024). + + + + + + Gets or sets the maximum size that the output file is allowed to reach + before being rolled over to backup files. + + + The maximum size that the output file is allowed to reach before being + rolled over to backup files. + + + + This property allows you to specify the maximum size with the + suffixes "KB", "MB" or "GB" so that the size is interpreted being + expressed respectively in kilobytes, megabytes or gigabytes. + + + For example, the value "10KB" will be interpreted as 10240 bytes. + + + The default maximum file size is 10MB. + + + If you have the option to set the maximum file size programmatically + consider using the property instead as this + allows you to set the size in bytes as a . + + + + + + Gets or sets the rolling file count direction. + + + The rolling file count direction. + + + + Indicates if the current file is the lowest numbered file or the + highest numbered file. + + + By default newer files have lower numbers ( < 0), + i.e. log.1 is most recent, log.5 is the 5th backup, etc... + + + >= 0 does the opposite i.e. + log.1 is the first backup made, log.5 is the 5th backup made, etc. + For infinite backups use >= 0 to reduce + rollover costs. + + The default file count direction is -1. + + + + + Gets or sets the rolling style. + + The rolling style. + + + The default rolling style is . + + + When set to this appender's + property is set to false, otherwise + the appender would append to a single file rather than rolling + the file each time it is opened. + + + + + + Gets or sets a value indicating whether to preserve the file name extension when rolling. + + + true if the file name extension should be preserved. + + + + By default file.log is rolled to file.log.yyyy-MM-dd or file.log.curSizeRollBackup. + However, under Windows the new file name will loose any program associations as the + extension is changed. Optionally file.log can be renamed to file.yyyy-MM-dd.log or + file.curSizeRollBackup.log to maintain any program associations. + + + + + + Gets or sets a value indicating whether to always log to + the same file. + + + true if always should be logged to the same file, otherwise false. + + + + By default file.log is always the current file. Optionally + file.log.yyyy-mm-dd for current formatted datePattern can by the currently + logging file (or file.log.curSizeRollBackup or even + file.log.yyyy-mm-dd.curSizeRollBackup). + + + This will make time based rollovers with a large number of backups + much faster as the appender it won't have to rename all the backups! + + + + + + Style of rolling to use + + + + Style of rolling to use + + + + + + Roll files once per program execution + + + + Roll files once per program execution. + Well really once each time this appender is + configured. + + + Setting this option also sets AppendToFile to + false on the RollingFileAppender, otherwise + this appender would just be a normal file appender. + + + + + + Roll files based only on the size of the file + + + + + Roll files based only on the date + + + + + Roll files based on both the size and date of the file + + + + + The code assumes that the following 'time' constants are in a increasing sequence. + + + + The code assumes that the following 'time' constants are in a increasing sequence. + + + + + + Roll the log not based on the date + + + + + Roll the log for each minute + + + + + Roll the log for each hour + + + + + Roll the log twice a day (midday and midnight) + + + + + Roll the log each day (midnight) + + + + + Roll the log each week + + + + + Roll the log each month + + + + + This interface is used to supply Date/Time information to the . + + + This interface is used to supply Date/Time information to the . + Used primarily to allow test classes to plug themselves in so they can + supply test date/times. + + + + + Gets the current time. + + The current time. + + + Gets the current time. + + + + + + Default implementation of that returns the current time. + + + + + Gets the current time. + + The current time. + + + Gets the current time. + + + + + + Implementation of that returns the current time as the coordinated universal time (UTC). + + + + + Gets the current time. + + The current time. + + + Gets the current time. + + + + + + Send an e-mail when a specific logging event occurs, typically on errors + or fatal errors. + + + + The number of logging events delivered in this e-mail depend on + the value of option. The + keeps only the last + logging events in its + cyclic buffer. This keeps memory requirements at a reasonable level while + still delivering useful application context. + + + Authentication and setting the server Port are only available on the MS .NET 1.1 runtime. + For these features to be enabled you need to ensure that you are using a version of + the log4net assembly that is built against the MS .NET 1.1 framework and that you are + running the your application on the MS .NET 1.1 runtime. On all other platforms only sending + unauthenticated messages to a server listening on port 25 (the default) is supported. + + + Authentication is supported by setting the property to + either or . + If using authentication then the + and properties must also be set. + + + To set the SMTP server port use the property. The default port is 25. + + + Nicko Cadell + Gert Driesen + + + + Default constructor + + + + Default constructor + + + + + + Sends the contents of the cyclic buffer as an e-mail message. + + The logging events to send. + + + + Send the email message + + the body text to include in the mail + + + + Gets or sets a comma- or semicolon-delimited list of recipient e-mail addresses (use semicolon on .NET 1.1 and comma for later versions). + + + + For .NET 1.1 (System.Web.Mail): A semicolon-delimited list of e-mail addresses. + + + For .NET 2.0 (System.Net.Mail): A comma-delimited list of e-mail addresses. + + + + + For .NET 1.1 (System.Web.Mail): A semicolon-delimited list of e-mail addresses. + + + For .NET 2.0 (System.Net.Mail): A comma-delimited list of e-mail addresses. + + + + + + Gets or sets a comma- or semicolon-delimited list of recipient e-mail addresses + that will be carbon copied (use semicolon on .NET 1.1 and comma for later versions). + + + + For .NET 1.1 (System.Web.Mail): A semicolon-delimited list of e-mail addresses. + + + For .NET 2.0 (System.Net.Mail): A comma-delimited list of e-mail addresses. + + + + + For .NET 1.1 (System.Web.Mail): A semicolon-delimited list of e-mail addresses. + + + For .NET 2.0 (System.Net.Mail): A comma-delimited list of e-mail addresses. + + + + + + Gets or sets a semicolon-delimited list of recipient e-mail addresses + that will be blind carbon copied. + + + A semicolon-delimited list of e-mail addresses. + + + + A semicolon-delimited list of recipient e-mail addresses. + + + + + + Gets or sets the e-mail address of the sender. + + + The e-mail address of the sender. + + + + The e-mail address of the sender. + + + + + + Gets or sets the subject line of the e-mail message. + + + The subject line of the e-mail message. + + + + The subject line of the e-mail message. + + + + + + Gets or sets the name of the SMTP relay mail server to use to send + the e-mail messages. + + + The name of the e-mail relay server. If SmtpServer is not set, the + name of the local SMTP server is used. + + + + The name of the e-mail relay server. If SmtpServer is not set, the + name of the local SMTP server is used. + + + + + + Obsolete + + + Use the BufferingAppenderSkeleton Fix methods instead + + + + Obsolete property. + + + + + + The mode to use to authentication with the SMTP server + + + Authentication is only available on the MS .NET 1.1 runtime. + + Valid Authentication mode values are: , + , and . + The default value is . When using + you must specify the + and to use to authenticate. + When using the Windows credentials for the current + thread, if impersonating, or the process will be used to authenticate. + + + + + + The username to use to authenticate with the SMTP server + + + Authentication is only available on the MS .NET 1.1 runtime. + + A and must be specified when + is set to , + otherwise the username will be ignored. + + + + + + The password to use to authenticate with the SMTP server + + + Authentication is only available on the MS .NET 1.1 runtime. + + A and must be specified when + is set to , + otherwise the password will be ignored. + + + + + + The port on which the SMTP server is listening + + + Server Port is only available on the MS .NET 1.1 runtime. + + The port on which the SMTP server is listening. The default + port is 25. The Port can only be changed when running on + the MS .NET 1.1 runtime. + + + + + + Gets or sets the priority of the e-mail message + + + One of the values. + + + + Sets the priority of the e-mails generated by this + appender. The default priority is . + + + If you are using this appender to report errors then + you may want to set the priority to . + + + + + + Enable or disable use of SSL when sending e-mail message + + + This is available on MS .NET 2.0 runtime and higher + + + + + Gets or sets the reply-to e-mail address. + + + This is available on MS .NET 2.0 runtime and higher + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Values for the property. + + + + SMTP authentication modes. + + + + + + No authentication + + + + + Basic authentication. + + + Requires a username and password to be supplied + + + + + Integrated authentication + + + Uses the Windows credentials from the current thread or process to authenticate. + + + + + Send an email when a specific logging event occurs, typically on errors + or fatal errors. Rather than sending via smtp it writes a file into the + directory specified by . This allows services such + as the IIS SMTP agent to manage sending the messages. + + + + The configuration for this appender is identical to that of the SMTPAppender, + except that instead of specifying the SMTPAppender.SMTPHost you specify + . + + + The number of logging events delivered in this e-mail depend on + the value of option. The + keeps only the last + logging events in its + cyclic buffer. This keeps memory requirements at a reasonable level while + still delivering useful application context. + + + Niall Daley + Nicko Cadell + + + + Default constructor + + + + Default constructor + + + + + + Sends the contents of the cyclic buffer as an e-mail message. + + The logging events to send. + + + Sends the contents of the cyclic buffer as an e-mail message. + + + + + + Activate the options on this appender. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Convert a path into a fully qualified path. + + The path to convert. + The fully qualified path. + + + Converts the path specified to a fully + qualified path. If the path is relative it is + taken as relative from the application base + directory. + + + + + + The security context to use for privileged calls + + + + + Gets or sets a semicolon-delimited list of recipient e-mail addresses. + + + A semicolon-delimited list of e-mail addresses. + + + + A semicolon-delimited list of e-mail addresses. + + + + + + Gets or sets the e-mail address of the sender. + + + The e-mail address of the sender. + + + + The e-mail address of the sender. + + + + + + Gets or sets the subject line of the e-mail message. + + + The subject line of the e-mail message. + + + + The subject line of the e-mail message. + + + + + + Gets or sets the path to write the messages to. + + + + Gets or sets the path to write the messages to. This should be the same + as that used by the agent sending the messages. + + + + + + Gets or sets the used to write to the pickup directory. + + + The used to write to the pickup directory. + + + + Unless a specified here for this appender + the is queried for the + security context to use. The default behavior is to use the security context + of the current thread. + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Appender that allows clients to connect via Telnet to receive log messages + + + + The TelnetAppender accepts socket connections and streams logging messages + back to the client. + The output is provided in a telnet-friendly way so that a log can be monitored + over a TCP/IP socket. + This allows simple remote monitoring of application logging. + + + The default is 23 (the telnet port). + + + Keith Long + Nicko Cadell + + + + Default constructor + + + + Default constructor + + + + + + The fully qualified type of the TelnetAppender class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Overrides the parent method to close the socket handler + + + + Closes all the outstanding connections. + + + + + + Initialize the appender based on the options set. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + Create the socket handler and wait for connections + + + + + + Writes the logging event to each connected client. + + The event to log. + + + Writes the logging event to each connected client. + + + + + + Gets or sets the TCP port number on which this will listen for connections. + + + An integer value in the range to + indicating the TCP port number on which this will listen for connections. + + + + The default value is 23 (the telnet port). + + + The value specified is less than + or greater than . + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Helper class to manage connected clients + + + + The SocketHandler class is used to accept connections from + clients. It is threaded so that clients can connect/disconnect + asynchronously. + + + + + + Opens a new server port on + + the local port to listen on for connections + + + Creates a socket handler on the specified local server port. + + + + + + Sends a string message to each of the connected clients + + the text to send + + + Sends a string message to each of the connected clients + + + + + + Add a client to the internal clients list + + client to add + + + + Remove a client from the internal clients list + + client to remove + + + + Callback used to accept a connection on the server socket + + The result of the asynchronous operation + + + On connection adds to the list of connections + if there are two many open connections you will be disconnected + + + + + + Close all network connections + + + + Make sure we close all network connections + + + + + + Test if this handler has active connections + + + true if this handler has active connections + + + + This property will be true while this handler has + active connections, that is at least one connection that + the handler will attempt to send a message to. + + + + + + Class that represents a client connected to this handler + + + + Class that represents a client connected to this handler + + + + + + Create this for the specified + + the client's socket + + + Opens a stream writer on the socket. + + + + + + Write a string to the client + + string to send + + + Write a string to the client + + + + + + Cleanup the clients connection + + + + Close the socket connection. + + + + + + Appends log events to the system. + + + + The application configuration file can be used to control what listeners + are actually used. See the MSDN documentation for the + class for details on configuring the + trace system. + + + Events are written using the System.Diagnostics.Trace.Write(string,string) + method. The event's logger name is the default value for the category parameter + of the Write method. + + + Compact Framework
+ The Compact Framework does not support the + class for any operation except Assert. When using the Compact Framework this + appender will write to the system rather than + the Trace system. This appender will therefore behave like the . +
+
+ Douglas de la Torre + Nicko Cadell + Gert Driesen + Ron Grabowski +
+ + + Initializes a new instance of the . + + + + Default constructor. + + + + + + Initializes a new instance of the + with a specified layout. + + The layout to use with this appender. + + + Obsolete constructor. + + + + + + Writes the logging event to the system. + + The event to log. + + + Writes the logging event to the system. + + + + + + Immediate flush means that the underlying writer or output stream + will be flushed at the end of each append operation. + + + + Immediate flush is slower but ensures that each append request is + actually written. If is set to + false, then there is a good chance that the last few + logs events are not actually written to persistent media if and + when the application crashes. + + + The default value is true. + + + + + Defaults to %logger + + + + + Gets or sets a value that indicates whether the appender will + flush at the end of each write. + + + The default behavior is to flush at the end of each + write. If the option is set tofalse, then the underlying + stream can defer writing to physical medium to a later time. + + + Avoiding the flush operation at the end of each append results + in a performance gain of 10 to 20 percent. However, there is safety + trade-off involved in skipping flushing. Indeed, when flushing is + skipped, then it is likely that the last few log events will not + be recorded on disk when the application exits. This is a high + price to pay even for a 20% performance gain. + + + + + + The category parameter sent to the Trace method. + + + + Defaults to %logger which will use the logger name of the current + as the category parameter. + + + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Assembly level attribute that specifies a domain to alias to this assembly's repository. + + + + AliasDomainAttribute is obsolete. Use AliasRepositoryAttribute instead of AliasDomainAttribute. + + + An assembly's logger repository is defined by its , + however this can be overridden by an assembly loaded before the target assembly. + + + An assembly can alias another assembly's domain to its repository by + specifying this attribute with the name of the target domain. + + + This attribute can only be specified on the assembly and may be used + as many times as necessary to alias all the required domains. + + + Nicko Cadell + Gert Driesen + + + + Assembly level attribute that specifies a repository to alias to this assembly's repository. + + + + An assembly's logger repository is defined by its , + however this can be overridden by an assembly loaded before the target assembly. + + + An assembly can alias another assembly's repository to its repository by + specifying this attribute with the name of the target repository. + + + This attribute can only be specified on the assembly and may be used + as many times as necessary to alias all the required repositories. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class with + the specified repository to alias to this assembly's repository. + + The repository to alias to this assemby's repository. + + + Initializes a new instance of the class with + the specified repository to alias to this assembly's repository. + + + + + + Gets or sets the repository to alias to this assemby's repository. + + + The repository to alias to this assemby's repository. + + + + The name of the repository to alias to this assemby's repository. + + + + + + Initializes a new instance of the class with + the specified domain to alias to this assembly's repository. + + The domain to alias to this assemby's repository. + + + Obsolete. Use instead of . + + + + + + Use this class to quickly configure a . + + + + Allows very simple programmatic configuration of log4net. + + + Only one appender can be configured using this configurator. + The appender is set at the root of the hierarchy and all logging + events will be delivered to that appender. + + + Appenders can also implement the interface. Therefore + they would require that the method + be called after the appenders properties have been configured. + + + Nicko Cadell + Gert Driesen + + + + The fully qualified type of the BasicConfigurator class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to prevent instantiation of this class. + + + + + + Initializes the log4net system with a default configuration. + + + + Initializes the log4net logging system using a + that will write to Console.Out. The log messages are + formatted using the layout object + with the + layout style. + + + + + + Initializes the log4net system using the specified appender. + + The appender to use to log all logging events. + + + Initializes the log4net system using the specified appender. + + + + + + Initializes the log4net system using the specified appenders. + + The appenders to use to log all logging events. + + + Initializes the log4net system using the specified appenders. + + + + + + Initializes the with a default configuration. + + The repository to configure. + + + Initializes the specified repository using a + that will write to Console.Out. The log messages are + formatted using the layout object + with the + layout style. + + + + + + Initializes the using the specified appender. + + The repository to configure. + The appender to use to log all logging events. + + + Initializes the using the specified appender. + + + + + + Initializes the using the specified appenders. + + The repository to configure. + The appenders to use to log all logging events. + + + Initializes the using the specified appender. + + + + + + Base class for all log4net configuration attributes. + + + This is an abstract class that must be extended by + specific configurators. This attribute allows the + configurator to be parameterized by an assembly level + attribute. + + Nicko Cadell + Gert Driesen + + + + Constructor used by subclasses. + + the ordering priority for this configurator + + + The is used to order the configurator + attributes before they are invoked. Higher priority configurators are executed + before lower priority ones. + + + + + + Configures the for the specified assembly. + + The assembly that this attribute was defined on. + The repository to configure. + + + Abstract method implemented by a subclass. When this method is called + the subclass should configure the . + + + + + + Compare this instance to another ConfiguratorAttribute + + the object to compare to + see + + + Compares the priorities of the two instances. + Sorts by priority in descending order. Objects with the same priority are + randomly ordered. + + + + + + Assembly level attribute that specifies the logging domain for the assembly. + + + + DomainAttribute is obsolete. Use RepositoryAttribute instead of DomainAttribute. + + + Assemblies are mapped to logging domains. Each domain has its own + logging repository. This attribute specified on the assembly controls + the configuration of the domain. The property specifies the name + of the domain that this assembly is a part of. The + specifies the type of the repository objects to create for the domain. If + this attribute is not specified and a is not specified + then the assembly will be part of the default shared logging domain. + + + This attribute can only be specified on the assembly and may only be used + once per assembly. + + + Nicko Cadell + Gert Driesen + + + + Assembly level attribute that specifies the logging repository for the assembly. + + + + Assemblies are mapped to logging repository. This attribute specified + on the assembly controls + the configuration of the repository. The property specifies the name + of the repository that this assembly is a part of. The + specifies the type of the object + to create for the assembly. If this attribute is not specified or a + is not specified then the assembly will be part of the default shared logging repository. + + + This attribute can only be specified on the assembly and may only be used + once per assembly. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Initialize a new instance of the class + with the name of the repository. + + The name of the repository. + + + Initialize the attribute with the name for the assembly's repository. + + + + + + Gets or sets the name of the logging repository. + + + The string name to use as the name of the repository associated with this + assembly. + + + + This value does not have to be unique. Several assemblies can share the + same repository. They will share the logging configuration of the repository. + + + + + + Gets or sets the type of repository to create for this assembly. + + + The type of repository to create for this assembly. + + + + The type of the repository to create for the assembly. + The type must implement the + interface. + + + This will be the type of repository created when + the repository is created. If multiple assemblies reference the + same repository then the repository is only created once using the + of the first assembly to call into the + repository. + + + + + + Initializes a new instance of the class. + + + + Obsolete. Use RepositoryAttribute instead of DomainAttribute. + + + + + + Initialize a new instance of the class + with the name of the domain. + + The name of the domain. + + + Obsolete. Use RepositoryAttribute instead of DomainAttribute. + + + + + + Use this class to initialize the log4net environment using an Xml tree. + + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + Configures a using an Xml tree. + + + Nicko Cadell + Gert Driesen + + + + Private constructor + + + + + Automatically configures the log4net system based on the + application's configuration settings. + + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + Each application has a configuration file. This has the + same name as the application with '.config' appended. + This file is XML and calling this function prompts the + configurator to look in that file for a section called + log4net that contains the configuration data. + + + + + Automatically configures the using settings + stored in the application's configuration file. + + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + Each application has a configuration file. This has the + same name as the application with '.config' appended. + This file is XML and calling this function prompts the + configurator to look in that file for a section called + log4net that contains the configuration data. + + The repository to configure. + + + + Configures log4net using a log4net element + + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + Loads the log4net configuration from the XML element + supplied as . + + The element to parse. + + + + Configures the using the specified XML + element. + + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + Loads the log4net configuration from the XML element + supplied as . + + The repository to configure. + The element to parse. + + + + Configures log4net using the specified configuration file. + + The XML file to load the configuration from. + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the log4net configuration data. + + + The log4net configuration file can possible be specified in the application's + configuration file (either MyAppName.exe.config for a + normal application on Web.config for an ASP.NET application). + + + The following example configures log4net using a configuration file, of which the + location is stored in the application's configuration file : + + + using log4net.Config; + using System.IO; + using System.Configuration; + + ... + + DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); + + + In the .config file, the path to the log4net can be specified like this : + + + + + + + + + + + + + Configures log4net using the specified configuration file. + + A stream to load the XML configuration from. + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the log4net configuration data. + + + Note that this method will NOT close the stream parameter. + + + + + + Configures the using the specified configuration + file. + + The repository to configure. + The XML file to load the configuration from. + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The log4net configuration file can possible be specified in the application's + configuration file (either MyAppName.exe.config for a + normal application on Web.config for an ASP.NET application). + + + The following example configures log4net using a configuration file, of which the + location is stored in the application's configuration file : + + + using log4net.Config; + using System.IO; + using System.Configuration; + + ... + + DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); + + + In the .config file, the path to the log4net can be specified like this : + + + + + + + + + + + + + Configures the using the specified configuration + file. + + The repository to configure. + The stream to load the XML configuration from. + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + Note that this method will NOT close the stream parameter. + + + + + + Configures log4net using the file specified, monitors the file for changes + and reloads the configuration if a change is detected. + + The XML file to load the configuration from. + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The configuration file will be monitored using a + and depends on the behavior of that class. + + + For more information on how to configure log4net using + a separate configuration file, see . + + + + + + + Configures the using the file specified, + monitors the file for changes and reloads the configuration if a change + is detected. + + The repository to configure. + The XML file to load the configuration from. + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The configuration file will be monitored using a + and depends on the behavior of that class. + + + For more information on how to configure log4net using + a separate configuration file, see . + + + + + + + Assembly level attribute to configure the . + + + + AliasDomainAttribute is obsolete. Use AliasRepositoryAttribute instead of AliasDomainAttribute. + + + This attribute may only be used at the assembly scope and can only + be used once per assembly. + + + Use this attribute to configure the + without calling one of the + methods. + + + Nicko Cadell + Gert Driesen + + + + Assembly level attribute to configure the . + + + + This attribute may only be used at the assembly scope and can only + be used once per assembly. + + + Use this attribute to configure the + without calling one of the + methods. + + + If neither of the or + properties are set the configuration is loaded from the application's .config file. + If set the property takes priority over the + property. The property + specifies a path to a file to load the config from. The path is relative to the + application's base directory; . + The property is used as a postfix to the assembly file name. + The config file must be located in the application's base directory; . + For example in a console application setting the to + config has the same effect as not specifying the or + properties. + + + The property can be set to cause the + to watch the configuration file for changes. + + + + Log4net will only look for assembly level configuration attributes once. + When using the log4net assembly level attributes to control the configuration + of log4net you must ensure that the first call to any of the + methods is made from the assembly with the configuration + attributes. + + + If you cannot guarantee the order in which log4net calls will be made from + different assemblies you must use programmatic configuration instead, i.e. + call the method directly. + + + + Nicko Cadell + Gert Driesen + + + + Default constructor + + + + Default constructor + + + + + + Configures the for the specified assembly. + + The assembly that this attribute was defined on. + The repository to configure. + + + Configure the repository using the . + The specified must extend the + class otherwise the will not be able to + configure it. + + + The does not extend . + + + + Attempt to load configuration from the local file system + + The assembly that this attribute was defined on. + The repository to configure. + + + + Configure the specified repository using a + + The repository to configure. + the FileInfo pointing to the config file + + + + Attempt to load configuration from a URI + + The assembly that this attribute was defined on. + The repository to configure. + + + + The fully qualified type of the XmlConfiguratorAttribute class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the filename of the configuration file. + + + The filename of the configuration file. + + + + If specified, this is the name of the configuration file to use with + the . This file path is relative to the + application base directory (). + + + The takes priority over the . + + + + + + Gets or sets the extension of the configuration file. + + + The extension of the configuration file. + + + + If specified this is the extension for the configuration file. + The path to the config file is built by using the application + base directory (), + the assembly file name and the config file extension. + + + If the is set to MyExt then + possible config file names would be: MyConsoleApp.exe.MyExt or + MyClassLibrary.dll.MyExt. + + + The takes priority over the . + + + + + + Gets or sets a value indicating whether to watch the configuration file. + + + true if the configuration should be watched, false otherwise. + + + + If this flag is specified and set to true then the framework + will watch the configuration file and will reload the config each time + the file is modified. + + + The config file can only be watched if it is loaded from local disk. + In a No-Touch (Smart Client) deployment where the application is downloaded + from a web server the config file may not reside on the local disk + and therefore it may not be able to watch it. + + + Watching configuration is not supported on the SSCLI. + + + + + + Class to register for the log4net section of the configuration file + + + The log4net section of the configuration file needs to have a section + handler registered. This is the section handler used. It simply returns + the XML element that is the root of the section. + + + Example of registering the log4net section handler : + + + +
+ + + log4net configuration XML goes here + + + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Parses the configuration section. + + The configuration settings in a corresponding parent configuration section. + The configuration context when called from the ASP.NET configuration system. Otherwise, this parameter is reserved and is a null reference. + The for the log4net section. + The for the log4net section. + + + Returns the containing the configuration data, + + + + + + Assembly level attribute that specifies a plugin to attach to + the repository. + + + + Specifies the type of a plugin to create and attach to the + assembly's repository. The plugin type must implement the + interface. + + + Nicko Cadell + Gert Driesen + + + + Interface used to create plugins. + + + + Interface used to create a plugin. + + + Nicko Cadell + Gert Driesen + + + + Creates the plugin object. + + the new plugin instance + + + Create and return a new plugin instance. + + + + + + Initializes a new instance of the class + with the specified type. + + The type name of plugin to create. + + + Create the attribute with the plugin type specified. + + + Where possible use the constructor that takes a . + + + + + + Initializes a new instance of the class + with the specified type. + + The type of plugin to create. + + + Create the attribute with the plugin type specified. + + + + + + Creates the plugin object defined by this attribute. + + + + Creates the instance of the object as + specified by this attribute. + + + The plugin object. + + + + Returns a representation of the properties of this object. + + + + Overrides base class method to + return a representation of the properties of this object. + + + A representation of the properties of this object + + + + Gets or sets the type for the plugin. + + + The type for the plugin. + + + + The type for the plugin. + + + + + + Gets or sets the type name for the plugin. + + + The type name for the plugin. + + + + The type name for the plugin. + + + Where possible use the property instead. + + + + + + Assembly level attribute to configure the . + + + + This attribute may only be used at the assembly scope and can only + be used once per assembly. + + + Use this attribute to configure the + without calling one of the + methods. + + + Nicko Cadell + + + + Construct provider attribute with type specified + + the type of the provider to use + + + The provider specified must subclass the + class. + + + + + + Configures the SecurityContextProvider + + The assembly that this attribute was defined on. + The repository to configure. + + + Creates a provider instance from the specified. + Sets this as the default security context provider . + + + + + + The fully qualified type of the SecurityContextProviderAttribute class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the type of the provider to use. + + + the type of the provider to use. + + + + The provider specified must subclass the + class. + + + + + + Use this class to initialize the log4net environment using an Xml tree. + + + + Configures a using an Xml tree. + + + Nicko Cadell + Gert Driesen + + + + Private constructor + + + + + Automatically configures the log4net system based on the + application's configuration settings. + + + + Each application has a configuration file. This has the + same name as the application with '.config' appended. + This file is XML and calling this function prompts the + configurator to look in that file for a section called + log4net that contains the configuration data. + + + To use this method to configure log4net you must specify + the section + handler for the log4net configuration section. See the + for an example. + + + + + + + Automatically configures the using settings + stored in the application's configuration file. + + + + Each application has a configuration file. This has the + same name as the application with '.config' appended. + This file is XML and calling this function prompts the + configurator to look in that file for a section called + log4net that contains the configuration data. + + + To use this method to configure log4net you must specify + the section + handler for the log4net configuration section. See the + for an example. + + + The repository to configure. + + + + Configures log4net using a log4net element + + + + Loads the log4net configuration from the XML element + supplied as . + + + The element to parse. + + + + Configures the using the specified XML + element. + + + Loads the log4net configuration from the XML element + supplied as . + + The repository to configure. + The element to parse. + + + + Configures log4net using the specified configuration file. + + The XML file to load the configuration from. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the log4net configuration data. + + + The log4net configuration file can possible be specified in the application's + configuration file (either MyAppName.exe.config for a + normal application on Web.config for an ASP.NET application). + + + The first element matching <configuration> will be read as the + configuration. If this file is also a .NET .config file then you must specify + a configuration section for the log4net element otherwise .NET will + complain. Set the type for the section handler to , for example: + + +
+ + + + + The following example configures log4net using a configuration file, of which the + location is stored in the application's configuration file : + + + using log4net.Config; + using System.IO; + using System.Configuration; + + ... + + XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); + + + In the .config file, the path to the log4net can be specified like this : + + + + + + + + + + + + + Configures log4net using the specified configuration URI. + + A URI to load the XML configuration from. + + + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the log4net configuration data. + + + The must support the URI scheme specified. + + + + + + Configures log4net using the specified configuration data stream. + + A stream to load the XML configuration from. + + + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the log4net configuration data. + + + Note that this method will NOT close the stream parameter. + + + + + + Configures the using the specified configuration + file. + + The repository to configure. + The XML file to load the configuration from. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The log4net configuration file can possible be specified in the application's + configuration file (either MyAppName.exe.config for a + normal application on Web.config for an ASP.NET application). + + + The first element matching <configuration> will be read as the + configuration. If this file is also a .NET .config file then you must specify + a configuration section for the log4net element otherwise .NET will + complain. Set the type for the section handler to , for example: + + +
+ + + + + The following example configures log4net using a configuration file, of which the + location is stored in the application's configuration file : + + + using log4net.Config; + using System.IO; + using System.Configuration; + + ... + + XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); + + + In the .config file, the path to the log4net can be specified like this : + + + + + + + + + + + + + Configures the using the specified configuration + URI. + + The repository to configure. + A URI to load the XML configuration from. + + + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The must support the URI scheme specified. + + + + + + Configures the using the specified configuration + file. + + The repository to configure. + The stream to load the XML configuration from. + + + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + Note that this method will NOT close the stream parameter. + + + + + + Configures log4net using the file specified, monitors the file for changes + and reloads the configuration if a change is detected. + + The XML file to load the configuration from. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The configuration file will be monitored using a + and depends on the behavior of that class. + + + For more information on how to configure log4net using + a separate configuration file, see . + + + + + + + Configures the using the file specified, + monitors the file for changes and reloads the configuration if a change + is detected. + + The repository to configure. + The XML file to load the configuration from. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The configuration file will be monitored using a + and depends on the behavior of that class. + + + For more information on how to configure log4net using + a separate configuration file, see . + + + + + + + Configures the specified repository using a log4net element. + + The hierarchy to configure. + The element to parse. + + + Loads the log4net configuration from the XML element + supplied as . + + + This method is ultimately called by one of the Configure methods + to load the configuration from an . + + + + + + Maps repository names to ConfigAndWatchHandler instances to allow a particular + ConfigAndWatchHandler to dispose of its FileSystemWatcher when a repository is + reconfigured. + + + + + The fully qualified type of the XmlConfigurator class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Class used to watch config files. + + + + Uses the to monitor + changes to a specified file. Because multiple change notifications + may be raised when the file is modified, a timer is used to + compress the notifications into a single event. The timer + waits for time before delivering + the event notification. If any further + change notifications arrive while the timer is waiting it + is reset and waits again for to + elapse. + + + + + + The default amount of time to wait after receiving notification + before reloading the config file. + + + + + Holds the FileInfo used to configure the XmlConfigurator + + + + + Holds the repository being configured. + + + + + The timer used to compress the notification events. + + + + + Watches file for changes. This object should be disposed when no longer + needed to free system handles on the watched resources. + + + + + Initializes a new instance of the class to + watch a specified config file used to configure a repository. + + The repository to configure. + The configuration file to watch. + + + Initializes a new instance of the class. + + + + + + Event handler used by . + + The firing the event. + The argument indicates the file that caused the event to be fired. + + + This handler reloads the configuration from the file when the event is fired. + + + + + + Event handler used by . + + The firing the event. + The argument indicates the file that caused the event to be fired. + + + This handler reloads the configuration from the file when the event is fired. + + + + + + Called by the timer when the configuration has been updated. + + null + + + + Release the handles held by the watcher and timer. + + + + + The implementation of the interface suitable + for use with the compact framework + + + + This implementation is a simple + mapping between repository name and + object. + + + The .NET Compact Framework 1.0 does not support retrieving assembly + level attributes therefore unlike the DefaultRepositorySelector + this selector does not examine the calling assembly for attributes. + + + Nicko Cadell + + + + Interface used by the to select the . + + + + The uses a + to specify the policy for selecting the correct + to return to the caller. + + + Nicko Cadell + Gert Driesen + + + + Gets the for the specified assembly. + + The assembly to use to lookup to the + The for the assembly. + + + Gets the for the specified assembly. + + + How the association between and + is made is not defined. The implementation may choose any method for + this association. The results of this method must be repeatable, i.e. + when called again with the same arguments the result must be the + save value. + + + + + + Gets the named . + + The name to use to lookup to the . + The named + + Lookup a named . This is the repository created by + calling . + + + + + Creates a new repository for the assembly specified. + + The assembly to use to create the domain to associate with the . + The type of repository to create, must implement . + The repository created. + + + The created will be associated with the domain + specified such that a call to with the + same assembly specified will return the same repository instance. + + + How the association between and + is made is not defined. The implementation may choose any method for + this association. + + + + + + Creates a new repository with the name specified. + + The name to associate with the . + The type of repository to create, must implement . + The repository created. + + + The created will be associated with the name + specified such that a call to with the + same name will return the same repository instance. + + + + + + Test if a named repository exists + + the named repository to check + true if the repository exists + + + Test if a named repository exists. Use + to create a new repository and to retrieve + a repository. + + + + + + Gets an array of all currently defined repositories. + + + An array of the instances created by + this . + + + Gets an array of all of the repositories created by this selector. + + + + + + Event to notify that a logger repository has been created. + + + Event to notify that a logger repository has been created. + + + + Event raised when a new repository is created. + The event source will be this selector. The event args will + be a which + holds the newly created . + + + + + + Create a new repository selector + + the type of the repositories to create, must implement + + + Create an new compact repository selector. + The default type for repositories must be specified, + an appropriate value would be . + + + throw if is null + throw if does not implement + + + + Get the for the specified assembly + + not used + The default + + + The argument is not used. This selector does not create a + separate repository for each assembly. + + + As a named repository is not specified the default repository is + returned. The default repository is named log4net-default-repository. + + + + + + Get the named + + the name of the repository to lookup + The named + + + Get the named . The default + repository is log4net-default-repository. Other repositories + must be created using the . + If the named repository does not exist an exception is thrown. + + + throw if is null + throw if the does not exist + + + + Create a new repository for the assembly specified + + not used + the type of repository to create, must implement + the repository created + + + The argument is not used. This selector does not create a + separate repository for each assembly. + + + If the is null then the + default repository type specified to the constructor is used. + + + As a named repository is not specified the default repository is + returned. The default repository is named log4net-default-repository. + + + + + + Create a new repository for the repository specified + + the repository to associate with the + the type of repository to create, must implement . + If this param is null then the default repository type is used. + the repository created + + + The created will be associated with the repository + specified such that a call to with the + same repository specified will return the same repository instance. + + + If the named repository already exists an exception will be thrown. + + + If is null then the default + repository type specified to the constructor is used. + + + throw if is null + throw if the already exists + + + + Test if a named repository exists + + the named repository to check + true if the repository exists + + + Test if a named repository exists. Use + to create a new repository and to retrieve + a repository. + + + + + + Gets a list of objects + + an array of all known objects + + + Gets an array of all of the repositories created by this selector. + + + + + + The fully qualified type of the CompactRepositorySelector class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Notify the registered listeners that the repository has been created + + The repository that has been created + + + Raises the LoggerRepositoryCreatedEvent + event. + + + + + + Event to notify that a logger repository has been created. + + + Event to notify that a logger repository has been created. + + + + Event raised when a new repository is created. + The event source will be this selector. The event args will + be a which + holds the newly created . + + + + + + The default implementation of the interface. + + + + Uses attributes defined on the calling assembly to determine how to + configure the hierarchy for the repository. + + + Nicko Cadell + Gert Driesen + + + + Creates a new repository selector. + + The type of the repositories to create, must implement + + + Create an new repository selector. + The default type for repositories must be specified, + an appropriate value would be . + + + is . + does not implement . + + + + Gets the for the specified assembly. + + The assembly use to lookup the . + + + The type of the created and the repository + to create can be overridden by specifying the + attribute on the . + + + The default values are to use the + implementation of the interface and to use the + as the name of the repository. + + + The created will be automatically configured using + any attributes defined on + the . + + + The for the assembly + is . + + + + Gets the for the specified repository. + + The repository to use to lookup the . + The for the specified repository. + + + Returns the named repository. If is null + a is thrown. If the repository + does not exist a is thrown. + + + Use to create a repository. + + + is . + does not exist. + + + + Create a new repository for the assembly specified + + the assembly to use to create the repository to associate with the . + The type of repository to create, must implement . + The repository created. + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + The type of the created and + the repository to create can be overridden by specifying the + attribute on the + . The default values are to use the + implementation of the + interface and to use the + as the name of the repository. + + + The created will be automatically + configured using any + attributes defined on the . + + + If a repository for the already exists + that repository will be returned. An error will not be raised and that + repository may be of a different type to that specified in . + Also the attribute on the + assembly may be used to override the repository type specified in + . + + + is . + + + + Creates a new repository for the assembly specified. + + the assembly to use to create the repository to associate with the . + The type of repository to create, must implement . + The name to assign to the created repository + Set to true to read and apply the assembly attributes + The repository created. + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + The type of the created and + the repository to create can be overridden by specifying the + attribute on the + . The default values are to use the + implementation of the + interface and to use the + as the name of the repository. + + + The created will be automatically + configured using any + attributes defined on the . + + + If a repository for the already exists + that repository will be returned. An error will not be raised and that + repository may be of a different type to that specified in . + Also the attribute on the + assembly may be used to override the repository type specified in + . + + + is . + + + + Creates a new repository for the specified repository. + + The repository to associate with the . + The type of repository to create, must implement . + If this param is then the default repository type is used. + The new repository. + + + The created will be associated with the repository + specified such that a call to with the + same repository specified will return the same repository instance. + + + is . + already exists. + + + + Test if a named repository exists + + the named repository to check + true if the repository exists + + + Test if a named repository exists. Use + to create a new repository and to retrieve + a repository. + + + + + + Gets a list of objects + + an array of all known objects + + + Gets an array of all of the repositories created by this selector. + + + + + + Aliases a repository to an existing repository. + + The repository to alias. + The repository that the repository is aliased to. + + + The repository specified will be aliased to the repository when created. + The repository must not already exist. + + + When the repository is created it must utilize the same repository type as + the repository it is aliased to, otherwise the aliasing will fail. + + + + is . + -or- + is . + + + + + Notifies the registered listeners that the repository has been created. + + The repository that has been created. + + + Raises the event. + + + + + + Gets the repository name and repository type for the specified assembly. + + The assembly that has a . + in/out param to hold the repository name to use for the assembly, caller should set this to the default value before calling. + in/out param to hold the type of the repository to create for the assembly, caller should set this to the default value before calling. + is . + + + + Configures the repository using information from the assembly. + + The assembly containing + attributes which define the configuration for the repository. + The repository to configure. + + is . + -or- + is . + + + + + Loads the attribute defined plugins on the assembly. + + The assembly that contains the attributes. + The repository to add the plugins to. + + is . + -or- + is . + + + + + Loads the attribute defined aliases on the assembly. + + The assembly that contains the attributes. + The repository to alias to. + + is . + -or- + is . + + + + + The fully qualified type of the DefaultRepositorySelector class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Event to notify that a logger repository has been created. + + + Event to notify that a logger repository has been created. + + + + Event raised when a new repository is created. + The event source will be this selector. The event args will + be a which + holds the newly created . + + + + + + Defined error codes that can be passed to the method. + + + + Values passed to the method. + + + Nicko Cadell + + + + A general error + + + + + Error while writing output + + + + + Failed to flush file + + + + + Failed to close file + + + + + Unable to open output file + + + + + No layout specified + + + + + Failed to parse address + + + + + An evaluator that triggers on an Exception type + + + + This evaluator will trigger if the type of the Exception + passed to + is equal to a Type in . /// + + + Drew Schaeffer + + + + Test if an triggers an action + + + + Implementations of this interface allow certain appenders to decide + when to perform an appender specific action. + + + The action or behavior triggered is defined by the implementation. + + + Nicko Cadell + + + + Test if this event triggers the action + + The event to check + true if this event triggers the action, otherwise false + + + Return true if this event triggers the action + + + + + + The type that causes the trigger to fire. + + + + + Causes subclasses of to cause the trigger to fire. + + + + + Default ctor to allow dynamic creation through a configurator. + + + + + Constructs an evaluator and initializes to trigger on + + the type that triggers this evaluator. + If true, this evaluator will trigger on subclasses of . + + + + Is this the triggering event? + + The event to check + This method returns true, if the logging event Exception + Type is . + Otherwise it returns false + + + This evaluator will trigger if the Exception Type of the event + passed to + is . + + + + + + The type that triggers this evaluator. + + + + + If true, this evaluator will trigger on subclasses of . + + + + + Appenders may delegate their error handling to an . + + + + Error handling is a particularly tedious to get right because by + definition errors are hard to predict and to reproduce. + + + Nicko Cadell + Gert Driesen + + + + Handles the error and information about the error condition is passed as + a parameter. + + The message associated with the error. + The that was thrown when the error occurred. + The error code associated with the error. + + + Handles the error and information about the error condition is passed as + a parameter. + + + + + + Prints the error message passed as a parameter. + + The message associated with the error. + The that was thrown when the error occurred. + + + See . + + + + + + Prints the error message passed as a parameter. + + The message associated with the error. + + + See . + + + + + + Interface for objects that require fixing. + + + + Interface that indicates that the object requires fixing before it + can be taken outside the context of the appender's + method. + + + When objects that implement this interface are stored + in the context properties maps + and + are fixed + (see ) the + method will be called. + + + Nicko Cadell + + + + Get a portable version of this object + + the portable instance of this object + + + Get a portable instance object that represents the current + state of this object. The portable object can be stored + and logged from any thread with identical results. + + + + + + Interface that all loggers implement + + + + This interface supports logging events and testing if a level + is enabled for logging. + + + These methods will not throw exceptions. Note to implementor, ensure + that the implementation of these methods cannot allow an exception + to be thrown to the caller. + + + Nicko Cadell + Gert Driesen + + + + This generic form is intended to be used by wrappers. + + The declaring type of the method that is + the stack boundary into the logging system for this call. + The level of the message to be logged. + The message object to log. + the exception to log, including its stack trace. Pass null to not log an exception. + + + Generates a logging event for the specified using + the and . + + + + + + This is the most generic printing method that is intended to be used + by wrappers. + + The event being logged. + + + Logs the specified logging event through this logger. + + + + + + Checks if this logger is enabled for a given passed as parameter. + + The level to check. + + true if this logger is enabled for level, otherwise false. + + + + Test if this logger is going to log events of the specified . + + + + + + Gets the name of the logger. + + + The name of the logger. + + + + The name of this logger + + + + + + Gets the where this + Logger instance is attached to. + + + The that this logger belongs to. + + + + Gets the where this + Logger instance is attached to. + + + + + + Base interface for all wrappers + + + + Base interface for all wrappers. + + + All wrappers must implement this interface. + + + Nicko Cadell + + + + Get the implementation behind this wrapper object. + + + The object that in implementing this object. + + + + The object that in implementing this + object. The Logger object may not + be the same object as this object because of logger decorators. + This gets the actual underlying objects that is used to process + the log events. + + + + + + Delegate used to handle logger repository creation event notifications + + The which created the repository. + The event args + that holds the instance that has been created. + + + Delegate used to handle logger repository creation event notifications. + + + + + + Provides data for the event. + + + + A + event is raised every time a is created. + + + + + + The created + + + + + Construct instance using specified + + the that has been created + + + Construct instance using specified + + + + + + The that has been created + + + The that has been created + + + + The that has been created + + + + + + Defines the default set of levels recognized by the system. + + + + Each has an associated . + + + Levels have a numeric that defines the relative + ordering between levels. Two Levels with the same + are deemed to be equivalent. + + + The levels that are recognized by log4net are set for each + and each repository can have different levels defined. The levels are stored + in the on the repository. Levels are + looked up by name from the . + + + When logging at level INFO the actual level used is not but + the value of LoggerRepository.LevelMap["INFO"]. The default value for this is + , but this can be changed by reconfiguring the level map. + + + Each level has a in addition to its . The + is the string that is written into the output log. By default + the display name is the same as the level name, but this can be used to alias levels + or to localize the log output. + + + Some of the predefined levels recognized by the system are: + + + + . + + + . + + + . + + + . + + + . + + + . + + + . + + + + Nicko Cadell + Gert Driesen + + + + Constructor + + Integer value for this level, higher values represent more severe levels. + The string name of this level. + The display name for this level. This may be localized or otherwise different from the name + + + Initializes a new instance of the class with + the specified level name and value. + + + + + + Constructor + + Integer value for this level, higher values represent more severe levels. + The string name of this level. + + + Initializes a new instance of the class with + the specified level name and value. + + + + + + Returns the representation of the current + . + + + A representation of the current . + + + + Returns the level . + + + + + + Compares levels. + + The object to compare against. + true if the objects are equal. + + + Compares the levels of instances, and + defers to base class if the target object is not a + instance. + + + + + + Returns a hash code + + A hash code for the current . + + + Returns a hash code suitable for use in hashing algorithms and data + structures like a hash table. + + + Returns the hash code of the level . + + + + + + Compares this instance to a specified object and returns an + indication of their relative values. + + A instance or to compare with this instance. + + A 32-bit signed integer that indicates the relative order of the + values compared. The return value has these meanings: + + + Value + Meaning + + + Less than zero + This instance is less than . + + + Zero + This instance is equal to . + + + Greater than zero + + This instance is greater than . + -or- + is . + + + + + + + must be an instance of + or ; otherwise, an exception is thrown. + + + is not a . + + + + Returns a value indicating whether a specified + is greater than another specified . + + A + A + + true if is greater than + ; otherwise, false. + + + + Compares two levels. + + + + + + Returns a value indicating whether a specified + is less than another specified . + + A + A + + true if is less than + ; otherwise, false. + + + + Compares two levels. + + + + + + Returns a value indicating whether a specified + is greater than or equal to another specified . + + A + A + + true if is greater than or equal to + ; otherwise, false. + + + + Compares two levels. + + + + + + Returns a value indicating whether a specified + is less than or equal to another specified . + + A + A + + true if is less than or equal to + ; otherwise, false. + + + + Compares two levels. + + + + + + Returns a value indicating whether two specified + objects have the same value. + + A or . + A or . + + true if the value of is the same as the + value of ; otherwise, false. + + + + Compares two levels. + + + + + + Returns a value indicating whether two specified + objects have different values. + + A or . + A or . + + true if the value of is different from + the value of ; otherwise, false. + + + + Compares two levels. + + + + + + Compares two specified instances. + + The first to compare. + The second to compare. + + A 32-bit signed integer that indicates the relative order of the + two values compared. The return value has these meanings: + + + Value + Meaning + + + Less than zero + is less than . + + + Zero + is equal to . + + + Greater than zero + is greater than . + + + + + + Compares two levels. + + + + + + The level designates a higher level than all the rest. + + + + + The level designates very severe error events. + System unusable, emergencies. + + + + + The level designates very severe error events. + System unusable, emergencies. + + + + + The level designates very severe error events + that will presumably lead the application to abort. + + + + + The level designates very severe error events. + Take immediate action, alerts. + + + + + The level designates very severe error events. + Critical condition, critical. + + + + + The level designates very severe error events. + + + + + The level designates error events that might + still allow the application to continue running. + + + + + The level designates potentially harmful + situations. + + + + + The level designates informational messages + that highlight the progress of the application at the highest level. + + + + + The level designates informational messages that + highlight the progress of the application at coarse-grained level. + + + + + The level designates fine-grained informational + events that are most useful to debug an application. + + + + + The level designates fine-grained informational + events that are most useful to debug an application. + + + + + The level designates fine-grained informational + events that are most useful to debug an application. + + + + + The level designates fine-grained informational + events that are most useful to debug an application. + + + + + The level designates fine-grained informational + events that are most useful to debug an application. + + + + + The level designates fine-grained informational + events that are most useful to debug an application. + + + + + The level designates the lowest level possible. + + + + + Gets the name of this level. + + + The name of this level. + + + + Gets the name of this level. + + + + + + Gets the value of this level. + + + The value of this level. + + + + Gets the value of this level. + + + + + + Gets the display name of this level. + + + The display name of this level. + + + + Gets the display name of this level. + + + + + + A strongly-typed collection of objects. + + Nicko Cadell + + + + Creates a read-only wrapper for a LevelCollection instance. + + list to create a readonly wrapper arround + + A LevelCollection wrapper that is read-only. + + + + + Initializes a new instance of the LevelCollection class + that is empty and has the default initial capacity. + + + + + Initializes a new instance of the LevelCollection class + that has the specified initial capacity. + + + The number of elements that the new LevelCollection is initially capable of storing. + + + + + Initializes a new instance of the LevelCollection class + that contains elements copied from the specified LevelCollection. + + The LevelCollection whose elements are copied to the new collection. + + + + Initializes a new instance of the LevelCollection class + that contains elements copied from the specified array. + + The array whose elements are copied to the new list. + + + + Initializes a new instance of the LevelCollection class + that contains elements copied from the specified collection. + + The collection whose elements are copied to the new list. + + + + Allow subclasses to avoid our default constructors + + + + + + Copies the entire LevelCollection to a one-dimensional + array. + + The one-dimensional array to copy to. + + + + Copies the entire LevelCollection to a one-dimensional + array, starting at the specified index of the target array. + + The one-dimensional array to copy to. + The zero-based index in at which copying begins. + + + + Adds a to the end of the LevelCollection. + + The to be added to the end of the LevelCollection. + The index at which the value has been added. + + + + Removes all elements from the LevelCollection. + + + + + Creates a shallow copy of the . + + A new with a shallow copy of the collection data. + + + + Determines whether a given is in the LevelCollection. + + The to check for. + true if is found in the LevelCollection; otherwise, false. + + + + Returns the zero-based index of the first occurrence of a + in the LevelCollection. + + The to locate in the LevelCollection. + + The zero-based index of the first occurrence of + in the entire LevelCollection, if found; otherwise, -1. + + + + + Inserts an element into the LevelCollection at the specified index. + + The zero-based index at which should be inserted. + The to insert. + + is less than zero + -or- + is equal to or greater than . + + + + + Removes the first occurrence of a specific from the LevelCollection. + + The to remove from the LevelCollection. + + The specified was not found in the LevelCollection. + + + + + Removes the element at the specified index of the LevelCollection. + + The zero-based index of the element to remove. + + is less than zero + -or- + is equal to or greater than . + + + + + Returns an enumerator that can iterate through the LevelCollection. + + An for the entire LevelCollection. + + + + Adds the elements of another LevelCollection to the current LevelCollection. + + The LevelCollection whose elements should be added to the end of the current LevelCollection. + The new of the LevelCollection. + + + + Adds the elements of a array to the current LevelCollection. + + The array whose elements should be added to the end of the LevelCollection. + The new of the LevelCollection. + + + + Adds the elements of a collection to the current LevelCollection. + + The collection whose elements should be added to the end of the LevelCollection. + The new of the LevelCollection. + + + + Sets the capacity to the actual number of elements. + + + + + is less than zero + -or- + is equal to or greater than . + + + + + is less than zero + -or- + is equal to or greater than . + + + + + Gets the number of elements actually contained in the LevelCollection. + + + + + Gets a value indicating whether access to the collection is synchronized (thread-safe). + + true if access to the ICollection is synchronized (thread-safe); otherwise, false. + + + + Gets an object that can be used to synchronize access to the collection. + + + + + Gets or sets the at the specified index. + + The zero-based index of the element to get or set. + + is less than zero + -or- + is equal to or greater than . + + + + + Gets a value indicating whether the collection has a fixed size. + + true if the collection has a fixed size; otherwise, false. The default is false + + + + Gets a value indicating whether the IList is read-only. + + true if the collection is read-only; otherwise, false. The default is false + + + + Gets or sets the number of elements the LevelCollection can contain. + + + + + Supports type-safe iteration over a . + + + + + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + Gets the current element in the collection. + + + + + Type visible only to our subclasses + Used to access protected constructor + + + + + A value + + + + + Supports simple iteration over a . + + + + + Initializes a new instance of the Enumerator class. + + + + + + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + Gets the current element in the collection. + + + + + An evaluator that triggers at a threshold level + + + + This evaluator will trigger if the level of the event + passed to + is equal to or greater than the + level. + + + Nicko Cadell + + + + The threshold for triggering + + + + + Create a new evaluator using the threshold. + + + + Create a new evaluator using the threshold. + + + This evaluator will trigger if the level of the event + passed to + is equal to or greater than the + level. + + + + + + Create a new evaluator using the specified threshold. + + the threshold to trigger at + + + Create a new evaluator using the specified threshold. + + + This evaluator will trigger if the level of the event + passed to + is equal to or greater than the + level. + + + + + + Is this the triggering event? + + The event to check + This method returns true, if the event level + is equal or higher than the . + Otherwise it returns false + + + This evaluator will trigger if the level of the event + passed to + is equal to or greater than the + level. + + + + + + the threshold to trigger at + + + The that will cause this evaluator to trigger + + + + This evaluator will trigger if the level of the event + passed to + is equal to or greater than the + level. + + + + + + Mapping between string name and Level object + + + + Mapping between string name and object. + This mapping is held separately for each . + The level name is case insensitive. + + + Nicko Cadell + + + + Mapping from level name to Level object. The + level name is case insensitive + + + + + Construct the level map + + + + Construct the level map. + + + + + + Clear the internal maps of all levels + + + + Clear the internal maps of all levels + + + + + + Create a new Level and add it to the map + + the string to display for the Level + the level value to give to the Level + + + Create a new Level and add it to the map + + + + + + + Create a new Level and add it to the map + + the string to display for the Level + the level value to give to the Level + the display name to give to the Level + + + Create a new Level and add it to the map + + + + + + Add a Level to the map + + the Level to add + + + Add a Level to the map + + + + + + Lookup a named level from the map + + the name of the level to lookup is taken from this level. + If the level is not set on the map then this level is added + the level in the map with the name specified + + + Lookup a named level from the map. The name of the level to lookup is taken + from the property of the + argument. + + + If no level with the specified name is found then the + argument is added to the level map + and returned. + + + + + + Lookup a by name + + The name of the Level to lookup + a Level from the map with the name specified + + + Returns the from the + map with the name specified. If the no level is + found then null is returned. + + + + + + Return all possible levels as a list of Level objects. + + all possible levels as a list of Level objects + + + Return all possible levels as a list of Level objects. + + + + + + The internal representation of caller location information. + + + + This class uses the System.Diagnostics.StackTrace class to generate + a call stack. The caller's information is then extracted from this stack. + + + The System.Diagnostics.StackTrace class is not supported on the + .NET Compact Framework 1.0 therefore caller location information is not + available on that framework. + + + The System.Diagnostics.StackTrace class has this to say about Release builds: + + + "StackTrace information will be most informative with Debug build configurations. + By default, Debug builds include debug symbols, while Release builds do not. The + debug symbols contain most of the file, method name, line number, and column + information used in constructing StackFrame and StackTrace objects. StackTrace + might not report as many method calls as expected, due to code transformations + that occur during optimization." + + + This means that in a Release build the caller information may be incomplete or may + not exist at all! Therefore caller location information cannot be relied upon in a Release build. + + + Nicko Cadell + Gert Driesen + + + + When location information is not available the constant + NA is returned. Current value of this string + constant is ?. + + + + + Constructor + + The declaring type of the method that is + the stack boundary into the logging system for this call. + + + Initializes a new instance of the + class based on the current thread. + + + + + + Constructor + + The fully qualified class name. + The method name. + The file name. + The line number of the method within the file. + + + Initializes a new instance of the + class with the specified data. + + + + + + The fully qualified type of the LocationInfo class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets the fully qualified class name of the caller making the logging + request. + + + The fully qualified class name of the caller making the logging + request. + + + + Gets the fully qualified class name of the caller making the logging + request. + + + + + + Gets the file name of the caller. + + + The file name of the caller. + + + + Gets the file name of the caller. + + + + + + Gets the line number of the caller. + + + The line number of the caller. + + + + Gets the line number of the caller. + + + + + + Gets the method name of the caller. + + + The method name of the caller. + + + + Gets the method name of the caller. + + + + + + Gets all available caller information + + + All available caller information, in the format + fully.qualified.classname.of.caller.methodName(Filename:line) + + + + Gets all available caller information, in the format + fully.qualified.classname.of.caller.methodName(Filename:line) + + + + + + Gets the stack frames from the stack trace of the caller making the log request + + + + + Static manager that controls the creation of repositories + + + + Static manager that controls the creation of repositories + + + This class is used by the wrapper managers (e.g. ) + to provide access to the objects. + + + This manager also holds the that is used to + lookup and create repositories. The selector can be set either programmatically using + the property, or by setting the log4net.RepositorySelector + AppSetting in the applications config file to the fully qualified type name of the + selector to use. + + + Nicko Cadell + Gert Driesen + + + + Private constructor to prevent instances. Only static methods should be used. + + + + Private constructor to prevent instances. Only static methods should be used. + + + + + + Hook the shutdown event + + + + On the full .NET runtime, the static constructor hooks up the + AppDomain.ProcessExit and AppDomain.DomainUnload> events. + These are used to shutdown the log4net system as the application exits. + + + + + + Register for ProcessExit and DomainUnload events on the AppDomain + + + + This needs to be in a separate method because the events make + a LinkDemand for the ControlAppDomain SecurityPermission. Because + this is a LinkDemand it is demanded at JIT time. Therefore we cannot + catch the exception in the method itself, we have to catch it in the + caller. + + + + + + Return the default instance. + + the repository to lookup in + Return the default instance + + + Gets the for the repository specified + by the argument. + + + + + + Returns the default instance. + + The assembly to use to lookup the repository. + The default instance. + + + + Return the default instance. + + the repository to lookup in + Return the default instance + + + Gets the for the repository specified + by the argument. + + + + + + Returns the default instance. + + The assembly to use to lookup the repository. + The default instance. + + + Returns the default instance. + + + + + + Returns the named logger if it exists. + + The repository to lookup in. + The fully qualified logger name to look for. + + The logger found, or null if the named logger does not exist in the + specified repository. + + + + If the named logger exists (in the specified repository) then it + returns a reference to the logger, otherwise it returns + null. + + + + + + Returns the named logger if it exists. + + The assembly to use to lookup the repository. + The fully qualified logger name to look for. + + The logger found, or null if the named logger does not exist in the + specified assembly's repository. + + + + If the named logger exists (in the specified assembly's repository) then it + returns a reference to the logger, otherwise it returns + null. + + + + + + Returns all the currently defined loggers in the specified repository. + + The repository to lookup in. + All the defined loggers. + + + The root logger is not included in the returned array. + + + + + + Returns all the currently defined loggers in the specified assembly's repository. + + The assembly to use to lookup the repository. + All the defined loggers. + + + The root logger is not included in the returned array. + + + + + + Retrieves or creates a named logger. + + The repository to lookup in. + The name of the logger to retrieve. + The logger with the name specified. + + + Retrieves a logger named as the + parameter. If the named logger already exists, then the + existing instance will be returned. Otherwise, a new instance is + created. + + + By default, loggers do not have a set level but inherit + it from the hierarchy. This is one of the central features of + log4net. + + + + + + Retrieves or creates a named logger. + + The assembly to use to lookup the repository. + The name of the logger to retrieve. + The logger with the name specified. + + + Retrieves a logger named as the + parameter. If the named logger already exists, then the + existing instance will be returned. Otherwise, a new instance is + created. + + + By default, loggers do not have a set level but inherit + it from the hierarchy. This is one of the central features of + log4net. + + + + + + Shorthand for . + + The repository to lookup in. + The of which the fullname will be used as the name of the logger to retrieve. + The logger with the name specified. + + + Gets the logger for the fully qualified name of the type specified. + + + + + + Shorthand for . + + the assembly to use to lookup the repository + The of which the fullname will be used as the name of the logger to retrieve. + The logger with the name specified. + + + Gets the logger for the fully qualified name of the type specified. + + + + + + Shuts down the log4net system. + + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in all the + default repositories. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + + Shuts down the repository for the repository specified. + + The repository to shutdown. + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in the + repository for the specified. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + + Shuts down the repository for the repository specified. + + The assembly to use to lookup the repository. + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in the + repository for the repository. The repository is looked up using + the specified. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + + Resets all values contained in this repository instance to their defaults. + + The repository to reset. + + + Resets all values contained in the repository instance to their + defaults. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set its default "off" value. + + + + + + Resets all values contained in this repository instance to their defaults. + + The assembly to use to lookup the repository to reset. + + + Resets all values contained in the repository instance to their + defaults. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set its default "off" value. + + + + + + Creates a repository with the specified name. + + The name of the repository, this must be unique amongst repositories. + The created for the repository. + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + Creates the default type of which is a + object. + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The specified repository already exists. + + + + Creates a repository with the specified name. + + The name of the repository, this must be unique amongst repositories. + The created for the repository. + + + Creates the default type of which is a + object. + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The specified repository already exists. + + + + Creates a repository with the specified name and repository type. + + The name of the repository, this must be unique to the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + The name must be unique. Repositories cannot be redefined. + An Exception will be thrown if the repository already exists. + + + The specified repository already exists. + + + + Creates a repository with the specified name and repository type. + + The name of the repository, this must be unique to the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + The name must be unique. Repositories cannot be redefined. + An Exception will be thrown if the repository already exists. + + + The specified repository already exists. + + + + Creates a repository for the specified assembly and repository type. + + The assembly to use to get the name of the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + + + + Creates a repository for the specified assembly and repository type. + + The assembly to use to get the name of the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + + + + Gets an array of all currently defined repositories. + + An array of all the known objects. + + + Gets an array of all currently defined repositories. + + + + + + Internal method to get pertinent version info. + + A string of version info. + + + + Called when the event fires + + the that is exiting + null + + + Called when the event fires. + + + When the event is triggered the log4net system is . + + + + + + Called when the event fires + + the that is exiting + null + + + Called when the event fires. + + + When the event is triggered the log4net system is . + + + + + + The fully qualified type of the LoggerManager class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Initialize the default repository selector + + + + + Gets or sets the repository selector used by the . + + + The repository selector used by the . + + + + The repository selector () is used by + the to create and select repositories + (). + + + The caller to supplies either a string name + or an assembly (if not supplied the assembly is inferred using + ). + + + This context is used by the selector to lookup a specific repository. + + + For the full .NET Framework, the default repository is DefaultRepositorySelector; + for the .NET Compact Framework CompactRepositorySelector is the default + repository. + + + + + + Implementation of the interface. + + + + This class should be used as the base for all wrapper implementations. + + + Nicko Cadell + Gert Driesen + + + + Constructs a new wrapper for the specified logger. + + The logger to wrap. + + + Constructs a new wrapper for the specified logger. + + + + + + The logger that this object is wrapping + + + + + Gets the implementation behind this wrapper object. + + + The object that this object is implementing. + + + + The Logger object may not be the same object as this object + because of logger decorators. + + + This gets the actual underlying objects that is used to process + the log events. + + + + + + Portable data structure used by + + + + Portable data structure used by + + + Nicko Cadell + + + + The logger name. + + + + The logger name. + + + + + + Level of logging event. + + + + Level of logging event. Level cannot be Serializable + because it is a flyweight. Due to its special serialization it + cannot be declared final either. + + + + + + The application supplied message. + + + + The application supplied message of logging event. + + + + + + The name of thread + + + + The name of thread in which this logging event was generated + + + + + + The time the event was logged + + + + The TimeStamp is stored in the local time zone for this computer. + + + + + + Location information for the caller. + + + + Location information for the caller. + + + + + + String representation of the user + + + + String representation of the user's windows name, + like DOMAIN\username + + + + + + String representation of the identity. + + + + String representation of the current thread's principal identity. + + + + + + The string representation of the exception + + + + The string representation of the exception + + + + + + String representation of the AppDomain. + + + + String representation of the AppDomain. + + + + + + Additional event specific properties + + + + A logger or an appender may attach additional + properties to specific events. These properties + have a string key and an object value. + + + + + + Flags passed to the property + + + + Flags passed to the property + + + Nicko Cadell + + + + Fix the MDC + + + + + Fix the NDC + + + + + Fix the rendered message + + + + + Fix the thread name + + + + + Fix the callers location information + + + CAUTION: Very slow to generate + + + + + Fix the callers windows user name + + + CAUTION: Slow to generate + + + + + Fix the domain friendly name + + + + + Fix the callers principal name + + + CAUTION: May be slow to generate + + + + + Fix the exception text + + + + + Fix the event properties. Active properties must implement in order to be eligible for fixing. + + + + + No fields fixed + + + + + All fields fixed + + + + + Partial fields fixed + + + + This set of partial fields gives good performance. The following fields are fixed: + + + + + + + + + + + + + The internal representation of logging events. + + + + When an affirmative decision is made to log then a + instance is created. This instance + is passed around to the different log4net components. + + + This class is of concern to those wishing to extend log4net. + + + Some of the values in instances of + are considered volatile, that is the values are correct at the + time the event is delivered to appenders, but will not be consistent + at any time afterwards. If an event is to be stored and then processed + at a later time these volatile values must be fixed by calling + . There is a performance penalty + for incurred by calling but it + is essential to maintaining data consistency. + + + Nicko Cadell + Gert Driesen + Douglas de la Torre + Daniel Cazzulino + + + + The key into the Properties map for the host name value. + + + + + The key into the Properties map for the thread identity value. + + + + + The key into the Properties map for the user name value. + + + + + Initializes a new instance of the class + from the supplied parameters. + + The declaring type of the method that is + the stack boundary into the logging system for this call. + The repository this event is logged in. + The name of the logger of this event. + The level of this event. + The message of this event. + The exception for this event. + + + Except , and , + all fields of LoggingEvent are filled when actually needed. Call + to cache all data locally + to prevent inconsistencies. + + This method is called by the log4net framework + to create a logging event. + + + + + + Initializes a new instance of the class + using specific data. + + The declaring type of the method that is + the stack boundary into the logging system for this call. + The repository this event is logged in. + Data used to initialize the logging event. + The fields in the struct that have already been fixed. + + + This constructor is provided to allow a + to be created independently of the log4net framework. This can + be useful if you require a custom serialization scheme. + + + Use the method to obtain an + instance of the class. + + + The parameter should be used to specify which fields in the + struct have been preset. Fields not specified in the + will be captured from the environment if requested or fixed. + + + + + + Initializes a new instance of the class + using specific data. + + The declaring type of the method that is + the stack boundary into the logging system for this call. + The repository this event is logged in. + Data used to initialize the logging event. + + + This constructor is provided to allow a + to be created independently of the log4net framework. This can + be useful if you require a custom serialization scheme. + + + Use the method to obtain an + instance of the class. + + + This constructor sets this objects flags to , + this assumes that all the data relating to this event is passed in via the + parameter and no other data should be captured from the environment. + + + + + + Initializes a new instance of the class + using specific data. + + Data used to initialize the logging event. + + + This constructor is provided to allow a + to be created independently of the log4net framework. This can + be useful if you require a custom serialization scheme. + + + Use the method to obtain an + instance of the class. + + + This constructor sets this objects flags to , + this assumes that all the data relating to this event is passed in via the + parameter and no other data should be captured from the environment. + + + + + + Serialization constructor + + The that holds the serialized object data. + The that contains contextual information about the source or destination. + + + Initializes a new instance of the class + with serialized data. + + + + + + Ensure that the repository is set. + + the value for the repository + + + + Write the rendered message to a TextWriter + + the writer to write the message to + + + Unlike the property this method + does store the message data in the internal cache. Therefore + if called only once this method should be faster than the + property, however if the message is + to be accessed multiple times then the property will be more efficient. + + + + + + Serializes this object into the provided. + + The to populate with data. + The destination for this serialization. + + + The data in this event must be fixed before it can be serialized. + + + The method must be called during the + method call if this event + is to be used outside that method. + + + + + + Gets the portable data for this . + + The for this event. + + + A new can be constructed using a + instance. + + + Does a fix of the data + in the logging event before returning the event data. + + + + + + Gets the portable data for this . + + The set of data to ensure is fixed in the LoggingEventData + The for this event. + + + A new can be constructed using a + instance. + + + + + + Returns this event's exception's rendered using the + . + + + This event's exception's rendered using the . + + + + Obsolete. Use instead. + + + + + + Returns this event's exception's rendered using the + . + + + This event's exception's rendered using the . + + + + Returns this event's exception's rendered using the + . + + + + + + Fix instance fields that hold volatile data. + + + + Some of the values in instances of + are considered volatile, that is the values are correct at the + time the event is delivered to appenders, but will not be consistent + at any time afterwards. If an event is to be stored and then processed + at a later time these volatile values must be fixed by calling + . There is a performance penalty + incurred by calling but it + is essential to maintaining data consistency. + + + Calling is equivalent to + calling passing the parameter + false. + + + See for more + information. + + + + + + Fixes instance fields that hold volatile data. + + Set to true to not fix data that takes a long time to fix. + + + Some of the values in instances of + are considered volatile, that is the values are correct at the + time the event is delivered to appenders, but will not be consistent + at any time afterwards. If an event is to be stored and then processed + at a later time these volatile values must be fixed by calling + . There is a performance penalty + for incurred by calling but it + is essential to maintaining data consistency. + + + The param controls the data that + is fixed. Some of the data that can be fixed takes a long time to + generate, therefore if you do not require those settings to be fixed + they can be ignored by setting the param + to true. This setting will ignore the + and settings. + + + Set to false to ensure that all + settings are fixed. + + + + + + Fix the fields specified by the parameter + + the fields to fix + + + Only fields specified in the will be fixed. + Fields will not be fixed if they have previously been fixed. + It is not possible to 'unfix' a field. + + + + + + Lookup a composite property in this event + + the key for the property to lookup + the value for the property + + + This event has composite properties that combine together properties from + several different contexts in the following order: + + + this events properties + + This event has that can be set. These + properties are specific to this event only. + + + + the thread properties + + The that are set on the current + thread. These properties are shared by all events logged on this thread. + + + + the global properties + + The that are set globally. These + properties are shared by all the threads in the AppDomain. + + + + + + + + + Get all the composite properties in this event + + the containing all the properties + + + See for details of the composite properties + stored by the event. + + + This method returns a single containing all the + properties defined for this event. + + + + + + The internal logging event data. + + + + + The internal logging event data. + + + + + The internal logging event data. + + + + + The fully qualified Type of the calling + logger class in the stack frame (i.e. the declaring type of the method). + + + + + The application supplied message of logging event. + + + + + The exception that was thrown. + + + This is not serialized. The string representation + is serialized instead. + + + + + The repository that generated the logging event + + + This is not serialized. + + + + + The fix state for this event + + + These flags indicate which fields have been fixed. + Not serialized. + + + + + Indicated that the internal cache is updateable (ie not fixed) + + + This is a seperate flag to m_fixFlags as it allows incrementel fixing and simpler + changes in the caching strategy. + + + + + Gets the time when the current process started. + + + This is the time when this process started. + + + + The TimeStamp is stored in the local time zone for this computer. + + + Tries to get the start time for the current process. + Failing that it returns the time of the first call to + this property. + + + Note that AppDomains may be loaded and unloaded within the + same process without the process terminating and therefore + without the process start time being reset. + + + + + + Gets the of the logging event. + + + The of the logging event. + + + + Gets the of the logging event. + + + + + + Gets the time of the logging event. + + + The time of the logging event. + + + + The TimeStamp is stored in the local time zone for this computer. + + + + + + Gets the name of the logger that logged the event. + + + The name of the logger that logged the event. + + + + Gets the name of the logger that logged the event. + + + + + + Gets the location information for this logging event. + + + The location information for this logging event. + + + + The collected information is cached for future use. + + + See the class for more information on + supported frameworks and the different behavior in Debug and + Release builds. + + + + + + Gets the message object used to initialize this event. + + + The message object used to initialize this event. + + + + Gets the message object used to initialize this event. + Note that this event may not have a valid message object. + If the event is serialized the message object will not + be transferred. To get the text of the message the + property must be used + not this property. + + + If there is no defined message object for this event then + null will be returned. + + + + + + Gets the exception object used to initialize this event. + + + The exception object used to initialize this event. + + + + Gets the exception object used to initialize this event. + Note that this event may not have a valid exception object. + If the event is serialized the exception object will not + be transferred. To get the text of the exception the + method must be used + not this property. + + + If there is no defined exception object for this event then + null will be returned. + + + + + + The that this event was created in. + + + + The that this event was created in. + + + + + + Gets the message, rendered through the . + + + The message rendered through the . + + + + The collected information is cached for future use. + + + + + + Gets the name of the current thread. + + + The name of the current thread, or the thread ID when + the name is not available. + + + + The collected information is cached for future use. + + + + + + Gets the name of the current user. + + + The name of the current user, or NOT AVAILABLE when the + underlying runtime has no support for retrieving the name of the + current user. + + + + Calls WindowsIdentity.GetCurrent().Name to get the name of + the current windows user. + + + To improve performance, we could cache the string representation of + the name, and reuse that as long as the identity stayed constant. + Once the identity changed, we would need to re-assign and re-render + the string. + + + However, the WindowsIdentity.GetCurrent() call seems to + return different objects every time, so the current implementation + doesn't do this type of caching. + + + Timing for these operations: + + + + Method + Results + + + WindowsIdentity.GetCurrent() + 10000 loops, 00:00:00.2031250 seconds + + + WindowsIdentity.GetCurrent().Name + 10000 loops, 00:00:08.0468750 seconds + + + + This means we could speed things up almost 40 times by caching the + value of the WindowsIdentity.GetCurrent().Name property, since + this takes (8.04-0.20) = 7.84375 seconds. + + + + + + Gets the identity of the current thread principal. + + + The string name of the identity of the current thread principal. + + + + Calls System.Threading.Thread.CurrentPrincipal.Identity.Name to get + the name of the current thread principal. + + + + + + Gets the AppDomain friendly name. + + + The AppDomain friendly name. + + + + Gets the AppDomain friendly name. + + + + + + Additional event specific properties. + + + Additional event specific properties. + + + + A logger or an appender may attach additional + properties to specific events. These properties + have a string key and an object value. + + + This property is for events that have been added directly to + this event. The aggregate properties (which include these + event properties) can be retrieved using + and . + + + Once the properties have been fixed this property + returns the combined cached properties. This ensures that updates to + this property are always reflected in the underlying storage. When + returning the combined properties there may be more keys in the + Dictionary than expected. + + + + + + The fixed fields in this event + + + The set of fields that are fixed in this event + + + + Fields will not be fixed if they have previously been fixed. + It is not possible to 'unfix' a field. + + + + + + Implementation of wrapper interface. + + + + This implementation of the interface + forwards to the held by the base class. + + + This logger has methods to allow the caller to log at the following + levels: + + + + DEBUG + + The and methods log messages + at the DEBUG level. That is the level with that name defined in the + repositories . The default value + for this level is . The + property tests if this level is enabled for logging. + + + + INFO + + The and methods log messages + at the INFO level. That is the level with that name defined in the + repositories . The default value + for this level is . The + property tests if this level is enabled for logging. + + + + WARN + + The and methods log messages + at the WARN level. That is the level with that name defined in the + repositories . The default value + for this level is . The + property tests if this level is enabled for logging. + + + + ERROR + + The and methods log messages + at the ERROR level. That is the level with that name defined in the + repositories . The default value + for this level is . The + property tests if this level is enabled for logging. + + + + FATAL + + The and methods log messages + at the FATAL level. That is the level with that name defined in the + repositories . The default value + for this level is . The + property tests if this level is enabled for logging. + + + + + The values for these levels and their semantic meanings can be changed by + configuring the for the repository. + + + Nicko Cadell + Gert Driesen + + + + The ILog interface is use by application to log messages into + the log4net framework. + + + + Use the to obtain logger instances + that implement this interface. The + static method is used to get logger instances. + + + This class contains methods for logging at different levels and also + has properties for determining if those logging levels are + enabled in the current configuration. + + + This interface can be implemented in different ways. This documentation + specifies reasonable behavior that a caller can expect from the actual + implementation, however different implementations reserve the right to + do things differently. + + + Simple example of logging messages + + ILog log = LogManager.GetLogger("application-log"); + + log.Info("Application Start"); + log.Debug("This is a debug message"); + + if (log.IsDebugEnabled) + { + log.Debug("This is another debug message"); + } + + + + + Nicko Cadell + Gert Driesen + + + Log a message object with the level. + + Log a message object with the level. + + The message object to log. + + + This method first checks if this logger is DEBUG + enabled by comparing the level of this logger with the + level. If this logger is + DEBUG enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a formatted string with the level. + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + Log a message object with the level. + + Logs a message object with the level. + + + + This method first checks if this logger is INFO + enabled by comparing the level of this logger with the + level. If this logger is + INFO enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of the + additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + The message object to log. + + + + + + Logs a message object with the INFO level including + the stack trace of the passed + as a parameter. + + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a formatted message string with the level. + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + Log a message object with the level. + + Log a message object with the level. + + + + This method first checks if this logger is WARN + enabled by comparing the level of this logger with the + level. If this logger is + WARN enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of the + additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + The message object to log. + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a formatted message string with the level. + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + Log a message object with the level. + + Logs a message object with the level. + + The message object to log. + + + This method first checks if this logger is ERROR + enabled by comparing the level of this logger with the + level. If this logger is + ERROR enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of the + additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a formatted message string with the level. + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + Log a message object with the level. + + Log a message object with the level. + + + + This method first checks if this logger is FATAL + enabled by comparing the level of this logger with the + level. If this logger is + FATAL enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of the + additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + The message object to log. + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a formatted message string with the level. + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Checks if this logger is enabled for the level. + + + true if this logger is enabled for events, false otherwise. + + + + This function is intended to lessen the computational cost of + disabled log debug statements. + + For some ILog interface log, when you write: + + log.Debug("This is entry number: " + i ); + + + You incur the cost constructing the message, string construction and concatenation in + this case, regardless of whether the message is logged or not. + + + If you are worried about speed (who isn't), then you should write: + + + if (log.IsDebugEnabled) + { + log.Debug("This is entry number: " + i ); + } + + + This way you will not incur the cost of parameter + construction if debugging is disabled for log. On + the other hand, if the log is debug enabled, you + will incur the cost of evaluating whether the logger is debug + enabled twice. Once in and once in + the . This is an insignificant overhead + since evaluating a logger takes about 1% of the time it + takes to actually log. This is the preferred style of logging. + + Alternatively if your logger is available statically then the is debug + enabled state can be stored in a static variable like this: + + + private static readonly bool isDebugEnabled = log.IsDebugEnabled; + + + Then when you come to log you can write: + + + if (isDebugEnabled) + { + log.Debug("This is entry number: " + i ); + } + + + This way the debug enabled state is only queried once + when the class is loaded. Using a private static readonly + variable is the most efficient because it is a run time constant + and can be heavily optimized by the JIT compiler. + + + Of course if you use a static readonly variable to + hold the enabled state of the logger then you cannot + change the enabled state at runtime to vary the logging + that is produced. You have to decide if you need absolute + speed or runtime flexibility. + + + + + + + + Checks if this logger is enabled for the level. + + + true if this logger is enabled for events, false otherwise. + + + For more information see . + + + + + + + + Checks if this logger is enabled for the level. + + + true if this logger is enabled for events, false otherwise. + + + For more information see . + + + + + + + + Checks if this logger is enabled for the level. + + + true if this logger is enabled for events, false otherwise. + + + For more information see . + + + + + + + + Checks if this logger is enabled for the level. + + + true if this logger is enabled for events, false otherwise. + + + For more information see . + + + + + + + + Construct a new wrapper for the specified logger. + + The logger to wrap. + + + Construct a new wrapper for the specified logger. + + + + + + Virtual method called when the configuration of the repository changes + + the repository holding the levels + + + Virtual method called when the configuration of the repository changes + + + + + + Logs a message object with the DEBUG level. + + The message object to log. + + + This method first checks if this logger is DEBUG + enabled by comparing the level of this logger with the + DEBUG level. If this logger is + DEBUG enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of the + additivity flag. + + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + Logs a message object with the DEBUG level + + The message object to log. + The exception to log, including its stack trace. + + + Logs a message object with the DEBUG level including + the stack trace of the passed + as a parameter. + + + See the form for more detailed information. + + + + + + + Logs a formatted message string with the DEBUG level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the DEBUG level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the DEBUG level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the DEBUG level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the DEBUG level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a message object with the INFO level. + + The message object to log. + + + This method first checks if this logger is INFO + enabled by comparing the level of this logger with the + INFO level. If this logger is + INFO enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + Logs a message object with the INFO level. + + The message object to log. + The exception to log, including its stack trace. + + + Logs a message object with the INFO level including + the stack trace of the + passed as a parameter. + + + See the form for more detailed information. + + + + + + + Logs a formatted message string with the INFO level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the INFO level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the INFO level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the INFO level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the INFO level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a message object with the WARN level. + + the message object to log + + + This method first checks if this logger is WARN + enabled by comparing the level of this logger with the + WARN level. If this logger is + WARN enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger and + also higher in the hierarchy depending on the value of the + additivity flag. + + + WARNING Note that passing an to this + method will print the name of the but no + stack trace. To print a stack trace use the + form instead. + + + + + + Logs a message object with the WARN level + + The message object to log. + The exception to log, including its stack trace. + + + Logs a message object with the WARN level including + the stack trace of the + passed as a parameter. + + + See the form for more detailed information. + + + + + + + Logs a formatted message string with the WARN level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the WARN level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the WARN level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the WARN level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the WARN level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a message object with the ERROR level. + + The message object to log. + + + This method first checks if this logger is ERROR + enabled by comparing the level of this logger with the + ERROR level. If this logger is + ERROR enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger and + also higher in the hierarchy depending on the value of the + additivity flag. + + + WARNING Note that passing an to this + method will print the name of the but no + stack trace. To print a stack trace use the + form instead. + + + + + + Logs a message object with the ERROR level + + The message object to log. + The exception to log, including its stack trace. + + + Logs a message object with the ERROR level including + the stack trace of the + passed as a parameter. + + + See the form for more detailed information. + + + + + + + Logs a formatted message string with the ERROR level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the ERROR level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the ERROR level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the ERROR level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the ERROR level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a message object with the FATAL level. + + The message object to log. + + + This method first checks if this logger is FATAL + enabled by comparing the level of this logger with the + FATAL level. If this logger is + FATAL enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger and + also higher in the hierarchy depending on the value of the + additivity flag. + + + WARNING Note that passing an to this + method will print the name of the but no + stack trace. To print a stack trace use the + form instead. + + + + + + Logs a message object with the FATAL level + + The message object to log. + The exception to log, including its stack trace. + + + Logs a message object with the FATAL level including + the stack trace of the + passed as a parameter. + + + See the form for more detailed information. + + + + + + + Logs a formatted message string with the FATAL level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the FATAL level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the FATAL level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the FATAL level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the FATAL level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Event handler for the event + + the repository + Empty + + + + The fully qualified name of this declaring type not the type of any subclass. + + + + + Checks if this logger is enabled for the DEBUG + level. + + + true if this logger is enabled for DEBUG events, + false otherwise. + + + + This function is intended to lessen the computational cost of + disabled log debug statements. + + + For some log Logger object, when you write: + + + log.Debug("This is entry number: " + i ); + + + You incur the cost constructing the message, concatenation in + this case, regardless of whether the message is logged or not. + + + If you are worried about speed, then you should write: + + + if (log.IsDebugEnabled()) + { + log.Debug("This is entry number: " + i ); + } + + + This way you will not incur the cost of parameter + construction if debugging is disabled for log. On + the other hand, if the log is debug enabled, you + will incur the cost of evaluating whether the logger is debug + enabled twice. Once in IsDebugEnabled and once in + the Debug. This is an insignificant overhead + since evaluating a logger takes about 1% of the time it + takes to actually log. + + + + + + Checks if this logger is enabled for the INFO level. + + + true if this logger is enabled for INFO events, + false otherwise. + + + + See for more information and examples + of using this method. + + + + + + + Checks if this logger is enabled for the WARN level. + + + true if this logger is enabled for WARN events, + false otherwise. + + + + See for more information and examples + of using this method. + + + + + + + Checks if this logger is enabled for the ERROR level. + + + true if this logger is enabled for ERROR events, + false otherwise. + + + + See for more information and examples of using this method. + + + + + + + Checks if this logger is enabled for the FATAL level. + + + true if this logger is enabled for FATAL events, + false otherwise. + + + + See for more information and examples of using this method. + + + + + + + A SecurityContext used by log4net when interacting with protected resources + + + + A SecurityContext used by log4net when interacting with protected resources + for example with operating system services. This can be used to impersonate + a principal that has been granted privileges on the system resources. + + + Nicko Cadell + + + + Impersonate this SecurityContext + + State supplied by the caller + An instance that will + revoke the impersonation of this SecurityContext, or null + + + Impersonate this security context. Further calls on the current + thread should now be made in the security context provided + by this object. When the result + method is called the security + context of the thread should be reverted to the state it was in + before was called. + + + + + + The providers default instances. + + + + A configured component that interacts with potentially protected system + resources uses a to provide the elevated + privileges required. If the object has + been not been explicitly provided to the component then the component + will request one from this . + + + By default the is + an instance of which returns only + objects. This is a reasonable default + where the privileges required are not know by the system. + + + This default behavior can be overridden by subclassing the + and overriding the method to return + the desired objects. The default provider + can be replaced by programmatically setting the value of the + property. + + + An alternative is to use the log4net.Config.SecurityContextProviderAttribute + This attribute can be applied to an assembly in the same way as the + log4net.Config.XmlConfiguratorAttribute". The attribute takes + the type to use as the as an argument. + + + Nicko Cadell + + + + The default provider + + + + + Protected default constructor to allow subclassing + + + + Protected default constructor to allow subclassing + + + + + + Create a SecurityContext for a consumer + + The consumer requesting the SecurityContext + An impersonation context + + + The default implementation is to return a . + + + Subclasses should override this method to provide their own + behavior. + + + + + + Gets or sets the default SecurityContextProvider + + + The default SecurityContextProvider + + + + The default provider is used by configured components that + require a and have not had one + given to them. + + + By default this is an instance of + that returns objects. + + + The default provider can be set programmatically by setting + the value of this property to a sub class of + that has the desired behavior. + + + + + + An evaluator that triggers after specified number of seconds. + + + + This evaluator will trigger if the specified time period + has passed since last check. + + + Robert Sevcik + + + + The default time threshold for triggering in seconds. Zero means it won't trigger at all. + + + + + The time threshold for triggering in seconds. Zero means it won't trigger at all. + + + + + The time of last check. This gets updated when the object is created and when the evaluator triggers. + + + + + Create a new evaluator using the time threshold in seconds. + + + + Create a new evaluator using the time threshold in seconds. + + + This evaluator will trigger if the specified time period + has passed since last check. + + + + + + Create a new evaluator using the specified time threshold in seconds. + + + The time threshold in seconds to trigger after. + Zero means it won't trigger at all. + + + + Create a new evaluator using the specified time threshold in seconds. + + + This evaluator will trigger if the specified time period + has passed since last check. + + + + + + Is this the triggering event? + + The event to check + This method returns true, if the specified time period + has passed since last check.. + Otherwise it returns false + + + This evaluator will trigger if the specified time period + has passed since last check. + + + + + + The time threshold in seconds to trigger after + + + The time threshold in seconds to trigger after. + Zero means it won't trigger at all. + + + + This evaluator will trigger if the specified time period + has passed since last check. + + + + + + Delegate used to handle creation of new wrappers. + + The logger to wrap in a wrapper. + + + Delegate used to handle creation of new wrappers. This delegate + is called from the + method to construct the wrapper for the specified logger. + + + The delegate to use is supplied to the + constructor. + + + + + + Maps between logger objects and wrapper objects. + + + + This class maintains a mapping between objects and + objects. Use the method to + lookup the for the specified . + + + New wrapper instances are created by the + method. The default behavior is for this method to delegate construction + of the wrapper to the delegate supplied + to the constructor. This allows specialization of the behavior without + requiring subclassing of this type. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the + + The handler to use to create the wrapper objects. + + + Initializes a new instance of the class with + the specified handler to create the wrapper objects. + + + + + + Gets the wrapper object for the specified logger. + + The wrapper object for the specified logger + + + If the logger is null then the corresponding wrapper is null. + + + Looks up the wrapper it it has previously been requested and + returns it. If the wrapper has never been requested before then + the virtual method is + called. + + + + + + Creates the wrapper object for the specified logger. + + The logger to wrap in a wrapper. + The wrapper object for the logger. + + + This implementation uses the + passed to the constructor to create the wrapper. This method + can be overridden in a subclass. + + + + + + Called when a monitored repository shutdown event is received. + + The that is shutting down + + + This method is called when a that this + is holding loggers for has signaled its shutdown + event . The default + behavior of this method is to release the references to the loggers + and their wrappers generated for this repository. + + + + + + Event handler for repository shutdown event. + + The sender of the event. + The event args. + + + + Map of logger repositories to hashtables of ILogger to ILoggerWrapper mappings + + + + + The handler to use to create the extension wrapper objects. + + + + + Internal reference to the delegate used to register for repository shutdown events. + + + + + Gets the map of logger repositories. + + + Map of logger repositories. + + + + Gets the hashtable that is keyed on . The + values are hashtables keyed on with the + value being the corresponding . + + + + + + Formats a as "HH:mm:ss,fff". + + + + Formats a in the format "HH:mm:ss,fff" for example, "15:49:37,459". + + + Nicko Cadell + Gert Driesen + + + + Render a as a string. + + + + Interface to abstract the rendering of a + instance into a string. + + + The method is used to render the + date to a text writer. + + + Nicko Cadell + Gert Driesen + + + + Formats the specified date as a string. + + The date to format. + The writer to write to. + + + Format the as a string and write it + to the provided. + + + + + + String constant used to specify AbsoluteTimeDateFormat in layouts. Current value is ABSOLUTE. + + + + + String constant used to specify DateTimeDateFormat in layouts. Current value is DATE. + + + + + String constant used to specify ISO8601DateFormat in layouts. Current value is ISO8601. + + + + + Renders the date into a string. Format is "HH:mm:ss". + + The date to render into a string. + The string builder to write to. + + + Subclasses should override this method to render the date + into a string using a precision up to the second. This method + will be called at most once per second and the result will be + reused if it is needed again during the same second. + + + + + + Renders the date into a string. Format is "HH:mm:ss,fff". + + The date to render into a string. + The writer to write to. + + + Uses the method to generate the + time string up to the seconds and then appends the current + milliseconds. The results from are + cached and is called at most once + per second. + + + Sub classes should override + rather than . + + + + + + Last stored time with precision up to the second. + + + + + Last stored time with precision up to the second, formatted + as a string. + + + + + Last stored time with precision up to the second, formatted + as a string. + + + + + Formats a as "dd MMM yyyy HH:mm:ss,fff" + + + + Formats a in the format + "dd MMM yyyy HH:mm:ss,fff" for example, + "06 Nov 1994 15:49:37,459". + + + Nicko Cadell + Gert Driesen + Angelika Schnagl + + + + Default constructor. + + + + Initializes a new instance of the class. + + + + + + Formats the date without the milliseconds part + + The date to format. + The string builder to write to. + + + Formats a DateTime in the format "dd MMM yyyy HH:mm:ss" + for example, "06 Nov 1994 15:49:37". + + + The base class will append the ",fff" milliseconds section. + This method will only be called at most once per second. + + + + + + The format info for the invariant culture. + + + + + Formats the as "yyyy-MM-dd HH:mm:ss,fff". + + + + Formats the specified as a string: "yyyy-MM-dd HH:mm:ss,fff". + + + Nicko Cadell + Gert Driesen + + + + Default constructor + + + + Initializes a new instance of the class. + + + + + + Formats the date without the milliseconds part + + The date to format. + The string builder to write to. + + + Formats the date specified as a string: "yyyy-MM-dd HH:mm:ss". + + + The base class will append the ",fff" milliseconds section. + This method will only be called at most once per second. + + + + + + Formats the using the method. + + + + Formats the using the method. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + The format string. + + + Initializes a new instance of the class + with the specified format string. + + + The format string must be compatible with the options + that can be supplied to . + + + + + + Formats the date using . + + The date to convert to a string. + The writer to write to. + + + Uses the date format string supplied to the constructor to call + the method to format the date. + + + + + + The format string used to format the . + + + + The format string must be compatible with the options + that can be supplied to . + + + + + + This filter drops all . + + + + You can add this filter to the end of a filter chain to + switch from the default "accept all unless instructed otherwise" + filtering behavior to a "deny all unless instructed otherwise" + behavior. + + + Nicko Cadell + Gert Driesen + + + + Subclass this type to implement customized logging event filtering + + + + Users should extend this class to implement customized logging + event filtering. Note that and + , the parent class of all standard + appenders, have built-in filtering rules. It is suggested that you + first use and understand the built-in rules before rushing to write + your own custom filters. + + + This abstract class assumes and also imposes that filters be + organized in a linear chain. The + method of each filter is called sequentially, in the order of their + addition to the chain. + + + The method must return one + of the integer constants , + or . + + + If the value is returned, then the log event is dropped + immediately without consulting with the remaining filters. + + + If the value is returned, then the next filter + in the chain is consulted. If there are no more filters in the + chain, then the log event is logged. Thus, in the presence of no + filters, the default behavior is to log all logging events. + + + If the value is returned, then the log + event is logged without consulting the remaining filters. + + + The philosophy of log4net filters is largely inspired from the + Linux ipchains. + + + Nicko Cadell + Gert Driesen + + + + Implement this interface to provide customized logging event filtering + + + + Users should implement this interface to implement customized logging + event filtering. Note that and + , the parent class of all standard + appenders, have built-in filtering rules. It is suggested that you + first use and understand the built-in rules before rushing to write + your own custom filters. + + + This abstract class assumes and also imposes that filters be + organized in a linear chain. The + method of each filter is called sequentially, in the order of their + addition to the chain. + + + The method must return one + of the integer constants , + or . + + + If the value is returned, then the log event is dropped + immediately without consulting with the remaining filters. + + + If the value is returned, then the next filter + in the chain is consulted. If there are no more filters in the + chain, then the log event is logged. Thus, in the presence of no + filters, the default behavior is to log all logging events. + + + If the value is returned, then the log + event is logged without consulting the remaining filters. + + + The philosophy of log4net filters is largely inspired from the + Linux ipchains. + + + Nicko Cadell + Gert Driesen + + + + Decide if the logging event should be logged through an appender. + + The LoggingEvent to decide upon + The decision of the filter + + + If the decision is , then the event will be + dropped. If the decision is , then the next + filter, if any, will be invoked. If the decision is then + the event will be logged without consulting with other filters in + the chain. + + + + + + Property to get and set the next filter + + + The next filter in the chain + + + + Filters are typically composed into chains. This property allows the next filter in + the chain to be accessed. + + + + + + Points to the next filter in the filter chain. + + + + See for more information. + + + + + + Initialize the filter with the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + Typically filter's options become active immediately on set, + however this method must still be called. + + + + + + Decide if the should be logged through an appender. + + The to decide upon + The decision of the filter + + + If the decision is , then the event will be + dropped. If the decision is , then the next + filter, if any, will be invoked. If the decision is then + the event will be logged without consulting with other filters in + the chain. + + + This method is marked abstract and must be implemented + in a subclass. + + + + + + Property to get and set the next filter + + + The next filter in the chain + + + + Filters are typically composed into chains. This property allows the next filter in + the chain to be accessed. + + + + + + Default constructor + + + + + Always returns the integer constant + + the LoggingEvent to filter + Always returns + + + Ignores the event being logged and just returns + . This can be used to change the default filter + chain behavior from to . This filter + should only be used as the last filter in the chain + as any further filters will be ignored! + + + + + + The return result from + + + + The return result from + + + + + + The log event must be dropped immediately without + consulting with the remaining filters, if any, in the chain. + + + + + This filter is neutral with respect to the log event. + The remaining filters, if any, should be consulted for a final decision. + + + + + The log event must be logged immediately without + consulting with the remaining filters, if any, in the chain. + + + + + This is a very simple filter based on matching. + + + + The filter admits two options and + . If there is an exact match between the value + of the option and the of the + , then the method returns in + case the option value is set + to true, if it is false then + is returned. If the does not match then + the result will be . + + + Nicko Cadell + Gert Driesen + + + + flag to indicate if the filter should on a match + + + + + the to match against + + + + + Default constructor + + + + + Tests if the of the logging event matches that of the filter + + the event to filter + see remarks + + + If the of the event matches the level of the + filter then the result of the function depends on the + value of . If it is true then + the function will return , it it is false then it + will return . If the does not match then + the result will be . + + + + + + when matching + + + + The property is a flag that determines + the behavior when a matching is found. If the + flag is set to true then the filter will the + logging event, otherwise it will the event. + + + The default is true i.e. to the event. + + + + + + The that the filter will match + + + + The level that this filter will attempt to match against the + level. If a match is found then + the result depends on the value of . + + + + + + This is a simple filter based on matching. + + + + The filter admits three options and + that determine the range of priorities that are matched, and + . If there is a match between the range + of priorities and the of the , then the + method returns in case the + option value is set to true, if it is false + then is returned. If there is no match, is returned. + + + Nicko Cadell + Gert Driesen + + + + Flag to indicate the behavior when matching a + + + + + the minimum value to match + + + + + the maximum value to match + + + + + Default constructor + + + + + Check if the event should be logged. + + the logging event to check + see remarks + + + If the of the logging event is outside the range + matched by this filter then + is returned. If the is matched then the value of + is checked. If it is true then + is returned, otherwise + is returned. + + + + + + when matching and + + + + The property is a flag that determines + the behavior when a matching is found. If the + flag is set to true then the filter will the + logging event, otherwise it will the event. + + + The default is true i.e. to the event. + + + + + + Set the minimum matched + + + + The minimum level that this filter will attempt to match against the + level. If a match is found then + the result depends on the value of . + + + + + + Sets the maximum matched + + + + The maximum level that this filter will attempt to match against the + level. If a match is found then + the result depends on the value of . + + + + + + Simple filter to match a string in the event's logger name. + + + + The works very similar to the . It admits two + options and . If the + of the starts + with the value of the option, then the + method returns in + case the option value is set to true, + if it is false then is returned. + + + Daniel Cazzulino + + + + Flag to indicate the behavior when we have a match + + + + + The logger name string to substring match against the event + + + + + Default constructor + + + + + Check if this filter should allow the event to be logged + + the event being logged + see remarks + + + The rendered message is matched against the . + If the equals the beginning of + the incoming () + then a match will have occurred. If no match occurs + this function will return + allowing other filters to check the event. If a match occurs then + the value of is checked. If it is + true then is returned otherwise + is returned. + + + + + + when matching + + + + The property is a flag that determines + the behavior when a matching is found. If the + flag is set to true then the filter will the + logging event, otherwise it will the event. + + + The default is true i.e. to the event. + + + + + + The that the filter will match + + + + This filter will attempt to match this value against logger name in + the following way. The match will be done against the beginning of the + logger name (using ). The match is + case sensitive. If a match is found then + the result depends on the value of . + + + + + + Simple filter to match a keyed string in the + + + + Simple filter to match a keyed string in the + + + As the MDC has been replaced with layered properties the + should be used instead. + + + Nicko Cadell + Gert Driesen + + + + Simple filter to match a string an event property + + + + Simple filter to match a string in the value for a + specific event property + + + Nicko Cadell + + + + Simple filter to match a string in the rendered message + + + + Simple filter to match a string in the rendered message + + + Nicko Cadell + Gert Driesen + + + + Flag to indicate the behavior when we have a match + + + + + The string to substring match against the message + + + + + A string regex to match + + + + + A regex object to match (generated from m_stringRegexToMatch) + + + + + Default constructor + + + + + Initialize and precompile the Regex if required + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Check if this filter should allow the event to be logged + + the event being logged + see remarks + + + The rendered message is matched against the . + If the occurs as a substring within + the message then a match will have occurred. If no match occurs + this function will return + allowing other filters to check the event. If a match occurs then + the value of is checked. If it is + true then is returned otherwise + is returned. + + + + + + when matching or + + + + The property is a flag that determines + the behavior when a matching is found. If the + flag is set to true then the filter will the + logging event, otherwise it will the event. + + + The default is true i.e. to the event. + + + + + + Sets the static string to match + + + + The string that will be substring matched against + the rendered message. If the message contains this + string then the filter will match. If a match is found then + the result depends on the value of . + + + One of or + must be specified. + + + + + + Sets the regular expression to match + + + + The regular expression pattern that will be matched against + the rendered message. If the message matches this + pattern then the filter will match. If a match is found then + the result depends on the value of . + + + One of or + must be specified. + + + + + + The key to use to lookup the string from the event properties + + + + + Default constructor + + + + + Check if this filter should allow the event to be logged + + the event being logged + see remarks + + + The event property for the is matched against + the . + If the occurs as a substring within + the property value then a match will have occurred. If no match occurs + this function will return + allowing other filters to check the event. If a match occurs then + the value of is checked. If it is + true then is returned otherwise + is returned. + + + + + + The key to lookup in the event properties and then match against. + + + + The key name to use to lookup in the properties map of the + . The match will be performed against + the value of this property if it exists. + + + + + + Simple filter to match a string in the + + + + Simple filter to match a string in the + + + As the MDC has been replaced with named stacks stored in the + properties collections the should + be used instead. + + + Nicko Cadell + Gert Driesen + + + + Default constructor + + + + Sets the to "NDC". + + + + + + Write the event appdomain name to the output + + + + Writes the to the output writer. + + + Daniel Cazzulino + Nicko Cadell + + + + Abstract class that provides the formatting functionality that + derived classes need. + + + Conversion specifiers in a conversion patterns are parsed to + individual PatternConverters. Each of which is responsible for + converting a logging event in a converter specific manner. + + Nicko Cadell + + + + Abstract class that provides the formatting functionality that + derived classes need. + + + + Conversion specifiers in a conversion patterns are parsed to + individual PatternConverters. Each of which is responsible for + converting a logging event in a converter specific manner. + + + Nicko Cadell + Gert Driesen + + + + Initial buffer size + + + + + Maximum buffer size before it is recycled + + + + + Protected constructor + + + + Initializes a new instance of the class. + + + + + + Evaluate this pattern converter and write the output to a writer. + + that will receive the formatted result. + The state object on which the pattern converter should be executed. + + + Derived pattern converters must override this method in order to + convert conversion specifiers in the appropriate way. + + + + + + Set the next pattern converter in the chains + + the pattern converter that should follow this converter in the chain + the next converter + + + The PatternConverter can merge with its neighbor during this method (or a sub class). + Therefore the return value may or may not be the value of the argument passed in. + + + + + + Write the pattern converter to the writer with appropriate formatting + + that will receive the formatted result. + The state object on which the pattern converter should be executed. + + + This method calls to allow the subclass to perform + appropriate conversion of the pattern converter. If formatting options have + been specified via the then this method will + apply those formattings before writing the output. + + + + + + Fast space padding method. + + to which the spaces will be appended. + The number of spaces to be padded. + + + Fast space padding method. + + + + + + The option string to the converter + + + + + Write an dictionary to a + + the writer to write to + a to use for object conversion + the value to write to the writer + + + Writes the to a writer in the form: + + + {key1=value1, key2=value2, key3=value3} + + + If the specified + is not null then it is used to render the key and value to text, otherwise + the object's ToString method is called. + + + + + + Write an dictionary to a + + the writer to write to + a to use for object conversion + the value to write to the writer + + + Writes the to a writer in the form: + + + {key1=value1, key2=value2, key3=value3} + + + If the specified + is not null then it is used to render the key and value to text, otherwise + the object's ToString method is called. + + + + + + Write an object to a + + the writer to write to + a to use for object conversion + the value to write to the writer + + + Writes the Object to a writer. If the specified + is not null then it is used to render the object to text, otherwise + the object's ToString method is called. + + + + + + Get the next pattern converter in the chain + + + the next pattern converter in the chain + + + + Get the next pattern converter in the chain + + + + + + Gets or sets the formatting info for this converter + + + The formatting info for this converter + + + + Gets or sets the formatting info for this converter + + + + + + Gets or sets the option value for this converter + + + The option for this converter + + + + Gets or sets the option value for this converter + + + + + + + + + + + Initializes a new instance of the class. + + + + + Derived pattern converters must override this method in order to + convert conversion specifiers in the correct way. + + that will receive the formatted result. + The on which the pattern converter should be executed. + + + + Derived pattern converters must override this method in order to + convert conversion specifiers in the correct way. + + that will receive the formatted result. + The state object on which the pattern converter should be executed. + + + + Flag indicating if this converter handles exceptions + + + false if this converter handles exceptions + + + + + Flag indicating if this converter handles the logging event exception + + false if this converter handles the logging event exception + + + If this converter handles the exception object contained within + , then this property should be set to + false. Otherwise, if the layout ignores the exception + object, then the property should be set to true. + + + Set this value to override a this default setting. The default + value is true, this converter does not handle the exception. + + + + + + Write the event appdomain name to the output + + that will receive the formatted result. + the event being logged + + + Writes the to the output . + + + + + + Converter for items in the ASP.Net Cache. + + + + Outputs an item from the . + + + Ron Grabowski + + + + Abstract class that provides access to the current HttpContext () that + derived classes need. + + + This class handles the case when HttpContext.Current is null by writing + to the writer. + + Ron Grabowski + + + + Derived pattern converters must override this method in order to + convert conversion specifiers in the correct way. + + that will receive the formatted result. + The on which the pattern converter should be executed. + The under which the ASP.Net request is running. + + + + Write the ASP.Net Cache item to the output + + that will receive the formatted result. + The on which the pattern converter should be executed. + The under which the ASP.Net request is running. + + + Writes out the value of a named property. The property name + should be set in the + property. If no property has been set, all key value pairs from the Cache will + be written to the output. + + + + + + Converter for items in the . + + + + Outputs an item from the . + + + Ron Grabowski + + + + Write the ASP.Net HttpContext item to the output + + that will receive the formatted result. + The on which the pattern converter should be executed. + The under which the ASP.Net request is running. + + + Writes out the value of a named property. The property name + should be set in the + property. + + + + + + Converter for items in the ASP.Net Cache. + + + + Outputs an item from the . + + + Ron Grabowski + + + + Write the ASP.Net Cache item to the output + + that will receive the formatted result. + The on which the pattern converter should be executed. + The under which the ASP.Net request is running. + + + Writes out the value of a named property. The property name + should be set in the + property. + + + + + + Converter for items in the ASP.Net Cache. + + + + Outputs an item from the . + + + Ron Grabowski + + + + Write the ASP.Net Cache item to the output + + that will receive the formatted result. + The on which the pattern converter should be executed. + The under which the ASP.Net request is running. + + + Writes out the value of a named property. The property name + should be set in the + property. If no property has been set, all key value pairs from the Session will + be written to the output. + + + + + + Date pattern converter, uses a to format + the date of a . + + + + Render the to the writer as a string. + + + The value of the determines + the formatting of the date. The following values are allowed: + + + Option value + Output + + + ISO8601 + + Uses the formatter. + Formats using the "yyyy-MM-dd HH:mm:ss,fff" pattern. + + + + DATE + + Uses the formatter. + Formats using the "dd MMM yyyy HH:mm:ss,fff" for example, "06 Nov 1994 15:49:37,459". + + + + ABSOLUTE + + Uses the formatter. + Formats using the "HH:mm:ss,yyyy" for example, "15:49:37,459". + + + + other + + Any other pattern string uses the formatter. + This formatter passes the pattern string to the + method. + For details on valid patterns see + DateTimeFormatInfo Class. + + + + + + The is in the local time zone and is rendered in that zone. + To output the time in Universal time see . + + + Nicko Cadell + + + + The used to render the date to a string + + + + The used to render the date to a string + + + + + + Initialize the converter pattern based on the property. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Convert the pattern into the rendered message + + that will receive the formatted result. + the event being logged + + + Pass the to the + for it to render it to the writer. + + + The passed is in the local time zone. + + + + + + The fully qualified type of the DatePatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Write the exception text to the output + + + + If an exception object is stored in the logging event + it will be rendered into the pattern output with a + trailing newline. + + + If there is no exception then nothing will be output + and no trailing newline will be appended. + It is typical to put a newline before the exception + and to have the exception as the last data in the pattern. + + + Nicko Cadell + + + + Default constructor + + + + + Write the exception text to the output + + that will receive the formatted result. + the event being logged + + + If an exception object is stored in the logging event + it will be rendered into the pattern output with a + trailing newline. + + + If there is no exception or the exception property specified + by the Option value does not exist then nothing will be output + and no trailing newline will be appended. + It is typical to put a newline before the exception + and to have the exception as the last data in the pattern. + + + Recognized values for the Option parameter are: + + + + Message + + + Source + + + StackTrace + + + TargetSite + + + HelpLink + + + + + + + Writes the caller location file name to the output + + + + Writes the value of the for + the event to the output writer. + + + Nicko Cadell + + + + Write the caller location file name to the output + + that will receive the formatted result. + the event being logged + + + Writes the value of the for + the to the output . + + + + + + Write the caller location info to the output + + + + Writes the to the output writer. + + + Nicko Cadell + + + + Write the caller location info to the output + + that will receive the formatted result. + the event being logged + + + Writes the to the output writer. + + + + + + Writes the event identity to the output + + + + Writes the value of the to + the output writer. + + + Daniel Cazzulino + Nicko Cadell + + + + Writes the event identity to the output + + that will receive the formatted result. + the event being logged + + + Writes the value of the + to + the output . + + + + + + Write the event level to the output + + + + Writes the display name of the event + to the writer. + + + Nicko Cadell + + + + Write the event level to the output + + that will receive the formatted result. + the event being logged + + + Writes the of the + to the . + + + + + + Write the caller location line number to the output + + + + Writes the value of the for + the event to the output writer. + + + Nicko Cadell + + + + Write the caller location line number to the output + + that will receive the formatted result. + the event being logged + + + Writes the value of the for + the to the output . + + + + + + Converter for logger name + + + + Outputs the of the event. + + + Nicko Cadell + + + + Converter to output and truncate '.' separated strings + + + + This abstract class supports truncating a '.' separated string + to show a specified number of elements from the right hand side. + This is used to truncate class names that are fully qualified. + + + Subclasses should override the method to + return the fully qualified string. + + + Nicko Cadell + + + + Initialize the converter + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Get the fully qualified string data + + the event being logged + the fully qualified name + + + Overridden by subclasses to get the fully qualified name before the + precision is applied to it. + + + Return the fully qualified '.' (dot/period) separated string. + + + + + + Convert the pattern to the rendered message + + that will receive the formatted result. + the event being logged + + Render the to the precision + specified by the property. + + + + + The fully qualified type of the NamedPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets the fully qualified name of the logger + + the event being logged + The fully qualified logger name + + + Returns the of the . + + + + + + Writes the event message to the output + + + + Uses the method + to write out the event message. + + + Nicko Cadell + + + + Writes the event message to the output + + that will receive the formatted result. + the event being logged + + + Uses the method + to write out the event message. + + + + + + Write the method name to the output + + + + Writes the caller location to + the output. + + + Nicko Cadell + + + + Write the method name to the output + + that will receive the formatted result. + the event being logged + + + Writes the caller location to + the output. + + + + + + Converter to include event NDC + + + + Outputs the value of the event property named NDC. + + + The should be used instead. + + + Nicko Cadell + + + + Write the event NDC to the output + + that will receive the formatted result. + the event being logged + + + As the thread context stacks are now stored in named event properties + this converter simply looks up the value of the NDC property. + + + The should be used instead. + + + + + + Property pattern converter + + + + Writes out the value of a named property. The property name + should be set in the + property. + + + If the is set to null + then all the properties are written as key value pairs. + + + Nicko Cadell + + + + Write the property value to the output + + that will receive the formatted result. + the event being logged + + + Writes out the value of a named property. The property name + should be set in the + property. + + + If the is set to null + then all the properties are written as key value pairs. + + + + + + Converter to output the relative time of the event + + + + Converter to output the time of the event relative to the start of the program. + + + Nicko Cadell + + + + Write the relative time to the output + + that will receive the formatted result. + the event being logged + + + Writes out the relative time of the event in milliseconds. + That is the number of milliseconds between the event + and the . + + + + + + Helper method to get the time difference between two DateTime objects + + start time (in the current local time zone) + end time (in the current local time zone) + the time difference in milliseconds + + + + Write the caller stack frames to the output + + + + Writes the to the output writer, using format: + type3.MethodCall3(type param,...) > type2.MethodCall2(type param,...) > type1.MethodCall1(type param,...) + + + Adam Davies + + + + Write the caller stack frames to the output + + + + Writes the to the output writer, using format: + type3.MethodCall3 > type2.MethodCall2 > type1.MethodCall1 + + + Michael Cromwell + + + + Initialize the converter + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Write the strack frames to the output + + that will receive the formatted result. + the event being logged + + + Writes the to the output writer. + + + + + + Returns the Name of the method + + + This method was created, so this class could be used as a base class for StackTraceDetailPatternConverter + string + + + + The fully qualified type of the StackTracePatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + The fully qualified type of the StackTraceDetailPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Converter to include event thread name + + + + Writes the to the output. + + + Nicko Cadell + + + + Write the ThreadName to the output + + that will receive the formatted result. + the event being logged + + + Writes the to the . + + + + + + Pattern converter for the class name + + + + Outputs the of the event. + + + Nicko Cadell + + + + Gets the fully qualified name of the class + + the event being logged + The fully qualified type name for the caller location + + + Returns the of the . + + + + + + Converter to include event user name + + Douglas de la Torre + Nicko Cadell + + + + Convert the pattern to the rendered message + + that will receive the formatted result. + the event being logged + + + + Write the TimeStamp to the output + + + + Date pattern converter, uses a to format + the date of a . + + + Uses a to format the + in Universal time. + + + See the for details on the date pattern syntax. + + + + Nicko Cadell + + + + Write the TimeStamp to the output + + that will receive the formatted result. + the event being logged + + + Pass the to the + for it to render it to the writer. + + + The passed is in the local time zone, this is converted + to Universal time before it is rendered. + + + + + + + The fully qualified type of the UtcDatePatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + A Layout that renders only the Exception text from the logging event + + + + A Layout that renders only the Exception text from the logging event. + + + This Layout should only be used with appenders that utilize multiple + layouts (e.g. ). + + + Nicko Cadell + Gert Driesen + + + + Extend this abstract class to create your own log layout format. + + + + This is the base implementation of the + interface. Most layout objects should extend this class. + + + + + + Subclasses must implement the + method. + + + Subclasses should set the in their default + constructor. + + + + Nicko Cadell + Gert Driesen + + + + Interface implemented by layout objects + + + + An object is used to format a + as text. The method is called by an + appender to transform the into a string. + + + The layout can also supply and + text that is appender before any events and after all the events respectively. + + + Nicko Cadell + Gert Driesen + + + + Implement this method to create your own layout format. + + The TextWriter to write the formatted event to + The event to format + + + This method is called by an appender to format + the as text and output to a writer. + + + If the caller does not have a and prefers the + event to be formatted as a then the following + code can be used to format the event into a . + + + StringWriter writer = new StringWriter(); + Layout.Format(writer, loggingEvent); + string formattedEvent = writer.ToString(); + + + + + + The content type output by this layout. + + The content type + + + The content type output by this layout. + + + This is a MIME type e.g. "text/plain". + + + + + + The header for the layout format. + + the layout header + + + The Header text will be appended before any logging events + are formatted and appended. + + + + + + The footer for the layout format. + + the layout footer + + + The Footer text will be appended after all the logging events + have been formatted and appended. + + + + + + Flag indicating if this layout handle exceptions + + false if this layout handles exceptions + + + If this layout handles the exception object contained within + , then the layout should return + false. Otherwise, if the layout ignores the exception + object, then the layout should return true. + + + + + + The header text + + + + See for more information. + + + + + + The footer text + + + + See for more information. + + + + + + Flag indicating if this layout handles exceptions + + + + false if this layout handles exceptions + + + + + + Empty default constructor + + + + Empty default constructor + + + + + + Activate component options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + This method must be implemented by the subclass. + + + + + + Implement this method to create your own layout format. + + The TextWriter to write the formatted event to + The event to format + + + This method is called by an appender to format + the as text. + + + + + + Convenience method for easily formatting the logging event into a string variable. + + + + Creates a new StringWriter instance to store the formatted logging event. + + + + + The content type output by this layout. + + The content type is "text/plain" + + + The content type output by this layout. + + + This base class uses the value "text/plain". + To change this value a subclass must override this + property. + + + + + + The header for the layout format. + + the layout header + + + The Header text will be appended before any logging events + are formatted and appended. + + + + + + The footer for the layout format. + + the layout footer + + + The Footer text will be appended after all the logging events + have been formatted and appended. + + + + + + Flag indicating if this layout handles exceptions + + false if this layout handles exceptions + + + If this layout handles the exception object contained within + , then the layout should return + false. Otherwise, if the layout ignores the exception + object, then the layout should return true. + + + Set this value to override a this default setting. The default + value is true, this layout does not handle the exception. + + + + + + Default constructor + + + + Constructs a ExceptionLayout + + + + + + Activate component options + + + + Part of the component activation + framework. + + + This method does nothing as options become effective immediately. + + + + + + Gets the exception text from the logging event + + The TextWriter to write the formatted event to + the event being logged + + + Write the exception string to the . + The exception string is retrieved from . + + + + + + Interface for raw layout objects + + + + Interface used to format a + to an object. + + + This interface should not be confused with the + interface. This interface is used in + only certain specialized situations where a raw object is + required rather than a formatted string. The + is not generally useful than this interface. + + + Nicko Cadell + Gert Driesen + + + + Implement this method to create your own layout format. + + The event to format + returns the formatted event + + + Implement this method to create your own layout format. + + + + + + Adapts any to a + + + + Where an is required this adapter + allows a to be specified. + + + Nicko Cadell + Gert Driesen + + + + The layout to adapt + + + + + Construct a new adapter + + the layout to adapt + + + Create the adapter for the specified . + + + + + + Format the logging event as an object. + + The event to format + returns the formatted event + + + Format the logging event as an object. + + + Uses the object supplied to + the constructor to perform the formatting. + + + + + + A flexible layout configurable with pattern string. + + + + The goal of this class is to a + as a string. The results + depend on the conversion pattern. + + + The conversion pattern is closely related to the conversion + pattern of the printf function in C. A conversion pattern is + composed of literal text and format control expressions called + conversion specifiers. + + + You are free to insert any literal text within the conversion + pattern. + + + Each conversion specifier starts with a percent sign (%) and is + followed by optional format modifiers and a conversion + pattern name. The conversion pattern name specifies the type of + data, e.g. logger, level, date, thread name. The format + modifiers control such things as field width, padding, left and + right justification. The following is a simple example. + + + Let the conversion pattern be "%-5level [%thread]: %message%newline" and assume + that the log4net environment was set to use a PatternLayout. Then the + statements + + + ILog log = LogManager.GetLogger(typeof(TestApp)); + log.Debug("Message 1"); + log.Warn("Message 2"); + + would yield the output + + DEBUG [main]: Message 1 + WARN [main]: Message 2 + + + Note that there is no explicit separator between text and + conversion specifiers. The pattern parser knows when it has reached + the end of a conversion specifier when it reads a conversion + character. In the example above the conversion specifier + %-5level means the level of the logging event should be left + justified to a width of five characters. + + + The recognized conversion pattern names are: + + + + Conversion Pattern Name + Effect + + + a + Equivalent to appdomain + + + appdomain + + Used to output the friendly name of the AppDomain where the + logging event was generated. + + + + aspnet-cache + + + Used to output all cache items in the case of %aspnet-cache or just one named item if used as %aspnet-cache{key} + + + This pattern is not available for Compact Framework or Client Profile assemblies. + + + + + aspnet-context + + + Used to output all context items in the case of %aspnet-context or just one named item if used as %aspnet-context{key} + + + This pattern is not available for Compact Framework or Client Profile assemblies. + + + + + aspnet-request + + + Used to output all request parameters in the case of %aspnet-request or just one named param if used as %aspnet-request{key} + + + This pattern is not available for Compact Framework or Client Profile assemblies. + + + + + aspnet-session + + + Used to output all session items in the case of %aspnet-session or just one named item if used as %aspnet-session{key} + + + This pattern is not available for Compact Framework or Client Profile assemblies. + + + + + c + Equivalent to logger + + + C + Equivalent to type + + + class + Equivalent to type + + + d + Equivalent to date + + + date + + + Used to output the date of the logging event in the local time zone. + To output the date in universal time use the %utcdate pattern. + The date conversion + specifier may be followed by a date format specifier enclosed + between braces. For example, %date{HH:mm:ss,fff} or + %date{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is + given then ISO8601 format is + assumed (). + + + The date format specifier admits the same syntax as the + time pattern string of the . + + + For better results it is recommended to use the log4net date + formatters. These can be specified using one of the strings + "ABSOLUTE", "DATE" and "ISO8601" for specifying + , + and respectively + . For example, + %date{ISO8601} or %date{ABSOLUTE}. + + + These dedicated date formatters perform significantly + better than . + + + + + exception + + + Used to output the exception passed in with the log message. + + + If an exception object is stored in the logging event + it will be rendered into the pattern output with a + trailing newline. + If there is no exception then nothing will be output + and no trailing newline will be appended. + It is typical to put a newline before the exception + and to have the exception as the last data in the pattern. + + + + + F + Equivalent to file + + + file + + + Used to output the file name where the logging request was + issued. + + + WARNING Generating caller location information is + extremely slow. Its use should be avoided unless execution speed + is not an issue. + + + See the note below on the availability of caller location information. + + + + + identity + + + Used to output the user name for the currently active user + (Principal.Identity.Name). + + + WARNING Generating caller information is + extremely slow. Its use should be avoided unless execution speed + is not an issue. + + + + + l + Equivalent to location + + + L + Equivalent to line + + + location + + + Used to output location information of the caller which generated + the logging event. + + + The location information depends on the CLI implementation but + usually consists of the fully qualified name of the calling + method followed by the callers source the file name and line + number between parentheses. + + + The location information can be very useful. However, its + generation is extremely slow. Its use should be avoided + unless execution speed is not an issue. + + + See the note below on the availability of caller location information. + + + + + level + + + Used to output the level of the logging event. + + + + + line + + + Used to output the line number from where the logging request + was issued. + + + WARNING Generating caller location information is + extremely slow. Its use should be avoided unless execution speed + is not an issue. + + + See the note below on the availability of caller location information. + + + + + logger + + + Used to output the logger of the logging event. The + logger conversion specifier can be optionally followed by + precision specifier, that is a decimal constant in + brackets. + + + If a precision specifier is given, then only the corresponding + number of right most components of the logger name will be + printed. By default the logger name is printed in full. + + + For example, for the logger name "a.b.c" the pattern + %logger{2} will output "b.c". + + + + + m + Equivalent to message + + + M + Equivalent to method + + + message + + + Used to output the application supplied message associated with + the logging event. + + + + + mdc + + + The MDC (old name for the ThreadContext.Properties) is now part of the + combined event properties. This pattern is supported for compatibility + but is equivalent to property. + + + + + method + + + Used to output the method name where the logging request was + issued. + + + WARNING Generating caller location information is + extremely slow. Its use should be avoided unless execution speed + is not an issue. + + + See the note below on the availability of caller location information. + + + + + n + Equivalent to newline + + + newline + + + Outputs the platform dependent line separator character or + characters. + + + This conversion pattern offers the same performance as using + non-portable line separator strings such as "\n", or "\r\n". + Thus, it is the preferred way of specifying a line separator. + + + + + ndc + + + Used to output the NDC (nested diagnostic context) associated + with the thread that generated the logging event. + + + + + p + Equivalent to level + + + P + Equivalent to property + + + properties + Equivalent to property + + + property + + + Used to output the an event specific property. The key to + lookup must be specified within braces and directly following the + pattern specifier, e.g. %property{user} would include the value + from the property that is keyed by the string 'user'. Each property value + that is to be included in the log must be specified separately. + Properties are added to events by loggers or appenders. By default + the log4net:HostName property is set to the name of machine on + which the event was originally logged. + + + If no key is specified, e.g. %property then all the keys and their + values are printed in a comma separated list. + + + The properties of an event are combined from a number of different + contexts. These are listed below in the order in which they are searched. + + + + the event properties + + The event has that can be set. These + properties are specific to this event only. + + + + the thread properties + + The that are set on the current + thread. These properties are shared by all events logged on this thread. + + + + the global properties + + The that are set globally. These + properties are shared by all the threads in the AppDomain. + + + + + + + + r + Equivalent to timestamp + + + stacktrace + + + Used to output the stack trace of the logging event + The stack trace level specifier may be enclosed + between braces. For example, %stacktrace{level}. + If no stack trace level specifier is given then 1 is assumed + + + Output uses the format: + type3.MethodCall3 > type2.MethodCall2 > type1.MethodCall1 + + + This pattern is not available for Compact Framework assemblies. + + + + + stacktracedetail + + + Used to output the stack trace of the logging event + The stack trace level specifier may be enclosed + between braces. For example, %stacktracedetail{level}. + If no stack trace level specifier is given then 1 is assumed + + + Output uses the format: + type3.MethodCall3(type param,...) > type2.MethodCall2(type param,...) > type1.MethodCall1(type param,...) + + + This pattern is not available for Compact Framework assemblies. + + + + + t + Equivalent to thread + + + timestamp + + + Used to output the number of milliseconds elapsed since the start + of the application until the creation of the logging event. + + + + + thread + + + Used to output the name of the thread that generated the + logging event. Uses the thread number if no name is available. + + + + + type + + + Used to output the fully qualified type name of the caller + issuing the logging request. This conversion specifier + can be optionally followed by precision specifier, that + is a decimal constant in brackets. + + + If a precision specifier is given, then only the corresponding + number of right most components of the class name will be + printed. By default the class name is output in fully qualified form. + + + For example, for the class name "log4net.Layout.PatternLayout", the + pattern %type{1} will output "PatternLayout". + + + WARNING Generating the caller class information is + slow. Thus, its use should be avoided unless execution speed is + not an issue. + + + See the note below on the availability of caller location information. + + + + + u + Equivalent to identity + + + username + + + Used to output the WindowsIdentity for the currently + active user. + + + WARNING Generating caller WindowsIdentity information is + extremely slow. Its use should be avoided unless execution speed + is not an issue. + + + + + utcdate + + + Used to output the date of the logging event in universal time. + The date conversion + specifier may be followed by a date format specifier enclosed + between braces. For example, %utcdate{HH:mm:ss,fff} or + %utcdate{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is + given then ISO8601 format is + assumed (). + + + The date format specifier admits the same syntax as the + time pattern string of the . + + + For better results it is recommended to use the log4net date + formatters. These can be specified using one of the strings + "ABSOLUTE", "DATE" and "ISO8601" for specifying + , + and respectively + . For example, + %utcdate{ISO8601} or %utcdate{ABSOLUTE}. + + + These dedicated date formatters perform significantly + better than . + + + + + w + Equivalent to username + + + x + Equivalent to ndc + + + X + Equivalent to mdc + + + % + + + The sequence %% outputs a single percent sign. + + + + + + The single letter patterns are deprecated in favor of the + longer more descriptive pattern names. + + + By default the relevant information is output as is. However, + with the aid of format modifiers it is possible to change the + minimum field width, the maximum field width and justification. + + + The optional format modifier is placed between the percent sign + and the conversion pattern name. + + + The first optional format modifier is the left justification + flag which is just the minus (-) character. Then comes the + optional minimum field width modifier. This is a decimal + constant that represents the minimum number of characters to + output. If the data item requires fewer characters, it is padded on + either the left or the right until the minimum width is + reached. The default is to pad on the left (right justify) but you + can specify right padding with the left justification flag. The + padding character is space. If the data item is larger than the + minimum field width, the field is expanded to accommodate the + data. The value is never truncated. + + + This behavior can be changed using the maximum field + width modifier which is designated by a period followed by a + decimal constant. If the data item is longer than the maximum + field, then the extra characters are removed from the + beginning of the data item and not from the end. For + example, it the maximum field width is eight and the data item is + ten characters long, then the first two characters of the data item + are dropped. This behavior deviates from the printf function in C + where truncation is done from the end. + + + Below are various format modifier examples for the logger + conversion specifier. + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Format modifierleft justifyminimum widthmaximum widthcomment
%20loggerfalse20none + + Left pad with spaces if the logger name is less than 20 + characters long. + +
%-20loggertrue20none + + Right pad with spaces if the logger + name is less than 20 characters long. + +
%.30loggerNAnone30 + + Truncate from the beginning if the logger + name is longer than 30 characters. + +
%20.30loggerfalse2030 + + Left pad with spaces if the logger name is shorter than 20 + characters. However, if logger name is longer than 30 characters, + then truncate from the beginning. + +
%-20.30loggertrue2030 + + Right pad with spaces if the logger name is shorter than 20 + characters. However, if logger name is longer than 30 characters, + then truncate from the beginning. + +
+
+ + Note about caller location information.
+ The following patterns %type %file %line %method %location %class %C %F %L %l %M + all generate caller location information. + Location information uses the System.Diagnostics.StackTrace class to generate + a call stack. The caller's information is then extracted from this stack. +
+ + + The System.Diagnostics.StackTrace class is not supported on the + .NET Compact Framework 1.0 therefore caller location information is not + available on that framework. + + + + + The System.Diagnostics.StackTrace class has this to say about Release builds: + + + "StackTrace information will be most informative with Debug build configurations. + By default, Debug builds include debug symbols, while Release builds do not. The + debug symbols contain most of the file, method name, line number, and column + information used in constructing StackFrame and StackTrace objects. StackTrace + might not report as many method calls as expected, due to code transformations + that occur during optimization." + + + This means that in a Release build the caller information may be incomplete or may + not exist at all! Therefore caller location information cannot be relied upon in a Release build. + + + + Additional pattern converters may be registered with a specific + instance using the method. + +
+ + This is a more detailed pattern. + %timestamp [%thread] %level %logger %ndc - %message%newline + + + A similar pattern except that the relative time is + right padded if less than 6 digits, thread name is right padded if + less than 15 characters and truncated if longer and the logger + name is left padded if shorter than 30 characters and truncated if + longer. + %-6timestamp [%15.15thread] %-5level %30.30logger %ndc - %message%newline + + Nicko Cadell + Gert Driesen + Douglas de la Torre + Daniel Cazzulino +
+ + + Default pattern string for log output. + + + + Default pattern string for log output. + Currently set to the string "%message%newline" + which just prints the application supplied message. + + + + + + A detailed conversion pattern + + + + A conversion pattern which includes Time, Thread, Logger, and Nested Context. + Current value is %timestamp [%thread] %level %logger %ndc - %message%newline. + + + + + + Internal map of converter identifiers to converter types. + + + + This static map is overridden by the m_converterRegistry instance map + + + + + + the pattern + + + + + the head of the pattern converter chain + + + + + patterns defined on this PatternLayout only + + + + + Initialize the global registry + + + + Defines the builtin global rules. + + + + + + Constructs a PatternLayout using the DefaultConversionPattern + + + + The default pattern just produces the application supplied message. + + + Note to Inheritors: This constructor calls the virtual method + . If you override this method be + aware that it will be called before your is called constructor. + + + As per the contract the + method must be called after the properties on this object have been + configured. + + + + + + Constructs a PatternLayout using the supplied conversion pattern + + the pattern to use + + + Note to Inheritors: This constructor calls the virtual method + . If you override this method be + aware that it will be called before your is called constructor. + + + When using this constructor the method + need not be called. This may not be the case when using a subclass. + + + + + + Create the pattern parser instance + + the pattern to parse + The that will format the event + + + Creates the used to parse the conversion string. Sets the + global and instance rules on the . + + + + + + Initialize layout options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Produces a formatted string as specified by the conversion pattern. + + the event being logged + The TextWriter to write the formatted event to + + + Parse the using the patter format + specified in the property. + + + + + + Add a converter to this PatternLayout + + the converter info + + + This version of the method is used by the configurator. + Programmatic users should use the alternative method. + + + + + + Add a converter to this PatternLayout + + the name of the conversion pattern for this converter + the type of the converter + + + Add a named pattern converter to this instance. This + converter will be used in the formatting of the event. + This method must be called before . + + + The specified must extend the + type. + + + + + + The pattern formatting string + + + + The ConversionPattern option. This is the string which + controls formatting and consists of a mix of literal content and + conversion specifiers. + + + + + + Type converter for the interface + + + + Used to convert objects to the interface. + Supports converting from the interface to + the interface using the . + + + Nicko Cadell + Gert Driesen + + + + Interface supported by type converters + + + + This interface supports conversion from arbitrary types + to a single target type. See . + + + Nicko Cadell + Gert Driesen + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Test if the can be converted to the + type supported by this converter. + + + + + + Convert the source object to the type supported by this object + + the object to convert + the converted object + + + Converts the to the type supported + by this converter. + + + + + + Can the sourceType be converted to an + + the source to be to be converted + true if the source type can be converted to + + + Test if the can be converted to a + . Only is supported + as the . + + + + + + Convert the value to a object + + the value to convert + the object + + + Convert the object to a + object. If the object + is a then the + is used to adapt between the two interfaces, otherwise an + exception is thrown. + + + + + + Extract the value of a property from the + + + + Extract the value of a property from the + + + Nicko Cadell + + + + Constructs a RawPropertyLayout + + + + + Lookup the property for + + The event to format + returns property value + + + Looks up and returns the object value of the property + named . If there is no property defined + with than name then null will be returned. + + + + + + The name of the value to lookup in the LoggingEvent Properties collection. + + + Value to lookup in the LoggingEvent Properties collection + + + + String name of the property to lookup in the . + + + + + + Extract the date from the + + + + Extract the date from the + + + Nicko Cadell + Gert Driesen + + + + Constructs a RawTimeStampLayout + + + + + Gets the as a . + + The event to format + returns the time stamp + + + Gets the as a . + + + The time stamp is in local time. To format the time stamp + in universal time use . + + + + + + Extract the date from the + + + + Extract the date from the + + + Nicko Cadell + Gert Driesen + + + + Constructs a RawUtcTimeStampLayout + + + + + Gets the as a . + + The event to format + returns the time stamp + + + Gets the as a . + + + The time stamp is in universal time. To format the time stamp + in local time use . + + + + + + A very simple layout + + + + SimpleLayout consists of the level of the log statement, + followed by " - " and then the log message itself. For example, + + DEBUG - Hello world + + + + Nicko Cadell + Gert Driesen + + + + Constructs a SimpleLayout + + + + + Initialize layout options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Produces a simple formatted output. + + the event being logged + The TextWriter to write the formatted event to + + + Formats the event as the level of the even, + followed by " - " and then the log message itself. The + output is terminated by a newline. + + + + + + Layout that formats the log events as XML elements. + + + + The output of the consists of a series of + log4net:event elements. It does not output a complete well-formed XML + file. The output is designed to be included as an external entity + in a separate file to form a correct XML file. + + + For example, if abc is the name of the file where + the output goes, then a well-formed XML file would + be: + + + <?xml version="1.0" ?> + + <!DOCTYPE log4net:events SYSTEM "log4net-events.dtd" [<!ENTITY data SYSTEM "abc">]> + + <log4net:events version="1.2" xmlns:log4net="http://logging.apache.org/log4net/schemas/log4net-events-1.2> + &data; + </log4net:events> + + + This approach enforces the independence of the + and the appender where it is embedded. + + + The version attribute helps components to correctly + interpret output generated by . The value of + this attribute should be "1.2" for release 1.2 and later. + + + Alternatively the Header and Footer properties can be + configured to output the correct XML header, open tag and close tag. + When setting the Header and Footer properties it is essential + that the underlying data store not be appendable otherwise the data + will become invalid XML. + + + Nicko Cadell + Gert Driesen + + + + Layout that formats the log events as XML elements. + + + + This is an abstract class that must be subclassed by an implementation + to conform to a specific schema. + + + Deriving classes must implement the method. + + + Nicko Cadell + Gert Driesen + + + + Protected constructor to support subclasses + + + + Initializes a new instance of the class + with no location info. + + + + + + Protected constructor to support subclasses + + + + The parameter determines whether + location information will be output by the layout. If + is set to true, then the + file name and line number of the statement at the origin of the log + statement will be output. + + + If you are embedding this layout within an SMTPAppender + then make sure to set the LocationInfo option of that + appender as well. + + + + + + Initialize layout options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Produces a formatted string. + + The event being logged. + The TextWriter to write the formatted event to + + + Format the and write it to the . + + + This method creates an that writes to the + . The is passed + to the method. Subclasses should override the + method rather than this method. + + + + + + Does the actual writing of the XML. + + The writer to use to output the event to. + The event to write. + + + Subclasses should override this method to format + the as XML. + + + + + + Flag to indicate if location information should be included in + the XML events. + + + + + The string to replace invalid chars with + + + + + Gets a value indicating whether to include location information in + the XML events. + + + true if location information should be included in the XML + events; otherwise, false. + + + + If is set to true, then the file + name and line number of the statement at the origin of the log + statement will be output. + + + If you are embedding this layout within an SMTPAppender + then make sure to set the LocationInfo option of that + appender as well. + + + + + + The string to replace characters that can not be expressed in XML with. + + + Not all characters may be expressed in XML. This property contains the + string to replace those that can not with. This defaults to a ?. Set it + to the empty string to simply remove offending characters. For more + details on the allowed character ranges see http://www.w3.org/TR/REC-xml/#charsets + Character replacement will occur in the log message, the property names + and the property values. + + + + + + + Gets the content type output by this layout. + + + As this is the XML layout, the value is always "text/xml". + + + + As this is the XML layout, the value is always "text/xml". + + + + + + Constructs an XmlLayout + + + + + Constructs an XmlLayout. + + + + The LocationInfo option takes a boolean value. By + default, it is set to false which means there will be no location + information output by this layout. If the the option is set to + true, then the file name and line number of the statement + at the origin of the log statement will be output. + + + If you are embedding this layout within an SmtpAppender + then make sure to set the LocationInfo option of that + appender as well. + + + + + + Initialize layout options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + Builds a cache of the element names + + + + + + Does the actual writing of the XML. + + The writer to use to output the event to. + The event to write. + + + Override the base class method + to write the to the . + + + + + + The prefix to use for all generated element names + + + + + The prefix to use for all element names + + + + The default prefix is log4net. Set this property + to change the prefix. If the prefix is set to an empty string + then no prefix will be written. + + + + + + Set whether or not to base64 encode the message. + + + + By default the log message will be written as text to the xml + output. This can cause problems when the message contains binary + data. By setting this to true the contents of the message will be + base64 encoded. If this is set then invalid character replacement + (see ) will not be performed + on the log message. + + + + + + Set whether or not to base64 encode the property values. + + + + By default the properties will be written as text to the xml + output. This can cause problems when one or more properties contain + binary data. By setting this to true the values of the properties + will be base64 encoded. If this is set then invalid character replacement + (see ) will not be performed + on the property values. + + + + + + Layout that formats the log events as XML elements compatible with the log4j schema + + + + Formats the log events according to the http://logging.apache.org/log4j schema. + + + Nicko Cadell + + + + The 1st of January 1970 in UTC + + + + + Constructs an XMLLayoutSchemaLog4j + + + + + Constructs an XMLLayoutSchemaLog4j. + + + + The LocationInfo option takes a boolean value. By + default, it is set to false which means there will be no location + information output by this layout. If the the option is set to + true, then the file name and line number of the statement + at the origin of the log statement will be output. + + + If you are embedding this layout within an SMTPAppender + then make sure to set the LocationInfo option of that + appender as well. + + + + + + Actually do the writing of the xml + + the writer to use + the event to write + + + Generate XML that is compatible with the log4j schema. + + + + + + The version of the log4j schema to use. + + + + Only version 1.2 of the log4j schema is supported. + + + + + + The default object Renderer. + + + + The default renderer supports rendering objects and collections to strings. + + + See the method for details of the output. + + + Nicko Cadell + Gert Driesen + + + + Implement this interface in order to render objects as strings + + + + Certain types require special case conversion to + string form. This conversion is done by an object renderer. + Object renderers implement the + interface. + + + Nicko Cadell + Gert Driesen + + + + Render the object to a string + + The map used to lookup renderers + The object to render + The writer to render to + + + Render the object to a + string. + + + The parameter is + provided to lookup and render other objects. This is + very useful where contains + nested objects of unknown type. The + method can be used to render these objects. + + + + + + Default constructor + + + + Default constructor + + + + + + Render the object to a string + + The map used to lookup renderers + The object to render + The writer to render to + + + Render the object to a string. + + + The parameter is + provided to lookup and render other objects. This is + very useful where contains + nested objects of unknown type. The + method can be used to render these objects. + + + The default renderer supports rendering objects to strings as follows: + + + + Value + Rendered String + + + null + + "(null)" + + + + + + + For a one dimensional array this is the + array type name, an open brace, followed by a comma + separated list of the elements (using the appropriate + renderer), followed by a close brace. + + + For example: int[] {1, 2, 3}. + + + If the array is not one dimensional the + Array.ToString() is returned. + + + + + , & + + + Rendered as an open brace, followed by a comma + separated list of the elements (using the appropriate + renderer), followed by a close brace. + + + For example: {a, b, c}. + + + All collection classes that implement its subclasses, + or generic equivalents all implement the interface. + + + + + + + + Rendered as the key, an equals sign ('='), and the value (using the appropriate + renderer). + + + For example: key=value. + + + + + other + + Object.ToString() + + + + + + + + Render the array argument into a string + + The map used to lookup renderers + the array to render + The writer to render to + + + For a one dimensional array this is the + array type name, an open brace, followed by a comma + separated list of the elements (using the appropriate + renderer), followed by a close brace. For example: + int[] {1, 2, 3}. + + + If the array is not one dimensional the + Array.ToString() is returned. + + + + + + Render the enumerator argument into a string + + The map used to lookup renderers + the enumerator to render + The writer to render to + + + Rendered as an open brace, followed by a comma + separated list of the elements (using the appropriate + renderer), followed by a close brace. For example: + {a, b, c}. + + + + + + Render the DictionaryEntry argument into a string + + The map used to lookup renderers + the DictionaryEntry to render + The writer to render to + + + Render the key, an equals sign ('='), and the value (using the appropriate + renderer). For example: key=value. + + + + + + Map class objects to an . + + + + Maintains a mapping between types that require special + rendering and the that + is used to render them. + + + The method is used to render an + object using the appropriate renderers defined in this map. + + + Nicko Cadell + Gert Driesen + + + + Default Constructor + + + + Default constructor. + + + + + + Render using the appropriate renderer. + + the object to render to a string + the object rendered as a string + + + This is a convenience method used to render an object to a string. + The alternative method + should be used when streaming output to a . + + + + + + Render using the appropriate renderer. + + the object to render to a string + The writer to render to + + + Find the appropriate renderer for the type of the + parameter. This is accomplished by calling the + method. Once a renderer is found, it is + applied on the object and the result is returned + as a . + + + + + + Gets the renderer for the specified object type + + the object to lookup the renderer for + the renderer for + + + Gets the renderer for the specified object type. + + + Syntactic sugar method that calls + with the type of the object parameter. + + + + + + Gets the renderer for the specified type + + the type to lookup the renderer for + the renderer for the specified type + + + Returns the renderer for the specified type. + If no specific renderer has been defined the + will be returned. + + + + + + Internal function to recursively search interfaces + + the type to lookup the renderer for + the renderer for the specified type + + + + Clear the map of renderers + + + + Clear the custom renderers defined by using + . The + cannot be removed. + + + + + + Register an for . + + the type that will be rendered by + the renderer for + + + Register an object renderer for a specific source type. + This renderer will be returned from a call to + specifying the same as an argument. + + + + + + Get the default renderer instance + + the default renderer + + + Get the default renderer + + + + + + Interface implemented by logger repository plugins. + + + + Plugins define additional behavior that can be associated + with a . + The held by the + property is used to store the plugins for a repository. + + + The log4net.Config.PluginAttribute can be used to + attach plugins to repositories created using configuration + attributes. + + + Nicko Cadell + Gert Driesen + + + + Attaches the plugin to the specified . + + The that this plugin should be attached to. + + + A plugin may only be attached to a single repository. + + + This method is called when the plugin is attached to the repository. + + + + + + Is called when the plugin is to shutdown. + + + + This method is called to notify the plugin that + it should stop operating and should detach from + the repository. + + + + + + Gets the name of the plugin. + + + The name of the plugin. + + + + Plugins are stored in the + keyed by name. Each plugin instance attached to a + repository must be a unique name. + + + + + + A strongly-typed collection of objects. + + Nicko Cadell + + + + Creates a read-only wrapper for a PluginCollection instance. + + list to create a readonly wrapper arround + + A PluginCollection wrapper that is read-only. + + + + + Initializes a new instance of the PluginCollection class + that is empty and has the default initial capacity. + + + + + Initializes a new instance of the PluginCollection class + that has the specified initial capacity. + + + The number of elements that the new PluginCollection is initially capable of storing. + + + + + Initializes a new instance of the PluginCollection class + that contains elements copied from the specified PluginCollection. + + The PluginCollection whose elements are copied to the new collection. + + + + Initializes a new instance of the PluginCollection class + that contains elements copied from the specified array. + + The array whose elements are copied to the new list. + + + + Initializes a new instance of the PluginCollection class + that contains elements copied from the specified collection. + + The collection whose elements are copied to the new list. + + + + Allow subclasses to avoid our default constructors + + + + + + + Copies the entire PluginCollection to a one-dimensional + array. + + The one-dimensional array to copy to. + + + + Copies the entire PluginCollection to a one-dimensional + array, starting at the specified index of the target array. + + The one-dimensional array to copy to. + The zero-based index in at which copying begins. + + + + Adds a to the end of the PluginCollection. + + The to be added to the end of the PluginCollection. + The index at which the value has been added. + + + + Removes all elements from the PluginCollection. + + + + + Creates a shallow copy of the . + + A new with a shallow copy of the collection data. + + + + Determines whether a given is in the PluginCollection. + + The to check for. + true if is found in the PluginCollection; otherwise, false. + + + + Returns the zero-based index of the first occurrence of a + in the PluginCollection. + + The to locate in the PluginCollection. + + The zero-based index of the first occurrence of + in the entire PluginCollection, if found; otherwise, -1. + + + + + Inserts an element into the PluginCollection at the specified index. + + The zero-based index at which should be inserted. + The to insert. + + is less than zero + -or- + is equal to or greater than . + + + + + Removes the first occurrence of a specific from the PluginCollection. + + The to remove from the PluginCollection. + + The specified was not found in the PluginCollection. + + + + + Removes the element at the specified index of the PluginCollection. + + The zero-based index of the element to remove. + + is less than zero. + -or- + is equal to or greater than . + + + + + Returns an enumerator that can iterate through the PluginCollection. + + An for the entire PluginCollection. + + + + Adds the elements of another PluginCollection to the current PluginCollection. + + The PluginCollection whose elements should be added to the end of the current PluginCollection. + The new of the PluginCollection. + + + + Adds the elements of a array to the current PluginCollection. + + The array whose elements should be added to the end of the PluginCollection. + The new of the PluginCollection. + + + + Adds the elements of a collection to the current PluginCollection. + + The collection whose elements should be added to the end of the PluginCollection. + The new of the PluginCollection. + + + + Sets the capacity to the actual number of elements. + + + + + is less than zero. + -or- + is equal to or greater than . + + + + + is less than zero. + -or- + is equal to or greater than . + + + + + Gets the number of elements actually contained in the PluginCollection. + + + + + Gets a value indicating whether access to the collection is synchronized (thread-safe). + + true if access to the ICollection is synchronized (thread-safe); otherwise, false. + + + + Gets an object that can be used to synchronize access to the collection. + + + An object that can be used to synchronize access to the collection. + + + + + Gets or sets the at the specified index. + + + The at the specified index. + + The zero-based index of the element to get or set. + + is less than zero. + -or- + is equal to or greater than . + + + + + Gets a value indicating whether the collection has a fixed size. + + true if the collection has a fixed size; otherwise, false. The default is false. + + + + Gets a value indicating whether the IList is read-only. + + true if the collection is read-only; otherwise, false. The default is false. + + + + Gets or sets the number of elements the PluginCollection can contain. + + + The number of elements the PluginCollection can contain. + + + + + Supports type-safe iteration over a . + + + + + + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + Gets the current element in the collection. + + + + + Type visible only to our subclasses + Used to access protected constructor + + + + + + A value + + + + + Supports simple iteration over a . + + + + + + Initializes a new instance of the Enumerator class. + + + + + + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + Gets the current element in the collection. + + + The current element in the collection. + + + + + + + + Map of repository plugins. + + + + This class is a name keyed map of the plugins that are + attached to a repository. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + The repository that the plugins should be attached to. + + + Initialize a new instance of the class with a + repository that the plugins should be attached to. + + + + + + Adds a to the map. + + The to add to the map. + + + The will be attached to the repository when added. + + + If there already exists a plugin with the same name + attached to the repository then the old plugin will + be and replaced with + the new plugin. + + + + + + Removes a from the map. + + The to remove from the map. + + + Remove a specific plugin from this map. + + + + + + Gets a by name. + + The name of the to lookup. + + The from the map with the name specified, or + null if no plugin is found. + + + + Lookup a plugin by name. If the plugin is not found null + will be returned. + + + + + + Gets all possible plugins as a list of objects. + + All possible plugins as a list of objects. + + + Get a collection of all the plugins defined in this map. + + + + + + Base implementation of + + + + Default abstract implementation of the + interface. This base class can be used by implementors + of the interface. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + the name of the plugin + + Initializes a new Plugin with the specified name. + + + + + Attaches this plugin to a . + + The that this plugin should be attached to. + + + A plugin may only be attached to a single repository. + + + This method is called when the plugin is attached to the repository. + + + + + + Is called when the plugin is to shutdown. + + + + This method is called to notify the plugin that + it should stop operating and should detach from + the repository. + + + + + + The name of this plugin. + + + + + The repository this plugin is attached to. + + + + + Gets or sets the name of the plugin. + + + The name of the plugin. + + + + Plugins are stored in the + keyed by name. Each plugin instance attached to a + repository must be a unique name. + + + The name of the plugin must not change one the + plugin has been attached to a repository. + + + + + + The repository for this plugin + + + The that this plugin is attached to. + + + + Gets or sets the that this plugin is + attached to. + + + + + + Plugin that listens for events from the + + + + This plugin publishes an instance of + on a specified . This listens for logging events delivered from + a remote . + + + When an event is received it is relogged within the attached repository + as if it had been raised locally. + + + Nicko Cadell + Gert Driesen + + + + Default constructor + + + + Initializes a new instance of the class. + + + The property must be set. + + + + + + Construct with sink Uri. + + The name to publish the sink under in the remoting infrastructure. + See for more details. + + + Initializes a new instance of the class + with specified name. + + + + + + Attaches this plugin to a . + + The that this plugin should be attached to. + + + A plugin may only be attached to a single repository. + + + This method is called when the plugin is attached to the repository. + + + + + + Is called when the plugin is to shutdown. + + + + When the plugin is shutdown the remote logging + sink is disconnected. + + + + + + The fully qualified type of the RemoteLoggingServerPlugin class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the URI of this sink. + + + The URI of this sink. + + + + This is the name under which the object is marshaled. + + + + + + + Delivers objects to a remote sink. + + + + Internal class used to listen for logging events + and deliver them to the local repository. + + + + + + Constructor + + The repository to log to. + + + Initializes a new instance of the for the + specified . + + + + + + Logs the events to the repository. + + The events to log. + + + The events passed are logged to the + + + + + + Obtains a lifetime service object to control the lifetime + policy for this instance. + + null to indicate that this instance should live forever. + + + Obtains a lifetime service object to control the lifetime + policy for this instance. This object should live forever + therefore this implementation returns null. + + + + + + The underlying that events should + be logged to. + + + + + Default implementation of + + + + This default implementation of the + interface is used to create the default subclass + of the object. + + + Nicko Cadell + Gert Driesen + + + + Interface abstracts creation of instances + + + + This interface is used by the to + create new objects. + + + The method is called + to create a named . + + + Implement this interface to create new subclasses of . + + + Nicko Cadell + Gert Driesen + + + + Create a new instance + + The that will own the . + The name of the . + The instance for the specified name. + + + Create a new instance with the + specified name. + + + Called by the to create + new named instances. + + + If the is null then the root logger + must be returned. + + + + + + Default constructor + + + + Initializes a new instance of the class. + + + + + + Create a new instance + + The that will own the . + The name of the . + The instance for the specified name. + + + Create a new instance with the + specified name. + + + Called by the to create + new named instances. + + + If the is null then the root logger + must be returned. + + + + + + Default internal subclass of + + + + This subclass has no additional behavior over the + class but does allow instances + to be created. + + + + + + Implementation of used by + + + + Internal class used to provide implementation of + interface. Applications should use to get + logger instances. + + + This is one of the central classes in the log4net implementation. One of the + distinctive features of log4net are hierarchical loggers and their + evaluation. The organizes the + instances into a rooted tree hierarchy. + + + The class is abstract. Only concrete subclasses of + can be created. The + is used to create instances of this type for the . + + + Nicko Cadell + Gert Driesen + Aspi Havewala + Douglas de la Torre + + + + This constructor created a new instance and + sets its name. + + The name of the . + + + This constructor is protected and designed to be used by + a subclass that is not abstract. + + + Loggers are constructed by + objects. See for the default + logger creator. + + + + + + Add to the list of appenders of this + Logger instance. + + An appender to add to this logger + + + Add to the list of appenders of this + Logger instance. + + + If is already in the list of + appenders, then it won't be added again. + + + + + + Look for the appender named as name + + The name of the appender to lookup + The appender with the name specified, or null. + + + Returns the named appender, or null if the appender is not found. + + + + + + Remove all previously added appenders from this Logger instance. + + + + Remove all previously added appenders from this Logger instance. + + + This is useful when re-reading configuration information. + + + + + + Remove the appender passed as parameter form the list of appenders. + + The appender to remove + The appender removed from the list + + + Remove the appender passed as parameter form the list of appenders. + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + + Remove the appender passed as parameter form the list of appenders. + + The name of the appender to remove + The appender removed from the list + + + Remove the named appender passed as parameter form the list of appenders. + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + + This generic form is intended to be used by wrappers. + + The declaring type of the method that is + the stack boundary into the logging system for this call. + The level of the message to be logged. + The message object to log. + The exception to log, including its stack trace. + + + Generate a logging event for the specified using + the and . + + + This method must not throw any exception to the caller. + + + + + + This is the most generic printing method that is intended to be used + by wrappers. + + The event being logged. + + + Logs the specified logging event through this logger. + + + This method must not throw any exception to the caller. + + + + + + Checks if this logger is enabled for a given passed as parameter. + + The level to check. + + true if this logger is enabled for level, otherwise false. + + + + Test if this logger is going to log events of the specified . + + + This method must not throw any exception to the caller. + + + + + + Deliver the to the attached appenders. + + The event to log. + + + Call the appenders in the hierarchy starting at + this. If no appenders could be found, emit a + warning. + + + This method calls all the appenders inherited from the + hierarchy circumventing any evaluation of whether to log or not + to log the particular log request. + + + + + + Closes all attached appenders implementing the interface. + + + + Used to ensure that the appenders are correctly shutdown. + + + + + + This is the most generic printing method. This generic form is intended to be used by wrappers + + The level of the message to be logged. + The message object to log. + The exception to log, including its stack trace. + + + Generate a logging event for the specified using + the . + + + + + + Creates a new logging event and logs the event without further checks. + + The declaring type of the method that is + the stack boundary into the logging system for this call. + The level of the message to be logged. + The message object to log. + The exception to log, including its stack trace. + + + Generates a logging event and delivers it to the attached + appenders. + + + + + + Creates a new logging event and logs the event without further checks. + + The event being logged. + + + Delivers the logging event to the attached appenders. + + + + + + The fully qualified type of the Logger class. + + + + + The name of this logger. + + + + + The assigned level of this logger. + + + + The level variable need not be + assigned a value in which case it is inherited + form the hierarchy. + + + + + + The parent of this logger. + + + + The parent of this logger. + All loggers have at least one ancestor which is the root logger. + + + + + + Loggers need to know what Hierarchy they are in. + + + + Loggers need to know what Hierarchy they are in. + The hierarchy that this logger is a member of is stored + here. + + + + + + Helper implementation of the interface + + + + + Flag indicating if child loggers inherit their parents appenders + + + + Additivity is set to true by default, that is children inherit + the appenders of their ancestors by default. If this variable is + set to false then the appenders found in the + ancestors of this logger are not used. However, the children + of this logger will inherit its appenders, unless the children + have their additivity flag set to false too. See + the user manual for more details. + + + + + + Lock to protect AppenderAttachedImpl variable m_appenderAttachedImpl + + + + + Gets or sets the parent logger in the hierarchy. + + + The parent logger in the hierarchy. + + + + Part of the Composite pattern that makes the hierarchy. + The hierarchy is parent linked rather than child linked. + + + + + + Gets or sets a value indicating if child loggers inherit their parent's appenders. + + + true if child loggers inherit their parent's appenders. + + + + Additivity is set to true by default, that is children inherit + the appenders of their ancestors by default. If this variable is + set to false then the appenders found in the + ancestors of this logger are not used. However, the children + of this logger will inherit its appenders, unless the children + have their additivity flag set to false too. See + the user manual for more details. + + + + + + Gets the effective level for this logger. + + The nearest level in the logger hierarchy. + + + Starting from this logger, searches the logger hierarchy for a + non-null level and returns it. Otherwise, returns the level of the + root logger. + + The Logger class is designed so that this method executes as + quickly as possible. + + + + + Gets or sets the where this + Logger instance is attached to. + + The hierarchy that this logger belongs to. + + + This logger must be attached to a single . + + + + + + Gets or sets the assigned , if any, for this Logger. + + + The of this logger. + + + + The assigned can be null. + + + + + + Get the appenders contained in this logger as an + . + + A collection of the appenders in this logger + + + Get the appenders contained in this logger as an + . If no appenders + can be found, then a is returned. + + + + + + Gets the logger name. + + + The name of the logger. + + + + The name of this logger + + + + + + Gets the where this + Logger instance is attached to. + + + The that this logger belongs to. + + + + Gets the where this + Logger instance is attached to. + + + + + + Construct a new Logger + + the name of the logger + + + Initializes a new instance of the class + with the specified name. + + + + + + Delegate used to handle logger creation event notifications. + + The in which the has been created. + The event args that hold the instance that has been created. + + + Delegate used to handle logger creation event notifications. + + + + + + Provides data for the event. + + + + A event is raised every time a + is created. + + + + + + The created + + + + + Constructor + + The that has been created. + + + Initializes a new instance of the event argument + class,with the specified . + + + + + + Gets the that has been created. + + + The that has been created. + + + + The that has been created. + + + + + + Hierarchical organization of loggers + + + + The casual user should not have to deal with this class + directly. + + + This class is specialized in retrieving loggers by name and + also maintaining the logger hierarchy. Implements the + interface. + + + The structure of the logger hierarchy is maintained by the + method. The hierarchy is such that children + link to their parent but parents do not have any references to their + children. Moreover, loggers can be instantiated in any order, in + particular descendant before ancestor. + + + In case a descendant is created before a particular ancestor, + then it creates a provision node for the ancestor and adds itself + to the provision node. Other descendants of the same ancestor add + themselves to the previously created provision node. + + + Nicko Cadell + Gert Driesen + + + + Base implementation of + + + + Default abstract implementation of the interface. + + + Skeleton implementation of the interface. + All types can extend this type. + + + Nicko Cadell + Gert Driesen + + + + Interface implemented by logger repositories. + + + + This interface is implemented by logger repositories. e.g. + . + + + This interface is used by the + to obtain interfaces. + + + Nicko Cadell + Gert Driesen + + + + Check if the named logger exists in the repository. If so return + its reference, otherwise returns null. + + The name of the logger to lookup + The Logger object with the name specified + + + If the names logger exists it is returned, otherwise + null is returned. + + + + + + Returns all the currently defined loggers as an Array. + + All the defined loggers + + + Returns all the currently defined loggers as an Array. + + + + + + Returns a named logger instance + + The name of the logger to retrieve + The logger object with the name specified + + + Returns a named logger instance. + + + If a logger of that name already exists, then it will be + returned. Otherwise, a new logger will be instantiated and + then linked with its existing ancestors as well as children. + + + + + Shutdown the repository + + + Shutting down a repository will safely close and remove + all appenders in all loggers including the root logger. + + + Some appenders need to be closed before the + application exists. Otherwise, pending logging events might be + lost. + + + The method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + + Reset the repositories configuration to a default state + + + + Reset all values contained in this instance to their + default state. + + + Existing loggers are not removed. They are just reset. + + + This method should be used sparingly and with care as it will + block all logging until it is completed. + + + + + + Log the through this repository. + + the event to log + + + This method should not normally be used to log. + The interface should be used + for routine logging. This interface can be obtained + using the method. + + + The logEvent is delivered to the appropriate logger and + that logger is then responsible for logging the event. + + + + + + Returns all the Appenders that are configured as an Array. + + All the Appenders + + + Returns all the Appenders that are configured as an Array. + + + + + + The name of the repository + + + The name of the repository + + + + The name of the repository. + + + + + + RendererMap accesses the object renderer map for this repository. + + + RendererMap accesses the object renderer map for this repository. + + + + RendererMap accesses the object renderer map for this repository. + + + The RendererMap holds a mapping between types and + objects. + + + + + + The plugin map for this repository. + + + The plugin map for this repository. + + + + The plugin map holds the instances + that have been attached to this repository. + + + + + + Get the level map for the Repository. + + + + Get the level map for the Repository. + + + The level map defines the mappings between + level names and objects in + this repository. + + + + + + The threshold for all events in this repository + + + The threshold for all events in this repository + + + + The threshold for all events in this repository. + + + + + + Flag indicates if this repository has been configured. + + + Flag indicates if this repository has been configured. + + + + Flag indicates if this repository has been configured. + + + + + + Collection of internal messages captured during the most + recent configuration process. + + + + + Event to notify that the repository has been shutdown. + + + Event to notify that the repository has been shutdown. + + + + Event raised when the repository has been shutdown. + + + + + + Event to notify that the repository has had its configuration reset. + + + Event to notify that the repository has had its configuration reset. + + + + Event raised when the repository's configuration has been + reset to default. + + + + + + Event to notify that the repository has had its configuration changed. + + + Event to notify that the repository has had its configuration changed. + + + + Event raised when the repository's configuration has been changed. + + + + + + Repository specific properties + + + Repository specific properties + + + + These properties can be specified on a repository specific basis. + + + + + + Default Constructor + + + + Initializes the repository with default (empty) properties. + + + + + + Construct the repository using specific properties + + the properties to set for this repository + + + Initializes the repository with specified properties. + + + + + + Test if logger exists + + The name of the logger to lookup + The Logger object with the name specified + + + Check if the named logger exists in the repository. If so return + its reference, otherwise returns null. + + + + + + Returns all the currently defined loggers in the repository + + All the defined loggers + + + Returns all the currently defined loggers in the repository as an Array. + + + + + + Return a new logger instance + + The name of the logger to retrieve + The logger object with the name specified + + + Return a new logger instance. + + + If a logger of that name already exists, then it will be + returned. Otherwise, a new logger will be instantiated and + then linked with its existing ancestors as well as children. + + + + + + Shutdown the repository + + + + Shutdown the repository. Can be overridden in a subclass. + This base class implementation notifies the + listeners and all attached plugins of the shutdown event. + + + + + + Reset the repositories configuration to a default state + + + + Reset all values contained in this instance to their + default state. + + + Existing loggers are not removed. They are just reset. + + + This method should be used sparingly and with care as it will + block all logging until it is completed. + + + + + + Log the logEvent through this repository. + + the event to log + + + This method should not normally be used to log. + The interface should be used + for routine logging. This interface can be obtained + using the method. + + + The logEvent is delivered to the appropriate logger and + that logger is then responsible for logging the event. + + + + + + Returns all the Appenders that are configured as an Array. + + All the Appenders + + + Returns all the Appenders that are configured as an Array. + + + + + + The fully qualified type of the LoggerRepositorySkeleton class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Adds an object renderer for a specific class. + + The type that will be rendered by the renderer supplied. + The object renderer used to render the object. + + + Adds an object renderer for a specific class. + + + + + + Notify the registered listeners that the repository is shutting down + + Empty EventArgs + + + Notify any listeners that this repository is shutting down. + + + + + + Notify the registered listeners that the repository has had its configuration reset + + Empty EventArgs + + + Notify any listeners that this repository's configuration has been reset. + + + + + + Notify the registered listeners that the repository has had its configuration changed + + Empty EventArgs + + + Notify any listeners that this repository's configuration has changed. + + + + + + Raise a configuration changed event on this repository + + EventArgs.Empty + + + Applications that programmatically change the configuration of the repository should + raise this event notification to notify listeners. + + + + + + The name of the repository + + + The string name of the repository + + + + The name of this repository. The name is + used to store and lookup the repositories + stored by the . + + + + + + The threshold for all events in this repository + + + The threshold for all events in this repository + + + + The threshold for all events in this repository + + + + + + RendererMap accesses the object renderer map for this repository. + + + RendererMap accesses the object renderer map for this repository. + + + + RendererMap accesses the object renderer map for this repository. + + + The RendererMap holds a mapping between types and + objects. + + + + + + The plugin map for this repository. + + + The plugin map for this repository. + + + + The plugin map holds the instances + that have been attached to this repository. + + + + + + Get the level map for the Repository. + + + + Get the level map for the Repository. + + + The level map defines the mappings between + level names and objects in + this repository. + + + + + + Flag indicates if this repository has been configured. + + + Flag indicates if this repository has been configured. + + + + Flag indicates if this repository has been configured. + + + + + + Contains a list of internal messages captures during the + last configuration. + + + + + Event to notify that the repository has been shutdown. + + + Event to notify that the repository has been shutdown. + + + + Event raised when the repository has been shutdown. + + + + + + Event to notify that the repository has had its configuration reset. + + + Event to notify that the repository has had its configuration reset. + + + + Event raised when the repository's configuration has been + reset to default. + + + + + + Event to notify that the repository has had its configuration changed. + + + Event to notify that the repository has had its configuration changed. + + + + Event raised when the repository's configuration has been changed. + + + + + + Repository specific properties + + + Repository specific properties + + + These properties can be specified on a repository specific basis + + + + + Basic Configurator interface for repositories + + + + Interface used by basic configurator to configure a + with a default . + + + A should implement this interface to support + configuration by the . + + + Nicko Cadell + Gert Driesen + + + + Initialize the repository using the specified appender + + the appender to use to log all logging events + + + Configure the repository to route all logging events to the + specified appender. + + + + + + Initialize the repository using the specified appenders + + the appenders to use to log all logging events + + + Configure the repository to route all logging events to the + specified appenders. + + + + + + Configure repository using XML + + + + Interface used by Xml configurator to configure a . + + + A should implement this interface to support + configuration by the . + + + Nicko Cadell + Gert Driesen + + + + Initialize the repository using the specified config + + the element containing the root of the config + + + The schema for the XML configuration data is defined by + the implementation. + + + + + + Default constructor + + + + Initializes a new instance of the class. + + + + + + Construct with properties + + The properties to pass to this repository. + + + Initializes a new instance of the class. + + + + + + Construct with a logger factory + + The factory to use to create new logger instances. + + + Initializes a new instance of the class with + the specified . + + + + + + Construct with properties and a logger factory + + The properties to pass to this repository. + The factory to use to create new logger instances. + + + Initializes a new instance of the class with + the specified . + + + + + + Test if a logger exists + + The name of the logger to lookup + The Logger object with the name specified + + + Check if the named logger exists in the hierarchy. If so return + its reference, otherwise returns null. + + + + + + Returns all the currently defined loggers in the hierarchy as an Array + + All the defined loggers + + + Returns all the currently defined loggers in the hierarchy as an Array. + The root logger is not included in the returned + enumeration. + + + + + + Return a new logger instance named as the first parameter using + the default factory. + + + + Return a new logger instance named as the first parameter using + the default factory. + + + If a logger of that name already exists, then it will be + returned. Otherwise, a new logger will be instantiated and + then linked with its existing ancestors as well as children. + + + The name of the logger to retrieve + The logger object with the name specified + + + + Shutting down a hierarchy will safely close and remove + all appenders in all loggers including the root logger. + + + + Shutting down a hierarchy will safely close and remove + all appenders in all loggers including the root logger. + + + Some appenders need to be closed before the + application exists. Otherwise, pending logging events might be + lost. + + + The Shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + + Reset all values contained in this hierarchy instance to their default. + + + + Reset all values contained in this hierarchy instance to their + default. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set its default "off" value. + + + Existing loggers are not removed. They are just reset. + + + This method should be used sparingly and with care as it will + block all logging until it is completed. + + + + + + Log the logEvent through this hierarchy. + + the event to log + + + This method should not normally be used to log. + The interface should be used + for routine logging. This interface can be obtained + using the method. + + + The logEvent is delivered to the appropriate logger and + that logger is then responsible for logging the event. + + + + + + Returns all the Appenders that are currently configured + + An array containing all the currently configured appenders + + + Returns all the instances that are currently configured. + All the loggers are searched for appenders. The appenders may also be containers + for appenders and these are also searched for additional loggers. + + + The list returned is unordered but does not contain duplicates. + + + + + + Collect the appenders from an . + The appender may also be a container. + + + + + + + Collect the appenders from an container + + + + + + + Initialize the log4net system using the specified appender + + the appender to use to log all logging events + + + + Initialize the log4net system using the specified appenders + + the appenders to use to log all logging events + + + + Initialize the log4net system using the specified appenders + + the appenders to use to log all logging events + + + This method provides the same functionality as the + method implemented + on this object, but it is protected and therefore can be called by subclasses. + + + + + + Initialize the log4net system using the specified config + + the element containing the root of the config + + + + Initialize the log4net system using the specified config + + the element containing the root of the config + + + This method provides the same functionality as the + method implemented + on this object, but it is protected and therefore can be called by subclasses. + + + + + + Test if this hierarchy is disabled for the specified . + + The level to check against. + + true if the repository is disabled for the level argument, false otherwise. + + + + If this hierarchy has not been configured then this method will + always return true. + + + This method will return true if this repository is + disabled for level object passed as parameter and + false otherwise. + + + See also the property. + + + + + + Clear all logger definitions from the internal hashtable + + + + This call will clear all logger definitions from the internal + hashtable. Invoking this method will irrevocably mess up the + logger hierarchy. + + + You should really know what you are doing before + invoking this method. + + + + + + Return a new logger instance named as the first parameter using + . + + The name of the logger to retrieve + The factory that will make the new logger instance + The logger object with the name specified + + + If a logger of that name already exists, then it will be + returned. Otherwise, a new logger will be instantiated by the + parameter and linked with its existing + ancestors as well as children. + + + + + + Sends a logger creation event to all registered listeners + + The newly created logger + + Raises the logger creation event. + + + + + Updates all the parents of the specified logger + + The logger to update the parents for + + + This method loops through all the potential parents of + . There 3 possible cases: + + + + No entry for the potential parent of exists + + We create a ProvisionNode for this potential + parent and insert in that provision node. + + + + The entry is of type Logger for the potential parent. + + The entry is 's nearest existing parent. We + update 's parent field with this entry. We also break from + he loop because updating our parent's parent is our parent's + responsibility. + + + + The entry is of type ProvisionNode for this potential parent. + + We add to the list of children for this + potential parent. + + + + + + + + Replace a with a in the hierarchy. + + + + + + We update the links for all the children that placed themselves + in the provision node 'pn'. The second argument 'log' is a + reference for the newly created Logger, parent of all the + children in 'pn'. + + + We loop on all the children 'c' in 'pn'. + + + If the child 'c' has been already linked to a child of + 'log' then there is no need to update 'c'. + + + Otherwise, we set log's parent field to c's parent and set + c's parent field to log. + + + + + + Define or redefine a Level using the values in the argument + + the level values + + + Define or redefine a Level using the values in the argument + + + Supports setting levels via the configuration file. + + + + + + Set a Property using the values in the argument + + the property value + + + Set a Property using the values in the argument. + + + Supports setting property values via the configuration file. + + + + + + The fully qualified type of the Hierarchy class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Event used to notify that a logger has been created. + + + + Event raised when a logger is created. + + + + + + Has no appender warning been emitted + + + + Flag to indicate if we have already issued a warning + about not having an appender warning. + + + + + + Get the root of this hierarchy + + + + Get the root of this hierarchy. + + + + + + Gets or sets the default instance. + + The default + + + The logger factory is used to create logger instances. + + + + + + A class to hold the value, name and display name for a level + + + + A class to hold the value, name and display name for a level + + + + + + Override Object.ToString to return sensible debug info + + string info about this object + + + + Value of the level + + + + If the value is not set (defaults to -1) the value will be looked + up for the current level with the same name. + + + + + + Name of the level + + + The name of the level + + + + The name of the level. + + + + + + Display name for the level + + + The display name of the level + + + + The display name of the level. + + + + + + Used internally to accelerate hash table searches. + + + + Internal class used to improve performance of + string keyed hashtables. + + + The hashcode of the string is cached for reuse. + The string is stored as an interned value. + When comparing two objects for equality + the reference equality of the interned strings is compared. + + + Nicko Cadell + Gert Driesen + + + + Construct key with string name + + + + Initializes a new instance of the class + with the specified name. + + + Stores the hashcode of the string and interns + the string key to optimize comparisons. + + + The Compact Framework 1.0 the + method does not work. On the Compact Framework + the string keys are not interned nor are they + compared by reference. + + + The name of the logger. + + + + Returns a hash code for the current instance. + + A hash code for the current instance. + + + Returns the cached hashcode. + + + + + + Determines whether two instances + are equal. + + The to compare with the current . + + true if the specified is equal to the current ; otherwise, false. + + + + Compares the references of the interned strings. + + + + + + Provision nodes are used where no logger instance has been specified + + + + instances are used in the + when there is no specified + for that node. + + + A provision node holds a list of child loggers on behalf of + a logger that does not exist. + + + Nicko Cadell + Gert Driesen + + + + Create a new provision node with child node + + A child logger to add to this node. + + + Initializes a new instance of the class + with the specified child logger. + + + + + + The sits at the root of the logger hierarchy tree. + + + + The is a regular except + that it provides several guarantees. + + + First, it cannot be assigned a null + level. Second, since the root logger cannot have a parent, the + property always returns the value of the + level field without walking the hierarchy. + + + Nicko Cadell + Gert Driesen + + + + Construct a + + The level to assign to the root logger. + + + Initializes a new instance of the class with + the specified logging level. + + + The root logger names itself as "root". However, the root + logger cannot be retrieved by name. + + + + + + The fully qualified type of the RootLogger class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets the assigned level value without walking the logger hierarchy. + + The assigned level value without walking the logger hierarchy. + + + Because the root logger cannot have a parent and its level + must not be null this property just returns the + value of . + + + + + + Gets or sets the assigned for the root logger. + + + The of the root logger. + + + + Setting the level of the root logger to a null reference + may have catastrophic results. We prevent this here. + + + + + + Initializes the log4net environment using an XML DOM. + + + + Configures a using an XML DOM. + + + Nicko Cadell + Gert Driesen + + + + Construct the configurator for a hierarchy + + The hierarchy to build. + + + Initializes a new instance of the class + with the specified . + + + + + + Configure the hierarchy by parsing a DOM tree of XML elements. + + The root element to parse. + + + Configure the hierarchy by parsing a DOM tree of XML elements. + + + + + + Parse appenders by IDREF. + + The appender ref element. + The instance of the appender that the ref refers to. + + + Parse an XML element that represents an appender and return + the appender. + + + + + + Parses an appender element. + + The appender element. + The appender instance or null when parsing failed. + + + Parse an XML element that represents an appender and return + the appender instance. + + + + + + Parses a logger element. + + The logger element. + + + Parse an XML element that represents a logger. + + + + + + Parses the root logger element. + + The root element. + + + Parse an XML element that represents the root logger. + + + + + + Parses the children of a logger element. + + The category element. + The logger instance. + Flag to indicate if the logger is the root logger. + + + Parse the child elements of a <logger> element. + + + + + + Parses an object renderer. + + The renderer element. + + + Parse an XML element that represents a renderer. + + + + + + Parses a level element. + + The level element. + The logger object to set the level on. + Flag to indicate if the logger is the root logger. + + + Parse an XML element that represents a level. + + + + + + Sets a parameter on an object. + + The parameter element. + The object to set the parameter on. + + The parameter name must correspond to a writable property + on the object. The value of the parameter is a string, + therefore this function will attempt to set a string + property first. If unable to set a string property it + will inspect the property and its argument type. It will + attempt to call a static method called Parse on the + type of the property. This method will take a single + string argument and return a value that can be used to + set the property. + + + + + Test if an element has no attributes or child elements + + the element to inspect + true if the element has any attributes or child elements, false otherwise + + + + Test if a is constructible with Activator.CreateInstance. + + the type to inspect + true if the type is creatable using a default constructor, false otherwise + + + + Look for a method on the that matches the supplied + + the type that has the method + the name of the method + the method info found + + + The method must be a public instance method on the . + The method must be named or "Add" followed by . + The method must take a single parameter. + + + + + + Converts a string value to a target type. + + The type of object to convert the string to. + The string value to use as the value of the object. + + + An object of type with value or + null when the conversion could not be performed. + + + + + + Creates an object as specified in XML. + + The XML element that contains the definition of the object. + The object type to use if not explicitly specified. + The type that the returned object must be or must inherit from. + The object or null + + + Parse an XML element and create an object instance based on the configuration + data. + + + The type of the instance may be specified in the XML. If not + specified then the is used + as the type. However the type is specified it must support the + type. + + + + + + key: appenderName, value: appender. + + + + + The Hierarchy being configured. + + + + + The fully qualified type of the XmlHierarchyConfigurator class. + + + Used by the internal logger to record the Type of the + log message. + + + + + + + + + + + + + + + + + + + + + Delegate used to handle logger repository shutdown event notifications + + The that is shutting down. + Empty event args + + + Delegate used to handle logger repository shutdown event notifications. + + + + + + Delegate used to handle logger repository configuration reset event notifications + + The that has had its configuration reset. + Empty event args + + + Delegate used to handle logger repository configuration reset event notifications. + + + + + + Delegate used to handle event notifications for logger repository configuration changes. + + The that has had its configuration changed. + Empty event arguments. + + + Delegate used to handle event notifications for logger repository configuration changes. + + + + + + Write the name of the current AppDomain to the output + + + + Write the name of the current AppDomain to the output writer + + + Nicko Cadell + + + + Write the name of the current AppDomain to the output + + the writer to write to + null, state is not set + + + Writes name of the current AppDomain to the output . + + + + + + Write the current date to the output + + + + Date pattern converter, uses a to format + the current date and time to the writer as a string. + + + The value of the determines + the formatting of the date. The following values are allowed: + + + Option value + Output + + + ISO8601 + + Uses the formatter. + Formats using the "yyyy-MM-dd HH:mm:ss,fff" pattern. + + + + DATE + + Uses the formatter. + Formats using the "dd MMM yyyy HH:mm:ss,fff" for example, "06 Nov 1994 15:49:37,459". + + + + ABSOLUTE + + Uses the formatter. + Formats using the "HH:mm:ss,fff" for example, "15:49:37,459". + + + + other + + Any other pattern string uses the formatter. + This formatter passes the pattern string to the + method. + For details on valid patterns see + DateTimeFormatInfo Class. + + + + + + The date and time is in the local time zone and is rendered in that zone. + To output the time in Universal time see . + + + Nicko Cadell + + + + The used to render the date to a string + + + + The used to render the date to a string + + + + + + Initialize the converter options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Write the current date to the output + + that will receive the formatted result. + null, state is not set + + + Pass the current date and time to the + for it to render it to the writer. + + + The date and time passed is in the local time zone. + + + + + + The fully qualified type of the DatePatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Write an folder path to the output + + + + Write an special path environment folder path to the output writer. + The value of the determines + the name of the variable to output. + should be a value in the enumeration. + + + Ron Grabowski + + + + Write an special path environment folder path to the output + + the writer to write to + null, state is not set + + + Writes the special path environment folder path to the output . + The name of the special path environment folder path to output must be set + using the + property. + + + + + + The fully qualified type of the EnvironmentFolderPathPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Write an environment variable to the output + + + + Write an environment variable to the output writer. + The value of the determines + the name of the variable to output. + + + Nicko Cadell + + + + Write an environment variable to the output + + the writer to write to + null, state is not set + + + Writes the environment variable to the output . + The name of the environment variable to output must be set + using the + property. + + + + + + The fully qualified type of the EnvironmentPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Write the current thread identity to the output + + + + Write the current thread identity to the output writer + + + Nicko Cadell + + + + Write the current thread identity to the output + + the writer to write to + null, state is not set + + + Writes the current thread identity to the output . + + + + + + The fully qualified type of the IdentityPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Pattern converter for literal string instances in the pattern + + + + Writes the literal string value specified in the + property to + the output. + + + Nicko Cadell + + + + Set the next converter in the chain + + The next pattern converter in the chain + The next pattern converter + + + Special case the building of the pattern converter chain + for instances. Two adjacent + literals in the pattern can be represented by a single combined + pattern converter. This implementation detects when a + is added to the chain + after this converter and combines its value with this converter's + literal value. + + + + + + Write the literal to the output + + the writer to write to + null, not set + + + Override the formatting behavior to ignore the FormattingInfo + because we have a literal instead. + + + Writes the value of + to the output . + + + + + + Convert this pattern into the rendered message + + that will receive the formatted result. + null, not set + + + This method is not used. + + + + + + Writes a newline to the output + + + + Writes the system dependent line terminator to the output. + This behavior can be overridden by setting the : + + + + Option Value + Output + + + DOS + DOS or Windows line terminator "\r\n" + + + UNIX + UNIX line terminator "\n" + + + + Nicko Cadell + + + + Initialize the converter + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Write the current process ID to the output + + + + Write the current process ID to the output writer + + + Nicko Cadell + + + + Write the current process ID to the output + + the writer to write to + null, state is not set + + + Write the current process ID to the output . + + + + + + The fully qualified type of the ProcessIdPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Property pattern converter + + + + This pattern converter reads the thread and global properties. + The thread properties take priority over global properties. + See for details of the + thread properties. See for + details of the global properties. + + + If the is specified then that will be used to + lookup a single property. If no is specified + then all properties will be dumped as a list of key value pairs. + + + Nicko Cadell + + + + Write the property value to the output + + that will receive the formatted result. + null, state is not set + + + Writes out the value of a named property. The property name + should be set in the + property. + + + If the is set to null + then all the properties are written as key value pairs. + + + + + + A Pattern converter that generates a string of random characters + + + + The converter generates a string of random characters. By default + the string is length 4. This can be changed by setting the + to the string value of the length required. + + + The random characters in the string are limited to uppercase letters + and numbers only. + + + The random number generator used by this class is not cryptographically secure. + + + Nicko Cadell + + + + Shared random number generator + + + + + Length of random string to generate. Default length 4. + + + + + Initialize the converter options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Write a randoim string to the output + + the writer to write to + null, state is not set + + + Write a randoim string to the output . + + + + + + The fully qualified type of the RandomStringPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Write the current threads username to the output + + + + Write the current threads username to the output writer + + + Nicko Cadell + + + + Write the current threads username to the output + + the writer to write to + null, state is not set + + + Write the current threads username to the output . + + + + + + The fully qualified type of the UserNamePatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Write the UTC date time to the output + + + + Date pattern converter, uses a to format + the current date and time in Universal time. + + + See the for details on the date pattern syntax. + + + + Nicko Cadell + + + + Write the current date and time to the output + + that will receive the formatted result. + null, state is not set + + + Pass the current date and time to the + for it to render it to the writer. + + + The date is in Universal time when it is rendered. + + + + + + + The fully qualified type of the UtcDatePatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Type converter for Boolean. + + + + Supports conversion from string to bool type. + + + + + + Nicko Cadell + Gert Driesen + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Returns true if the is + the type. + + + + + + Convert the source object to the type supported by this object + + the object to convert + the converted object + + + Uses the method to convert the + argument to a . + + + + The object cannot be converted to the + target type. To check for this condition use the + method. + + + + + Exception base type for conversion errors. + + + + This type extends . It + does not add any new functionality but does differentiate the + type of exception being thrown. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Constructor + + A message to include with the exception. + + + Initializes a new instance of the class + with the specified message. + + + + + + Constructor + + A message to include with the exception. + A nested exception to include. + + + Initializes a new instance of the class + with the specified message and inner exception. + + + + + + Serialization constructor + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + + + Initializes a new instance of the class + with serialized data. + + + + + + Creates a new instance of the class. + + The conversion destination type. + The value to convert. + An instance of the . + + + Creates a new instance of the class. + + + + + + Creates a new instance of the class. + + The conversion destination type. + The value to convert. + A nested exception to include. + An instance of the . + + + Creates a new instance of the class. + + + + + + Register of type converters for specific types. + + + + Maintains a registry of type converters used to convert between + types. + + + Use the and + methods to register new converters. + The and methods + lookup appropriate converters to use. + + + + + Nicko Cadell + Gert Driesen + + + + Private constructor + + + Initializes a new instance of the class. + + + + + Static constructor. + + + + This constructor defines the intrinsic type converters. + + + + + + Adds a converter for a specific type. + + The type being converted to. + The type converter to use to convert to the destination type. + + + Adds a converter instance for a specific type. + + + + + + Adds a converter for a specific type. + + The type being converted to. + The type of the type converter to use to convert to the destination type. + + + Adds a converter for a specific type. + + + + + + Gets the type converter to use to convert values to the destination type. + + The type being converted from. + The type being converted to. + + The type converter instance to use for type conversions or null + if no type converter is found. + + + + Gets the type converter to use to convert values to the destination type. + + + + + + Gets the type converter to use to convert values to the destination type. + + The type being converted to. + + The type converter instance to use for type conversions or null + if no type converter is found. + + + + Gets the type converter to use to convert values to the destination type. + + + + + + Lookups the type converter to use as specified by the attributes on the + destination type. + + The type being converted to. + + The type converter instance to use for type conversions or null + if no type converter is found. + + + + + Creates the instance of the type converter. + + The type of the type converter. + + The type converter instance to use for type conversions or null + if no type converter is found. + + + + The type specified for the type converter must implement + the or interfaces + and must have a public default (no argument) constructor. + + + + + + The fully qualified type of the ConverterRegistry class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Mapping from to type converter. + + + + + Supports conversion from string to type. + + + + Supports conversion from string to type. + + + + + + Nicko Cadell + Gert Driesen + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Returns true if the is + the type. + + + + + + Overrides the ConvertFrom method of IConvertFrom. + + the object to convert to an encoding + the encoding + + + Uses the method to + convert the argument to an . + + + + The object cannot be converted to the + target type. To check for this condition use the + method. + + + + + Interface supported by type converters + + + + This interface supports conversion from a single type to arbitrary types. + See . + + + Nicko Cadell + + + + Returns whether this converter can convert the object to the specified type + + A Type that represents the type you want to convert to + true if the conversion is possible + + + Test if the type supported by this converter can be converted to the + . + + + + + + Converts the given value object to the specified type, using the arguments + + the object to convert + The Type to convert the value parameter to + the converted object + + + Converts the (which must be of the type supported + by this converter) to the specified.. + + + + + + Supports conversion from string to type. + + + + Supports conversion from string to type. + + + + + Nicko Cadell + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Returns true if the is + the type. + + + + + + Overrides the ConvertFrom method of IConvertFrom. + + the object to convert to an IPAddress + the IPAddress + + + Uses the method to convert the + argument to an . + If that fails then the string is resolved as a DNS hostname. + + + + The object cannot be converted to the + target type. To check for this condition use the + method. + + + + + Valid characters in an IPv4 or IPv6 address string. (Does not support subnets) + + + + + Supports conversion from string to type. + + + + Supports conversion from string to type. + + + The string is used as the + of the . + + + + + + Nicko Cadell + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Returns true if the is + the type. + + + + + + Overrides the ConvertFrom method of IConvertFrom. + + the object to convert to a PatternLayout + the PatternLayout + + + Creates and returns a new using + the as the + . + + + + The object cannot be converted to the + target type. To check for this condition use the + method. + + + + + Convert between string and + + + + Supports conversion from string to type, + and from a type to a string. + + + The string is used as the + of the . + + + + + + Nicko Cadell + + + + Can the target type be converted to the type supported by this object + + A that represents the type you want to convert to + true if the conversion is possible + + + Returns true if the is + assignable from a type. + + + + + + Converts the given value object to the specified type, using the arguments + + the object to convert + The Type to convert the value parameter to + the converted object + + + Uses the method to convert the + argument to a . + + + + The object cannot be converted to the + . To check for this condition use the + method. + + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Returns true if the is + the type. + + + + + + Overrides the ConvertFrom method of IConvertFrom. + + the object to convert to a PatternString + the PatternString + + + Creates and returns a new using + the as the + . + + + + The object cannot be converted to the + target type. To check for this condition use the + method. + + + + + Supports conversion from string to type. + + + + Supports conversion from string to type. + + + + + + Nicko Cadell + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Returns true if the is + the type. + + + + + + Overrides the ConvertFrom method of IConvertFrom. + + the object to convert to a Type + the Type + + + Uses the method to convert the + argument to a . + Additional effort is made to locate partially specified types + by searching the loaded assemblies. + + + + The object cannot be converted to the + target type. To check for this condition use the + method. + + + + + Attribute used to associate a type converter + + + + Class and Interface level attribute that specifies a type converter + to use with the associated type. + + + To associate a type converter with a target type apply a + TypeConverterAttribute to the target type. Specify the + type of the type converter on the attribute. + + + Nicko Cadell + Gert Driesen + + + + The string type name of the type converter + + + + + Default constructor + + + + Default constructor + + + + + + Create a new type converter attribute for the specified type name + + The string type name of the type converter + + + The type specified must implement the + or the interfaces. + + + + + + Create a new type converter attribute for the specified type + + The type of the type converter + + + The type specified must implement the + or the interfaces. + + + + + + The string type name of the type converter + + + The string type name of the type converter + + + + The type specified must implement the + or the interfaces. + + + + + + A straightforward implementation of the interface. + + + + This is the default implementation of the + interface. Implementors of the interface + should aggregate an instance of this type. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Append on on all attached appenders. + + The event being logged. + The number of appenders called. + + + Calls the method on all + attached appenders. + + + + + + Append on on all attached appenders. + + The array of events being logged. + The number of appenders called. + + + Calls the method on all + attached appenders. + + + + + + Calls the DoAppende method on the with + the objects supplied. + + The appender + The events + + + If the supports the + interface then the will be passed + through using that interface. Otherwise the + objects in the array will be passed one at a time. + + + + + + Attaches an appender. + + The appender to add. + + + If the appender is already in the list it won't be added again. + + + + + + Gets an attached appender with the specified name. + + The name of the appender to get. + + The appender with the name specified, or null if no appender with the + specified name is found. + + + + Lookup an attached appender by name. + + + + + + Removes all attached appenders. + + + + Removes and closes all attached appenders + + + + + + Removes the specified appender from the list of attached appenders. + + The appender to remove. + The appender removed from the list + + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + + Removes the appender with the specified name from the list of appenders. + + The name of the appender to remove. + The appender removed from the list + + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + + List of appenders + + + + + Array of appenders, used to cache the m_appenderList + + + + + The fully qualified type of the AppenderAttachedImpl class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets all attached appenders. + + + A collection of attached appenders, or null if there + are no attached appenders. + + + + The read only collection of all currently attached appenders. + + + + + + This class aggregates several PropertiesDictionary collections together. + + + + Provides a dictionary style lookup over an ordered list of + collections. + + + Nicko Cadell + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Add a Properties Dictionary to this composite collection + + the properties to add + + + Properties dictionaries added first take precedence over dictionaries added + later. + + + + + + Flatten this composite collection into a single properties dictionary + + the flattened dictionary + + + Reduces the collection of ordered dictionaries to a single dictionary + containing the resultant values for the keys. + + + + + + Gets the value of a property + + + The value for the property with the specified key + + + + Looks up the value for the specified. + The collections are searched + in the order in which they were added to this collection. The value + returned is the value held by the first collection that contains + the specified key. + + + If none of the collections contain the specified key then + null is returned. + + + + + + Base class for Context Properties implementations + + + + This class defines a basic property get set accessor + + + Nicko Cadell + + + + Gets or sets the value of a property + + + The value for the property with the specified key + + + + Gets or sets the value of a property + + + + + + Wrapper class used to map converter names to converter types + + + + Pattern converter info class used during configuration by custom + PatternString and PatternLayer converters. + + + + + + default constructor + + + + + + + + + + + Gets or sets the name of the conversion pattern + + + + The name of the pattern in the format string + + + + + + Gets or sets the type of the converter + + + + The value specified must extend the + type. + + + + + + + + + + + Subclass of that maintains a count of + the number of bytes written. + + + + This writer counts the number of bytes written. + + + Nicko Cadell + Gert Driesen + + + + that does not leak exceptions + + + + does not throw exceptions when things go wrong. + Instead, it delegates error handling to its . + + + Nicko Cadell + Gert Driesen + + + + Adapter that extends and forwards all + messages to an instance of . + + + + Adapter that extends and forwards all + messages to an instance of . + + + Nicko Cadell + + + + The writer to forward messages to + + + + + Create an instance of that forwards all + messages to a . + + The to forward to + + + Create an instance of that forwards all + messages to a . + + + + + + Closes the writer and releases any system resources associated with the writer + + + + + + + + + Dispose this writer + + flag indicating if we are being disposed + + + Dispose this writer + + + + + + Flushes any buffered output + + + + Clears all buffers for the writer and causes any buffered data to be written + to the underlying device + + + + + + Writes a character to the wrapped TextWriter + + the value to write to the TextWriter + + + Writes a character to the wrapped TextWriter + + + + + + Writes a character buffer to the wrapped TextWriter + + the data buffer + the start index + the number of characters to write + + + Writes a character buffer to the wrapped TextWriter + + + + + + Writes a string to the wrapped TextWriter + + the value to write to the TextWriter + + + Writes a string to the wrapped TextWriter + + + + + + Gets or sets the underlying . + + + The underlying . + + + + Gets or sets the underlying . + + + + + + The Encoding in which the output is written + + + The + + + + The Encoding in which the output is written + + + + + + Gets an object that controls formatting + + + The format provider + + + + Gets an object that controls formatting + + + + + + Gets or sets the line terminator string used by the TextWriter + + + The line terminator to use + + + + Gets or sets the line terminator string used by the TextWriter + + + + + + Constructor + + the writer to actually write to + the error handler to report error to + + + Create a new QuietTextWriter using a writer and error handler + + + + + + Writes a character to the underlying writer + + the char to write + + + Writes a character to the underlying writer + + + + + + Writes a buffer to the underlying writer + + the buffer to write + the start index to write from + the number of characters to write + + + Writes a buffer to the underlying writer + + + + + + Writes a string to the output. + + The string data to write to the output. + + + Writes a string to the output. + + + + + + Closes the underlying output writer. + + + + Closes the underlying output writer. + + + + + + The error handler instance to pass all errors to + + + + + Flag to indicate if this writer is closed + + + + + Gets or sets the error handler that all errors are passed to. + + + The error handler that all errors are passed to. + + + + Gets or sets the error handler that all errors are passed to. + + + + + + Gets a value indicating whether this writer is closed. + + + true if this writer is closed, otherwise false. + + + + Gets a value indicating whether this writer is closed. + + + + + + Constructor + + The to actually write to. + The to report errors to. + + + Creates a new instance of the class + with the specified and . + + + + + + Writes a character to the underlying writer and counts the number of bytes written. + + the char to write + + + Overrides implementation of . Counts + the number of bytes written. + + + + + + Writes a buffer to the underlying writer and counts the number of bytes written. + + the buffer to write + the start index to write from + the number of characters to write + + + Overrides implementation of . Counts + the number of bytes written. + + + + + + Writes a string to the output and counts the number of bytes written. + + The string data to write to the output. + + + Overrides implementation of . Counts + the number of bytes written. + + + + + + Total number of bytes written. + + + + + Gets or sets the total number of bytes written. + + + The total number of bytes written. + + + + Gets or sets the total number of bytes written. + + + + + + A fixed size rolling buffer of logging events. + + + + An array backed fixed size leaky bucket. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + The maximum number of logging events in the buffer. + + + Initializes a new instance of the class with + the specified maximum number of buffered logging events. + + + The argument is not a positive integer. + + + + Appends a to the buffer. + + The event to append to the buffer. + The event discarded from the buffer, if the buffer is full, otherwise null. + + + Append an event to the buffer. If the buffer still contains free space then + null is returned. If the buffer is full then an event will be dropped + to make space for the new event, the event dropped is returned. + + + + + + Get and remove the oldest event in the buffer. + + The oldest logging event in the buffer + + + Gets the oldest (first) logging event in the buffer and removes it + from the buffer. + + + + + + Pops all the logging events from the buffer into an array. + + An array of all the logging events in the buffer. + + + Get all the events in the buffer and clear the buffer. + + + + + + Clear the buffer + + + + Clear the buffer of all events. The events in the buffer are lost. + + + + + + Gets the th oldest event currently in the buffer. + + The th oldest event currently in the buffer. + + + If is outside the range 0 to the number of events + currently in the buffer, then null is returned. + + + + + + Gets the maximum size of the buffer. + + The maximum size of the buffer. + + + Gets the maximum size of the buffer + + + + + + Gets the number of logging events in the buffer. + + The number of logging events in the buffer. + + + This number is guaranteed to be in the range 0 to + (inclusive). + + + + + + An always empty . + + + + A singleton implementation of the + interface that always represents an empty collection. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to enforce the singleton pattern. + + + + + + Copies the elements of the to an + , starting at a particular Array index. + + The one-dimensional + that is the destination of the elements copied from + . The Array must have zero-based + indexing. + The zero-based index in array at which + copying begins. + + + As the collection is empty no values are copied into the array. + + + + + + Returns an enumerator that can iterate through a collection. + + + An that can be used to + iterate through the collection. + + + + As the collection is empty a is returned. + + + + + + The singleton instance of the empty collection. + + + + + Gets the singleton instance of the empty collection. + + The singleton instance of the empty collection. + + + Gets the singleton instance of the empty collection. + + + + + + Gets a value indicating if access to the is synchronized (thread-safe). + + + true if access to the is synchronized (thread-safe); otherwise, false. + + + + For the this property is always true. + + + + + + Gets the number of elements contained in the . + + + The number of elements contained in the . + + + + As the collection is empty the is always 0. + + + + + + Gets an object that can be used to synchronize access to the . + + + An object that can be used to synchronize access to the . + + + + As the collection is empty and thread safe and synchronized this instance is also + the object. + + + + + + An always empty . + + + + A singleton implementation of the + interface that always represents an empty collection. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to enforce the singleton pattern. + + + + + + Copies the elements of the to an + , starting at a particular Array index. + + The one-dimensional + that is the destination of the elements copied from + . The Array must have zero-based + indexing. + The zero-based index in array at which + copying begins. + + + As the collection is empty no values are copied into the array. + + + + + + Returns an enumerator that can iterate through a collection. + + + An that can be used to + iterate through the collection. + + + + As the collection is empty a is returned. + + + + + + Adds an element with the provided key and value to the + . + + The to use as the key of the element to add. + The to use as the value of the element to add. + + + As the collection is empty no new values can be added. A + is thrown if this method is called. + + + This dictionary is always empty and cannot be modified. + + + + Removes all elements from the . + + + + As the collection is empty no values can be removed. A + is thrown if this method is called. + + + This dictionary is always empty and cannot be modified. + + + + Determines whether the contains an element + with the specified key. + + The key to locate in the . + false + + + As the collection is empty the method always returns false. + + + + + + Returns an enumerator that can iterate through a collection. + + + An that can be used to + iterate through the collection. + + + + As the collection is empty a is returned. + + + + + + Removes the element with the specified key from the . + + The key of the element to remove. + + + As the collection is empty no values can be removed. A + is thrown if this method is called. + + + This dictionary is always empty and cannot be modified. + + + + The singleton instance of the empty dictionary. + + + + + Gets the singleton instance of the . + + The singleton instance of the . + + + Gets the singleton instance of the . + + + + + + Gets a value indicating if access to the is synchronized (thread-safe). + + + true if access to the is synchronized (thread-safe); otherwise, false. + + + + For the this property is always true. + + + + + + Gets the number of elements contained in the + + + The number of elements contained in the . + + + + As the collection is empty the is always 0. + + + + + + Gets an object that can be used to synchronize access to the . + + + An object that can be used to synchronize access to the . + + + + As the collection is empty and thread safe and synchronized this instance is also + the object. + + + + + + Gets a value indicating whether the has a fixed size. + + true + + + As the collection is empty always returns true. + + + + + + Gets a value indicating whether the is read-only. + + true + + + As the collection is empty always returns true. + + + + + + Gets an containing the keys of the . + + An containing the keys of the . + + + As the collection is empty a is returned. + + + + + + Gets an containing the values of the . + + An containing the values of the . + + + As the collection is empty a is returned. + + + + + + Gets or sets the element with the specified key. + + The key of the element to get or set. + null + + + As the collection is empty no values can be looked up or stored. + If the index getter is called then null is returned. + A is thrown if the setter is called. + + + This dictionary is always empty and cannot be modified. + + + + Contain the information obtained when parsing formatting modifiers + in conversion modifiers. + + + + Holds the formatting information extracted from the format string by + the . This is used by the + objects when rendering the output. + + + Nicko Cadell + Gert Driesen + + + + Defaut Constructor + + + + Initializes a new instance of the class. + + + + + + Constructor + + + + Initializes a new instance of the class + with the specified parameters. + + + + + + Gets or sets the minimum value. + + + The minimum value. + + + + Gets or sets the minimum value. + + + + + + Gets or sets the maximum value. + + + The maximum value. + + + + Gets or sets the maximum value. + + + + + + Gets or sets a flag indicating whether left align is enabled + or not. + + + A flag indicating whether left align is enabled or not. + + + + Gets or sets a flag indicating whether left align is enabled or not. + + + + + + Implementation of Properties collection for the + + + + This class implements a properties collection that is thread safe and supports both + storing properties and capturing a read only copy of the current propertied. + + + This class is optimized to the scenario where the properties are read frequently + and are modified infrequently. + + + Nicko Cadell + + + + The read only copy of the properties. + + + + This variable is declared volatile to prevent the compiler and JIT from + reordering reads and writes of this thread performed on different threads. + + + + + + Lock object used to synchronize updates within this instance + + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Remove a property from the global context + + the key for the entry to remove + + + Removing an entry from the global context properties is relatively expensive compared + with reading a value. + + + + + + Clear the global context properties + + + + + Get a readonly immutable copy of the properties + + the current global context properties + + + This implementation is fast because the GlobalContextProperties class + stores a readonly copy of the properties. + + + + + + Gets or sets the value of a property + + + The value for the property with the specified key + + + + Reading the value for a key is faster than setting the value. + When the value is written a new read only copy of + the properties is created. + + + + + + Manages a mapping from levels to + + + + Manages an ordered mapping from instances + to subclasses. + + + Nicko Cadell + + + + Default constructor + + + + Initialise a new instance of . + + + + + + Add a to this mapping + + the entry to add + + + If a has previously been added + for the same then that entry will be + overwritten. + + + + + + Lookup the mapping for the specified level + + the level to lookup + the for the level or null if no mapping found + + + Lookup the value for the specified level. Finds the nearest + mapping value for the level that is equal to or less than the + specified. + + + If no mapping could be found then null is returned. + + + + + + Initialize options + + + + Caches the sorted list of in an array + + + + + + Implementation of Properties collection for the + + + + Class implements a collection of properties that is specific to each thread. + The class is not synchronized as each thread has its own . + + + This class stores its properties in a slot on the named + log4net.Util.LogicalThreadContextProperties. + + + The requires a link time + for the + . + If the calling code does not have this permission then this context will be disabled. + It will not store any property values set on it. + + + Nicko Cadell + + + + Flag used to disable this context if we don't have permission to access the CallContext. + + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Remove a property + + the key for the entry to remove + + + Remove the value for the specified from the context. + + + + + + Clear all the context properties + + + + Clear all the context properties + + + + + + Get the PropertiesDictionary stored in the LocalDataStoreSlot for this thread. + + create the dictionary if it does not exist, otherwise return null if is does not exist + the properties for this thread + + + The collection returned is only to be used on the calling thread. If the + caller needs to share the collection between different threads then the + caller must clone the collection before doings so. + + + + + + Gets the call context get data. + + The peroperties dictionary stored in the call context + + The method has a + security link demand, therfore we must put the method call in a seperate method + that we can wrap in an exception handler. + + + + + Sets the call context data. + + The properties. + + The method has a + security link demand, therfore we must put the method call in a seperate method + that we can wrap in an exception handler. + + + + + The fully qualified type of the LogicalThreadContextProperties class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the value of a property + + + The value for the property with the specified key + + + + Get or set the property value for the specified. + + + + + + + + + + + + + Outputs log statements from within the log4net assembly. + + + + Log4net components cannot make log4net logging calls. However, it is + sometimes useful for the user to learn about what log4net is + doing. + + + All log4net internal debug calls go to the standard output stream + whereas internal error messages are sent to the standard error output + stream. + + + Nicko Cadell + Gert Driesen + + + + Formats Prefix, Source, and Message in the same format as the value + sent to Console.Out and Trace.Write. + + + + + + Initializes a new instance of the class. + + + + + + + + + Static constructor that initializes logging by reading + settings from the application configuration file. + + + + The log4net.Internal.Debug application setting + controls internal debugging. This setting should be set + to true to enable debugging. + + + The log4net.Internal.Quiet application setting + suppresses all internal logging including error messages. + This setting should be set to true to enable message + suppression. + + + + + + Raises the LogReceived event when an internal messages is received. + + + + + + + + + Writes log4net internal debug messages to the + standard output stream. + + + The message to log. + + + All internal debug messages are prepended with + the string "log4net: ". + + + + + + Writes log4net internal debug messages to the + standard output stream. + + The Type that generated this message. + The message to log. + An exception to log. + + + All internal debug messages are prepended with + the string "log4net: ". + + + + + + Writes log4net internal warning messages to the + standard error stream. + + The Type that generated this message. + The message to log. + + + All internal warning messages are prepended with + the string "log4net:WARN ". + + + + + + Writes log4net internal warning messages to the + standard error stream. + + The Type that generated this message. + The message to log. + An exception to log. + + + All internal warning messages are prepended with + the string "log4net:WARN ". + + + + + + Writes log4net internal error messages to the + standard error stream. + + The Type that generated this message. + The message to log. + + + All internal error messages are prepended with + the string "log4net:ERROR ". + + + + + + Writes log4net internal error messages to the + standard error stream. + + The Type that generated this message. + The message to log. + An exception to log. + + + All internal debug messages are prepended with + the string "log4net:ERROR ". + + + + + + Writes output to the standard output stream. + + The message to log. + + + Writes to both Console.Out and System.Diagnostics.Trace. + Note that the System.Diagnostics.Trace is not supported + on the Compact Framework. + + + If the AppDomain is not configured with a config file then + the call to System.Diagnostics.Trace may fail. This is only + an issue if you are programmatically creating your own AppDomains. + + + + + + Writes output to the standard error stream. + + The message to log. + + + Writes to both Console.Error and System.Diagnostics.Trace. + Note that the System.Diagnostics.Trace is not supported + on the Compact Framework. + + + If the AppDomain is not configured with a config file then + the call to System.Diagnostics.Trace may fail. This is only + an issue if you are programmatically creating your own AppDomains. + + + + + + Default debug level + + + + + In quietMode not even errors generate any output. + + + + + The event raised when an internal message has been received. + + + + + The Type that generated the internal message. + + + + + The DateTime stamp of when the internal message was received. + + + + + A string indicating the severity of the internal message. + + + "log4net: ", + "log4net:ERROR ", + "log4net:WARN " + + + + + The internal log message. + + + + + The Exception related to the message. + + + Optional. Will be null if no Exception was passed. + + + + + Gets or sets a value indicating whether log4net internal logging + is enabled or disabled. + + + true if log4net internal logging is enabled, otherwise + false. + + + + When set to true, internal debug level logging will be + displayed. + + + This value can be set by setting the application setting + log4net.Internal.Debug in the application configuration + file. + + + The default value is false, i.e. debugging is + disabled. + + + + + The following example enables internal debugging using the + application configuration file : + + + + + + + + + + + + + Gets or sets a value indicating whether log4net should generate no output + from internal logging, not even for errors. + + + true if log4net should generate no output at all from internal + logging, otherwise false. + + + + When set to true will cause internal logging at all levels to be + suppressed. This means that no warning or error reports will be logged. + This option overrides the setting and + disables all debug also. + + This value can be set by setting the application setting + log4net.Internal.Quiet in the application configuration file. + + + The default value is false, i.e. internal logging is not + disabled. + + + + The following example disables internal logging using the + application configuration file : + + + + + + + + + + + + + + + + + Test if LogLog.Debug is enabled for output. + + + true if Debug is enabled + + + + Test if LogLog.Debug is enabled for output. + + + + + + Test if LogLog.Warn is enabled for output. + + + true if Warn is enabled + + + + Test if LogLog.Warn is enabled for output. + + + + + + Test if LogLog.Error is enabled for output. + + + true if Error is enabled + + + + Test if LogLog.Error is enabled for output. + + + + + + Subscribes to the LogLog.LogReceived event and stores messages + to the supplied IList instance. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a native error code and message. + + + + Represents a Win32 platform native error. + + + Nicko Cadell + Gert Driesen + + + + Create an instance of the class with the specified + error number and message. + + The number of the native error. + The message of the native error. + + + Create an instance of the class with the specified + error number and message. + + + + + + Create a new instance of the class for the last Windows error. + + + An instance of the class for the last windows error. + + + + The message for the error number is lookup up using the + native Win32 FormatMessage function. + + + + + + Create a new instance of the class. + + the error number for the native error + + An instance of the class for the specified + error number. + + + + The message for the specified error number is lookup up using the + native Win32 FormatMessage function. + + + + + + Retrieves the message corresponding with a Win32 message identifier. + + Message identifier for the requested message. + + The message corresponding with the specified message identifier. + + + + The message will be searched for in system message-table resource(s) + using the native FormatMessage function. + + + + + + Return error information string + + error information string + + + Return error information string + + + + + + Formats a message string. + + Formatting options, and how to interpret the parameter. + Location of the message definition. + Message identifier for the requested message. + Language identifier for the requested message. + If includes FORMAT_MESSAGE_ALLOCATE_BUFFER, the function allocates a buffer using the LocalAlloc function, and places the pointer to the buffer at the address specified in . + If the FORMAT_MESSAGE_ALLOCATE_BUFFER flag is not set, this parameter specifies the maximum number of TCHARs that can be stored in the output buffer. If FORMAT_MESSAGE_ALLOCATE_BUFFER is set, this parameter specifies the minimum number of TCHARs to allocate for an output buffer. + Pointer to an array of values that are used as insert values in the formatted message. + + + The function requires a message definition as input. The message definition can come from a + buffer passed into the function. It can come from a message table resource in an + already-loaded module. Or the caller can ask the function to search the system's message + table resource(s) for the message definition. The function finds the message definition + in a message table resource based on a message identifier and a language identifier. + The function copies the formatted message text to an output buffer, processing any embedded + insert sequences if requested. + + + To prevent the usage of unsafe code, this stub does not support inserting values in the formatted message. + + + + + If the function succeeds, the return value is the number of TCHARs stored in the output + buffer, excluding the terminating null character. + + + If the function fails, the return value is zero. To get extended error information, + call . + + + + + + Gets the number of the native error. + + + The number of the native error. + + + + Gets the number of the native error. + + + + + + Gets the message of the native error. + + + The message of the native error. + + + + + Gets the message of the native error. + + + + + An always empty . + + + + A singleton implementation of the over a collection + that is empty and not modifiable. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to enforce the singleton pattern. + + + + + + Test if the enumerator can advance, if so advance. + + false as the cannot advance. + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will always return false. + + + + + + Resets the enumerator back to the start. + + + + As the enumerator is over an empty collection does nothing. + + + + + + The singleton instance of the . + + + + + Gets the singleton instance of the . + + The singleton instance of the . + + + Gets the singleton instance of the . + + + + + + Gets the current object from the enumerator. + + + Throws an because the + never has a current value. + + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will throw an . + + + The collection is empty and + cannot be positioned over a valid location. + + + + Gets the current key from the enumerator. + + + Throws an exception because the + never has a current value. + + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will throw an . + + + The collection is empty and + cannot be positioned over a valid location. + + + + Gets the current value from the enumerator. + + The current value from the enumerator. + + Throws an because the + never has a current value. + + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will throw an . + + + The collection is empty and + cannot be positioned over a valid location. + + + + Gets the current entry from the enumerator. + + + Throws an because the + never has a current entry. + + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will throw an . + + + The collection is empty and + cannot be positioned over a valid location. + + + + An always empty . + + + + A singleton implementation of the over a collection + that is empty and not modifiable. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to enforce the singleton pattern. + + + + + + Test if the enumerator can advance, if so advance + + false as the cannot advance. + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will always return false. + + + + + + Resets the enumerator back to the start. + + + + As the enumerator is over an empty collection does nothing. + + + + + + The singleton instance of the . + + + + + Get the singleton instance of the . + + The singleton instance of the . + + + Gets the singleton instance of the . + + + + + + Gets the current object from the enumerator. + + + Throws an because the + never has a current value. + + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will throw an . + + + The collection is empty and + cannot be positioned over a valid location. + + + + A SecurityContext used when a SecurityContext is not required + + + + The is a no-op implementation of the + base class. It is used where a + is required but one has not been provided. + + + Nicko Cadell + + + + Singleton instance of + + + + Singleton instance of + + + + + + Private constructor + + + + Private constructor for singleton pattern. + + + + + + Impersonate this SecurityContext + + State supplied by the caller + null + + + No impersonation is done and null is always returned. + + + + + + Implements log4net's default error handling policy which consists + of emitting a message for the first error in an appender and + ignoring all subsequent errors. + + + + The error message is processed using the LogLog sub-system. + + + This policy aims at protecting an otherwise working application + from being flooded with error messages when logging fails. + + + Nicko Cadell + Gert Driesen + Ron Grabowski + + + + Default Constructor + + + + Initializes a new instance of the class. + + + + + + Constructor + + The prefix to use for each message. + + + Initializes a new instance of the class + with the specified prefix. + + + + + + Reset the error handler back to its initial disabled state. + + + + + Log an Error + + The error message. + The exception. + The internal error code. + + + Sends the error information to 's Error method. + + + + + + Log an Error + + The error message. + The exception. + + + Prints the message and the stack trace of the exception on the standard + error output stream. + + + + + + Log an error + + The error message. + + + Print a the error message passed as parameter on the standard + error output stream. + + + + + + The date the error was recorded. + + + + + Flag to indicate if it is the first error + + + + + The message recorded during the first error. + + + + + The exception recorded during the first error. + + + + + The error code recorded during the first error. + + + + + String to prefix each message with + + + + + The fully qualified type of the OnlyOnceErrorHandler class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Is error logging enabled + + + + Is error logging enabled. Logging is only enabled for the + first error delivered to the . + + + + + + The date the first error that trigged this error handler occured. + + + + + The message from the first error that trigged this error handler. + + + + + The exception from the first error that trigged this error handler. + + + May be . + + + + + The error code from the first error that trigged this error handler. + + + Defaults to + + + + + A convenience class to convert property values to specific types. + + + + Utility functions for converting types and parsing values. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to prevent instantiation of this class. + + + + + + Converts a string to a value. + + String to convert. + The default value. + The value of . + + + If is "true", then true is returned. + If is "false", then false is returned. + Otherwise, is returned. + + + + + + Parses a file size into a number. + + String to parse. + The default value. + The value of . + + + Parses a file size of the form: number[KB|MB|GB] into a + long value. It is scaled with the appropriate multiplier. + + + is returned when + cannot be converted to a value. + + + + + + Converts a string to an object. + + The target type to convert to. + The string to convert to an object. + + The object converted from a string or null when the + conversion failed. + + + + Converts a string to an object. Uses the converter registry to try + to convert the string value into the specified target type. + + + + + + Checks if there is an appropriate type conversion from the source type to the target type. + + The type to convert from. + The type to convert to. + true if there is a conversion from the source type to the target type. + + Checks if there is an appropriate type conversion from the source type to the target type. + + + + + + + Converts an object to the target type. + + The object to convert to the target type. + The type to convert to. + The converted object. + + + Converts an object to the target type. + + + + + + Instantiates an object given a class name. + + The fully qualified class name of the object to instantiate. + The class to which the new object should belong. + The object to return in case of non-fulfillment. + + An instance of the or + if the object could not be instantiated. + + + + Checks that the is a subclass of + . If that test fails or the object could + not be instantiated, then is returned. + + + + + + Performs variable substitution in string from the + values of keys found in . + + The string on which variable substitution is performed. + The dictionary to use to lookup variables. + The result of the substitutions. + + + The variable substitution delimiters are ${ and }. + + + For example, if props contains key=value, then the call + + + + string s = OptionConverter.SubstituteVariables("Value of key is ${key}."); + + + + will set the variable s to "Value of key is value.". + + + If no value could be found for the specified key, then substitution + defaults to an empty string. + + + For example, if system properties contains no value for the key + "nonExistentKey", then the call + + + + string s = OptionConverter.SubstituteVariables("Value of nonExistentKey is [${nonExistentKey}]"); + + + + will set s to "Value of nonExistentKey is []". + + + An Exception is thrown if contains a start + delimiter "${" which is not balanced by a stop delimiter "}". + + + + + + Converts the string representation of the name or numeric value of one or + more enumerated constants to an equivalent enumerated object. + + The type to convert to. + The enum string value. + If true, ignore case; otherwise, regard case. + An object of type whose value is represented by . + + + + The fully qualified type of the OptionConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Most of the work of the class + is delegated to the PatternParser class. + + + + The PatternParser processes a pattern string and + returns a chain of objects. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + The pattern to parse. + + + Initializes a new instance of the class + with the specified pattern string. + + + + + + Parses the pattern into a chain of pattern converters. + + The head of a chain of pattern converters. + + + Parses the pattern into a chain of pattern converters. + + + + + + Build the unified cache of converters from the static and instance maps + + the list of all the converter names + + + Build the unified cache of converters from the static and instance maps + + + + + + Internal method to parse the specified pattern to find specified matches + + the pattern to parse + the converter names to match in the pattern + + + The matches param must be sorted such that longer strings come before shorter ones. + + + + + + Process a parsed literal + + the literal text + + + + Process a parsed converter pattern + + the name of the converter + the optional option for the converter + the formatting info for the converter + + + + Resets the internal state of the parser and adds the specified pattern converter + to the chain. + + The pattern converter to add. + + + + The first pattern converter in the chain + + + + + the last pattern converter in the chain + + + + + The pattern + + + + + Internal map of converter identifiers to converter types + + + + This map overrides the static s_globalRulesRegistry map. + + + + + + The fully qualified type of the PatternParser class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Get the converter registry used by this parser + + + The converter registry used by this parser + + + + Get the converter registry used by this parser + + + + + + Sort strings by length + + + + that orders strings by string length. + The longest strings are placed first + + + + + + This class implements a patterned string. + + + + This string has embedded patterns that are resolved and expanded + when the string is formatted. + + + This class functions similarly to the + in that it accepts a pattern and renders it to a string. Unlike the + however the PatternString + does not render the properties of a specific but + of the process in general. + + + The recognized conversion pattern names are: + + + + Conversion Pattern Name + Effect + + + appdomain + + + Used to output the friendly name of the current AppDomain. + + + + + date + + + Used to output the current date and time in the local time zone. + To output the date in universal time use the %utcdate pattern. + The date conversion + specifier may be followed by a date format specifier enclosed + between braces. For example, %date{HH:mm:ss,fff} or + %date{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is + given then ISO8601 format is + assumed (). + + + The date format specifier admits the same syntax as the + time pattern string of the . + + + For better results it is recommended to use the log4net date + formatters. These can be specified using one of the strings + "ABSOLUTE", "DATE" and "ISO8601" for specifying + , + and respectively + . For example, + %date{ISO8601} or %date{ABSOLUTE}. + + + These dedicated date formatters perform significantly + better than . + + + + + env + + + Used to output the a specific environment variable. The key to + lookup must be specified within braces and directly following the + pattern specifier, e.g. %env{COMPUTERNAME} would include the value + of the COMPUTERNAME environment variable. + + + The env pattern is not supported on the .NET Compact Framework. + + + + + identity + + + Used to output the user name for the currently active user + (Principal.Identity.Name). + + + + + newline + + + Outputs the platform dependent line separator character or + characters. + + + This conversion pattern name offers the same performance as using + non-portable line separator strings such as "\n", or "\r\n". + Thus, it is the preferred way of specifying a line separator. + + + + + processid + + + Used to output the system process ID for the current process. + + + + + property + + + Used to output a specific context property. The key to + lookup must be specified within braces and directly following the + pattern specifier, e.g. %property{user} would include the value + from the property that is keyed by the string 'user'. Each property value + that is to be included in the log must be specified separately. + Properties are stored in logging contexts. By default + the log4net:HostName property is set to the name of machine on + which the event was originally logged. + + + If no key is specified, e.g. %property then all the keys and their + values are printed in a comma separated list. + + + The properties of an event are combined from a number of different + contexts. These are listed below in the order in which they are searched. + + + + the thread properties + + The that are set on the current + thread. These properties are shared by all events logged on this thread. + + + + the global properties + + The that are set globally. These + properties are shared by all the threads in the AppDomain. + + + + + + + random + + + Used to output a random string of characters. The string is made up of + uppercase letters and numbers. By default the string is 4 characters long. + The length of the string can be specified within braces directly following the + pattern specifier, e.g. %random{8} would output an 8 character string. + + + + + username + + + Used to output the WindowsIdentity for the currently + active user. + + + + + utcdate + + + Used to output the date of the logging event in universal time. + The date conversion + specifier may be followed by a date format specifier enclosed + between braces. For example, %utcdate{HH:mm:ss,fff} or + %utcdate{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is + given then ISO8601 format is + assumed (). + + + The date format specifier admits the same syntax as the + time pattern string of the . + + + For better results it is recommended to use the log4net date + formatters. These can be specified using one of the strings + "ABSOLUTE", "DATE" and "ISO8601" for specifying + , + and respectively + . For example, + %utcdate{ISO8601} or %utcdate{ABSOLUTE}. + + + These dedicated date formatters perform significantly + better than . + + + + + % + + + The sequence %% outputs a single percent sign. + + + + + + Additional pattern converters may be registered with a specific + instance using or + . + + + See the for details on the + format modifiers supported by the patterns. + + + Nicko Cadell + + + + Internal map of converter identifiers to converter types. + + + + + the pattern + + + + + the head of the pattern converter chain + + + + + patterns defined on this PatternString only + + + + + Initialize the global registry + + + + + Default constructor + + + + Initialize a new instance of + + + + + + Constructs a PatternString + + The pattern to use with this PatternString + + + Initialize a new instance of with the pattern specified. + + + + + + Initialize object options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Create the used to parse the pattern + + the pattern to parse + The + + + Returns PatternParser used to parse the conversion string. Subclasses + may override this to return a subclass of PatternParser which recognize + custom conversion pattern name. + + + + + + Produces a formatted string as specified by the conversion pattern. + + The TextWriter to write the formatted event to + + + Format the pattern to the . + + + + + + Format the pattern as a string + + the pattern formatted as a string + + + Format the pattern to a string. + + + + + + Add a converter to this PatternString + + the converter info + + + This version of the method is used by the configurator. + Programmatic users should use the alternative method. + + + + + + Add a converter to this PatternString + + the name of the conversion pattern for this converter + the type of the converter + + + Add a converter to this PatternString + + + + + + Gets or sets the pattern formatting string + + + The pattern formatting string + + + + The ConversionPattern option. This is the string which + controls formatting and consists of a mix of literal content and + conversion specifiers. + + + + + + String keyed object map. + + + + While this collection is serializable only member + objects that are serializable will + be serialized along with this collection. + + + Nicko Cadell + Gert Driesen + + + + String keyed object map that is read only. + + + + This collection is readonly and cannot be modified. + + + While this collection is serializable only member + objects that are serializable will + be serialized along with this collection. + + + Nicko Cadell + Gert Driesen + + + + The Hashtable used to store the properties data + + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Copy Constructor + + properties to copy + + + Initializes a new instance of the class. + + + + + + Deserialization constructor + + The that holds the serialized object data. + The that contains contextual information about the source or destination. + + + Initializes a new instance of the class + with serialized data. + + + + + + Gets the key names. + + An array of all the keys. + + + Gets the key names. + + + + + + Test if the dictionary contains a specified key + + the key to look for + true if the dictionary contains the specified key + + + Test if the dictionary contains a specified key + + + + + + Serializes this object into the provided. + + The to populate with data. + The destination for this serialization. + + + Serializes this object into the provided. + + + + + + See + + + + + See + + + + + + See + + + + + + + Remove all properties from the properties collection + + + + + See + + + + + + + See + + + + + + + See + + + + + Gets or sets the value of the property with the specified key. + + + The value of the property with the specified key. + + The key of the property to get or set. + + + The property value will only be serialized if it is serializable. + If it cannot be serialized it will be silently ignored if + a serialization operation is performed. + + + + + + The hashtable used to store the properties + + + The internal collection used to store the properties + + + + The hashtable used to store the properties + + + + + + See + + + + + See + + + + + See + + + + + See + + + + + See + + + + + See + + + + + The number of properties in this collection + + + + + See + + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Constructor + + properties to copy + + + Initializes a new instance of the class. + + + + + + Initializes a new instance of the class + with serialized data. + + The that holds the serialized object data. + The that contains contextual information about the source or destination. + + + Because this class is sealed the serialization constructor is private. + + + + + + Remove the entry with the specified key from this dictionary + + the key for the entry to remove + + + Remove the entry with the specified key from this dictionary + + + + + + See + + an enumerator + + + Returns a over the contest of this collection. + + + + + + See + + the key to remove + + + Remove the entry with the specified key from this dictionary + + + + + + See + + the key to lookup in the collection + true if the collection contains the specified key + + + Test if this collection contains a specified key. + + + + + + Remove all properties from the properties collection + + + + Remove all properties from the properties collection + + + + + + See + + the key + the value to store for the key + + + Store a value for the specified . + + + Thrown if the is not a string + + + + See + + + + + + + See + + + + + Gets or sets the value of the property with the specified key. + + + The value of the property with the specified key. + + The key of the property to get or set. + + + The property value will only be serialized if it is serializable. + If it cannot be serialized it will be silently ignored if + a serialization operation is performed. + + + + + + See + + + false + + + + This collection is modifiable. This property always + returns false. + + + + + + See + + + The value for the key specified. + + + + Get or set a value for the specified . + + + Thrown if the is not a string + + + + See + + + + + See + + + + + See + + + + + See + + + + + See + + + + + A class to hold the key and data for a property set in the config file + + + + A class to hold the key and data for a property set in the config file + + + + + + Override Object.ToString to return sensible debug info + + string info about this object + + + + Property Key + + + Property Key + + + + Property Key. + + + + + + Property Value + + + Property Value + + + + Property Value. + + + + + + A that ignores the message + + + + This writer is used in special cases where it is necessary + to protect a writer from being closed by a client. + + + Nicko Cadell + + + + Constructor + + the writer to actually write to + + + Create a new ProtectCloseTextWriter using a writer + + + + + + Attach this instance to a different underlying + + the writer to attach to + + + Attach this instance to a different underlying + + + + + + Does not close the underlying output writer. + + + + Does not close the underlying output writer. + This method does nothing. + + + + + + Defines a lock that supports single writers and multiple readers + + + + ReaderWriterLock is used to synchronize access to a resource. + At any given time, it allows either concurrent read access for + multiple threads, or write access for a single thread. In a + situation where a resource is changed infrequently, a + ReaderWriterLock provides better throughput than a simple + one-at-a-time lock, such as . + + + If a platform does not support a System.Threading.ReaderWriterLock + implementation then all readers and writers are serialized. Therefore + the caller must not rely on multiple simultaneous readers. + + + Nicko Cadell + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Acquires a reader lock + + + + blocks if a different thread has the writer + lock, or if at least one thread is waiting for the writer lock. + + + + + + Decrements the lock count + + + + decrements the lock count. When the count + reaches zero, the lock is released. + + + + + + Acquires the writer lock + + + + This method blocks if another thread has a reader lock or writer lock. + + + + + + Decrements the lock count on the writer lock + + + + ReleaseWriterLock decrements the writer lock count. + When the count reaches zero, the writer lock is released. + + + + + + A that can be and reused + + + + A that can be and reused. + This uses a single buffer for string operations. + + + Nicko Cadell + + + + Create an instance of + + the format provider to use + + + Create an instance of + + + + + + Override Dispose to prevent closing of writer + + flag + + + Override Dispose to prevent closing of writer + + + + + + Reset this string writer so that it can be reused. + + the maximum buffer capacity before it is trimmed + the default size to make the buffer + + + Reset this string writer so that it can be reused. + The internal buffers are cleared and reset. + + + + + + Utility class for system specific information. + + + + Utility class of static methods for system specific information. + + + Nicko Cadell + Gert Driesen + Alexey Solofnenko + + + + Private constructor to prevent instances. + + + + Only static methods are exposed from this type. + + + + + + Initialize default values for private static fields. + + + + Only static methods are exposed from this type. + + + + + + Gets the assembly location path for the specified assembly. + + The assembly to get the location for. + The location of the assembly. + + + This method does not guarantee to return the correct path + to the assembly. If only tries to give an indication as to + where the assembly was loaded from. + + + + + + Gets the fully qualified name of the , including + the name of the assembly from which the was + loaded. + + The to get the fully qualified name for. + The fully qualified name for the . + + + This is equivalent to the Type.AssemblyQualifiedName property, + but this method works on the .NET Compact Framework 1.0 as well as + the full .NET runtime. + + + + + + Gets the short name of the . + + The to get the name for. + The short name of the . + + + The short name of the assembly is the + without the version, culture, or public key. i.e. it is just the + assembly's file name without the extension. + + + Use this rather than Assembly.GetName().Name because that + is not available on the Compact Framework. + + + Because of a FileIOPermission security demand we cannot do + the obvious Assembly.GetName().Name. We are allowed to get + the of the assembly so we + start from there and strip out just the assembly name. + + + + + + Gets the file name portion of the , including the extension. + + The to get the file name for. + The file name of the assembly. + + + Gets the file name portion of the , including the extension. + + + + + + Loads the type specified in the type string. + + A sibling type to use to load the type. + The name of the type to load. + Flag set to true to throw an exception if the type cannot be loaded. + true to ignore the case of the type name; otherwise, false + The type loaded or null if it could not be loaded. + + + If the type name is fully qualified, i.e. if contains an assembly name in + the type name, the type will be loaded from the system using + . + + + If the type name is not fully qualified, it will be loaded from the assembly + containing the specified relative type. If the type is not found in the assembly + then all the loaded assemblies will be searched for the type. + + + + + + Loads the type specified in the type string. + + The name of the type to load. + Flag set to true to throw an exception if the type cannot be loaded. + true to ignore the case of the type name; otherwise, false + The type loaded or null if it could not be loaded. + + + If the type name is fully qualified, i.e. if contains an assembly name in + the type name, the type will be loaded from the system using + . + + + If the type name is not fully qualified it will be loaded from the + assembly that is directly calling this method. If the type is not found + in the assembly then all the loaded assemblies will be searched for the type. + + + + + + Loads the type specified in the type string. + + An assembly to load the type from. + The name of the type to load. + Flag set to true to throw an exception if the type cannot be loaded. + true to ignore the case of the type name; otherwise, false + The type loaded or null if it could not be loaded. + + + If the type name is fully qualified, i.e. if contains an assembly name in + the type name, the type will be loaded from the system using + . + + + If the type name is not fully qualified it will be loaded from the specified + assembly. If the type is not found in the assembly then all the loaded assemblies + will be searched for the type. + + + + + + Generate a new guid + + A new Guid + + + Generate a new guid + + + + + + Create an + + The name of the parameter that caused the exception + The value of the argument that causes this exception + The message that describes the error + the ArgumentOutOfRangeException object + + + Create a new instance of the class + with a specified error message, the parameter name, and the value + of the argument. + + + The Compact Framework does not support the 3 parameter constructor for the + type. This method provides an + implementation that works for all platforms. + + + + + + Parse a string into an value + + the string to parse + out param where the parsed value is placed + true if the string was able to be parsed into an integer + + + Attempts to parse the string into an integer. If the string cannot + be parsed then this method returns false. The method does not throw an exception. + + + + + + Parse a string into an value + + the string to parse + out param where the parsed value is placed + true if the string was able to be parsed into an integer + + + Attempts to parse the string into an integer. If the string cannot + be parsed then this method returns false. The method does not throw an exception. + + + + + + Parse a string into an value + + the string to parse + out param where the parsed value is placed + true if the string was able to be parsed into an integer + + + Attempts to parse the string into an integer. If the string cannot + be parsed then this method returns false. The method does not throw an exception. + + + + + + Lookup an application setting + + the application settings key to lookup + the value for the key, or null + + + Configuration APIs are not supported under the Compact Framework + + + + + + Convert a path into a fully qualified local file path. + + The path to convert. + The fully qualified path. + + + Converts the path specified to a fully + qualified path. If the path is relative it is + taken as relative from the application base + directory. + + + The path specified must be a local file path, a URI is not supported. + + + + + + Creates a new case-insensitive instance of the class with the default initial capacity. + + A new case-insensitive instance of the class with the default initial capacity + + + The new Hashtable instance uses the default load factor, the CaseInsensitiveHashCodeProvider, and the CaseInsensitiveComparer. + + + + + + Gets an empty array of types. + + + + The Type.EmptyTypes field is not available on + the .NET Compact Framework 1.0. + + + + + + The fully qualified type of the SystemInfo class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Cache the host name for the current machine + + + + + Cache the application friendly name + + + + + Text to output when a null is encountered. + + + + + Text to output when an unsupported feature is requested. + + + + + Start time for the current process. + + + + + Gets the system dependent line terminator. + + + The system dependent line terminator. + + + + Gets the system dependent line terminator. + + + + + + Gets the base directory for this . + + The base directory path for the current . + + + Gets the base directory for this . + + + The value returned may be either a local file path or a URI. + + + + + + Gets the path to the configuration file for the current . + + The path to the configuration file for the current . + + + The .NET Compact Framework 1.0 does not have a concept of a configuration + file. For this runtime, we use the entry assembly location as the root for + the configuration file name. + + + The value returned may be either a local file path or a URI. + + + + + + Gets the path to the file that first executed in the current . + + The path to the entry assembly. + + + Gets the path to the file that first executed in the current . + + + + + + Gets the ID of the current thread. + + The ID of the current thread. + + + On the .NET framework, the AppDomain.GetCurrentThreadId method + is used to obtain the thread ID for the current thread. This is the + operating system ID for the thread. + + + On the .NET Compact Framework 1.0 it is not possible to get the + operating system thread ID for the current thread. The native method + GetCurrentThreadId is implemented inline in a header file + and cannot be called. + + + On the .NET Framework 2.0 the Thread.ManagedThreadId is used as this + gives a stable id unrelated to the operating system thread ID which may + change if the runtime is using fibers. + + + + + + Get the host name or machine name for the current machine + + + The hostname or machine name + + + + Get the host name or machine name for the current machine + + + The host name () or + the machine name (Environment.MachineName) for + the current machine, or if neither of these are available + then NOT AVAILABLE is returned. + + + + + + Get this application's friendly name + + + The friendly name of this application as a string + + + + If available the name of the application is retrieved from + the AppDomain using AppDomain.CurrentDomain.FriendlyName. + + + Otherwise the file name of the entry assembly is used. + + + + + + Get the start time for the current process. + + + + This is the time at which the log4net library was loaded into the + AppDomain. Due to reports of a hang in the call to System.Diagnostics.Process.StartTime + this is not the start time for the current process. + + + The log4net library should be loaded by an application early during its + startup, therefore this start time should be a good approximation for + the actual start time. + + + Note that AppDomains may be loaded and unloaded within the + same process without the process terminating, however this start time + will be set per AppDomain. + + + + + + Text to output when a null is encountered. + + + + Use this value to indicate a null has been encountered while + outputting a string representation of an item. + + + The default value is (null). This value can be overridden by specifying + a value for the log4net.NullText appSetting in the application's + .config file. + + + + + + Text to output when an unsupported feature is requested. + + + + Use this value when an unsupported feature is requested. + + + The default value is NOT AVAILABLE. This value can be overridden by specifying + a value for the log4net.NotAvailableText appSetting in the application's + .config file. + + + + + + Utility class that represents a format string. + + + + Utility class that represents a format string. + + + Nicko Cadell + + + + Initialise the + + An that supplies culture-specific formatting information. + A containing zero or more format items. + An array containing zero or more objects to format. + + + + Format the string and arguments + + the formatted string + + + + Replaces the format item in a specified with the text equivalent + of the value of a corresponding instance in a specified array. + A specified parameter supplies culture-specific formatting information. + + An that supplies culture-specific formatting information. + A containing zero or more format items. + An array containing zero or more objects to format. + + A copy of format in which the format items have been replaced by the + equivalent of the corresponding instances of in args. + + + + This method does not throw exceptions. If an exception thrown while formatting the result the + exception and arguments are returned in the result string. + + + + + + Process an error during StringFormat + + + + + Dump the contents of an array into a string builder + + + + + Dump an object to a string + + + + + The fully qualified type of the SystemStringFormat class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Implementation of Properties collection for the + + + + Class implements a collection of properties that is specific to each thread. + The class is not synchronized as each thread has its own . + + + Nicko Cadell + + + + The thread local data slot to use to store a PropertiesDictionary. + + + + + Internal constructor + + + + Initializes a new instance of the class. + + + + + + Remove a property + + the key for the entry to remove + + + Remove a property + + + + + + Clear all properties + + + + Clear all properties + + + + + + Get the PropertiesDictionary for this thread. + + create the dictionary if it does not exist, otherwise return null if is does not exist + the properties for this thread + + + The collection returned is only to be used on the calling thread. If the + caller needs to share the collection between different threads then the + caller must clone the collection before doing so. + + + + + + Gets or sets the value of a property + + + The value for the property with the specified key + + + + Gets or sets the value of a property + + + + + + Implementation of Stack for the + + + + Implementation of Stack for the + + + Nicko Cadell + + + + The stack store. + + + + + Internal constructor + + + + Initializes a new instance of the class. + + + + + + Clears all the contextual information held in this stack. + + + + Clears all the contextual information held in this stack. + Only call this if you think that this tread is being reused after + a previous call execution which may not have completed correctly. + You do not need to use this method if you always guarantee to call + the method of the + returned from even in exceptional circumstances, + for example by using the using(log4net.ThreadContext.Stacks["NDC"].Push("Stack_Message")) + syntax. + + + + + + Removes the top context from this stack. + + The message in the context that was removed from the top of this stack. + + + Remove the top context from this stack, and return + it to the caller. If this stack is empty then an + empty string (not ) is returned. + + + + + + Pushes a new context message into this stack. + + The new context message. + + An that can be used to clean up the context stack. + + + + Pushes a new context onto this stack. An + is returned that can be used to clean up this stack. This + can be easily combined with the using keyword to scope the + context. + + + Simple example of using the Push method with the using keyword. + + using(log4net.ThreadContext.Stacks["NDC"].Push("Stack_Message")) + { + log.Warn("This should have an ThreadContext Stack message"); + } + + + + + + Gets the current context information for this stack. + + The current context information. + + + + Gets the current context information for this stack. + + Gets the current context information + + + Gets the current context information for this stack. + + + + + + Get a portable version of this object + + the portable instance of this object + + + Get a cross thread portable version of this object + + + + + + The number of messages in the stack + + + The current number of messages in the stack + + + + The current number of messages in the stack. That is + the number of times has been called + minus the number of times has been called. + + + + + + Gets and sets the internal stack used by this + + The internal storage stack + + + This property is provided only to support backward compatability + of the . Tytpically the internal stack should not + be modified. + + + + + + Inner class used to represent a single context frame in the stack. + + + + Inner class used to represent a single context frame in the stack. + + + + + + Constructor + + The message for this context. + The parent context in the chain. + + + Initializes a new instance of the class + with the specified message and parent context. + + + + + + Get the message. + + The message. + + + Get the message. + + + + + + Gets the full text of the context down to the root level. + + + The full text of the context down to the root level. + + + + Gets the full text of the context down to the root level. + + + + + + Struct returned from the method. + + + + This struct implements the and is designed to be used + with the pattern to remove the stack frame at the end of the scope. + + + + + + The ThreadContextStack internal stack + + + + + The depth to trim the stack to when this instance is disposed + + + + + Constructor + + The internal stack used by the ThreadContextStack. + The depth to return the stack to when this object is disposed. + + + Initializes a new instance of the class with + the specified stack and return depth. + + + + + + Returns the stack to the correct depth. + + + + Returns the stack to the correct depth. + + + + + + Implementation of Stacks collection for the + + + + Implementation of Stacks collection for the + + + Nicko Cadell + + + + Internal constructor + + + + Initializes a new instance of the class. + + + + + + The fully qualified type of the ThreadContextStacks class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets the named thread context stack + + + The named stack + + + + Gets the named thread context stack + + + + + + Utility class for transforming strings. + + + + Utility class for transforming strings. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to prevent instantiation of this class. + + + + + + Write a string to an + + the writer to write to + the string to write + The string to replace non XML compliant chars with + + + The test is escaped either using XML escape entities + or using CDATA sections. + + + + + + Replace invalid XML characters in text string + + the XML text input string + the string to use in place of invalid characters + A string that does not contain invalid XML characters. + + + Certain Unicode code points are not allowed in the XML InfoSet, for + details see: http://www.w3.org/TR/REC-xml/#charsets. + + + This method replaces any illegal characters in the input string + with the mask string specified. + + + + + + Count the number of times that the substring occurs in the text + + the text to search + the substring to find + the number of times the substring occurs in the text + + + The substring is assumed to be non repeating within itself. + + + + + + Characters illegal in XML 1.0 + + + + + Impersonate a Windows Account + + + + This impersonates a Windows account. + + + How the impersonation is done depends on the value of . + This allows the context to either impersonate a set of user credentials specified + using username, domain name and password or to revert to the process credentials. + + + + + + Default constructor + + + + Default constructor + + + + + + Initialize the SecurityContext based on the options set. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + The security context will try to Logon the specified user account and + capture a primary token for impersonation. + + + The required , + or properties were not specified. + + + + Impersonate the Windows account specified by the and properties. + + caller provided state + + An instance that will revoke the impersonation of this SecurityContext + + + + Depending on the property either + impersonate a user using credentials supplied or revert + to the process credentials. + + + + + + Create a given the userName, domainName and password. + + the user name + the domain name + the password + the for the account specified + + + Uses the Windows API call LogonUser to get a principal token for the account. This + token is used to initialize the WindowsIdentity. + + + + + + Gets or sets the impersonation mode for this security context + + + The impersonation mode for this security context + + + + Impersonate either a user with user credentials or + revert this thread to the credentials of the process. + The value is one of the + enum. + + + The default value is + + + When the mode is set to + the user's credentials are established using the + , and + values. + + + When the mode is set to + no other properties need to be set. If the calling thread is + impersonating then it will be reverted back to the process credentials. + + + + + + Gets or sets the Windows username for this security context + + + The Windows username for this security context + + + + This property must be set if + is set to (the default setting). + + + + + + Gets or sets the Windows domain name for this security context + + + The Windows domain name for this security context + + + + The default value for is the local machine name + taken from the property. + + + This property must be set if + is set to (the default setting). + + + + + + Sets the password for the Windows account specified by the and properties. + + + The password for the Windows account specified by the and properties. + + + + This property must be set if + is set to (the default setting). + + + + + + The impersonation modes for the + + + + See the property for + details. + + + + + + Impersonate a user using the credentials supplied + + + + + Revert this the thread to the credentials of the process + + + + + Adds to + + + + Helper class to expose the + through the interface. + + + + + + Constructor + + the impersonation context being wrapped + + + Constructor + + + + + + Revert the impersonation + + + + Revert the impersonation + + + + + + The log4net Global Context. + + + + The GlobalContext provides a location for global debugging + information to be stored. + + + The global context has a properties map and these properties can + be included in the output of log messages. The + supports selecting and outputing these properties. + + + By default the log4net:HostName property is set to the name of + the current machine. + + + + + GlobalContext.Properties["hostname"] = Environment.MachineName; + + + + Nicko Cadell + + + + Private Constructor. + + + Uses a private access modifier to prevent instantiation of this class. + + + + + The global context properties instance + + + + + The global properties map. + + + The global properties map. + + + + The global properties map. + + + + + + Provides information about the environment the assembly has + been built for. + + + + Version of the assembly + + + Version of the framework targeted + + + Type of framework targeted + + + Does it target a client profile? + + + + Identifies the version and target for this assembly. + + + + + The log4net Logical Thread Context. + + + + The LogicalThreadContext provides a location for specific debugging + information to be stored. + The LogicalThreadContext properties override any or + properties with the same name. + + + The Logical Thread Context has a properties map and a stack. + The properties and stack can + be included in the output of log messages. The + supports selecting and outputting these properties. + + + The Logical Thread Context provides a diagnostic context for the current call context. + This is an instrument for distinguishing interleaved log + output from different sources. Log output is typically interleaved + when a server handles multiple clients near-simultaneously. + + + The Logical Thread Context is managed on a per basis. + + + The requires a link time + for the + . + If the calling code does not have this permission then this context will be disabled. + It will not store any property values set on it. + + + Example of using the thread context properties to store a username. + + LogicalThreadContext.Properties["user"] = userName; + log.Info("This log message has a LogicalThreadContext Property called 'user'"); + + + Example of how to push a message into the context stack + + using(LogicalThreadContext.Stacks["LDC"].Push("my context message")) + { + log.Info("This log message has a LogicalThreadContext Stack message that includes 'my context message'"); + + } // at the end of the using block the message is automatically popped + + + + Nicko Cadell + + + + Private Constructor. + + + + Uses a private access modifier to prevent instantiation of this class. + + + + + + The thread context properties instance + + + + + The thread context stacks instance + + + + + The thread properties map + + + The thread properties map + + + + The LogicalThreadContext properties override any + or properties with the same name. + + + + + + The thread stacks + + + stack map + + + + The logical thread stacks. + + + + + + This class is used by client applications to request logger instances. + + + + This class has static methods that are used by a client to request + a logger instance. The method is + used to retrieve a logger. + + + See the interface for more details. + + + Simple example of logging messages + + ILog log = LogManager.GetLogger("application-log"); + + log.Info("Application Start"); + log.Debug("This is a debug message"); + + if (log.IsDebugEnabled) + { + log.Debug("This is another debug message"); + } + + + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + Uses a private access modifier to prevent instantiation of this class. + + + + Returns the named logger if it exists. + + Returns the named logger if it exists. + + + + If the named logger exists (in the default repository) then it + returns a reference to the logger, otherwise it returns null. + + + The fully qualified logger name to look for. + The logger found, or null if no logger could be found. + + + + Returns the named logger if it exists. + + + + If the named logger exists (in the specified repository) then it + returns a reference to the logger, otherwise it returns + null. + + + The repository to lookup in. + The fully qualified logger name to look for. + + The logger found, or null if the logger doesn't exist in the specified + repository. + + + + + Returns the named logger if it exists. + + + + If the named logger exists (in the repository for the specified assembly) then it + returns a reference to the logger, otherwise it returns + null. + + + The assembly to use to lookup the repository. + The fully qualified logger name to look for. + + The logger, or null if the logger doesn't exist in the specified + assembly's repository. + + + + Get the currently defined loggers. + + Returns all the currently defined loggers in the default repository. + + + The root logger is not included in the returned array. + + All the defined loggers. + + + + Returns all the currently defined loggers in the specified repository. + + The repository to lookup in. + + The root logger is not included in the returned array. + + All the defined loggers. + + + + Returns all the currently defined loggers in the specified assembly's repository. + + The assembly to use to lookup the repository. + + The root logger is not included in the returned array. + + All the defined loggers. + + + Get or create a logger. + + Retrieves or creates a named logger. + + + + Retrieves a logger named as the + parameter. If the named logger already exists, then the + existing instance will be returned. Otherwise, a new instance is + created. + + By default, loggers do not have a set level but inherit + it from the hierarchy. This is one of the central features of + log4net. + + + The name of the logger to retrieve. + The logger with the name specified. + + + + Retrieves or creates a named logger. + + + + Retrieve a logger named as the + parameter. If the named logger already exists, then the + existing instance will be returned. Otherwise, a new instance is + created. + + + By default, loggers do not have a set level but inherit + it from the hierarchy. This is one of the central features of + log4net. + + + The repository to lookup in. + The name of the logger to retrieve. + The logger with the name specified. + + + + Retrieves or creates a named logger. + + + + Retrieve a logger named as the + parameter. If the named logger already exists, then the + existing instance will be returned. Otherwise, a new instance is + created. + + + By default, loggers do not have a set level but inherit + it from the hierarchy. This is one of the central features of + log4net. + + + The assembly to use to lookup the repository. + The name of the logger to retrieve. + The logger with the name specified. + + + + Shorthand for . + + + Get the logger for the fully qualified name of the type specified. + + The full name of will be used as the name of the logger to retrieve. + The logger with the name specified. + + + + Shorthand for . + + + Gets the logger for the fully qualified name of the type specified. + + The repository to lookup in. + The full name of will be used as the name of the logger to retrieve. + The logger with the name specified. + + + + Shorthand for . + + + Gets the logger for the fully qualified name of the type specified. + + The assembly to use to lookup the repository. + The full name of will be used as the name of the logger to retrieve. + The logger with the name specified. + + + + Shuts down the log4net system. + + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in all the + default repositories. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + Shutdown a logger repository. + + Shuts down the default repository. + + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in the + default repository. + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + + Shuts down the repository for the repository specified. + + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in the + specified. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + The repository to shutdown. + + + + Shuts down the repository specified. + + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in the + repository. The repository is looked up using + the specified. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + The assembly to use to lookup the repository. + + + Reset the configuration of a repository + + Resets all values contained in this repository instance to their defaults. + + + + Resets all values contained in the repository instance to their + defaults. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set to its default "off" value. + + + + + + Resets all values contained in this repository instance to their defaults. + + + + Reset all values contained in the repository instance to their + defaults. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set to its default "off" value. + + + The repository to reset. + + + + Resets all values contained in this repository instance to their defaults. + + + + Reset all values contained in the repository instance to their + defaults. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set to its default "off" value. + + + The assembly to use to lookup the repository to reset. + + + Get the logger repository. + + Returns the default instance. + + + + Gets the for the repository specified + by the callers assembly (). + + + The instance for the default repository. + + + + Returns the default instance. + + The default instance. + + + Gets the for the repository specified + by the argument. + + + The repository to lookup in. + + + + Returns the default instance. + + The default instance. + + + Gets the for the repository specified + by the argument. + + + The assembly to use to lookup the repository. + + + Get a logger repository. + + Returns the default instance. + + + + Gets the for the repository specified + by the callers assembly (). + + + The instance for the default repository. + + + + Returns the default instance. + + The default instance. + + + Gets the for the repository specified + by the argument. + + + The repository to lookup in. + + + + Returns the default instance. + + The default instance. + + + Gets the for the repository specified + by the argument. + + + The assembly to use to lookup the repository. + + + Create a domain + + Creates a repository with the specified repository type. + + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + The created will be associated with the repository + specified such that a call to will return + the same repository instance. + + + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + Create a logger repository. + + Creates a repository with the specified repository type. + + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + The created will be associated with the repository + specified such that a call to will return + the same repository instance. + + + + + + Creates a repository with the specified name. + + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + Creates the default type of which is a + object. + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The name of the repository, this must be unique amongst repositories. + The created for the repository. + The specified repository already exists. + + + + Creates a repository with the specified name. + + + + Creates the default type of which is a + object. + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The name of the repository, this must be unique amongst repositories. + The created for the repository. + The specified repository already exists. + + + + Creates a repository with the specified name and repository type. + + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The name of the repository, this must be unique to the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + The specified repository already exists. + + + + Creates a repository with the specified name and repository type. + + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The name of the repository, this must be unique to the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + The specified repository already exists. + + + + Creates a repository for the specified assembly and repository type. + + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + The assembly to use to get the name of the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + + Creates a repository for the specified assembly and repository type. + + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + The assembly to use to get the name of the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + + Gets the list of currently defined repositories. + + + + Get an array of all the objects that have been created. + + + An array of all the known objects. + + + + Looks up the wrapper object for the logger specified. + + The logger to get the wrapper for. + The wrapper for the logger specified. + + + + Looks up the wrapper objects for the loggers specified. + + The loggers to get the wrappers for. + The wrapper objects for the loggers specified. + + + + Create the objects used by + this manager. + + The logger to wrap. + The wrapper for the logger specified. + + + + The wrapper map to use to hold the objects. + + + + + Implementation of Mapped Diagnostic Contexts. + + + + + The MDC is deprecated and has been replaced by the . + The current MDC implementation forwards to the ThreadContext.Properties. + + + + The MDC class is similar to the class except that it is + based on a map instead of a stack. It provides mapped + diagnostic contexts. A Mapped Diagnostic Context, or + MDC in short, is an instrument for distinguishing interleaved log + output from different sources. Log output is typically interleaved + when a server handles multiple clients near-simultaneously. + + + The MDC is managed on a per thread basis. + + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + Uses a private access modifier to prevent instantiation of this class. + + + + + Gets the context value identified by the parameter. + + The key to lookup in the MDC. + The string value held for the key, or a null reference if no corresponding value is found. + + + + The MDC is deprecated and has been replaced by the . + The current MDC implementation forwards to the ThreadContext.Properties. + + + + If the parameter does not look up to a + previously defined context then null will be returned. + + + + + + Add an entry to the MDC + + The key to store the value under. + The value to store. + + + + The MDC is deprecated and has been replaced by the . + The current MDC implementation forwards to the ThreadContext.Properties. + + + + Puts a context value (the parameter) as identified + with the parameter into the current thread's + context map. + + + If a value is already defined for the + specified then the value will be replaced. If the + is specified as null then the key value mapping will be removed. + + + + + + Removes the key value mapping for the key specified. + + The key to remove. + + + + The MDC is deprecated and has been replaced by the . + The current MDC implementation forwards to the ThreadContext.Properties. + + + + Remove the specified entry from this thread's MDC + + + + + + Clear all entries in the MDC + + + + + The MDC is deprecated and has been replaced by the . + The current MDC implementation forwards to the ThreadContext.Properties. + + + + Remove all the entries from this thread's MDC + + + + + + Implementation of Nested Diagnostic Contexts. + + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + A Nested Diagnostic Context, or NDC in short, is an instrument + to distinguish interleaved log output from different sources. Log + output is typically interleaved when a server handles multiple + clients near-simultaneously. + + + Interleaved log output can still be meaningful if each log entry + from different contexts had a distinctive stamp. This is where NDCs + come into play. + + + Note that NDCs are managed on a per thread basis. The NDC class + is made up of static methods that operate on the context of the + calling thread. + + + How to push a message into the context + + using(NDC.Push("my context message")) + { + ... all log calls will have 'my context message' included ... + + } // at the end of the using block the message is automatically removed + + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + Uses a private access modifier to prevent instantiation of this class. + + + + + Clears all the contextual information held on the current thread. + + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + Clears the stack of NDC data held on the current thread. + + + + + + Creates a clone of the stack of context information. + + A clone of the context info for this thread. + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + The results of this method can be passed to the + method to allow child threads to inherit the context of their + parent thread. + + + + + + Inherits the contextual information from another thread. + + The context stack to inherit. + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + This thread will use the context information from the stack + supplied. This can be used to initialize child threads with + the same contextual information as their parent threads. These + contexts will NOT be shared. Any further contexts that + are pushed onto the stack will not be visible to the other. + Call to obtain a stack to pass to + this method. + + + + + + Removes the top context from the stack. + + + The message in the context that was removed from the top + of the stack. + + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + Remove the top context from the stack, and return + it to the caller. If the stack is empty then an + empty string (not null) is returned. + + + + + + Pushes a new context message. + + The new context message. + + An that can be used to clean up + the context stack. + + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + Pushes a new context onto the context stack. An + is returned that can be used to clean up the context stack. This + can be easily combined with the using keyword to scope the + context. + + + Simple example of using the Push method with the using keyword. + + using(log4net.NDC.Push("NDC_Message")) + { + log.Warn("This should have an NDC message"); + } + + + + + + Removes the context information for this thread. It is + not required to call this method. + + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + This method is not implemented. + + + + + + Forces the stack depth to be at most . + + The maximum depth of the stack + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + Forces the stack depth to be at most . + This may truncate the head of the stack. This only affects the + stack in the current thread. Also it does not prevent it from + growing, it only sets the maximum depth at the time of the + call. This can be used to return to a known context depth. + + + + + + Gets the current context depth. + + The current context depth. + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + The number of context values pushed onto the context stack. + + + Used to record the current depth of the context. This can then + be restored using the method. + + + + + + + The log4net Thread Context. + + + + The ThreadContext provides a location for thread specific debugging + information to be stored. + The ThreadContext properties override any + properties with the same name. + + + The thread context has a properties map and a stack. + The properties and stack can + be included in the output of log messages. The + supports selecting and outputting these properties. + + + The Thread Context provides a diagnostic context for the current thread. + This is an instrument for distinguishing interleaved log + output from different sources. Log output is typically interleaved + when a server handles multiple clients near-simultaneously. + + + The Thread Context is managed on a per thread basis. + + + Example of using the thread context properties to store a username. + + ThreadContext.Properties["user"] = userName; + log.Info("This log message has a ThreadContext Property called 'user'"); + + + Example of how to push a message into the context stack + + using(ThreadContext.Stacks["NDC"].Push("my context message")) + { + log.Info("This log message has a ThreadContext Stack message that includes 'my context message'"); + + } // at the end of the using block the message is automatically popped + + + + Nicko Cadell + + + + Private Constructor. + + + + Uses a private access modifier to prevent instantiation of this class. + + + + + + The thread context properties instance + + + + + The thread context stacks instance + + + + + The thread properties map + + + The thread properties map + + + + The ThreadContext properties override any + properties with the same name. + + + + + + The thread stacks + + + stack map + + + + The thread local stacks. + + + + + diff --git a/udsService/log4net/3.5/log4net.dll b/udsService/log4net/3.5/log4net.dll new file mode 100644 index 000000000..06e778c66 Binary files /dev/null and b/udsService/log4net/3.5/log4net.dll differ diff --git a/udsService/log4net/3.5/log4net.xml b/udsService/log4net/3.5/log4net.xml new file mode 100644 index 000000000..de8317a32 --- /dev/null +++ b/udsService/log4net/3.5/log4net.xml @@ -0,0 +1,30205 @@ + + + + log4net + + + + + Appender that logs to a database. + + + + appends logging events to a table within a + database. The appender can be configured to specify the connection + string by setting the property. + The connection type (provider) can be specified by setting the + property. For more information on database connection strings for + your specific database see http://www.connectionstrings.com/. + + + Records are written into the database either using a prepared + statement or a stored procedure. The property + is set to (System.Data.CommandType.Text) to specify a prepared statement + or to (System.Data.CommandType.StoredProcedure) to specify a stored + procedure. + + + The prepared statement text or the name of the stored procedure + must be set in the property. + + + The prepared statement or stored procedure can take a number + of parameters. Parameters are added using the + method. This adds a single to the + ordered list of parameters. The + type may be subclassed if required to provide database specific + functionality. The specifies + the parameter name, database type, size, and how the value should + be generated using a . + + + + An example of a SQL Server table that could be logged to: + + CREATE TABLE [dbo].[Log] ( + [ID] [int] IDENTITY (1, 1) NOT NULL , + [Date] [datetime] NOT NULL , + [Thread] [varchar] (255) NOT NULL , + [Level] [varchar] (20) NOT NULL , + [Logger] [varchar] (255) NOT NULL , + [Message] [varchar] (4000) NOT NULL + ) ON [PRIMARY] + + + + An example configuration to log to the above table: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Julian Biddle + Nicko Cadell + Gert Driesen + Lance Nehring + + + + Abstract base class implementation of that + buffers events in a fixed size buffer. + + + + This base class should be used by appenders that need to buffer a + number of events before logging them. For example the + buffers events and then submits the entire contents of the buffer to + the underlying database in one go. + + + Subclasses should override the + method to deliver the buffered events. + + The BufferingAppenderSkeleton maintains a fixed size cyclic + buffer of events. The size of the buffer is set using + the property. + + A is used to inspect + each event as it arrives in the appender. If the + triggers, then the current buffer is sent immediately + (see ). Otherwise the event + is stored in the buffer. For example, an evaluator can be used to + deliver the events immediately when an ERROR event arrives. + + + The buffering appender can be configured in a mode. + By default the appender is NOT lossy. When the buffer is full all + the buffered events are sent with . + If the property is set to true then the + buffer will not be sent when it is full, and new events arriving + in the appender will overwrite the oldest event in the buffer. + In lossy mode the buffer will only be sent when the + triggers. This can be useful behavior when you need to know about + ERROR events but not about events with a lower level, configure an + evaluator that will trigger when an ERROR event arrives, the whole + buffer will be sent which gives a history of events leading up to + the ERROR event. + + + Nicko Cadell + Gert Driesen + + + + Abstract base class implementation of . + + + + This class provides the code for common functionality, such + as support for threshold filtering and support for general filters. + + + Appenders can also implement the interface. Therefore + they would require that the method + be called after the appenders properties have been configured. + + + Nicko Cadell + Gert Driesen + + + + Implement this interface for your own strategies for printing log statements. + + + + Implementors should consider extending the + class which provides a default implementation of this interface. + + + Appenders can also implement the interface. Therefore + they would require that the method + be called after the appenders properties have been configured. + + + Nicko Cadell + Gert Driesen + + + + Closes the appender and releases resources. + + + + Releases any resources allocated within the appender such as file handles, + network connections, etc. + + + It is a programming error to append to a closed appender. + + + + + + Log the logging event in Appender specific way. + + The event to log + + + This method is called to log a message into this appender. + + + + + + Gets or sets the name of this appender. + + The name of the appender. + + The name uniquely identifies the appender. + + + + + Interface for appenders that support bulk logging. + + + + This interface extends the interface to + support bulk logging of objects. Appenders + should only implement this interface if they can bulk log efficiently. + + + Nicko Cadell + + + + Log the array of logging events in Appender specific way. + + The events to log + + + This method is called to log an array of events into this appender. + + + + + + Interface used to delay activate a configured object. + + + + This allows an object to defer activation of its options until all + options have been set. This is required for components which have + related options that remain ambiguous until all are set. + + + If a component implements this interface then the method + must be called by the container after its all the configured properties have been set + and before the component can be used. + + + Nicko Cadell + + + + Activate the options that were previously set with calls to properties. + + + + This allows an object to defer activation of its options until all + options have been set. This is required for components which have + related options that remain ambiguous until all are set. + + + If a component implements this interface then this method must be called + after its properties have been set before the component can be used. + + + + + + Initial buffer size + + + + + Maximum buffer size before it is recycled + + + + + Default constructor + + + Empty default constructor + + + + + Finalizes this appender by calling the implementation's + method. + + + + If this appender has not been closed then the Finalize method + will call . + + + + + + Initialize the appender based on the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Closes the appender and release resources. + + + + Release any resources allocated within the appender such as file handles, + network connections, etc. + + + It is a programming error to append to a closed appender. + + + This method cannot be overridden by subclasses. This method + delegates the closing of the appender to the + method which must be overridden in the subclass. + + + + + + Performs threshold checks and invokes filters before + delegating actual logging to the subclasses specific + method. + + The event to log. + + + This method cannot be overridden by derived classes. A + derived class should override the method + which is called by this method. + + + The implementation of this method is as follows: + + + + + + Checks that the severity of the + is greater than or equal to the of this + appender. + + + + Checks that the chain accepts the + . + + + + + Calls and checks that + it returns true. + + + + + If all of the above steps succeed then the + will be passed to the abstract method. + + + + + + Performs threshold checks and invokes filters before + delegating actual logging to the subclasses specific + method. + + The array of events to log. + + + This method cannot be overridden by derived classes. A + derived class should override the method + which is called by this method. + + + The implementation of this method is as follows: + + + + + + Checks that the severity of the + is greater than or equal to the of this + appender. + + + + Checks that the chain accepts the + . + + + + + Calls and checks that + it returns true. + + + + + If all of the above steps succeed then the + will be passed to the method. + + + + + + Test if the logging event should we output by this appender + + the event to test + true if the event should be output, false if the event should be ignored + + + This method checks the logging event against the threshold level set + on this appender and also against the filters specified on this + appender. + + + The implementation of this method is as follows: + + + + + + Checks that the severity of the + is greater than or equal to the of this + appender. + + + + Checks that the chain accepts the + . + + + + + + + + + Adds a filter to the end of the filter chain. + + the filter to add to this appender + + + The Filters are organized in a linked list. + + + Setting this property causes the new filter to be pushed onto the + back of the filter chain. + + + + + + Clears the filter list for this appender. + + + + Clears the filter list for this appender. + + + + + + Checks if the message level is below this appender's threshold. + + to test against. + + + If there is no threshold set, then the return value is always true. + + + + true if the meets the + requirements of this appender. + + + + + Is called when the appender is closed. Derived classes should override + this method if resources need to be released. + + + + Releases any resources allocated within the appender such as file handles, + network connections, etc. + + + It is a programming error to append to a closed appender. + + + + + + Subclasses of should implement this method + to perform actual logging. + + The event to append. + + + A subclass must implement this method to perform + logging of the . + + This method will be called by + if all the conditions listed for that method are met. + + + To restrict the logging of events in the appender + override the method. + + + + + + Append a bulk array of logging events. + + the array of logging events + + + This base class implementation calls the + method for each element in the bulk array. + + + A sub class that can better process a bulk array of events should + override this method in addition to . + + + + + + Called before as a precondition. + + + + This method is called by + before the call to the abstract method. + + + This method can be overridden in a subclass to extend the checks + made before the event is passed to the method. + + + A subclass should ensure that they delegate this call to + this base class if it is overridden. + + + true if the call to should proceed. + + + + Renders the to a string. + + The event to render. + The event rendered as a string. + + + Helper method to render a to + a string. This appender must have a + set to render the to + a string. + + If there is exception data in the logging event and + the layout does not process the exception, this method + will append the exception text to the rendered string. + + + Where possible use the alternative version of this method + . + That method streams the rendering onto an existing Writer + which can give better performance if the caller already has + a open and ready for writing. + + + + + + Renders the to a string. + + The event to render. + The TextWriter to write the formatted event to + + + Helper method to render a to + a string. This appender must have a + set to render the to + a string. + + If there is exception data in the logging event and + the layout does not process the exception, this method + will append the exception text to the rendered string. + + + Use this method in preference to + where possible. If, however, the caller needs to render the event + to a string then does + provide an efficient mechanism for doing so. + + + + + + The layout of this appender. + + + See for more information. + + + + + The name of this appender. + + + See for more information. + + + + + The level threshold of this appender. + + + + There is no level threshold filtering by default. + + + See for more information. + + + + + + It is assumed and enforced that errorHandler is never null. + + + + It is assumed and enforced that errorHandler is never null. + + + See for more information. + + + + + + The first filter in the filter chain. + + + + Set to null initially. + + + See for more information. + + + + + + The last filter in the filter chain. + + + See for more information. + + + + + Flag indicating if this appender is closed. + + + See for more information. + + + + + The guard prevents an appender from repeatedly calling its own DoAppend method + + + + + StringWriter used to render events + + + + + The fully qualified type of the AppenderSkeleton class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the threshold of this appender. + + + The threshold of the appender. + + + + All log events with lower level than the threshold level are ignored + by the appender. + + + In configuration files this option is specified by setting the + value of the option to a level + string, such as "DEBUG", "INFO" and so on. + + + + + + Gets or sets the for this appender. + + The of the appender + + + The provides a default + implementation for the property. + + + + + + The filter chain. + + The head of the filter chain filter chain. + + + Returns the head Filter. The Filters are organized in a linked list + and so all Filters on this Appender are available through the result. + + + + + + Gets or sets the for this appender. + + The layout of the appender. + + + See for more information. + + + + + + + Gets or sets the name of this appender. + + The name of the appender. + + + The name uniquely identifies the appender. + + + + + + Tests if this appender requires a to be set. + + + + In the rather exceptional case, where the appender + implementation admits a layout but can also work without it, + then the appender should return true. + + + This default implementation always returns false. + + + + true if the appender requires a layout object, otherwise false. + + + + + The default buffer size. + + + The default size of the cyclic buffer used to store events. + This is set to 512 by default. + + + + + Initializes a new instance of the class. + + + + Protected default constructor to allow subclassing. + + + + + + Initializes a new instance of the class. + + the events passed through this appender must be + fixed by the time that they arrive in the derived class' SendBuffer method. + + + Protected constructor to allow subclassing. + + + The should be set if the subclass + expects the events delivered to be fixed even if the + is set to zero, i.e. when no buffering occurs. + + + + + + Flush the currently buffered events + + + + Flushes any events that have been buffered. + + + If the appender is buffering in mode then the contents + of the buffer will NOT be flushed to the appender. + + + + + + Flush the currently buffered events + + set to true to flush the buffer of lossy events + + + Flushes events that have been buffered. If is + false then events will only be flushed if this buffer is non-lossy mode. + + + If the appender is buffering in mode then the contents + of the buffer will only be flushed if is true. + In this case the contents of the buffer will be tested against the + and if triggering will be output. All other buffered + events will be discarded. + + + If is true then the buffer will always + be emptied by calling this method. + + + + + + Initialize the appender based on the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Close this appender instance. + + + + Close this appender instance. If this appender is marked + as not then the remaining events in + the buffer must be sent when the appender is closed. + + + + + + This method is called by the method. + + the event to log + + + Stores the in the cyclic buffer. + + + The buffer will be sent (i.e. passed to the + method) if one of the following conditions is met: + + + + The cyclic buffer is full and this appender is + marked as not lossy (see ) + + + An is set and + it is triggered for the + specified. + + + + Before the event is stored in the buffer it is fixed + (see ) to ensure that + any data referenced by the event will be valid when the buffer + is processed. + + + + + + Sends the contents of the buffer. + + The first logging event. + The buffer containing the events that need to be send. + + + The subclass must override . + + + + + + Sends the events. + + The events that need to be send. + + + The subclass must override this method to process the buffered events. + + + + + + The size of the cyclic buffer used to hold the logging events. + + + Set to by default. + + + + + The cyclic buffer used to store the logging events. + + + + + The triggering event evaluator that causes the buffer to be sent immediately. + + + The object that is used to determine if an event causes the entire + buffer to be sent immediately. This field can be null, which + indicates that event triggering is not to be done. The evaluator + can be set using the property. If this appender + has the ( property) set to + true then an must be set. + + + + + Indicates if the appender should overwrite events in the cyclic buffer + when it becomes full, or if the buffer should be flushed when the + buffer is full. + + + If this field is set to true then an must + be set. + + + + + The triggering event evaluator filters discarded events. + + + The object that is used to determine if an event that is discarded should + really be discarded or if it should be sent to the appenders. + This field can be null, which indicates that all discarded events will + be discarded. + + + + + Value indicating which fields in the event should be fixed + + + By default all fields are fixed + + + + + The events delivered to the subclass must be fixed. + + + + + Gets or sets a value that indicates whether the appender is lossy. + + + true if the appender is lossy, otherwise false. The default is false. + + + + This appender uses a buffer to store logging events before + delivering them. A triggering event causes the whole buffer + to be send to the remote sink. If the buffer overruns before + a triggering event then logging events could be lost. Set + to false to prevent logging events + from being lost. + + If is set to true then an + must be specified. + + + + + Gets or sets the size of the cyclic buffer used to hold the + logging events. + + + The size of the cyclic buffer used to hold the logging events. + + + + The option takes a positive integer + representing the maximum number of logging events to collect in + a cyclic buffer. When the is reached, + oldest events are deleted as new events are added to the + buffer. By default the size of the cyclic buffer is 512 events. + + + If the is set to a value less than + or equal to 1 then no buffering will occur. The logging event + will be delivered synchronously (depending on the + and properties). Otherwise the event will + be buffered. + + + + + + Gets or sets the that causes the + buffer to be sent immediately. + + + The that causes the buffer to be + sent immediately. + + + + The evaluator will be called for each event that is appended to this + appender. If the evaluator triggers then the current buffer will + immediately be sent (see ). + + If is set to true then an + must be specified. + + + + + Gets or sets the value of the to use. + + + The value of the to use. + + + + The evaluator will be called for each event that is discarded from this + appender. If the evaluator triggers then the current buffer will immediately + be sent (see ). + + + + + + Gets or sets a value indicating if only part of the logging event data + should be fixed. + + + true if the appender should only fix part of the logging event + data, otherwise false. The default is false. + + + + Setting this property to true will cause only part of the + event data to be fixed and serialized. This will improve performance. + + + See for more information. + + + + + + Gets or sets a the fields that will be fixed in the event + + + The event fields that will be fixed before the event is buffered + + + + The logging event needs to have certain thread specific values + captured before it can be buffered. See + for details. + + + + + + + Initializes a new instance of the class. + + + Public default constructor to initialize a new instance of this class. + + + + + Initialize the appender based on the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Override the parent method to close the database + + + + Closes the database command and database connection. + + + + + + Inserts the events into the database. + + The events to insert into the database. + + + Insert all the events specified in the + array into the database. + + + + + + Adds a parameter to the command. + + The parameter to add to the command. + + + Adds a parameter to the ordered list of command parameters. + + + + + + Writes the events to the database using the transaction specified. + + The transaction that the events will be executed under. + The array of events to insert into the database. + + + The transaction argument can be null if the appender has been + configured not to use transactions. See + property for more information. + + + + + + Formats the log message into database statement text. + + The event being logged. + + This method can be overridden by subclasses to provide + more control over the format of the database statement. + + + Text that can be passed to a . + + + + + Creates an instance used to connect to the database. + + + This method is called whenever a new IDbConnection is needed (i.e. when a reconnect is necessary). + + The of the object. + The connectionString output from the ResolveConnectionString method. + An instance with a valid connection string. + + + + Resolves the connection string from the ConnectionString, ConnectionStringName, or AppSettingsKey + property. + + + ConnectiongStringName is only supported on .NET 2.0 and higher. + + Additional information describing the connection string. + A connection string used to connect to the database. + + + + Retrieves the class type of the ADO.NET provider. + + + + Gets the Type of the ADO.NET provider to use to connect to the + database. This method resolves the type specified in the + property. + + + Subclasses can override this method to return a different type + if necessary. + + + The of the ADO.NET provider + + + + Prepares the database command and initialize the parameters. + + + + + Connects to the database. + + + + + Cleanup the existing command. + + + If true, a message will be written using LogLog.Warn if an exception is encountered when calling Dispose. + + + + + Cleanup the existing connection. + + + Calls the IDbConnection's method. + + + + + Flag to indicate if we are using a command object + + + + Set to true when the appender is to use a prepared + statement or stored procedure to insert into the database. + + + + + + The list of objects. + + + + The list of objects. + + + + + + The security context to use for privileged calls + + + + + The that will be used + to insert logging events into a database. + + + + + The database command. + + + + + Database connection string. + + + + + The appSettings key from App.Config that contains the connection string. + + + + + The connectionStrings key from App.Config that contains the connection string. + + + + + String type name of the type name. + + + + + The text of the command. + + + + + The command type. + + + + + Indicates whether to use transactions when writing to the database. + + + + + Indicates whether to use transactions when writing to the database. + + + + + The fully qualified type of the AdoNetAppender class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the database connection string that is used to connect to + the database. + + + The database connection string used to connect to the database. + + + + The connections string is specific to the connection type. + See for more information. + + + Connection string for MS Access via ODBC: + "DSN=MS Access Database;UID=admin;PWD=;SystemDB=C:\data\System.mdw;SafeTransactions = 0;FIL=MS Access;DriverID = 25;DBQ=C:\data\train33.mdb" + + Another connection string for MS Access via ODBC: + "Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\Work\cvs_root\log4net-1.2\access.mdb;UID=;PWD=;" + + Connection string for MS Access via OLE DB: + "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Work\cvs_root\log4net-1.2\access.mdb;User Id=;Password=;" + + + + + The appSettings key from App.Config that contains the connection string. + + + + + The connectionStrings key from App.Config that contains the connection string. + + + This property requires at least .NET 2.0. + + + + + Gets or sets the type name of the connection + that should be created. + + + The type name of the connection. + + + + The type name of the ADO.NET provider to use. + + + The default is to use the OLE DB provider. + + + Use the OLE DB Provider. This is the default value. + System.Data.OleDb.OleDbConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Use the MS SQL Server Provider. + System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Use the ODBC Provider. + Microsoft.Data.Odbc.OdbcConnection,Microsoft.Data.Odbc,version=1.0.3300.0,publicKeyToken=b77a5c561934e089,culture=neutral + This is an optional package that you can download from + http://msdn.microsoft.com/downloads + search for ODBC .NET Data Provider. + + Use the Oracle Provider. + System.Data.OracleClient.OracleConnection, System.Data.OracleClient, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + This is an optional package that you can download from + http://msdn.microsoft.com/downloads + search for .NET Managed Provider for Oracle. + + + + + Gets or sets the command text that is used to insert logging events + into the database. + + + The command text used to insert logging events into the database. + + + + Either the text of the prepared statement or the + name of the stored procedure to execute to write into + the database. + + + The property determines if + this text is a prepared statement or a stored procedure. + + + + + + Gets or sets the command type to execute. + + + The command type to execute. + + + + This value may be either (System.Data.CommandType.Text) to specify + that the is a prepared statement to execute, + or (System.Data.CommandType.StoredProcedure) to specify that the + property is the name of a stored procedure + to execute. + + + The default value is (System.Data.CommandType.Text). + + + + + + Should transactions be used to insert logging events in the database. + + + true if transactions should be used to insert logging events in + the database, otherwise false. The default value is true. + + + + Gets or sets a value that indicates whether transactions should be used + to insert logging events in the database. + + + When set a single transaction will be used to insert the buffered events + into the database. Otherwise each event will be inserted without using + an explicit transaction. + + + + + + Gets or sets the used to call the NetSend method. + + + The used to call the NetSend method. + + + + Unless a specified here for this appender + the is queried for the + security context to use. The default behavior is to use the security context + of the current thread. + + + + + + Should this appender try to reconnect to the database on error. + + + true if the appender should try to reconnect to the database after an + error has occurred, otherwise false. The default value is false, + i.e. not to try to reconnect. + + + + The default behaviour is for the appender not to try to reconnect to the + database if an error occurs. Subsequent logging events are discarded. + + + To force the appender to attempt to reconnect to the database set this + property to true. + + + When the appender attempts to connect to the database there may be a + delay of up to the connection timeout specified in the connection string. + This delay will block the calling application's thread. + Until the connection can be reestablished this potential delay may occur multiple times. + + + + + + Gets or sets the underlying . + + + The underlying . + + + creates a to insert + logging events into a database. Classes deriving from + can use this property to get or set this . Use the + underlying returned from if + you require access beyond that which provides. + + + + + Parameter type used by the . + + + + This class provides the basic database parameter properties + as defined by the interface. + + This type can be subclassed to provide database specific + functionality. The two methods that are called externally are + and . + + + + + + Initializes a new instance of the class. + + + Default constructor for the AdoNetAppenderParameter class. + + + + + Prepare the specified database command object. + + The command to prepare. + + + Prepares the database command object by adding + this parameter to its collection of parameters. + + + + + + Renders the logging event and set the parameter value in the command. + + The command containing the parameter. + The event to be rendered. + + + Renders the logging event using this parameters layout + object. Sets the value of the parameter on the command object. + + + + + + The name of this parameter. + + + + + The database type for this parameter. + + + + + Flag to infer type rather than use the DbType + + + + + The precision for this parameter. + + + + + The scale for this parameter. + + + + + The size for this parameter. + + + + + The to use to render the + logging event into an object for this parameter. + + + + + Gets or sets the name of this parameter. + + + The name of this parameter. + + + + The name of this parameter. The parameter name + must match up to a named parameter to the SQL stored procedure + or prepared statement. + + + + + + Gets or sets the database type for this parameter. + + + The database type for this parameter. + + + + The database type for this parameter. This property should + be set to the database type from the + enumeration. See . + + + This property is optional. If not specified the ADO.NET provider + will attempt to infer the type from the value. + + + + + + + Gets or sets the precision for this parameter. + + + The precision for this parameter. + + + + The maximum number of digits used to represent the Value. + + + This property is optional. If not specified the ADO.NET provider + will attempt to infer the precision from the value. + + + + + + + Gets or sets the scale for this parameter. + + + The scale for this parameter. + + + + The number of decimal places to which Value is resolved. + + + This property is optional. If not specified the ADO.NET provider + will attempt to infer the scale from the value. + + + + + + + Gets or sets the size for this parameter. + + + The size for this parameter. + + + + The maximum size, in bytes, of the data within the column. + + + This property is optional. If not specified the ADO.NET provider + will attempt to infer the size from the value. + + + + + + + Gets or sets the to use to + render the logging event into an object for this + parameter. + + + The used to render the + logging event into an object for this parameter. + + + + The that renders the value for this + parameter. + + + The can be used to adapt + any into a + for use in the property. + + + + + + Appends logging events to the terminal using ANSI color escape sequences. + + + + AnsiColorTerminalAppender appends log events to the standard output stream + or the error output stream using a layout specified by the + user. It also allows the color of a specific level of message to be set. + + + This appender expects the terminal to understand the VT100 control set + in order to interpret the color codes. If the terminal or console does not + understand the control codes the behavior is not defined. + + + By default, all output is written to the console's standard output stream. + The property can be set to direct the output to the + error stream. + + + NOTE: This appender writes each message to the System.Console.Out or + System.Console.Error that is set at the time the event is appended. + Therefore it is possible to programmatically redirect the output of this appender + (for example NUnit does this to capture program output). While this is the desired + behavior of this appender it may have security implications in your application. + + + When configuring the ANSI colored terminal appender, a mapping should be + specified to map a logging level to a color. For example: + + + + + + + + + + + + + + + The Level is the standard log4net logging level and ForeColor and BackColor can be any + of the following values: + + Blue + Green + Red + White + Yellow + Purple + Cyan + + These color values cannot be combined together to make new colors. + + + The attributes can be any combination of the following: + + Brightforeground is brighter + Dimforeground is dimmer + Underscoremessage is underlined + Blinkforeground is blinking (does not work on all terminals) + Reverseforeground and background are reversed + Hiddenoutput is hidden + Strikethroughmessage has a line through it + + While any of these attributes may be combined together not all combinations + work well together, for example setting both Bright and Dim attributes makes + no sense. + + + Patrick Wagstrom + Nicko Cadell + + + + The to use when writing to the Console + standard output stream. + + + + The to use when writing to the Console + standard output stream. + + + + + + The to use when writing to the Console + standard error output stream. + + + + The to use when writing to the Console + standard error output stream. + + + + + + Ansi code to reset terminal + + + + + Initializes a new instance of the class. + + + The instance of the class is set up to write + to the standard output stream. + + + + + Add a mapping of level to color + + The mapping to add + + + Add a mapping to this appender. + Each mapping defines the foreground and background colours + for a level. + + + + + + This method is called by the method. + + The event to log. + + + Writes the event to the console. + + + The format of the output will depend on the appender's layout. + + + + + + Initialize the options for this appender + + + + Initialize the level to color mappings set on this appender. + + + + + + Flag to write output to the error stream rather than the standard output stream + + + + + Mapping from level object to color value + + + + + Target is the value of the console output stream. + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + The enum of possible display attributes + + + + The following flags can be combined together to + form the ANSI color attributes. + + + + + + + text is bright + + + + + text is dim + + + + + text is underlined + + + + + text is blinking + + + Not all terminals support this attribute + + + + + text and background colors are reversed + + + + + text is hidden + + + + + text is displayed with a strikethrough + + + + + The enum of possible foreground or background color values for + use with the color mapping method + + + + The output can be in one for the following ANSI colors. + + + + + + + color is black + + + + + color is red + + + + + color is green + + + + + color is yellow + + + + + color is blue + + + + + color is magenta + + + + + color is cyan + + + + + color is white + + + + + A class to act as a mapping between the level that a logging call is made at and + the color it should be displayed as. + + + + Defines the mapping between a level and the color it should be displayed in. + + + + + + An entry in the + + + + This is an abstract base class for types that are stored in the + object. + + + Nicko Cadell + + + + Default protected constructor + + + + Default protected constructor + + + + + + Initialize any options defined on this entry + + + + Should be overridden by any classes that need to initialise based on their options + + + + + + The level that is the key for this mapping + + + The that is the key for this mapping + + + + Get or set the that is the key for this + mapping subclass. + + + + + + Initialize the options for the object + + + + Combine the and together + and append the attributes. + + + + + + The mapped foreground color for the specified level + + + + Required property. + The mapped foreground color for the specified level + + + + + + The mapped background color for the specified level + + + + Required property. + The mapped background color for the specified level + + + + + + The color attributes for the specified level + + + + Required property. + The color attributes for the specified level + + + + + + The combined , and + suitable for setting the ansi terminal color. + + + + + A strongly-typed collection of objects. + + Nicko Cadell + + + + Creates a read-only wrapper for a AppenderCollection instance. + + list to create a readonly wrapper arround + + An AppenderCollection wrapper that is read-only. + + + + + An empty readonly static AppenderCollection + + + + + Initializes a new instance of the AppenderCollection class + that is empty and has the default initial capacity. + + + + + Initializes a new instance of the AppenderCollection class + that has the specified initial capacity. + + + The number of elements that the new AppenderCollection is initially capable of storing. + + + + + Initializes a new instance of the AppenderCollection class + that contains elements copied from the specified AppenderCollection. + + The AppenderCollection whose elements are copied to the new collection. + + + + Initializes a new instance of the AppenderCollection class + that contains elements copied from the specified array. + + The array whose elements are copied to the new list. + + + + Initializes a new instance of the AppenderCollection class + that contains elements copied from the specified collection. + + The collection whose elements are copied to the new list. + + + + Allow subclasses to avoid our default constructors + + + + + + + Copies the entire AppenderCollection to a one-dimensional + array. + + The one-dimensional array to copy to. + + + + Copies the entire AppenderCollection to a one-dimensional + array, starting at the specified index of the target array. + + The one-dimensional array to copy to. + The zero-based index in at which copying begins. + + + + Adds a to the end of the AppenderCollection. + + The to be added to the end of the AppenderCollection. + The index at which the value has been added. + + + + Removes all elements from the AppenderCollection. + + + + + Creates a shallow copy of the . + + A new with a shallow copy of the collection data. + + + + Determines whether a given is in the AppenderCollection. + + The to check for. + true if is found in the AppenderCollection; otherwise, false. + + + + Returns the zero-based index of the first occurrence of a + in the AppenderCollection. + + The to locate in the AppenderCollection. + + The zero-based index of the first occurrence of + in the entire AppenderCollection, if found; otherwise, -1. + + + + + Inserts an element into the AppenderCollection at the specified index. + + The zero-based index at which should be inserted. + The to insert. + + is less than zero + -or- + is equal to or greater than . + + + + + Removes the first occurrence of a specific from the AppenderCollection. + + The to remove from the AppenderCollection. + + The specified was not found in the AppenderCollection. + + + + + Removes the element at the specified index of the AppenderCollection. + + The zero-based index of the element to remove. + + is less than zero + -or- + is equal to or greater than . + + + + + Returns an enumerator that can iterate through the AppenderCollection. + + An for the entire AppenderCollection. + + + + Adds the elements of another AppenderCollection to the current AppenderCollection. + + The AppenderCollection whose elements should be added to the end of the current AppenderCollection. + The new of the AppenderCollection. + + + + Adds the elements of a array to the current AppenderCollection. + + The array whose elements should be added to the end of the AppenderCollection. + The new of the AppenderCollection. + + + + Adds the elements of a collection to the current AppenderCollection. + + The collection whose elements should be added to the end of the AppenderCollection. + The new of the AppenderCollection. + + + + Sets the capacity to the actual number of elements. + + + + + Return the collection elements as an array + + the array + + + + is less than zero + -or- + is equal to or greater than . + + + + + is less than zero + -or- + is equal to or greater than . + + + + + Gets the number of elements actually contained in the AppenderCollection. + + + + + Gets a value indicating whether access to the collection is synchronized (thread-safe). + + true if access to the ICollection is synchronized (thread-safe); otherwise, false. + + + + Gets an object that can be used to synchronize access to the collection. + + + + + Gets or sets the at the specified index. + + The zero-based index of the element to get or set. + + is less than zero + -or- + is equal to or greater than . + + + + + Gets a value indicating whether the collection has a fixed size. + + true if the collection has a fixed size; otherwise, false. The default is false + + + + Gets a value indicating whether the IList is read-only. + + true if the collection is read-only; otherwise, false. The default is false + + + + Gets or sets the number of elements the AppenderCollection can contain. + + + + + Supports type-safe iteration over a . + + + + + + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + Gets the current element in the collection. + + + + + Type visible only to our subclasses + Used to access protected constructor + + + + + + A value + + + + + Supports simple iteration over a . + + + + + + Initializes a new instance of the Enumerator class. + + + + + + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + Gets the current element in the collection. + + + + + + + + + Appends log events to the ASP.NET system. + + + + + Diagnostic information and tracing messages that you specify are appended to the output + of the page that is sent to the requesting browser. Optionally, you can view this information + from a separate trace viewer (Trace.axd) that displays trace information for every page in a + given application. + + + Trace statements are processed and displayed only when tracing is enabled. You can control + whether tracing is displayed to a page, to the trace viewer, or both. + + + The logging event is passed to the or + method depending on the level of the logging event. + The event's logger name is the default value for the category parameter of the Write/Warn method. + + + Nicko Cadell + Gert Driesen + Ron Grabowski + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Write the logging event to the ASP.NET trace + + the event to log + + + Write the logging event to the ASP.NET trace + HttpContext.Current.Trace + (). + + + + + + Defaults to %logger + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + The category parameter sent to the Trace method. + + + + Defaults to %logger which will use the logger name of the current + as the category parameter. + + + + + + + + Buffers events and then forwards them to attached appenders. + + + + The events are buffered in this appender until conditions are + met to allow the appender to deliver the events to the attached + appenders. See for the + conditions that cause the buffer to be sent. + + The forwarding appender can be used to specify different + thresholds and filters for the same appender at different locations + within the hierarchy. + + + Nicko Cadell + Gert Driesen + + + + Interface for attaching appenders to objects. + + + + Interface for attaching, removing and retrieving appenders. + + + Nicko Cadell + Gert Driesen + + + + Attaches an appender. + + The appender to add. + + + Add the specified appender. The implementation may + choose to allow or deny duplicate appenders. + + + + + + Gets an attached appender with the specified name. + + The name of the appender to get. + + The appender with the name specified, or null if no appender with the + specified name is found. + + + + Returns an attached appender with the specified. + If no appender with the specified name is found null will be + returned. + + + + + + Removes all attached appenders. + + + + Removes and closes all attached appenders + + + + + + Removes the specified appender from the list of attached appenders. + + The appender to remove. + The appender removed from the list + + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + + Removes the appender with the specified name from the list of appenders. + + The name of the appender to remove. + The appender removed from the list + + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + + Gets all attached appenders. + + + A collection of attached appenders. + + + + Gets a collection of attached appenders. + If there are no attached appenders the + implementation should return an empty + collection rather than null. + + + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Closes the appender and releases resources. + + + + Releases any resources allocated within the appender such as file handles, + network connections, etc. + + + It is a programming error to append to a closed appender. + + + + + + Send the events. + + The events that need to be send. + + + Forwards the events to the attached appenders. + + + + + + Adds an to the list of appenders of this + instance. + + The to add to this appender. + + + If the specified is already in the list of + appenders, then it won't be added again. + + + + + + Looks for the appender with the specified name. + + The name of the appender to lookup. + + The appender with the specified name, or null. + + + + Get the named appender attached to this buffering appender. + + + + + + Removes all previously added appenders from this appender. + + + + This is useful when re-reading configuration information. + + + + + + Removes the specified appender from the list of appenders. + + The appender to remove. + The appender removed from the list + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + Removes the appender with the specified name from the list of appenders. + + The name of the appender to remove. + The appender removed from the list + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + Implementation of the interface + + + + + Gets the appenders contained in this appender as an + . + + + If no appenders can be found, then an + is returned. + + + A collection of the appenders in this appender. + + + + + Appends logging events to the console. + + + + ColoredConsoleAppender appends log events to the standard output stream + or the error output stream using a layout specified by the + user. It also allows the color of a specific type of message to be set. + + + By default, all output is written to the console's standard output stream. + The property can be set to direct the output to the + error stream. + + + NOTE: This appender writes directly to the application's attached console + not to the System.Console.Out or System.Console.Error TextWriter. + The System.Console.Out and System.Console.Error streams can be + programmatically redirected (for example NUnit does this to capture program output). + This appender will ignore these redirections because it needs to use Win32 + API calls to colorize the output. To respect these redirections the + must be used. + + + When configuring the colored console appender, mapping should be + specified to map a logging level to a color. For example: + + + + + + + + + + + + + + The Level is the standard log4net logging level and ForeColor and BackColor can be any + combination of the following values: + + Blue + Green + Red + White + Yellow + Purple + Cyan + HighIntensity + + + + Rick Hobbs + Nicko Cadell + + + + The to use when writing to the Console + standard output stream. + + + + The to use when writing to the Console + standard output stream. + + + + + + The to use when writing to the Console + standard error output stream. + + + + The to use when writing to the Console + standard error output stream. + + + + + + Initializes a new instance of the class. + + + The instance of the class is set up to write + to the standard output stream. + + + + + Initializes a new instance of the class + with the specified layout. + + the layout to use for this appender + + The instance of the class is set up to write + to the standard output stream. + + + + + Initializes a new instance of the class + with the specified layout. + + the layout to use for this appender + flag set to true to write to the console error stream + + When is set to true, output is written to + the standard error output stream. Otherwise, output is written to the standard + output stream. + + + + + Add a mapping of level to color - done by the config file + + The mapping to add + + + Add a mapping to this appender. + Each mapping defines the foreground and background colors + for a level. + + + + + + This method is called by the method. + + The event to log. + + + Writes the event to the console. + + + The format of the output will depend on the appender's layout. + + + + + + Initialize the options for this appender + + + + Initialize the level to color mappings set on this appender. + + + + + + Flag to write output to the error stream rather than the standard output stream + + + + + Mapping from level object to color value + + + + + The console output stream writer to write to + + + + This writer is not thread safe. + + + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + The enum of possible color values for use with the color mapping method + + + + The following flags can be combined together to + form the colors. + + + + + + + color is blue + + + + + color is green + + + + + color is red + + + + + color is white + + + + + color is yellow + + + + + color is purple + + + + + color is cyan + + + + + color is intensified + + + + + A class to act as a mapping between the level that a logging call is made at and + the color it should be displayed as. + + + + Defines the mapping between a level and the color it should be displayed in. + + + + + + Initialize the options for the object + + + + Combine the and together. + + + + + + The mapped foreground color for the specified level + + + + Required property. + The mapped foreground color for the specified level. + + + + + + The mapped background color for the specified level + + + + Required property. + The mapped background color for the specified level. + + + + + + The combined and suitable for + setting the console color. + + + + + Appends logging events to the console. + + + + ConsoleAppender appends log events to the standard output stream + or the error output stream using a layout specified by the + user. + + + By default, all output is written to the console's standard output stream. + The property can be set to direct the output to the + error stream. + + + NOTE: This appender writes each message to the System.Console.Out or + System.Console.Error that is set at the time the event is appended. + Therefore it is possible to programmatically redirect the output of this appender + (for example NUnit does this to capture program output). While this is the desired + behavior of this appender it may have security implications in your application. + + + Nicko Cadell + Gert Driesen + + + + The to use when writing to the Console + standard output stream. + + + + The to use when writing to the Console + standard output stream. + + + + + + The to use when writing to the Console + standard error output stream. + + + + The to use when writing to the Console + standard error output stream. + + + + + + Initializes a new instance of the class. + + + The instance of the class is set up to write + to the standard output stream. + + + + + Initializes a new instance of the class + with the specified layout. + + the layout to use for this appender + + The instance of the class is set up to write + to the standard output stream. + + + + + Initializes a new instance of the class + with the specified layout. + + the layout to use for this appender + flag set to true to write to the console error stream + + When is set to true, output is written to + the standard error output stream. Otherwise, output is written to the standard + output stream. + + + + + This method is called by the method. + + The event to log. + + + Writes the event to the console. + + + The format of the output will depend on the appender's layout. + + + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + Target is the value of the console output stream. + This is either "Console.Out" or "Console.Error". + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Appends log events to the system. + + + + The application configuration file can be used to control what listeners + are actually used. See the MSDN documentation for the + class for details on configuring the + debug system. + + + Events are written using the + method. The event's logger name is passed as the value for the category name to the Write method. + + + Nicko Cadell + + + + Initializes a new instance of the . + + + + Default constructor. + + + + + + Initializes a new instance of the + with a specified layout. + + The layout to use with this appender. + + + Obsolete constructor. + + + + + + Writes the logging event to the system. + + The event to log. + + + Writes the logging event to the system. + If is true then the + is called. + + + + + + Immediate flush means that the underlying writer or output stream + will be flushed at the end of each append operation. + + + + Immediate flush is slower but ensures that each append request is + actually written. If is set to + false, then there is a good chance that the last few + logs events are not actually written to persistent media if and + when the application crashes. + + + The default value is true. + + + + + Gets or sets a value that indicates whether the appender will + flush at the end of each write. + + + The default behavior is to flush at the end of each + write. If the option is set tofalse, then the underlying + stream can defer writing to physical medium to a later time. + + + Avoiding the flush operation at the end of each append results + in a performance gain of 10 to 20 percent. However, there is safety + trade-off involved in skipping flushing. Indeed, when flushing is + skipped, then it is likely that the last few log events will not + be recorded on disk when the application exits. This is a high + price to pay even for a 20% performance gain. + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Writes events to the system event log. + + + + The appender will fail if you try to write using an event source that doesn't exist unless it is running with local administrator privileges. + See also http://logging.apache.org/log4net/release/faq.html#trouble-EventLog + + + The EventID of the event log entry can be + set using the EventID property () + on the . + + + The Category of the event log entry can be + set using the Category property () + on the . + + + There is a limit of 32K characters for an event log message + + + When configuring the EventLogAppender a mapping can be + specified to map a logging level to an event log entry type. For example: + + + <mapping> + <level value="ERROR" /> + <eventLogEntryType value="Error" /> + </mapping> + <mapping> + <level value="DEBUG" /> + <eventLogEntryType value="Information" /> + </mapping> + + + The Level is the standard log4net logging level and eventLogEntryType can be any value + from the enum, i.e.: + + Erroran error event + Warninga warning event + Informationan informational event + + + + Aspi Havewala + Douglas de la Torre + Nicko Cadell + Gert Driesen + Thomas Voss + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Initializes a new instance of the class + with the specified . + + The to use with this appender. + + + Obsolete constructor. + + + + + + Add a mapping of level to - done by the config file + + The mapping to add + + + Add a mapping to this appender. + Each mapping defines the event log entry type for a level. + + + + + + Initialize the appender based on the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Create an event log source + + + Uses different API calls under NET_2_0 + + + + + This method is called by the + method. + + the event to log + + Writes the event to the system event log using the + . + + If the event has an EventID property (see ) + set then this integer will be used as the event log event id. + + + There is a limit of 32K characters for an event log message + + + + + + Get the equivalent for a + + the Level to convert to an EventLogEntryType + The equivalent for a + + Because there are fewer applicable + values to use in logging levels than there are in the + this is a one way mapping. There is + a loss of information during the conversion. + + + + + The log name is the section in the event logs where the messages + are stored. + + + + + Name of the application to use when logging. This appears in the + application column of the event log named by . + + + + + The name of the machine which holds the event log. This is + currently only allowed to be '.' i.e. the current machine. + + + + + Mapping from level object to EventLogEntryType + + + + + The security context to use for privileged calls + + + + + The event ID to use unless one is explicitly specified via the LoggingEvent's properties. + + + + + The event category to use unless one is explicitly specified via the LoggingEvent's properties. + + + + + The fully qualified type of the EventLogAppender class. + + + Used by the internal logger to record the Type of the + log message. + + + + + The name of the log where messages will be stored. + + + The string name of the log where messages will be stored. + + + This is the name of the log as it appears in the Event Viewer + tree. The default value is to log into the Application + log, this is where most applications write their events. However + if you need a separate log for your application (or applications) + then you should set the appropriately. + This should not be used to distinguish your event log messages + from those of other applications, the + property should be used to distinguish events. This property should be + used to group together events into a single log. + + + + + + Property used to set the Application name. This appears in the + event logs when logging. + + + The string used to distinguish events from different sources. + + + Sets the event log source property. + + + + + This property is used to return the name of the computer to use + when accessing the event logs. Currently, this is the current + computer, denoted by a dot "." + + + The string name of the machine holding the event log that + will be logged into. + + + This property cannot be changed. It is currently set to '.' + i.e. the local machine. This may be changed in future. + + + + + Gets or sets the used to write to the EventLog. + + + The used to write to the EventLog. + + + + The system security context used to write to the EventLog. + + + Unless a specified here for this appender + the is queried for the + security context to use. The default behavior is to use the security context + of the current thread. + + + + + + Gets or sets the EventId to use unless one is explicitly specified via the LoggingEvent's properties. + + + + The EventID of the event log entry will normally be + set using the EventID property () + on the . + This property provides the fallback value which defaults to 0. + + + + + + Gets or sets the Category to use unless one is explicitly specified via the LoggingEvent's properties. + + + + The Category of the event log entry will normally be + set using the Category property () + on the . + This property provides the fallback value which defaults to 0. + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + A class to act as a mapping between the level that a logging call is made at and + the color it should be displayed as. + + + + Defines the mapping between a level and its event log entry type. + + + + + + The for this entry + + + + Required property. + The for this entry + + + + + + Appends logging events to a file. + + + + Logging events are sent to the file specified by + the property. + + + The file can be opened in either append or overwrite mode + by specifying the property. + If the file path is relative it is taken as relative from + the application base directory. The file encoding can be + specified by setting the property. + + + The layout's and + values will be written each time the file is opened and closed + respectively. If the property is + then the file may contain multiple copies of the header and footer. + + + This appender will first try to open the file for writing when + is called. This will typically be during configuration. + If the file cannot be opened for writing the appender will attempt + to open the file again each time a message is logged to the appender. + If the file cannot be opened for writing when a message is logged then + the message will be discarded by this appender. + + + The supports pluggable file locking models via + the property. + The default behavior, implemented by + is to obtain an exclusive write lock on the file until this appender is closed. + The alternative models only hold a + write lock while the appender is writing a logging event () + or synchronize by using a named system wide Mutex (). + + + All locking strategies have issues and you should seriously consider using a different strategy that + avoids having multiple processes logging to the same file. + + + Nicko Cadell + Gert Driesen + Rodrigo B. de Oliveira + Douglas de la Torre + Niall Daley + + + + Sends logging events to a . + + + + An Appender that writes to a . + + + This appender may be used stand alone if initialized with an appropriate + writer, however it is typically used as a base class for an appender that + can open a to write to. + + + Nicko Cadell + Gert Driesen + Douglas de la Torre + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Initializes a new instance of the class and + sets the output destination to a new initialized + with the specified . + + The layout to use with this appender. + The to output to. + + + Obsolete constructor. + + + + + + Initializes a new instance of the class and sets + the output destination to the specified . + + The layout to use with this appender + The to output to + + The must have been previously opened. + + + + Obsolete constructor. + + + + + + This method determines if there is a sense in attempting to append. + + + + This method checks if an output target has been set and if a + layout has been set. + + + false if any of the preconditions fail. + + + + This method is called by the + method. + + The event to log. + + + Writes a log statement to the output stream if the output stream exists + and is writable. + + + The format of the output will depend on the appender's layout. + + + + + + This method is called by the + method. + + The array of events to log. + + + This method writes all the bulk logged events to the output writer + before flushing the stream. + + + + + + Close this appender instance. The underlying stream or writer is also closed. + + + Closed appenders cannot be reused. + + + + + Writes the footer and closes the underlying . + + + + Writes the footer and closes the underlying . + + + + + + Closes the underlying . + + + + Closes the underlying . + + + + + + Clears internal references to the underlying + and other variables. + + + + Subclasses can override this method for an alternate closing behavior. + + + + + + Writes a footer as produced by the embedded layout's property. + + + + Writes a footer as produced by the embedded layout's property. + + + + + + Writes a header produced by the embedded layout's property. + + + + Writes a header produced by the embedded layout's property. + + + + + + Called to allow a subclass to lazily initialize the writer + + + + This method is called when an event is logged and the or + have not been set. This allows a subclass to + attempt to initialize the writer multiple times. + + + + + + This is the where logging events + will be written to. + + + + + Immediate flush means that the underlying + or output stream will be flushed at the end of each append operation. + + + + Immediate flush is slower but ensures that each append request is + actually written. If is set to + false, then there is a good chance that the last few + logging events are not actually persisted if and when the application + crashes. + + + The default value is true. + + + + + + The fully qualified type of the TextWriterAppender class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or set whether the appender will flush at the end + of each append operation. + + + + The default behavior is to flush at the end of each + append operation. + + + If this option is set to false, then the underlying + stream can defer persisting the logging event to a later + time. + + + + Avoiding the flush operation at the end of each append results in + a performance gain of 10 to 20 percent. However, there is safety + trade-off involved in skipping flushing. Indeed, when flushing is + skipped, then it is likely that the last few log events will not + be recorded on disk when the application exits. This is a high + price to pay even for a 20% performance gain. + + + + + Sets the where the log output will go. + + + + The specified must be open and writable. + + + The will be closed when the appender + instance is closed. + + + Note: Logging to an unopened will fail. + + + + + + Gets or set the and the underlying + , if any, for this appender. + + + The for this appender. + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Gets or sets the where logging events + will be written to. + + + The where logging events are written. + + + + This is the where logging events + will be written to. + + + + + + Default constructor + + + + Default constructor + + + + + + Construct a new appender using the layout, file and append mode. + + the layout to use with this appender + the full path to the file to write to + flag to indicate if the file should be appended to + + + Obsolete constructor. + + + + + + Construct a new appender using the layout and file specified. + The file will be appended to. + + the layout to use with this appender + the full path to the file to write to + + + Obsolete constructor. + + + + + + Activate the options on the file appender. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + This will cause the file to be opened. + + + + + + Closes any previously opened file and calls the parent's . + + + + Resets the filename and the file stream. + + + + + + Called to initialize the file writer + + + + Will be called for each logged message until the file is + successfully opened. + + + + + + This method is called by the + method. + + The event to log. + + + Writes a log statement to the output stream if the output stream exists + and is writable. + + + The format of the output will depend on the appender's layout. + + + + + + This method is called by the + method. + + The array of events to log. + + + Acquires the output file locks once before writing all the events to + the stream. + + + + + + Writes a footer as produced by the embedded layout's property. + + + + Writes a footer as produced by the embedded layout's property. + + + + + + Writes a header produced by the embedded layout's property. + + + + Writes a header produced by the embedded layout's property. + + + + + + Closes the underlying . + + + + Closes the underlying . + + + + + + Closes the previously opened file. + + + + Writes the to the file and then + closes the file. + + + + + + Sets and opens the file where the log output will go. The specified file must be writable. + + The path to the log file. Must be a fully qualified path. + If true will append to fileName. Otherwise will truncate fileName + + + Calls but guarantees not to throw an exception. + Errors are passed to the . + + + + + + Sets and opens the file where the log output will go. The specified file must be writable. + + The path to the log file. Must be a fully qualified path. + If true will append to fileName. Otherwise will truncate fileName + + + If there was already an opened file, then the previous file + is closed first. + + + This method will ensure that the directory structure + for the specified exists. + + + + + + Sets the quiet writer used for file output + + the file stream that has been opened for writing + + + This implementation of creates a + over the and passes it to the + method. + + + This method can be overridden by sub classes that want to wrap the + in some way, for example to encrypt the output + data using a System.Security.Cryptography.CryptoStream. + + + + + + Sets the quiet writer being used. + + the writer over the file stream that has been opened for writing + + + This method can be overridden by sub classes that want to + wrap the in some way. + + + + + + Convert a path into a fully qualified path. + + The path to convert. + The fully qualified path. + + + Converts the path specified to a fully + qualified path. If the path is relative it is + taken as relative from the application base + directory. + + + + + + Flag to indicate if we should append to the file + or overwrite the file. The default is to append. + + + + + The name of the log file. + + + + + The encoding to use for the file stream. + + + + + The security context to use for privileged calls + + + + + The stream to log to. Has added locking semantics + + + + + The locking model to use + + + + + The fully qualified type of the FileAppender class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the path to the file that logging will be written to. + + + The path to the file that logging will be written to. + + + + If the path is relative it is taken as relative from + the application base directory. + + + + + + Gets or sets a flag that indicates whether the file should be + appended to or overwritten. + + + Indicates whether the file should be appended to or overwritten. + + + + If the value is set to false then the file will be overwritten, if + it is set to true then the file will be appended to. + + The default value is true. + + + + + Gets or sets used to write to the file. + + + The used to write to the file. + + + + The default encoding set is + which is the encoding for the system's current ANSI code page. + + + + + + Gets or sets the used to write to the file. + + + The used to write to the file. + + + + Unless a specified here for this appender + the is queried for the + security context to use. The default behavior is to use the security context + of the current thread. + + + + + + Gets or sets the used to handle locking of the file. + + + The used to lock the file. + + + + Gets or sets the used to handle locking of the file. + + + There are three built in locking models, , and . + The first locks the file from the start of logging to the end, the + second locks only for the minimal amount of time when logging each message + and the last synchronizes processes using a named system wide Mutex. + + + The default locking model is the . + + + + + + Write only that uses the + to manage access to an underlying resource. + + + + + True asynchronous writes are not supported, the implementation forces a synchronous write. + + + + + Exception base type for log4net. + + + + This type extends . It + does not add any new functionality but does differentiate the + type of exception being thrown. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Constructor + + A message to include with the exception. + + + Initializes a new instance of the class with + the specified message. + + + + + + Constructor + + A message to include with the exception. + A nested exception to include. + + + Initializes a new instance of the class + with the specified message and inner exception. + + + + + + Serialization constructor + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + + + Initializes a new instance of the class + with serialized data. + + + + + + Locking model base class + + + + Base class for the locking models available to the derived loggers. + + + + + + Open the output file + + The filename to use + Whether to append to the file, or overwrite + The encoding to use + + + Open the file specified and prepare for logging. + No writes will be made until is called. + Must be called before any calls to , + and . + + + + + + Close the file + + + + Close the file. No further writes will be made. + + + + + + Acquire the lock on the file + + A stream that is ready to be written to. + + + Acquire the lock on the file in preparation for writing to it. + Return a stream pointing to the file. + must be called to release the lock on the output file. + + + + + + Release the lock on the file + + + + Release the lock on the file. No further writes will be made to the + stream until is called again. + + + + + + Helper method that creates a FileStream under CurrentAppender's SecurityContext. + + + + Typically called during OpenFile or AcquireLock. + + + If the directory portion of the does not exist, it is created + via Directory.CreateDirecctory. + + + + + + + + + + Helper method to close under CurrentAppender's SecurityContext. + + + Does not set to null. + + + + + + Gets or sets the for this LockingModel + + + The for this LockingModel + + + + The file appender this locking model is attached to and working on + behalf of. + + + The file appender is used to locate the security context and the error handler to use. + + + The value of this property will be set before is + called. + + + + + + Hold an exclusive lock on the output file + + + + Open the file once for writing and hold it open until is called. + Maintains an exclusive lock on the file during this time. + + + + + + Open the file specified and prepare for logging. + + The filename to use + Whether to append to the file, or overwrite + The encoding to use + + + Open the file specified and prepare for logging. + No writes will be made until is called. + Must be called before any calls to , + and . + + + + + + Close the file + + + + Close the file. No further writes will be made. + + + + + + Acquire the lock on the file + + A stream that is ready to be written to. + + + Does nothing. The lock is already taken + + + + + + Release the lock on the file + + + + Does nothing. The lock will be released when the file is closed. + + + + + + Acquires the file lock for each write + + + + Opens the file once for each / cycle, + thus holding the lock for the minimal amount of time. This method of locking + is considerably slower than but allows + other processes to move/delete the log file whilst logging continues. + + + + + + Prepares to open the file when the first message is logged. + + The filename to use + Whether to append to the file, or overwrite + The encoding to use + + + Open the file specified and prepare for logging. + No writes will be made until is called. + Must be called before any calls to , + and . + + + + + + Close the file + + + + Close the file. No further writes will be made. + + + + + + Acquire the lock on the file + + A stream that is ready to be written to. + + + Acquire the lock on the file in preparation for writing to it. + Return a stream pointing to the file. + must be called to release the lock on the output file. + + + + + + Release the lock on the file + + + + Release the lock on the file. No further writes will be made to the + stream until is called again. + + + + + + Provides cross-process file locking. + + Ron Grabowski + Steve Wranovsky + + + + Open the file specified and prepare for logging. + + The filename to use + Whether to append to the file, or overwrite + The encoding to use + + + Open the file specified and prepare for logging. + No writes will be made until is called. + Must be called before any calls to , + - and . + + + + + + Close the file + + + + Close the file. No further writes will be made. + + + + + + Acquire the lock on the file + + A stream that is ready to be written to. + + + Does nothing. The lock is already taken + + + + + + + + + + + This appender forwards logging events to attached appenders. + + + + The forwarding appender can be used to specify different thresholds + and filters for the same appender at different locations within the hierarchy. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Closes the appender and releases resources. + + + + Releases any resources allocated within the appender such as file handles, + network connections, etc. + + + It is a programming error to append to a closed appender. + + + + + + Forward the logging event to the attached appenders + + The event to log. + + + Delivers the logging event to all the attached appenders. + + + + + + Forward the logging events to the attached appenders + + The array of events to log. + + + Delivers the logging events to all the attached appenders. + + + + + + Adds an to the list of appenders of this + instance. + + The to add to this appender. + + + If the specified is already in the list of + appenders, then it won't be added again. + + + + + + Looks for the appender with the specified name. + + The name of the appender to lookup. + + The appender with the specified name, or null. + + + + Get the named appender attached to this appender. + + + + + + Removes all previously added appenders from this appender. + + + + This is useful when re-reading configuration information. + + + + + + Removes the specified appender from the list of appenders. + + The appender to remove. + The appender removed from the list + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + Removes the appender with the specified name from the list of appenders. + + The name of the appender to remove. + The appender removed from the list + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + Implementation of the interface + + + + + Gets the appenders contained in this appender as an + . + + + If no appenders can be found, then an + is returned. + + + A collection of the appenders in this appender. + + + + + Logs events to a local syslog service. + + + + This appender uses the POSIX libc library functions openlog, syslog, and closelog. + If these functions are not available on the local system then this appender will not work! + + + The functions openlog, syslog, and closelog are specified in SUSv2 and + POSIX 1003.1-2001 standards. These are used to log messages to the local syslog service. + + + This appender talks to a local syslog service. If you need to log to a remote syslog + daemon and you cannot configure your local syslog service to do this you may be + able to use the to log via UDP. + + + Syslog messages must have a facility and and a severity. The severity + is derived from the Level of the logging event. + The facility must be chosen from the set of defined syslog + values. The facilities list is predefined + and cannot be extended. + + + An identifier is specified with each log message. This can be specified + by setting the property. The identity (also know + as the tag) must not contain white space. The default value for the + identity is the application name (from ). + + + Rob Lyon + Nicko Cadell + + + + Initializes a new instance of the class. + + + This instance of the class is set up to write + to a local syslog service. + + + + + Add a mapping of level to severity + + The mapping to add + + + Adds a to this appender. + + + + + + Initialize the appender based on the options set. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + This method is called by the method. + + The event to log. + + + Writes the event to a remote syslog daemon. + + + The format of the output will depend on the appender's layout. + + + + + + Close the syslog when the appender is closed + + + + Close the syslog when the appender is closed + + + + + + Translates a log4net level to a syslog severity. + + A log4net level. + A syslog severity. + + + Translates a log4net level to a syslog severity. + + + + + + Generate a syslog priority. + + The syslog facility. + The syslog severity. + A syslog priority. + + + + The facility. The default facility is . + + + + + The message identity + + + + + Marshaled handle to the identity string. We have to hold on to the + string as the openlog and syslog APIs just hold the + pointer to the ident and dereference it for each log message. + + + + + Mapping from level object to syslog severity + + + + + Open connection to system logger. + + + + + Generate a log message. + + + + The libc syslog method takes a format string and a variable argument list similar + to the classic printf function. As this type of vararg list is not supported + by C# we need to specify the arguments explicitly. Here we have specified the + format string with a single message argument. The caller must set the format + string to "%s". + + + + + + Close descriptor used to write to system logger. + + + + + Message identity + + + + An identifier is specified with each log message. This can be specified + by setting the property. The identity (also know + as the tag) must not contain white space. The default value for the + identity is the application name (from ). + + + + + + Syslog facility + + + Set to one of the values. The list of + facilities is predefined and cannot be extended. The default value + is . + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + syslog severities + + + + The log4net Level maps to a syslog severity using the + method and the + class. The severity is set on . + + + + + + system is unusable + + + + + action must be taken immediately + + + + + critical conditions + + + + + error conditions + + + + + warning conditions + + + + + normal but significant condition + + + + + informational + + + + + debug-level messages + + + + + syslog facilities + + + + The syslog facility defines which subsystem the logging comes from. + This is set on the property. + + + + + + kernel messages + + + + + random user-level messages + + + + + mail system + + + + + system daemons + + + + + security/authorization messages + + + + + messages generated internally by syslogd + + + + + line printer subsystem + + + + + network news subsystem + + + + + UUCP subsystem + + + + + clock (cron/at) daemon + + + + + security/authorization messages (private) + + + + + ftp daemon + + + + + NTP subsystem + + + + + log audit + + + + + log alert + + + + + clock daemon + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + A class to act as a mapping between the level that a logging call is made at and + the syslog severity that is should be logged at. + + + + A class to act as a mapping between the level that a logging call is made at and + the syslog severity that is should be logged at. + + + + + + The mapped syslog severity for the specified level + + + + Required property. + The mapped syslog severity for the specified level + + + + + + Stores logging events in an array. + + + + The memory appender stores all the logging events + that are appended in an in-memory array. + + + Use the method to get + the current list of events that have been appended. + + + Use the method to clear the + current list of events. + + + Julian Biddle + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Gets the events that have been logged. + + The events that have been logged + + + Gets the events that have been logged. + + + + + + This method is called by the method. + + the event to log + + Stores the in the events list. + + + + + Clear the list of events + + + Clear the list of events + + + + + The list of events that have been appended. + + + + + Value indicating which fields in the event should be fixed + + + By default all fields are fixed + + + + + Gets or sets a value indicating whether only part of the logging event + data should be fixed. + + + true if the appender should only fix part of the logging event + data, otherwise false. The default is false. + + + + Setting this property to true will cause only part of the event + data to be fixed and stored in the appender, hereby improving performance. + + + See for more information. + + + + + + Gets or sets the fields that will be fixed in the event + + + + The logging event needs to have certain thread specific values + captured before it can be buffered. See + for details. + + + + + + Logs entries by sending network messages using the + native function. + + + + You can send messages only to names that are active + on the network. If you send the message to a user name, + that user must be logged on and running the Messenger + service to receive the message. + + + The receiver will get a top most window displaying the + messages one at a time, therefore this appender should + not be used to deliver a high volume of messages. + + + The following table lists some possible uses for this appender : + + + + + Action + Property Value(s) + + + Send a message to a user account on the local machine + + + = <name of the local machine> + + + = <user name> + + + + + Send a message to a user account on a remote machine + + + = <name of the remote machine> + + + = <user name> + + + + + Send a message to a domain user account + + + = <name of a domain controller | uninitialized> + + + = <user name> + + + + + Send a message to all the names in a workgroup or domain + + + = <workgroup name | domain name>* + + + + + Send a message from the local machine to a remote machine + + + = <name of the local machine | uninitialized> + + + = <name of the remote machine> + + + + + + + Note : security restrictions apply for sending + network messages, see + for more information. + + + + + An example configuration section to log information + using this appender from the local machine, named + LOCAL_PC, to machine OPERATOR_PC : + + + + + + + + + + Nicko Cadell + Gert Driesen + + + + The DNS or NetBIOS name of the server on which the function is to execute. + + + + + The sender of the network message. + + + + + The message alias to which the message should be sent. + + + + + The security context to use for privileged calls + + + + + Initializes the appender. + + + The default constructor initializes all fields to their default values. + + + + + Initialize the appender based on the options set. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + The appender will be ignored if no was specified. + + + The required property was not specified. + + + + This method is called by the method. + + The event to log. + + + Sends the event using a network message. + + + + + + Sends a buffer of information to a registered message alias. + + The DNS or NetBIOS name of the server on which the function is to execute. + The message alias to which the message buffer should be sent + The originator of the message. + The message text. + The length, in bytes, of the message text. + + + The following restrictions apply for sending network messages: + + + + + Platform + Requirements + + + Windows NT + + + No special group membership is required to send a network message. + + + Admin, Accounts, Print, or Server Operator group membership is required to + successfully send a network message on a remote server. + + + + + Windows 2000 or later + + + If you send a message on a domain controller that is running Active Directory, + access is allowed or denied based on the access control list (ACL) for the securable + object. The default ACL permits only Domain Admins and Account Operators to send a network message. + + + On a member server or workstation, only Administrators and Server Operators can send a network message. + + + + + + + For more information see Security Requirements for the Network Management Functions. + + + + + If the function succeeds, the return value is zero. + + + + + + Gets or sets the sender of the message. + + + The sender of the message. + + + If this property is not specified, the message is sent from the local computer. + + + + + Gets or sets the message alias to which the message should be sent. + + + The recipient of the message. + + + This property should always be specified in order to send a message. + + + + + Gets or sets the DNS or NetBIOS name of the remote server on which the function is to execute. + + + DNS or NetBIOS name of the remote server on which the function is to execute. + + + + For Windows NT 4.0 and earlier, the string should begin with \\. + + + If this property is not specified, the local computer is used. + + + + + + Gets or sets the used to call the NetSend method. + + + The used to call the NetSend method. + + + + Unless a specified here for this appender + the is queried for the + security context to use. The default behavior is to use the security context + of the current thread. + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Appends log events to the OutputDebugString system. + + + + OutputDebugStringAppender appends log events to the + OutputDebugString system. + + + The string is passed to the native OutputDebugString + function. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Write the logging event to the output debug string API + + the event to log + + + Write the logging event to the output debug string API + + + + + + Stub for OutputDebugString native method + + the string to output + + + Stub for OutputDebugString native method + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Logs events to a remote syslog daemon. + + + + The BSD syslog protocol is used to remotely log to + a syslog daemon. The syslogd listens for for messages + on UDP port 514. + + + The syslog UDP protocol is not authenticated. Most syslog daemons + do not accept remote log messages because of the security implications. + You may be able to use the LocalSyslogAppender to talk to a local + syslog service. + + + There is an RFC 3164 that claims to document the BSD Syslog Protocol. + This RFC can be seen here: http://www.faqs.org/rfcs/rfc3164.html. + This appender generates what the RFC calls an "Original Device Message", + i.e. does not include the TIMESTAMP or HOSTNAME fields. By observation + this format of message will be accepted by all current syslog daemon + implementations. The daemon will attach the current time and the source + hostname or IP address to any messages received. + + + Syslog messages must have a facility and and a severity. The severity + is derived from the Level of the logging event. + The facility must be chosen from the set of defined syslog + values. The facilities list is predefined + and cannot be extended. + + + An identifier is specified with each log message. This can be specified + by setting the property. The identity (also know + as the tag) must not contain white space. The default value for the + identity is the application name (from ). + + + Rob Lyon + Nicko Cadell + + + + Sends logging events as connectionless UDP datagrams to a remote host or a + multicast group using an . + + + + UDP guarantees neither that messages arrive, nor that they arrive in the correct order. + + + To view the logging results, a custom application can be developed that listens for logging + events. + + + When decoding events send via this appender remember to use the same encoding + to decode the events as was used to send the events. See the + property to specify the encoding to use. + + + + This example shows how to log receive logging events that are sent + on IP address 244.0.0.1 and port 8080 to the console. The event is + encoded in the packet as a unicode string and it is decoded as such. + + IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Any, 0); + UdpClient udpClient; + byte[] buffer; + string loggingEvent; + + try + { + udpClient = new UdpClient(8080); + + while(true) + { + buffer = udpClient.Receive(ref remoteEndPoint); + loggingEvent = System.Text.Encoding.Unicode.GetString(buffer); + Console.WriteLine(loggingEvent); + } + } + catch(Exception e) + { + Console.WriteLine(e.ToString()); + } + + + Dim remoteEndPoint as IPEndPoint + Dim udpClient as UdpClient + Dim buffer as Byte() + Dim loggingEvent as String + + Try + remoteEndPoint = new IPEndPoint(IPAddress.Any, 0) + udpClient = new UdpClient(8080) + + While True + buffer = udpClient.Receive(ByRef remoteEndPoint) + loggingEvent = System.Text.Encoding.Unicode.GetString(buffer) + Console.WriteLine(loggingEvent) + Wend + Catch e As Exception + Console.WriteLine(e.ToString()) + End Try + + + An example configuration section to log information using this appender to the + IP 224.0.0.1 on port 8080: + + + + + + + + + + Gert Driesen + Nicko Cadell + + + + Initializes a new instance of the class. + + + The default constructor initializes all fields to their default values. + + + + + Initialize the appender based on the options set. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + The appender will be ignored if no was specified or + an invalid remote or local TCP port number was specified. + + + The required property was not specified. + The TCP port number assigned to or is less than or greater than . + + + + This method is called by the method. + + The event to log. + + + Sends the event using an UDP datagram. + + + Exceptions are passed to the . + + + + + + Closes the UDP connection and releases all resources associated with + this instance. + + + + Disables the underlying and releases all managed + and unmanaged resources associated with the . + + + + + + Initializes the underlying connection. + + + + The underlying is initialized and binds to the + port number from which you intend to communicate. + + + Exceptions are passed to the . + + + + + + The IP address of the remote host or multicast group to which + the logging event will be sent. + + + + + The TCP port number of the remote host or multicast group to + which the logging event will be sent. + + + + + The cached remote endpoint to which the logging events will be sent. + + + + + The TCP port number from which the will communicate. + + + + + The instance that will be used for sending the + logging events. + + + + + The encoding to use for the packet. + + + + + Gets or sets the IP address of the remote host or multicast group to which + the underlying should sent the logging event. + + + The IP address of the remote host or multicast group to which the logging event + will be sent. + + + + Multicast addresses are identified by IP class D addresses (in the range 224.0.0.0 to + 239.255.255.255). Multicast packets can pass across different networks through routers, so + it is possible to use multicasts in an Internet scenario as long as your network provider + supports multicasting. + + + Hosts that want to receive particular multicast messages must register their interest by joining + the multicast group. Multicast messages are not sent to networks where no host has joined + the multicast group. Class D IP addresses are used for multicast groups, to differentiate + them from normal host addresses, allowing nodes to easily detect if a message is of interest. + + + Static multicast addresses that are needed globally are assigned by IANA. A few examples are listed in the table below: + + + + + IP Address + Description + + + 224.0.0.1 + + + Sends a message to all system on the subnet. + + + + + 224.0.0.2 + + + Sends a message to all routers on the subnet. + + + + + 224.0.0.12 + + + The DHCP server answers messages on the IP address 224.0.0.12, but only on a subnet. + + + + + + + A complete list of actually reserved multicast addresses and their owners in the ranges + defined by RFC 3171 can be found at the IANA web site. + + + The address range 239.0.0.0 to 239.255.255.255 is reserved for administrative scope-relative + addresses. These addresses can be reused with other local groups. Routers are typically + configured with filters to prevent multicast traffic in this range from flowing outside + of the local network. + + + + + + Gets or sets the TCP port number of the remote host or multicast group to which + the underlying should sent the logging event. + + + An integer value in the range to + indicating the TCP port number of the remote host or multicast group to which the logging event + will be sent. + + + The underlying will send messages to this TCP port number + on the remote host or multicast group. + + The value specified is less than or greater than . + + + + Gets or sets the TCP port number from which the underlying will communicate. + + + An integer value in the range to + indicating the TCP port number from which the underlying will communicate. + + + + The underlying will bind to this port for sending messages. + + + Setting the value to 0 (the default) will cause the udp client not to bind to + a local port. + + + The value specified is less than or greater than . + + + + Gets or sets used to write the packets. + + + The used to write the packets. + + + + The used to write the packets. + + + + + + Gets or sets the underlying . + + + The underlying . + + + creates a to send logging events + over a network. Classes deriving from can use this + property to get or set this . Use the underlying + returned from if you require access beyond that which + provides. + + + + + Gets or sets the cached remote endpoint to which the logging events should be sent. + + + The cached remote endpoint to which the logging events will be sent. + + + The method will initialize the remote endpoint + with the values of the and + properties. + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Syslog port 514 + + + + + Initializes a new instance of the class. + + + This instance of the class is set up to write + to a remote syslog daemon. + + + + + Add a mapping of level to severity + + The mapping to add + + + Add a mapping to this appender. + + + + + + This method is called by the method. + + The event to log. + + + Writes the event to a remote syslog daemon. + + + The format of the output will depend on the appender's layout. + + + + + + Initialize the options for this appender + + + + Initialize the level to syslog severity mappings set on this appender. + + + + + + Translates a log4net level to a syslog severity. + + A log4net level. + A syslog severity. + + + Translates a log4net level to a syslog severity. + + + + + + Generate a syslog priority. + + The syslog facility. + The syslog severity. + A syslog priority. + + + Generate a syslog priority. + + + + + + The facility. The default facility is . + + + + + The message identity + + + + + Mapping from level object to syslog severity + + + + + Message identity + + + + An identifier is specified with each log message. This can be specified + by setting the property. The identity (also know + as the tag) must not contain white space. The default value for the + identity is the application name (from ). + + + + + + Syslog facility + + + Set to one of the values. The list of + facilities is predefined and cannot be extended. The default value + is . + + + + + syslog severities + + + + The syslog severities. + + + + + + system is unusable + + + + + action must be taken immediately + + + + + critical conditions + + + + + error conditions + + + + + warning conditions + + + + + normal but significant condition + + + + + informational + + + + + debug-level messages + + + + + syslog facilities + + + + The syslog facilities + + + + + + kernel messages + + + + + random user-level messages + + + + + mail system + + + + + system daemons + + + + + security/authorization messages + + + + + messages generated internally by syslogd + + + + + line printer subsystem + + + + + network news subsystem + + + + + UUCP subsystem + + + + + clock (cron/at) daemon + + + + + security/authorization messages (private) + + + + + ftp daemon + + + + + NTP subsystem + + + + + log audit + + + + + log alert + + + + + clock daemon + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + reserved for local use + + + + + A class to act as a mapping between the level that a logging call is made at and + the syslog severity that is should be logged at. + + + + A class to act as a mapping between the level that a logging call is made at and + the syslog severity that is should be logged at. + + + + + + The mapped syslog severity for the specified level + + + + Required property. + The mapped syslog severity for the specified level + + + + + + Delivers logging events to a remote logging sink. + + + + This Appender is designed to deliver events to a remote sink. + That is any object that implements the + interface. It delivers the events using .NET remoting. The + object to deliver events to is specified by setting the + appenders property. + + The RemotingAppender buffers events before sending them. This allows it to + make more efficient use of the remoting infrastructure. + + Once the buffer is full the events are still not sent immediately. + They are scheduled to be sent using a pool thread. The effect is that + the send occurs asynchronously. This is very important for a + number of non obvious reasons. The remoting infrastructure will + flow thread local variables (stored in the ), + if they are marked as , across the + remoting boundary. If the server is not contactable then + the remoting infrastructure will clear the + objects from the . To prevent a logging failure from + having side effects on the calling application the remoting call must be made + from a separate thread to the one used by the application. A + thread is used for this. If no thread is available then + the events will block in the thread pool manager until a thread is available. + + Because the events are sent asynchronously using pool threads it is possible to close + this appender before all the queued events have been sent. + When closing the appender attempts to wait until all the queued events have been sent, but + this will timeout after 30 seconds regardless. + + If this appender is being closed because the + event has fired it may not be possible to send all the queued events. During process + exit the runtime limits the time that a + event handler is allowed to run for. If the runtime terminates the threads before + the queued events have been sent then they will be lost. To ensure that all events + are sent the appender must be closed before the application exits. See + for details on how to shutdown + log4net programmatically. + + + Nicko Cadell + Gert Driesen + Daniel Cazzulino + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Initialize the appender based on the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Send the contents of the buffer to the remote sink. + + + The events are not sent immediately. They are scheduled to be sent + using a pool thread. The effect is that the send occurs asynchronously. + This is very important for a number of non obvious reasons. The remoting + infrastructure will flow thread local variables (stored in the ), + if they are marked as , across the + remoting boundary. If the server is not contactable then + the remoting infrastructure will clear the + objects from the . To prevent a logging failure from + having side effects on the calling application the remoting call must be made + from a separate thread to the one used by the application. A + thread is used for this. If no thread is available then + the events will block in the thread pool manager until a thread is available. + + The events to send. + + + + Override base class close. + + + + This method waits while there are queued work items. The events are + sent asynchronously using work items. These items + will be sent once a thread pool thread is available to send them, therefore + it is possible to close the appender before all the queued events have been + sent. + + This method attempts to wait until all the queued events have been sent, but this + method will timeout after 30 seconds regardless. + + If the appender is being closed because the + event has fired it may not be possible to send all the queued events. During process + exit the runtime limits the time that a + event handler is allowed to run for. + + + + + A work item is being queued into the thread pool + + + + + A work item from the thread pool has completed + + + + + Send the contents of the buffer to the remote sink. + + + This method is designed to be used with the . + This method expects to be passed an array of + objects in the state param. + + the logging events to send + + + + The URL of the remote sink. + + + + + The local proxy (.NET remoting) for the remote logging sink. + + + + + The number of queued callbacks currently waiting or executing + + + + + Event used to signal when there are no queued work items + + + This event is set when there are no queued work items. In this + state it is safe to close the appender. + + + + + Gets or sets the URL of the well-known object that will accept + the logging events. + + + The well-known URL of the remote sink. + + + + The URL of the remoting sink that will accept logging events. + The sink must implement the + interface. + + + + + + Interface used to deliver objects to a remote sink. + + + This interface must be implemented by a remoting sink + if the is to be used + to deliver logging events to the sink. + + + + + Delivers logging events to the remote sink + + Array of events to log. + + + Delivers logging events to the remote sink + + + + + + Appender that rolls log files based on size or date or both. + + + + RollingFileAppender can roll log files based on size or date or both + depending on the setting of the property. + When set to the log file will be rolled + once its size exceeds the . + When set to the log file will be rolled + once the date boundary specified in the property + is crossed. + When set to the log file will be + rolled once the date boundary specified in the property + is crossed, but within a date boundary the file will also be rolled + once its size exceeds the . + When set to the log file will be rolled when + the appender is configured. This effectively means that the log file can be + rolled once per program execution. + + + A of few additional optional features have been added: + + Attach date pattern for current log file + Backup number increments for newer files + Infinite number of backups by file size + + + + + + For large or infinite numbers of backup files a + greater than zero is highly recommended, otherwise all the backup files need + to be renamed each time a new backup is created. + + + When Date/Time based rolling is used setting + to will reduce the number of file renamings to few or none. + + + + + + Changing or without clearing + the log file directory of backup files will cause unexpected and unwanted side effects. + + + + + If Date/Time based rolling is enabled this appender will attempt to roll existing files + in the directory without a Date/Time tag based on the last write date of the base log file. + The appender only rolls the log file when a message is logged. If Date/Time based rolling + is enabled then the appender will not roll the log file at the Date/Time boundary but + at the point when the next message is logged after the boundary has been crossed. + + + + The extends the and + has the same behavior when opening the log file. + The appender will first try to open the file for writing when + is called. This will typically be during configuration. + If the file cannot be opened for writing the appender will attempt + to open the file again each time a message is logged to the appender. + If the file cannot be opened for writing when a message is logged then + the message will be discarded by this appender. + + + When rolling a backup file necessitates deleting an older backup file the + file to be deleted is moved to a temporary name before being deleted. + + + + + A maximum number of backup files when rolling on date/time boundaries is not supported. + + + + Nicko Cadell + Gert Driesen + Aspi Havewala + Douglas de la Torre + Edward Smit + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + The fully qualified type of the RollingFileAppender class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Sets the quiet writer being used. + + + This method can be overridden by sub classes. + + the writer to set + + + + Write out a logging event. + + the event to write to file. + + + Handles append time behavior for RollingFileAppender. This checks + if a roll over either by date (checked first) or time (checked second) + is need and then appends to the file last. + + + + + + Write out an array of logging events. + + the events to write to file. + + + Handles append time behavior for RollingFileAppender. This checks + if a roll over either by date (checked first) or time (checked second) + is need and then appends to the file last. + + + + + + Performs any required rolling before outputting the next event + + + + Handles append time behavior for RollingFileAppender. This checks + if a roll over either by date (checked first) or time (checked second) + is need and then appends to the file last. + + + + + + Creates and opens the file for logging. If + is false then the fully qualified name is determined and used. + + the name of the file to open + true to append to existing file + + This method will ensure that the directory structure + for the specified exists. + + + + + Get the current output file name + + the base file name + the output file name + + The output file name is based on the base fileName specified. + If is set then the output + file name is the same as the base file passed in. Otherwise + the output file depends on the date pattern, on the count + direction or both. + + + + + Determines curSizeRollBackups (only within the current roll point) + + + + + Generates a wildcard pattern that can be used to find all files + that are similar to the base file name. + + + + + + + Builds a list of filenames for all files matching the base filename plus a file + pattern. + + + + + + + Initiates a roll over if needed for crossing a date boundary since the last run. + + + + + Initializes based on existing conditions at time of . + + + + Initializes based on existing conditions at time of . + The following is done + + determine curSizeRollBackups (only within the current roll point) + initiates a roll over if needed for crossing a date boundary since the last run. + + + + + + + Does the work of bumping the 'current' file counter higher + to the highest count when an incremental file name is seen. + The highest count is either the first file (when count direction + is greater than 0) or the last file (when count direction less than 0). + In either case, we want to know the highest count that is present. + + + + + + + Attempts to extract a number from the end of the file name that indicates + the number of the times the file has been rolled over. + + + Certain date pattern extensions like yyyyMMdd will be parsed as valid backup indexes. + + + + + + + Takes a list of files and a base file name, and looks for + 'incremented' versions of the base file. Bumps the max + count up to the highest count seen. + + + + + + + Calculates the RollPoint for the datePattern supplied. + + the date pattern to calculate the check period for + The RollPoint that is most accurate for the date pattern supplied + + Essentially the date pattern is examined to determine what the + most suitable roll point is. The roll point chosen is the roll point + with the smallest period that can be detected using the date pattern + supplied. i.e. if the date pattern only outputs the year, month, day + and hour then the smallest roll point that can be detected would be + and hourly roll point as minutes could not be detected. + + + + + Initialize the appender based on the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + Sets initial conditions including date/time roll over information, first check, + scheduledFilename, and calls to initialize + the current number of backups. + + + + + + + + + .1, .2, .3, etc. + + + + + Rollover the file(s) to date/time tagged file(s). + + set to true if the file to be rolled is currently open + + + Rollover the file(s) to date/time tagged file(s). + Resets curSizeRollBackups. + If fileIsOpen is set then the new file is opened (through SafeOpenFile). + + + + + + Renames file to file . + + Name of existing file to roll. + New name for file. + + + Renames file to file . It + also checks for existence of target file and deletes if it does. + + + + + + Test if a file exists at a specified path + + the path to the file + true if the file exists + + + Test if a file exists at a specified path + + + + + + Deletes the specified file if it exists. + + The file to delete. + + + Delete a file if is exists. + The file is first moved to a new filename then deleted. + This allows the file to be removed even when it cannot + be deleted, but it still can be moved. + + + + + + Implements file roll base on file size. + + + + If the maximum number of size based backups is reached + (curSizeRollBackups == maxSizeRollBackups) then the oldest + file is deleted -- its index determined by the sign of countDirection. + If countDirection < 0, then files + {File.1, ..., File.curSizeRollBackups -1} + are renamed to {File.2, ..., + File.curSizeRollBackups}. Moreover, File is + renamed File.1 and closed. + + + A new file is created to receive further log output. + + + If maxSizeRollBackups is equal to zero, then the + File is truncated with no backup files created. + + + If maxSizeRollBackups < 0, then File is + renamed if needed and no files are deleted. + + + + + + Implements file roll. + + the base name to rename + + + If the maximum number of size based backups is reached + (curSizeRollBackups == maxSizeRollBackups) then the oldest + file is deleted -- its index determined by the sign of countDirection. + If countDirection < 0, then files + {File.1, ..., File.curSizeRollBackups -1} + are renamed to {File.2, ..., + File.curSizeRollBackups}. + + + If maxSizeRollBackups is equal to zero, then the + File is truncated with no backup files created. + + + If maxSizeRollBackups < 0, then File is + renamed if needed and no files are deleted. + + + This is called by to rename the files. + + + + + + Get the start time of the next window for the current rollpoint + + the current date + the type of roll point we are working with + the start time for the next roll point an interval after the currentDateTime date + + + Returns the date of the next roll point after the currentDateTime date passed to the method. + + + The basic strategy is to subtract the time parts that are less significant + than the rollpoint from the current time. This should roll the time back to + the start of the time window for the current rollpoint. Then we add 1 window + worth of time and get the start time of the next window for the rollpoint. + + + + + + This object supplies the current date/time. Allows test code to plug in + a method to control this class when testing date/time based rolling. The default + implementation uses the underlying value of DateTime.Now. + + + + + The date pattern. By default, the pattern is set to ".yyyy-MM-dd" + meaning daily rollover. + + + + + The actual formatted filename that is currently being written to + or will be the file transferred to on roll over + (based on staticLogFileName). + + + + + The timestamp when we shall next recompute the filename. + + + + + Holds date of last roll over + + + + + The type of rolling done + + + + + The default maximum file size is 10MB + + + + + There is zero backup files by default + + + + + How many sized based backups have been made so far + + + + + The rolling file count direction. + + + + + The rolling mode used in this appender. + + + + + Cache flag set if we are rolling by date. + + + + + Cache flag set if we are rolling by size. + + + + + Value indicating whether to always log to the same file. + + + + + Value indicating whether to preserve the file name extension when rolling. + + + + + FileName provided in configuration. Used for rolling properly + + + + + The 1st of January 1970 in UTC + + + + + Gets or sets the strategy for determining the current date and time. The default + implementation is to use LocalDateTime which internally calls through to DateTime.Now. + DateTime.UtcNow may be used on frameworks newer than .NET 1.0 by specifying + . + + + An implementation of the interface which returns the current date and time. + + + + Gets or sets the used to return the current date and time. + + + There are two built strategies for determining the current date and time, + + and . + + + The default strategy is . + + + + + + Gets or sets the date pattern to be used for generating file names + when rolling over on date. + + + The date pattern to be used for generating file names when rolling + over on date. + + + + Takes a string in the same format as expected by + . + + + This property determines the rollover schedule when rolling over + on date. + + + + + + Gets or sets the maximum number of backup files that are kept before + the oldest is erased. + + + The maximum number of backup files that are kept before the oldest is + erased. + + + + If set to zero, then there will be no backup files and the log file + will be truncated when it reaches . + + + If a negative number is supplied then no deletions will be made. Note + that this could result in very slow performance as a large number of + files are rolled over unless is used. + + + The maximum applies to each time based group of files and + not the total. + + + + + + Gets or sets the maximum size that the output file is allowed to reach + before being rolled over to backup files. + + + The maximum size in bytes that the output file is allowed to reach before being + rolled over to backup files. + + + + This property is equivalent to except + that it is required for differentiating the setter taking a + argument from the setter taking a + argument. + + + The default maximum file size is 10MB (10*1024*1024). + + + + + + Gets or sets the maximum size that the output file is allowed to reach + before being rolled over to backup files. + + + The maximum size that the output file is allowed to reach before being + rolled over to backup files. + + + + This property allows you to specify the maximum size with the + suffixes "KB", "MB" or "GB" so that the size is interpreted being + expressed respectively in kilobytes, megabytes or gigabytes. + + + For example, the value "10KB" will be interpreted as 10240 bytes. + + + The default maximum file size is 10MB. + + + If you have the option to set the maximum file size programmatically + consider using the property instead as this + allows you to set the size in bytes as a . + + + + + + Gets or sets the rolling file count direction. + + + The rolling file count direction. + + + + Indicates if the current file is the lowest numbered file or the + highest numbered file. + + + By default newer files have lower numbers ( < 0), + i.e. log.1 is most recent, log.5 is the 5th backup, etc... + + + >= 0 does the opposite i.e. + log.1 is the first backup made, log.5 is the 5th backup made, etc. + For infinite backups use >= 0 to reduce + rollover costs. + + The default file count direction is -1. + + + + + Gets or sets the rolling style. + + The rolling style. + + + The default rolling style is . + + + When set to this appender's + property is set to false, otherwise + the appender would append to a single file rather than rolling + the file each time it is opened. + + + + + + Gets or sets a value indicating whether to preserve the file name extension when rolling. + + + true if the file name extension should be preserved. + + + + By default file.log is rolled to file.log.yyyy-MM-dd or file.log.curSizeRollBackup. + However, under Windows the new file name will loose any program associations as the + extension is changed. Optionally file.log can be renamed to file.yyyy-MM-dd.log or + file.curSizeRollBackup.log to maintain any program associations. + + + + + + Gets or sets a value indicating whether to always log to + the same file. + + + true if always should be logged to the same file, otherwise false. + + + + By default file.log is always the current file. Optionally + file.log.yyyy-mm-dd for current formatted datePattern can by the currently + logging file (or file.log.curSizeRollBackup or even + file.log.yyyy-mm-dd.curSizeRollBackup). + + + This will make time based rollovers with a large number of backups + much faster as the appender it won't have to rename all the backups! + + + + + + Style of rolling to use + + + + Style of rolling to use + + + + + + Roll files once per program execution + + + + Roll files once per program execution. + Well really once each time this appender is + configured. + + + Setting this option also sets AppendToFile to + false on the RollingFileAppender, otherwise + this appender would just be a normal file appender. + + + + + + Roll files based only on the size of the file + + + + + Roll files based only on the date + + + + + Roll files based on both the size and date of the file + + + + + The code assumes that the following 'time' constants are in a increasing sequence. + + + + The code assumes that the following 'time' constants are in a increasing sequence. + + + + + + Roll the log not based on the date + + + + + Roll the log for each minute + + + + + Roll the log for each hour + + + + + Roll the log twice a day (midday and midnight) + + + + + Roll the log each day (midnight) + + + + + Roll the log each week + + + + + Roll the log each month + + + + + This interface is used to supply Date/Time information to the . + + + This interface is used to supply Date/Time information to the . + Used primarily to allow test classes to plug themselves in so they can + supply test date/times. + + + + + Gets the current time. + + The current time. + + + Gets the current time. + + + + + + Default implementation of that returns the current time. + + + + + Gets the current time. + + The current time. + + + Gets the current time. + + + + + + Implementation of that returns the current time as the coordinated universal time (UTC). + + + + + Gets the current time. + + The current time. + + + Gets the current time. + + + + + + Send an e-mail when a specific logging event occurs, typically on errors + or fatal errors. + + + + The number of logging events delivered in this e-mail depend on + the value of option. The + keeps only the last + logging events in its + cyclic buffer. This keeps memory requirements at a reasonable level while + still delivering useful application context. + + + Authentication and setting the server Port are only available on the MS .NET 1.1 runtime. + For these features to be enabled you need to ensure that you are using a version of + the log4net assembly that is built against the MS .NET 1.1 framework and that you are + running the your application on the MS .NET 1.1 runtime. On all other platforms only sending + unauthenticated messages to a server listening on port 25 (the default) is supported. + + + Authentication is supported by setting the property to + either or . + If using authentication then the + and properties must also be set. + + + To set the SMTP server port use the property. The default port is 25. + + + Nicko Cadell + Gert Driesen + + + + Default constructor + + + + Default constructor + + + + + + Sends the contents of the cyclic buffer as an e-mail message. + + The logging events to send. + + + + Send the email message + + the body text to include in the mail + + + + Gets or sets a comma- or semicolon-delimited list of recipient e-mail addresses (use semicolon on .NET 1.1 and comma for later versions). + + + + For .NET 1.1 (System.Web.Mail): A semicolon-delimited list of e-mail addresses. + + + For .NET 2.0 (System.Net.Mail): A comma-delimited list of e-mail addresses. + + + + + For .NET 1.1 (System.Web.Mail): A semicolon-delimited list of e-mail addresses. + + + For .NET 2.0 (System.Net.Mail): A comma-delimited list of e-mail addresses. + + + + + + Gets or sets a comma- or semicolon-delimited list of recipient e-mail addresses + that will be carbon copied (use semicolon on .NET 1.1 and comma for later versions). + + + + For .NET 1.1 (System.Web.Mail): A semicolon-delimited list of e-mail addresses. + + + For .NET 2.0 (System.Net.Mail): A comma-delimited list of e-mail addresses. + + + + + For .NET 1.1 (System.Web.Mail): A semicolon-delimited list of e-mail addresses. + + + For .NET 2.0 (System.Net.Mail): A comma-delimited list of e-mail addresses. + + + + + + Gets or sets a semicolon-delimited list of recipient e-mail addresses + that will be blind carbon copied. + + + A semicolon-delimited list of e-mail addresses. + + + + A semicolon-delimited list of recipient e-mail addresses. + + + + + + Gets or sets the e-mail address of the sender. + + + The e-mail address of the sender. + + + + The e-mail address of the sender. + + + + + + Gets or sets the subject line of the e-mail message. + + + The subject line of the e-mail message. + + + + The subject line of the e-mail message. + + + + + + Gets or sets the name of the SMTP relay mail server to use to send + the e-mail messages. + + + The name of the e-mail relay server. If SmtpServer is not set, the + name of the local SMTP server is used. + + + + The name of the e-mail relay server. If SmtpServer is not set, the + name of the local SMTP server is used. + + + + + + Obsolete + + + Use the BufferingAppenderSkeleton Fix methods instead + + + + Obsolete property. + + + + + + The mode to use to authentication with the SMTP server + + + Authentication is only available on the MS .NET 1.1 runtime. + + Valid Authentication mode values are: , + , and . + The default value is . When using + you must specify the + and to use to authenticate. + When using the Windows credentials for the current + thread, if impersonating, or the process will be used to authenticate. + + + + + + The username to use to authenticate with the SMTP server + + + Authentication is only available on the MS .NET 1.1 runtime. + + A and must be specified when + is set to , + otherwise the username will be ignored. + + + + + + The password to use to authenticate with the SMTP server + + + Authentication is only available on the MS .NET 1.1 runtime. + + A and must be specified when + is set to , + otherwise the password will be ignored. + + + + + + The port on which the SMTP server is listening + + + Server Port is only available on the MS .NET 1.1 runtime. + + The port on which the SMTP server is listening. The default + port is 25. The Port can only be changed when running on + the MS .NET 1.1 runtime. + + + + + + Gets or sets the priority of the e-mail message + + + One of the values. + + + + Sets the priority of the e-mails generated by this + appender. The default priority is . + + + If you are using this appender to report errors then + you may want to set the priority to . + + + + + + Enable or disable use of SSL when sending e-mail message + + + This is available on MS .NET 2.0 runtime and higher + + + + + Gets or sets the reply-to e-mail address. + + + This is available on MS .NET 2.0 runtime and higher + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Values for the property. + + + + SMTP authentication modes. + + + + + + No authentication + + + + + Basic authentication. + + + Requires a username and password to be supplied + + + + + Integrated authentication + + + Uses the Windows credentials from the current thread or process to authenticate. + + + + + Send an email when a specific logging event occurs, typically on errors + or fatal errors. Rather than sending via smtp it writes a file into the + directory specified by . This allows services such + as the IIS SMTP agent to manage sending the messages. + + + + The configuration for this appender is identical to that of the SMTPAppender, + except that instead of specifying the SMTPAppender.SMTPHost you specify + . + + + The number of logging events delivered in this e-mail depend on + the value of option. The + keeps only the last + logging events in its + cyclic buffer. This keeps memory requirements at a reasonable level while + still delivering useful application context. + + + Niall Daley + Nicko Cadell + + + + Default constructor + + + + Default constructor + + + + + + Sends the contents of the cyclic buffer as an e-mail message. + + The logging events to send. + + + Sends the contents of the cyclic buffer as an e-mail message. + + + + + + Activate the options on this appender. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Convert a path into a fully qualified path. + + The path to convert. + The fully qualified path. + + + Converts the path specified to a fully + qualified path. If the path is relative it is + taken as relative from the application base + directory. + + + + + + The security context to use for privileged calls + + + + + Gets or sets a semicolon-delimited list of recipient e-mail addresses. + + + A semicolon-delimited list of e-mail addresses. + + + + A semicolon-delimited list of e-mail addresses. + + + + + + Gets or sets the e-mail address of the sender. + + + The e-mail address of the sender. + + + + The e-mail address of the sender. + + + + + + Gets or sets the subject line of the e-mail message. + + + The subject line of the e-mail message. + + + + The subject line of the e-mail message. + + + + + + Gets or sets the path to write the messages to. + + + + Gets or sets the path to write the messages to. This should be the same + as that used by the agent sending the messages. + + + + + + Gets or sets the used to write to the pickup directory. + + + The used to write to the pickup directory. + + + + Unless a specified here for this appender + the is queried for the + security context to use. The default behavior is to use the security context + of the current thread. + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Appender that allows clients to connect via Telnet to receive log messages + + + + The TelnetAppender accepts socket connections and streams logging messages + back to the client. + The output is provided in a telnet-friendly way so that a log can be monitored + over a TCP/IP socket. + This allows simple remote monitoring of application logging. + + + The default is 23 (the telnet port). + + + Keith Long + Nicko Cadell + + + + Default constructor + + + + Default constructor + + + + + + The fully qualified type of the TelnetAppender class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Overrides the parent method to close the socket handler + + + + Closes all the outstanding connections. + + + + + + Initialize the appender based on the options set. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + Create the socket handler and wait for connections + + + + + + Writes the logging event to each connected client. + + The event to log. + + + Writes the logging event to each connected client. + + + + + + Gets or sets the TCP port number on which this will listen for connections. + + + An integer value in the range to + indicating the TCP port number on which this will listen for connections. + + + + The default value is 23 (the telnet port). + + + The value specified is less than + or greater than . + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Helper class to manage connected clients + + + + The SocketHandler class is used to accept connections from + clients. It is threaded so that clients can connect/disconnect + asynchronously. + + + + + + Opens a new server port on + + the local port to listen on for connections + + + Creates a socket handler on the specified local server port. + + + + + + Sends a string message to each of the connected clients + + the text to send + + + Sends a string message to each of the connected clients + + + + + + Add a client to the internal clients list + + client to add + + + + Remove a client from the internal clients list + + client to remove + + + + Callback used to accept a connection on the server socket + + The result of the asynchronous operation + + + On connection adds to the list of connections + if there are two many open connections you will be disconnected + + + + + + Close all network connections + + + + Make sure we close all network connections + + + + + + Test if this handler has active connections + + + true if this handler has active connections + + + + This property will be true while this handler has + active connections, that is at least one connection that + the handler will attempt to send a message to. + + + + + + Class that represents a client connected to this handler + + + + Class that represents a client connected to this handler + + + + + + Create this for the specified + + the client's socket + + + Opens a stream writer on the socket. + + + + + + Write a string to the client + + string to send + + + Write a string to the client + + + + + + Cleanup the clients connection + + + + Close the socket connection. + + + + + + Appends log events to the system. + + + + The application configuration file can be used to control what listeners + are actually used. See the MSDN documentation for the + class for details on configuring the + trace system. + + + Events are written using the System.Diagnostics.Trace.Write(string,string) + method. The event's logger name is the default value for the category parameter + of the Write method. + + + Compact Framework
+ The Compact Framework does not support the + class for any operation except Assert. When using the Compact Framework this + appender will write to the system rather than + the Trace system. This appender will therefore behave like the . +
+
+ Douglas de la Torre + Nicko Cadell + Gert Driesen + Ron Grabowski +
+ + + Initializes a new instance of the . + + + + Default constructor. + + + + + + Initializes a new instance of the + with a specified layout. + + The layout to use with this appender. + + + Obsolete constructor. + + + + + + Writes the logging event to the system. + + The event to log. + + + Writes the logging event to the system. + + + + + + Immediate flush means that the underlying writer or output stream + will be flushed at the end of each append operation. + + + + Immediate flush is slower but ensures that each append request is + actually written. If is set to + false, then there is a good chance that the last few + logs events are not actually written to persistent media if and + when the application crashes. + + + The default value is true. + + + + + Defaults to %logger + + + + + Gets or sets a value that indicates whether the appender will + flush at the end of each write. + + + The default behavior is to flush at the end of each + write. If the option is set tofalse, then the underlying + stream can defer writing to physical medium to a later time. + + + Avoiding the flush operation at the end of each append results + in a performance gain of 10 to 20 percent. However, there is safety + trade-off involved in skipping flushing. Indeed, when flushing is + skipped, then it is likely that the last few log events will not + be recorded on disk when the application exits. This is a high + price to pay even for a 20% performance gain. + + + + + + The category parameter sent to the Trace method. + + + + Defaults to %logger which will use the logger name of the current + as the category parameter. + + + + + + + + This appender requires a to be set. + + true + + + This appender requires a to be set. + + + + + + Assembly level attribute that specifies a domain to alias to this assembly's repository. + + + + AliasDomainAttribute is obsolete. Use AliasRepositoryAttribute instead of AliasDomainAttribute. + + + An assembly's logger repository is defined by its , + however this can be overridden by an assembly loaded before the target assembly. + + + An assembly can alias another assembly's domain to its repository by + specifying this attribute with the name of the target domain. + + + This attribute can only be specified on the assembly and may be used + as many times as necessary to alias all the required domains. + + + Nicko Cadell + Gert Driesen + + + + Assembly level attribute that specifies a repository to alias to this assembly's repository. + + + + An assembly's logger repository is defined by its , + however this can be overridden by an assembly loaded before the target assembly. + + + An assembly can alias another assembly's repository to its repository by + specifying this attribute with the name of the target repository. + + + This attribute can only be specified on the assembly and may be used + as many times as necessary to alias all the required repositories. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class with + the specified repository to alias to this assembly's repository. + + The repository to alias to this assemby's repository. + + + Initializes a new instance of the class with + the specified repository to alias to this assembly's repository. + + + + + + Gets or sets the repository to alias to this assemby's repository. + + + The repository to alias to this assemby's repository. + + + + The name of the repository to alias to this assemby's repository. + + + + + + Initializes a new instance of the class with + the specified domain to alias to this assembly's repository. + + The domain to alias to this assemby's repository. + + + Obsolete. Use instead of . + + + + + + Use this class to quickly configure a . + + + + Allows very simple programmatic configuration of log4net. + + + Only one appender can be configured using this configurator. + The appender is set at the root of the hierarchy and all logging + events will be delivered to that appender. + + + Appenders can also implement the interface. Therefore + they would require that the method + be called after the appenders properties have been configured. + + + Nicko Cadell + Gert Driesen + + + + The fully qualified type of the BasicConfigurator class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to prevent instantiation of this class. + + + + + + Initializes the log4net system with a default configuration. + + + + Initializes the log4net logging system using a + that will write to Console.Out. The log messages are + formatted using the layout object + with the + layout style. + + + + + + Initializes the log4net system using the specified appender. + + The appender to use to log all logging events. + + + Initializes the log4net system using the specified appender. + + + + + + Initializes the log4net system using the specified appenders. + + The appenders to use to log all logging events. + + + Initializes the log4net system using the specified appenders. + + + + + + Initializes the with a default configuration. + + The repository to configure. + + + Initializes the specified repository using a + that will write to Console.Out. The log messages are + formatted using the layout object + with the + layout style. + + + + + + Initializes the using the specified appender. + + The repository to configure. + The appender to use to log all logging events. + + + Initializes the using the specified appender. + + + + + + Initializes the using the specified appenders. + + The repository to configure. + The appenders to use to log all logging events. + + + Initializes the using the specified appender. + + + + + + Base class for all log4net configuration attributes. + + + This is an abstract class that must be extended by + specific configurators. This attribute allows the + configurator to be parameterized by an assembly level + attribute. + + Nicko Cadell + Gert Driesen + + + + Constructor used by subclasses. + + the ordering priority for this configurator + + + The is used to order the configurator + attributes before they are invoked. Higher priority configurators are executed + before lower priority ones. + + + + + + Configures the for the specified assembly. + + The assembly that this attribute was defined on. + The repository to configure. + + + Abstract method implemented by a subclass. When this method is called + the subclass should configure the . + + + + + + Compare this instance to another ConfiguratorAttribute + + the object to compare to + see + + + Compares the priorities of the two instances. + Sorts by priority in descending order. Objects with the same priority are + randomly ordered. + + + + + + Assembly level attribute that specifies the logging domain for the assembly. + + + + DomainAttribute is obsolete. Use RepositoryAttribute instead of DomainAttribute. + + + Assemblies are mapped to logging domains. Each domain has its own + logging repository. This attribute specified on the assembly controls + the configuration of the domain. The property specifies the name + of the domain that this assembly is a part of. The + specifies the type of the repository objects to create for the domain. If + this attribute is not specified and a is not specified + then the assembly will be part of the default shared logging domain. + + + This attribute can only be specified on the assembly and may only be used + once per assembly. + + + Nicko Cadell + Gert Driesen + + + + Assembly level attribute that specifies the logging repository for the assembly. + + + + Assemblies are mapped to logging repository. This attribute specified + on the assembly controls + the configuration of the repository. The property specifies the name + of the repository that this assembly is a part of. The + specifies the type of the object + to create for the assembly. If this attribute is not specified or a + is not specified then the assembly will be part of the default shared logging repository. + + + This attribute can only be specified on the assembly and may only be used + once per assembly. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Initialize a new instance of the class + with the name of the repository. + + The name of the repository. + + + Initialize the attribute with the name for the assembly's repository. + + + + + + Gets or sets the name of the logging repository. + + + The string name to use as the name of the repository associated with this + assembly. + + + + This value does not have to be unique. Several assemblies can share the + same repository. They will share the logging configuration of the repository. + + + + + + Gets or sets the type of repository to create for this assembly. + + + The type of repository to create for this assembly. + + + + The type of the repository to create for the assembly. + The type must implement the + interface. + + + This will be the type of repository created when + the repository is created. If multiple assemblies reference the + same repository then the repository is only created once using the + of the first assembly to call into the + repository. + + + + + + Initializes a new instance of the class. + + + + Obsolete. Use RepositoryAttribute instead of DomainAttribute. + + + + + + Initialize a new instance of the class + with the name of the domain. + + The name of the domain. + + + Obsolete. Use RepositoryAttribute instead of DomainAttribute. + + + + + + Use this class to initialize the log4net environment using an Xml tree. + + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + Configures a using an Xml tree. + + + Nicko Cadell + Gert Driesen + + + + Private constructor + + + + + Automatically configures the log4net system based on the + application's configuration settings. + + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + Each application has a configuration file. This has the + same name as the application with '.config' appended. + This file is XML and calling this function prompts the + configurator to look in that file for a section called + log4net that contains the configuration data. + + + + + Automatically configures the using settings + stored in the application's configuration file. + + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + Each application has a configuration file. This has the + same name as the application with '.config' appended. + This file is XML and calling this function prompts the + configurator to look in that file for a section called + log4net that contains the configuration data. + + The repository to configure. + + + + Configures log4net using a log4net element + + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + Loads the log4net configuration from the XML element + supplied as . + + The element to parse. + + + + Configures the using the specified XML + element. + + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + Loads the log4net configuration from the XML element + supplied as . + + The repository to configure. + The element to parse. + + + + Configures log4net using the specified configuration file. + + The XML file to load the configuration from. + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the log4net configuration data. + + + The log4net configuration file can possible be specified in the application's + configuration file (either MyAppName.exe.config for a + normal application on Web.config for an ASP.NET application). + + + The following example configures log4net using a configuration file, of which the + location is stored in the application's configuration file : + + + using log4net.Config; + using System.IO; + using System.Configuration; + + ... + + DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); + + + In the .config file, the path to the log4net can be specified like this : + + + + + + + + + + + + + Configures log4net using the specified configuration file. + + A stream to load the XML configuration from. + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the log4net configuration data. + + + Note that this method will NOT close the stream parameter. + + + + + + Configures the using the specified configuration + file. + + The repository to configure. + The XML file to load the configuration from. + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The log4net configuration file can possible be specified in the application's + configuration file (either MyAppName.exe.config for a + normal application on Web.config for an ASP.NET application). + + + The following example configures log4net using a configuration file, of which the + location is stored in the application's configuration file : + + + using log4net.Config; + using System.IO; + using System.Configuration; + + ... + + DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); + + + In the .config file, the path to the log4net can be specified like this : + + + + + + + + + + + + + Configures the using the specified configuration + file. + + The repository to configure. + The stream to load the XML configuration from. + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + Note that this method will NOT close the stream parameter. + + + + + + Configures log4net using the file specified, monitors the file for changes + and reloads the configuration if a change is detected. + + The XML file to load the configuration from. + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The configuration file will be monitored using a + and depends on the behavior of that class. + + + For more information on how to configure log4net using + a separate configuration file, see . + + + + + + + Configures the using the file specified, + monitors the file for changes and reloads the configuration if a change + is detected. + + The repository to configure. + The XML file to load the configuration from. + + + DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The configuration file will be monitored using a + and depends on the behavior of that class. + + + For more information on how to configure log4net using + a separate configuration file, see . + + + + + + + Assembly level attribute to configure the . + + + + AliasDomainAttribute is obsolete. Use AliasRepositoryAttribute instead of AliasDomainAttribute. + + + This attribute may only be used at the assembly scope and can only + be used once per assembly. + + + Use this attribute to configure the + without calling one of the + methods. + + + Nicko Cadell + Gert Driesen + + + + Assembly level attribute to configure the . + + + + This attribute may only be used at the assembly scope and can only + be used once per assembly. + + + Use this attribute to configure the + without calling one of the + methods. + + + If neither of the or + properties are set the configuration is loaded from the application's .config file. + If set the property takes priority over the + property. The property + specifies a path to a file to load the config from. The path is relative to the + application's base directory; . + The property is used as a postfix to the assembly file name. + The config file must be located in the application's base directory; . + For example in a console application setting the to + config has the same effect as not specifying the or + properties. + + + The property can be set to cause the + to watch the configuration file for changes. + + + + Log4net will only look for assembly level configuration attributes once. + When using the log4net assembly level attributes to control the configuration + of log4net you must ensure that the first call to any of the + methods is made from the assembly with the configuration + attributes. + + + If you cannot guarantee the order in which log4net calls will be made from + different assemblies you must use programmatic configuration instead, i.e. + call the method directly. + + + + Nicko Cadell + Gert Driesen + + + + Default constructor + + + + Default constructor + + + + + + Configures the for the specified assembly. + + The assembly that this attribute was defined on. + The repository to configure. + + + Configure the repository using the . + The specified must extend the + class otherwise the will not be able to + configure it. + + + The does not extend . + + + + Attempt to load configuration from the local file system + + The assembly that this attribute was defined on. + The repository to configure. + + + + Configure the specified repository using a + + The repository to configure. + the FileInfo pointing to the config file + + + + Attempt to load configuration from a URI + + The assembly that this attribute was defined on. + The repository to configure. + + + + The fully qualified type of the XmlConfiguratorAttribute class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the filename of the configuration file. + + + The filename of the configuration file. + + + + If specified, this is the name of the configuration file to use with + the . This file path is relative to the + application base directory (). + + + The takes priority over the . + + + + + + Gets or sets the extension of the configuration file. + + + The extension of the configuration file. + + + + If specified this is the extension for the configuration file. + The path to the config file is built by using the application + base directory (), + the assembly file name and the config file extension. + + + If the is set to MyExt then + possible config file names would be: MyConsoleApp.exe.MyExt or + MyClassLibrary.dll.MyExt. + + + The takes priority over the . + + + + + + Gets or sets a value indicating whether to watch the configuration file. + + + true if the configuration should be watched, false otherwise. + + + + If this flag is specified and set to true then the framework + will watch the configuration file and will reload the config each time + the file is modified. + + + The config file can only be watched if it is loaded from local disk. + In a No-Touch (Smart Client) deployment where the application is downloaded + from a web server the config file may not reside on the local disk + and therefore it may not be able to watch it. + + + Watching configuration is not supported on the SSCLI. + + + + + + Class to register for the log4net section of the configuration file + + + The log4net section of the configuration file needs to have a section + handler registered. This is the section handler used. It simply returns + the XML element that is the root of the section. + + + Example of registering the log4net section handler : + + + +
+ + + log4net configuration XML goes here + + + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Default constructor. + + + + + + Parses the configuration section. + + The configuration settings in a corresponding parent configuration section. + The configuration context when called from the ASP.NET configuration system. Otherwise, this parameter is reserved and is a null reference. + The for the log4net section. + The for the log4net section. + + + Returns the containing the configuration data, + + + + + + Assembly level attribute that specifies a plugin to attach to + the repository. + + + + Specifies the type of a plugin to create and attach to the + assembly's repository. The plugin type must implement the + interface. + + + Nicko Cadell + Gert Driesen + + + + Interface used to create plugins. + + + + Interface used to create a plugin. + + + Nicko Cadell + Gert Driesen + + + + Creates the plugin object. + + the new plugin instance + + + Create and return a new plugin instance. + + + + + + Initializes a new instance of the class + with the specified type. + + The type name of plugin to create. + + + Create the attribute with the plugin type specified. + + + Where possible use the constructor that takes a . + + + + + + Initializes a new instance of the class + with the specified type. + + The type of plugin to create. + + + Create the attribute with the plugin type specified. + + + + + + Creates the plugin object defined by this attribute. + + + + Creates the instance of the object as + specified by this attribute. + + + The plugin object. + + + + Returns a representation of the properties of this object. + + + + Overrides base class method to + return a representation of the properties of this object. + + + A representation of the properties of this object + + + + Gets or sets the type for the plugin. + + + The type for the plugin. + + + + The type for the plugin. + + + + + + Gets or sets the type name for the plugin. + + + The type name for the plugin. + + + + The type name for the plugin. + + + Where possible use the property instead. + + + + + + Assembly level attribute to configure the . + + + + This attribute may only be used at the assembly scope and can only + be used once per assembly. + + + Use this attribute to configure the + without calling one of the + methods. + + + Nicko Cadell + + + + Construct provider attribute with type specified + + the type of the provider to use + + + The provider specified must subclass the + class. + + + + + + Configures the SecurityContextProvider + + The assembly that this attribute was defined on. + The repository to configure. + + + Creates a provider instance from the specified. + Sets this as the default security context provider . + + + + + + The fully qualified type of the SecurityContextProviderAttribute class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the type of the provider to use. + + + the type of the provider to use. + + + + The provider specified must subclass the + class. + + + + + + Use this class to initialize the log4net environment using an Xml tree. + + + + Configures a using an Xml tree. + + + Nicko Cadell + Gert Driesen + + + + Private constructor + + + + + Automatically configures the log4net system based on the + application's configuration settings. + + + + Each application has a configuration file. This has the + same name as the application with '.config' appended. + This file is XML and calling this function prompts the + configurator to look in that file for a section called + log4net that contains the configuration data. + + + To use this method to configure log4net you must specify + the section + handler for the log4net configuration section. See the + for an example. + + + + + + + Automatically configures the using settings + stored in the application's configuration file. + + + + Each application has a configuration file. This has the + same name as the application with '.config' appended. + This file is XML and calling this function prompts the + configurator to look in that file for a section called + log4net that contains the configuration data. + + + To use this method to configure log4net you must specify + the section + handler for the log4net configuration section. See the + for an example. + + + The repository to configure. + + + + Configures log4net using a log4net element + + + + Loads the log4net configuration from the XML element + supplied as . + + + The element to parse. + + + + Configures the using the specified XML + element. + + + Loads the log4net configuration from the XML element + supplied as . + + The repository to configure. + The element to parse. + + + + Configures log4net using the specified configuration file. + + The XML file to load the configuration from. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the log4net configuration data. + + + The log4net configuration file can possible be specified in the application's + configuration file (either MyAppName.exe.config for a + normal application on Web.config for an ASP.NET application). + + + The first element matching <configuration> will be read as the + configuration. If this file is also a .NET .config file then you must specify + a configuration section for the log4net element otherwise .NET will + complain. Set the type for the section handler to , for example: + + +
+ + + + + The following example configures log4net using a configuration file, of which the + location is stored in the application's configuration file : + + + using log4net.Config; + using System.IO; + using System.Configuration; + + ... + + XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); + + + In the .config file, the path to the log4net can be specified like this : + + + + + + + + + + + + + Configures log4net using the specified configuration URI. + + A URI to load the XML configuration from. + + + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the log4net configuration data. + + + The must support the URI scheme specified. + + + + + + Configures log4net using the specified configuration data stream. + + A stream to load the XML configuration from. + + + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the log4net configuration data. + + + Note that this method will NOT close the stream parameter. + + + + + + Configures the using the specified configuration + file. + + The repository to configure. + The XML file to load the configuration from. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The log4net configuration file can possible be specified in the application's + configuration file (either MyAppName.exe.config for a + normal application on Web.config for an ASP.NET application). + + + The first element matching <configuration> will be read as the + configuration. If this file is also a .NET .config file then you must specify + a configuration section for the log4net element otherwise .NET will + complain. Set the type for the section handler to , for example: + + +
+ + + + + The following example configures log4net using a configuration file, of which the + location is stored in the application's configuration file : + + + using log4net.Config; + using System.IO; + using System.Configuration; + + ... + + XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"])); + + + In the .config file, the path to the log4net can be specified like this : + + + + + + + + + + + + + Configures the using the specified configuration + URI. + + The repository to configure. + A URI to load the XML configuration from. + + + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The must support the URI scheme specified. + + + + + + Configures the using the specified configuration + file. + + The repository to configure. + The stream to load the XML configuration from. + + + The configuration data must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + Note that this method will NOT close the stream parameter. + + + + + + Configures log4net using the file specified, monitors the file for changes + and reloads the configuration if a change is detected. + + The XML file to load the configuration from. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The configuration file will be monitored using a + and depends on the behavior of that class. + + + For more information on how to configure log4net using + a separate configuration file, see . + + + + + + + Configures the using the file specified, + monitors the file for changes and reloads the configuration if a change + is detected. + + The repository to configure. + The XML file to load the configuration from. + + + The configuration file must be valid XML. It must contain + at least one element called log4net that holds + the configuration data. + + + The configuration file will be monitored using a + and depends on the behavior of that class. + + + For more information on how to configure log4net using + a separate configuration file, see . + + + + + + + Configures the specified repository using a log4net element. + + The hierarchy to configure. + The element to parse. + + + Loads the log4net configuration from the XML element + supplied as . + + + This method is ultimately called by one of the Configure methods + to load the configuration from an . + + + + + + Maps repository names to ConfigAndWatchHandler instances to allow a particular + ConfigAndWatchHandler to dispose of its FileSystemWatcher when a repository is + reconfigured. + + + + + The fully qualified type of the XmlConfigurator class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Class used to watch config files. + + + + Uses the to monitor + changes to a specified file. Because multiple change notifications + may be raised when the file is modified, a timer is used to + compress the notifications into a single event. The timer + waits for time before delivering + the event notification. If any further + change notifications arrive while the timer is waiting it + is reset and waits again for to + elapse. + + + + + + The default amount of time to wait after receiving notification + before reloading the config file. + + + + + Holds the FileInfo used to configure the XmlConfigurator + + + + + Holds the repository being configured. + + + + + The timer used to compress the notification events. + + + + + Watches file for changes. This object should be disposed when no longer + needed to free system handles on the watched resources. + + + + + Initializes a new instance of the class to + watch a specified config file used to configure a repository. + + The repository to configure. + The configuration file to watch. + + + Initializes a new instance of the class. + + + + + + Event handler used by . + + The firing the event. + The argument indicates the file that caused the event to be fired. + + + This handler reloads the configuration from the file when the event is fired. + + + + + + Event handler used by . + + The firing the event. + The argument indicates the file that caused the event to be fired. + + + This handler reloads the configuration from the file when the event is fired. + + + + + + Called by the timer when the configuration has been updated. + + null + + + + Release the handles held by the watcher and timer. + + + + + The implementation of the interface suitable + for use with the compact framework + + + + This implementation is a simple + mapping between repository name and + object. + + + The .NET Compact Framework 1.0 does not support retrieving assembly + level attributes therefore unlike the DefaultRepositorySelector + this selector does not examine the calling assembly for attributes. + + + Nicko Cadell + + + + Interface used by the to select the . + + + + The uses a + to specify the policy for selecting the correct + to return to the caller. + + + Nicko Cadell + Gert Driesen + + + + Gets the for the specified assembly. + + The assembly to use to lookup to the + The for the assembly. + + + Gets the for the specified assembly. + + + How the association between and + is made is not defined. The implementation may choose any method for + this association. The results of this method must be repeatable, i.e. + when called again with the same arguments the result must be the + save value. + + + + + + Gets the named . + + The name to use to lookup to the . + The named + + Lookup a named . This is the repository created by + calling . + + + + + Creates a new repository for the assembly specified. + + The assembly to use to create the domain to associate with the . + The type of repository to create, must implement . + The repository created. + + + The created will be associated with the domain + specified such that a call to with the + same assembly specified will return the same repository instance. + + + How the association between and + is made is not defined. The implementation may choose any method for + this association. + + + + + + Creates a new repository with the name specified. + + The name to associate with the . + The type of repository to create, must implement . + The repository created. + + + The created will be associated with the name + specified such that a call to with the + same name will return the same repository instance. + + + + + + Test if a named repository exists + + the named repository to check + true if the repository exists + + + Test if a named repository exists. Use + to create a new repository and to retrieve + a repository. + + + + + + Gets an array of all currently defined repositories. + + + An array of the instances created by + this . + + + Gets an array of all of the repositories created by this selector. + + + + + + Event to notify that a logger repository has been created. + + + Event to notify that a logger repository has been created. + + + + Event raised when a new repository is created. + The event source will be this selector. The event args will + be a which + holds the newly created . + + + + + + Create a new repository selector + + the type of the repositories to create, must implement + + + Create an new compact repository selector. + The default type for repositories must be specified, + an appropriate value would be . + + + throw if is null + throw if does not implement + + + + Get the for the specified assembly + + not used + The default + + + The argument is not used. This selector does not create a + separate repository for each assembly. + + + As a named repository is not specified the default repository is + returned. The default repository is named log4net-default-repository. + + + + + + Get the named + + the name of the repository to lookup + The named + + + Get the named . The default + repository is log4net-default-repository. Other repositories + must be created using the . + If the named repository does not exist an exception is thrown. + + + throw if is null + throw if the does not exist + + + + Create a new repository for the assembly specified + + not used + the type of repository to create, must implement + the repository created + + + The argument is not used. This selector does not create a + separate repository for each assembly. + + + If the is null then the + default repository type specified to the constructor is used. + + + As a named repository is not specified the default repository is + returned. The default repository is named log4net-default-repository. + + + + + + Create a new repository for the repository specified + + the repository to associate with the + the type of repository to create, must implement . + If this param is null then the default repository type is used. + the repository created + + + The created will be associated with the repository + specified such that a call to with the + same repository specified will return the same repository instance. + + + If the named repository already exists an exception will be thrown. + + + If is null then the default + repository type specified to the constructor is used. + + + throw if is null + throw if the already exists + + + + Test if a named repository exists + + the named repository to check + true if the repository exists + + + Test if a named repository exists. Use + to create a new repository and to retrieve + a repository. + + + + + + Gets a list of objects + + an array of all known objects + + + Gets an array of all of the repositories created by this selector. + + + + + + The fully qualified type of the CompactRepositorySelector class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Notify the registered listeners that the repository has been created + + The repository that has been created + + + Raises the LoggerRepositoryCreatedEvent + event. + + + + + + Event to notify that a logger repository has been created. + + + Event to notify that a logger repository has been created. + + + + Event raised when a new repository is created. + The event source will be this selector. The event args will + be a which + holds the newly created . + + + + + + The default implementation of the interface. + + + + Uses attributes defined on the calling assembly to determine how to + configure the hierarchy for the repository. + + + Nicko Cadell + Gert Driesen + + + + Creates a new repository selector. + + The type of the repositories to create, must implement + + + Create an new repository selector. + The default type for repositories must be specified, + an appropriate value would be . + + + is . + does not implement . + + + + Gets the for the specified assembly. + + The assembly use to lookup the . + + + The type of the created and the repository + to create can be overridden by specifying the + attribute on the . + + + The default values are to use the + implementation of the interface and to use the + as the name of the repository. + + + The created will be automatically configured using + any attributes defined on + the . + + + The for the assembly + is . + + + + Gets the for the specified repository. + + The repository to use to lookup the . + The for the specified repository. + + + Returns the named repository. If is null + a is thrown. If the repository + does not exist a is thrown. + + + Use to create a repository. + + + is . + does not exist. + + + + Create a new repository for the assembly specified + + the assembly to use to create the repository to associate with the . + The type of repository to create, must implement . + The repository created. + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + The type of the created and + the repository to create can be overridden by specifying the + attribute on the + . The default values are to use the + implementation of the + interface and to use the + as the name of the repository. + + + The created will be automatically + configured using any + attributes defined on the . + + + If a repository for the already exists + that repository will be returned. An error will not be raised and that + repository may be of a different type to that specified in . + Also the attribute on the + assembly may be used to override the repository type specified in + . + + + is . + + + + Creates a new repository for the assembly specified. + + the assembly to use to create the repository to associate with the . + The type of repository to create, must implement . + The name to assign to the created repository + Set to true to read and apply the assembly attributes + The repository created. + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + The type of the created and + the repository to create can be overridden by specifying the + attribute on the + . The default values are to use the + implementation of the + interface and to use the + as the name of the repository. + + + The created will be automatically + configured using any + attributes defined on the . + + + If a repository for the already exists + that repository will be returned. An error will not be raised and that + repository may be of a different type to that specified in . + Also the attribute on the + assembly may be used to override the repository type specified in + . + + + is . + + + + Creates a new repository for the specified repository. + + The repository to associate with the . + The type of repository to create, must implement . + If this param is then the default repository type is used. + The new repository. + + + The created will be associated with the repository + specified such that a call to with the + same repository specified will return the same repository instance. + + + is . + already exists. + + + + Test if a named repository exists + + the named repository to check + true if the repository exists + + + Test if a named repository exists. Use + to create a new repository and to retrieve + a repository. + + + + + + Gets a list of objects + + an array of all known objects + + + Gets an array of all of the repositories created by this selector. + + + + + + Aliases a repository to an existing repository. + + The repository to alias. + The repository that the repository is aliased to. + + + The repository specified will be aliased to the repository when created. + The repository must not already exist. + + + When the repository is created it must utilize the same repository type as + the repository it is aliased to, otherwise the aliasing will fail. + + + + is . + -or- + is . + + + + + Notifies the registered listeners that the repository has been created. + + The repository that has been created. + + + Raises the event. + + + + + + Gets the repository name and repository type for the specified assembly. + + The assembly that has a . + in/out param to hold the repository name to use for the assembly, caller should set this to the default value before calling. + in/out param to hold the type of the repository to create for the assembly, caller should set this to the default value before calling. + is . + + + + Configures the repository using information from the assembly. + + The assembly containing + attributes which define the configuration for the repository. + The repository to configure. + + is . + -or- + is . + + + + + Loads the attribute defined plugins on the assembly. + + The assembly that contains the attributes. + The repository to add the plugins to. + + is . + -or- + is . + + + + + Loads the attribute defined aliases on the assembly. + + The assembly that contains the attributes. + The repository to alias to. + + is . + -or- + is . + + + + + The fully qualified type of the DefaultRepositorySelector class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Event to notify that a logger repository has been created. + + + Event to notify that a logger repository has been created. + + + + Event raised when a new repository is created. + The event source will be this selector. The event args will + be a which + holds the newly created . + + + + + + Defined error codes that can be passed to the method. + + + + Values passed to the method. + + + Nicko Cadell + + + + A general error + + + + + Error while writing output + + + + + Failed to flush file + + + + + Failed to close file + + + + + Unable to open output file + + + + + No layout specified + + + + + Failed to parse address + + + + + An evaluator that triggers on an Exception type + + + + This evaluator will trigger if the type of the Exception + passed to + is equal to a Type in . /// + + + Drew Schaeffer + + + + Test if an triggers an action + + + + Implementations of this interface allow certain appenders to decide + when to perform an appender specific action. + + + The action or behavior triggered is defined by the implementation. + + + Nicko Cadell + + + + Test if this event triggers the action + + The event to check + true if this event triggers the action, otherwise false + + + Return true if this event triggers the action + + + + + + The type that causes the trigger to fire. + + + + + Causes subclasses of to cause the trigger to fire. + + + + + Default ctor to allow dynamic creation through a configurator. + + + + + Constructs an evaluator and initializes to trigger on + + the type that triggers this evaluator. + If true, this evaluator will trigger on subclasses of . + + + + Is this the triggering event? + + The event to check + This method returns true, if the logging event Exception + Type is . + Otherwise it returns false + + + This evaluator will trigger if the Exception Type of the event + passed to + is . + + + + + + The type that triggers this evaluator. + + + + + If true, this evaluator will trigger on subclasses of . + + + + + Appenders may delegate their error handling to an . + + + + Error handling is a particularly tedious to get right because by + definition errors are hard to predict and to reproduce. + + + Nicko Cadell + Gert Driesen + + + + Handles the error and information about the error condition is passed as + a parameter. + + The message associated with the error. + The that was thrown when the error occurred. + The error code associated with the error. + + + Handles the error and information about the error condition is passed as + a parameter. + + + + + + Prints the error message passed as a parameter. + + The message associated with the error. + The that was thrown when the error occurred. + + + See . + + + + + + Prints the error message passed as a parameter. + + The message associated with the error. + + + See . + + + + + + Interface for objects that require fixing. + + + + Interface that indicates that the object requires fixing before it + can be taken outside the context of the appender's + method. + + + When objects that implement this interface are stored + in the context properties maps + and + are fixed + (see ) the + method will be called. + + + Nicko Cadell + + + + Get a portable version of this object + + the portable instance of this object + + + Get a portable instance object that represents the current + state of this object. The portable object can be stored + and logged from any thread with identical results. + + + + + + Interface that all loggers implement + + + + This interface supports logging events and testing if a level + is enabled for logging. + + + These methods will not throw exceptions. Note to implementor, ensure + that the implementation of these methods cannot allow an exception + to be thrown to the caller. + + + Nicko Cadell + Gert Driesen + + + + This generic form is intended to be used by wrappers. + + The declaring type of the method that is + the stack boundary into the logging system for this call. + The level of the message to be logged. + The message object to log. + the exception to log, including its stack trace. Pass null to not log an exception. + + + Generates a logging event for the specified using + the and . + + + + + + This is the most generic printing method that is intended to be used + by wrappers. + + The event being logged. + + + Logs the specified logging event through this logger. + + + + + + Checks if this logger is enabled for a given passed as parameter. + + The level to check. + + true if this logger is enabled for level, otherwise false. + + + + Test if this logger is going to log events of the specified . + + + + + + Gets the name of the logger. + + + The name of the logger. + + + + The name of this logger + + + + + + Gets the where this + Logger instance is attached to. + + + The that this logger belongs to. + + + + Gets the where this + Logger instance is attached to. + + + + + + Base interface for all wrappers + + + + Base interface for all wrappers. + + + All wrappers must implement this interface. + + + Nicko Cadell + + + + Get the implementation behind this wrapper object. + + + The object that in implementing this object. + + + + The object that in implementing this + object. The Logger object may not + be the same object as this object because of logger decorators. + This gets the actual underlying objects that is used to process + the log events. + + + + + + Delegate used to handle logger repository creation event notifications + + The which created the repository. + The event args + that holds the instance that has been created. + + + Delegate used to handle logger repository creation event notifications. + + + + + + Provides data for the event. + + + + A + event is raised every time a is created. + + + + + + The created + + + + + Construct instance using specified + + the that has been created + + + Construct instance using specified + + + + + + The that has been created + + + The that has been created + + + + The that has been created + + + + + + Defines the default set of levels recognized by the system. + + + + Each has an associated . + + + Levels have a numeric that defines the relative + ordering between levels. Two Levels with the same + are deemed to be equivalent. + + + The levels that are recognized by log4net are set for each + and each repository can have different levels defined. The levels are stored + in the on the repository. Levels are + looked up by name from the . + + + When logging at level INFO the actual level used is not but + the value of LoggerRepository.LevelMap["INFO"]. The default value for this is + , but this can be changed by reconfiguring the level map. + + + Each level has a in addition to its . The + is the string that is written into the output log. By default + the display name is the same as the level name, but this can be used to alias levels + or to localize the log output. + + + Some of the predefined levels recognized by the system are: + + + + . + + + . + + + . + + + . + + + . + + + . + + + . + + + + Nicko Cadell + Gert Driesen + + + + Constructor + + Integer value for this level, higher values represent more severe levels. + The string name of this level. + The display name for this level. This may be localized or otherwise different from the name + + + Initializes a new instance of the class with + the specified level name and value. + + + + + + Constructor + + Integer value for this level, higher values represent more severe levels. + The string name of this level. + + + Initializes a new instance of the class with + the specified level name and value. + + + + + + Returns the representation of the current + . + + + A representation of the current . + + + + Returns the level . + + + + + + Compares levels. + + The object to compare against. + true if the objects are equal. + + + Compares the levels of instances, and + defers to base class if the target object is not a + instance. + + + + + + Returns a hash code + + A hash code for the current . + + + Returns a hash code suitable for use in hashing algorithms and data + structures like a hash table. + + + Returns the hash code of the level . + + + + + + Compares this instance to a specified object and returns an + indication of their relative values. + + A instance or to compare with this instance. + + A 32-bit signed integer that indicates the relative order of the + values compared. The return value has these meanings: + + + Value + Meaning + + + Less than zero + This instance is less than . + + + Zero + This instance is equal to . + + + Greater than zero + + This instance is greater than . + -or- + is . + + + + + + + must be an instance of + or ; otherwise, an exception is thrown. + + + is not a . + + + + Returns a value indicating whether a specified + is greater than another specified . + + A + A + + true if is greater than + ; otherwise, false. + + + + Compares two levels. + + + + + + Returns a value indicating whether a specified + is less than another specified . + + A + A + + true if is less than + ; otherwise, false. + + + + Compares two levels. + + + + + + Returns a value indicating whether a specified + is greater than or equal to another specified . + + A + A + + true if is greater than or equal to + ; otherwise, false. + + + + Compares two levels. + + + + + + Returns a value indicating whether a specified + is less than or equal to another specified . + + A + A + + true if is less than or equal to + ; otherwise, false. + + + + Compares two levels. + + + + + + Returns a value indicating whether two specified + objects have the same value. + + A or . + A or . + + true if the value of is the same as the + value of ; otherwise, false. + + + + Compares two levels. + + + + + + Returns a value indicating whether two specified + objects have different values. + + A or . + A or . + + true if the value of is different from + the value of ; otherwise, false. + + + + Compares two levels. + + + + + + Compares two specified instances. + + The first to compare. + The second to compare. + + A 32-bit signed integer that indicates the relative order of the + two values compared. The return value has these meanings: + + + Value + Meaning + + + Less than zero + is less than . + + + Zero + is equal to . + + + Greater than zero + is greater than . + + + + + + Compares two levels. + + + + + + The level designates a higher level than all the rest. + + + + + The level designates very severe error events. + System unusable, emergencies. + + + + + The level designates very severe error events. + System unusable, emergencies. + + + + + The level designates very severe error events + that will presumably lead the application to abort. + + + + + The level designates very severe error events. + Take immediate action, alerts. + + + + + The level designates very severe error events. + Critical condition, critical. + + + + + The level designates very severe error events. + + + + + The level designates error events that might + still allow the application to continue running. + + + + + The level designates potentially harmful + situations. + + + + + The level designates informational messages + that highlight the progress of the application at the highest level. + + + + + The level designates informational messages that + highlight the progress of the application at coarse-grained level. + + + + + The level designates fine-grained informational + events that are most useful to debug an application. + + + + + The level designates fine-grained informational + events that are most useful to debug an application. + + + + + The level designates fine-grained informational + events that are most useful to debug an application. + + + + + The level designates fine-grained informational + events that are most useful to debug an application. + + + + + The level designates fine-grained informational + events that are most useful to debug an application. + + + + + The level designates fine-grained informational + events that are most useful to debug an application. + + + + + The level designates the lowest level possible. + + + + + Gets the name of this level. + + + The name of this level. + + + + Gets the name of this level. + + + + + + Gets the value of this level. + + + The value of this level. + + + + Gets the value of this level. + + + + + + Gets the display name of this level. + + + The display name of this level. + + + + Gets the display name of this level. + + + + + + A strongly-typed collection of objects. + + Nicko Cadell + + + + Creates a read-only wrapper for a LevelCollection instance. + + list to create a readonly wrapper arround + + A LevelCollection wrapper that is read-only. + + + + + Initializes a new instance of the LevelCollection class + that is empty and has the default initial capacity. + + + + + Initializes a new instance of the LevelCollection class + that has the specified initial capacity. + + + The number of elements that the new LevelCollection is initially capable of storing. + + + + + Initializes a new instance of the LevelCollection class + that contains elements copied from the specified LevelCollection. + + The LevelCollection whose elements are copied to the new collection. + + + + Initializes a new instance of the LevelCollection class + that contains elements copied from the specified array. + + The array whose elements are copied to the new list. + + + + Initializes a new instance of the LevelCollection class + that contains elements copied from the specified collection. + + The collection whose elements are copied to the new list. + + + + Allow subclasses to avoid our default constructors + + + + + + Copies the entire LevelCollection to a one-dimensional + array. + + The one-dimensional array to copy to. + + + + Copies the entire LevelCollection to a one-dimensional + array, starting at the specified index of the target array. + + The one-dimensional array to copy to. + The zero-based index in at which copying begins. + + + + Adds a to the end of the LevelCollection. + + The to be added to the end of the LevelCollection. + The index at which the value has been added. + + + + Removes all elements from the LevelCollection. + + + + + Creates a shallow copy of the . + + A new with a shallow copy of the collection data. + + + + Determines whether a given is in the LevelCollection. + + The to check for. + true if is found in the LevelCollection; otherwise, false. + + + + Returns the zero-based index of the first occurrence of a + in the LevelCollection. + + The to locate in the LevelCollection. + + The zero-based index of the first occurrence of + in the entire LevelCollection, if found; otherwise, -1. + + + + + Inserts an element into the LevelCollection at the specified index. + + The zero-based index at which should be inserted. + The to insert. + + is less than zero + -or- + is equal to or greater than . + + + + + Removes the first occurrence of a specific from the LevelCollection. + + The to remove from the LevelCollection. + + The specified was not found in the LevelCollection. + + + + + Removes the element at the specified index of the LevelCollection. + + The zero-based index of the element to remove. + + is less than zero + -or- + is equal to or greater than . + + + + + Returns an enumerator that can iterate through the LevelCollection. + + An for the entire LevelCollection. + + + + Adds the elements of another LevelCollection to the current LevelCollection. + + The LevelCollection whose elements should be added to the end of the current LevelCollection. + The new of the LevelCollection. + + + + Adds the elements of a array to the current LevelCollection. + + The array whose elements should be added to the end of the LevelCollection. + The new of the LevelCollection. + + + + Adds the elements of a collection to the current LevelCollection. + + The collection whose elements should be added to the end of the LevelCollection. + The new of the LevelCollection. + + + + Sets the capacity to the actual number of elements. + + + + + is less than zero + -or- + is equal to or greater than . + + + + + is less than zero + -or- + is equal to or greater than . + + + + + Gets the number of elements actually contained in the LevelCollection. + + + + + Gets a value indicating whether access to the collection is synchronized (thread-safe). + + true if access to the ICollection is synchronized (thread-safe); otherwise, false. + + + + Gets an object that can be used to synchronize access to the collection. + + + + + Gets or sets the at the specified index. + + The zero-based index of the element to get or set. + + is less than zero + -or- + is equal to or greater than . + + + + + Gets a value indicating whether the collection has a fixed size. + + true if the collection has a fixed size; otherwise, false. The default is false + + + + Gets a value indicating whether the IList is read-only. + + true if the collection is read-only; otherwise, false. The default is false + + + + Gets or sets the number of elements the LevelCollection can contain. + + + + + Supports type-safe iteration over a . + + + + + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + Gets the current element in the collection. + + + + + Type visible only to our subclasses + Used to access protected constructor + + + + + A value + + + + + Supports simple iteration over a . + + + + + Initializes a new instance of the Enumerator class. + + + + + + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + Gets the current element in the collection. + + + + + An evaluator that triggers at a threshold level + + + + This evaluator will trigger if the level of the event + passed to + is equal to or greater than the + level. + + + Nicko Cadell + + + + The threshold for triggering + + + + + Create a new evaluator using the threshold. + + + + Create a new evaluator using the threshold. + + + This evaluator will trigger if the level of the event + passed to + is equal to or greater than the + level. + + + + + + Create a new evaluator using the specified threshold. + + the threshold to trigger at + + + Create a new evaluator using the specified threshold. + + + This evaluator will trigger if the level of the event + passed to + is equal to or greater than the + level. + + + + + + Is this the triggering event? + + The event to check + This method returns true, if the event level + is equal or higher than the . + Otherwise it returns false + + + This evaluator will trigger if the level of the event + passed to + is equal to or greater than the + level. + + + + + + the threshold to trigger at + + + The that will cause this evaluator to trigger + + + + This evaluator will trigger if the level of the event + passed to + is equal to or greater than the + level. + + + + + + Mapping between string name and Level object + + + + Mapping between string name and object. + This mapping is held separately for each . + The level name is case insensitive. + + + Nicko Cadell + + + + Mapping from level name to Level object. The + level name is case insensitive + + + + + Construct the level map + + + + Construct the level map. + + + + + + Clear the internal maps of all levels + + + + Clear the internal maps of all levels + + + + + + Create a new Level and add it to the map + + the string to display for the Level + the level value to give to the Level + + + Create a new Level and add it to the map + + + + + + + Create a new Level and add it to the map + + the string to display for the Level + the level value to give to the Level + the display name to give to the Level + + + Create a new Level and add it to the map + + + + + + Add a Level to the map + + the Level to add + + + Add a Level to the map + + + + + + Lookup a named level from the map + + the name of the level to lookup is taken from this level. + If the level is not set on the map then this level is added + the level in the map with the name specified + + + Lookup a named level from the map. The name of the level to lookup is taken + from the property of the + argument. + + + If no level with the specified name is found then the + argument is added to the level map + and returned. + + + + + + Lookup a by name + + The name of the Level to lookup + a Level from the map with the name specified + + + Returns the from the + map with the name specified. If the no level is + found then null is returned. + + + + + + Return all possible levels as a list of Level objects. + + all possible levels as a list of Level objects + + + Return all possible levels as a list of Level objects. + + + + + + The internal representation of caller location information. + + + + This class uses the System.Diagnostics.StackTrace class to generate + a call stack. The caller's information is then extracted from this stack. + + + The System.Diagnostics.StackTrace class is not supported on the + .NET Compact Framework 1.0 therefore caller location information is not + available on that framework. + + + The System.Diagnostics.StackTrace class has this to say about Release builds: + + + "StackTrace information will be most informative with Debug build configurations. + By default, Debug builds include debug symbols, while Release builds do not. The + debug symbols contain most of the file, method name, line number, and column + information used in constructing StackFrame and StackTrace objects. StackTrace + might not report as many method calls as expected, due to code transformations + that occur during optimization." + + + This means that in a Release build the caller information may be incomplete or may + not exist at all! Therefore caller location information cannot be relied upon in a Release build. + + + Nicko Cadell + Gert Driesen + + + + When location information is not available the constant + NA is returned. Current value of this string + constant is ?. + + + + + Constructor + + The declaring type of the method that is + the stack boundary into the logging system for this call. + + + Initializes a new instance of the + class based on the current thread. + + + + + + Constructor + + The fully qualified class name. + The method name. + The file name. + The line number of the method within the file. + + + Initializes a new instance of the + class with the specified data. + + + + + + The fully qualified type of the LocationInfo class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets the fully qualified class name of the caller making the logging + request. + + + The fully qualified class name of the caller making the logging + request. + + + + Gets the fully qualified class name of the caller making the logging + request. + + + + + + Gets the file name of the caller. + + + The file name of the caller. + + + + Gets the file name of the caller. + + + + + + Gets the line number of the caller. + + + The line number of the caller. + + + + Gets the line number of the caller. + + + + + + Gets the method name of the caller. + + + The method name of the caller. + + + + Gets the method name of the caller. + + + + + + Gets all available caller information + + + All available caller information, in the format + fully.qualified.classname.of.caller.methodName(Filename:line) + + + + Gets all available caller information, in the format + fully.qualified.classname.of.caller.methodName(Filename:line) + + + + + + Gets the stack frames from the stack trace of the caller making the log request + + + + + Static manager that controls the creation of repositories + + + + Static manager that controls the creation of repositories + + + This class is used by the wrapper managers (e.g. ) + to provide access to the objects. + + + This manager also holds the that is used to + lookup and create repositories. The selector can be set either programmatically using + the property, or by setting the log4net.RepositorySelector + AppSetting in the applications config file to the fully qualified type name of the + selector to use. + + + Nicko Cadell + Gert Driesen + + + + Private constructor to prevent instances. Only static methods should be used. + + + + Private constructor to prevent instances. Only static methods should be used. + + + + + + Hook the shutdown event + + + + On the full .NET runtime, the static constructor hooks up the + AppDomain.ProcessExit and AppDomain.DomainUnload> events. + These are used to shutdown the log4net system as the application exits. + + + + + + Register for ProcessExit and DomainUnload events on the AppDomain + + + + This needs to be in a separate method because the events make + a LinkDemand for the ControlAppDomain SecurityPermission. Because + this is a LinkDemand it is demanded at JIT time. Therefore we cannot + catch the exception in the method itself, we have to catch it in the + caller. + + + + + + Return the default instance. + + the repository to lookup in + Return the default instance + + + Gets the for the repository specified + by the argument. + + + + + + Returns the default instance. + + The assembly to use to lookup the repository. + The default instance. + + + + Return the default instance. + + the repository to lookup in + Return the default instance + + + Gets the for the repository specified + by the argument. + + + + + + Returns the default instance. + + The assembly to use to lookup the repository. + The default instance. + + + Returns the default instance. + + + + + + Returns the named logger if it exists. + + The repository to lookup in. + The fully qualified logger name to look for. + + The logger found, or null if the named logger does not exist in the + specified repository. + + + + If the named logger exists (in the specified repository) then it + returns a reference to the logger, otherwise it returns + null. + + + + + + Returns the named logger if it exists. + + The assembly to use to lookup the repository. + The fully qualified logger name to look for. + + The logger found, or null if the named logger does not exist in the + specified assembly's repository. + + + + If the named logger exists (in the specified assembly's repository) then it + returns a reference to the logger, otherwise it returns + null. + + + + + + Returns all the currently defined loggers in the specified repository. + + The repository to lookup in. + All the defined loggers. + + + The root logger is not included in the returned array. + + + + + + Returns all the currently defined loggers in the specified assembly's repository. + + The assembly to use to lookup the repository. + All the defined loggers. + + + The root logger is not included in the returned array. + + + + + + Retrieves or creates a named logger. + + The repository to lookup in. + The name of the logger to retrieve. + The logger with the name specified. + + + Retrieves a logger named as the + parameter. If the named logger already exists, then the + existing instance will be returned. Otherwise, a new instance is + created. + + + By default, loggers do not have a set level but inherit + it from the hierarchy. This is one of the central features of + log4net. + + + + + + Retrieves or creates a named logger. + + The assembly to use to lookup the repository. + The name of the logger to retrieve. + The logger with the name specified. + + + Retrieves a logger named as the + parameter. If the named logger already exists, then the + existing instance will be returned. Otherwise, a new instance is + created. + + + By default, loggers do not have a set level but inherit + it from the hierarchy. This is one of the central features of + log4net. + + + + + + Shorthand for . + + The repository to lookup in. + The of which the fullname will be used as the name of the logger to retrieve. + The logger with the name specified. + + + Gets the logger for the fully qualified name of the type specified. + + + + + + Shorthand for . + + the assembly to use to lookup the repository + The of which the fullname will be used as the name of the logger to retrieve. + The logger with the name specified. + + + Gets the logger for the fully qualified name of the type specified. + + + + + + Shuts down the log4net system. + + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in all the + default repositories. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + + Shuts down the repository for the repository specified. + + The repository to shutdown. + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in the + repository for the specified. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + + Shuts down the repository for the repository specified. + + The assembly to use to lookup the repository. + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in the + repository for the repository. The repository is looked up using + the specified. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + + Resets all values contained in this repository instance to their defaults. + + The repository to reset. + + + Resets all values contained in the repository instance to their + defaults. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set its default "off" value. + + + + + + Resets all values contained in this repository instance to their defaults. + + The assembly to use to lookup the repository to reset. + + + Resets all values contained in the repository instance to their + defaults. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set its default "off" value. + + + + + + Creates a repository with the specified name. + + The name of the repository, this must be unique amongst repositories. + The created for the repository. + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + Creates the default type of which is a + object. + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The specified repository already exists. + + + + Creates a repository with the specified name. + + The name of the repository, this must be unique amongst repositories. + The created for the repository. + + + Creates the default type of which is a + object. + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The specified repository already exists. + + + + Creates a repository with the specified name and repository type. + + The name of the repository, this must be unique to the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + The name must be unique. Repositories cannot be redefined. + An Exception will be thrown if the repository already exists. + + + The specified repository already exists. + + + + Creates a repository with the specified name and repository type. + + The name of the repository, this must be unique to the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + The name must be unique. Repositories cannot be redefined. + An Exception will be thrown if the repository already exists. + + + The specified repository already exists. + + + + Creates a repository for the specified assembly and repository type. + + The assembly to use to get the name of the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + + + + Creates a repository for the specified assembly and repository type. + + The assembly to use to get the name of the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + + + + Gets an array of all currently defined repositories. + + An array of all the known objects. + + + Gets an array of all currently defined repositories. + + + + + + Internal method to get pertinent version info. + + A string of version info. + + + + Called when the event fires + + the that is exiting + null + + + Called when the event fires. + + + When the event is triggered the log4net system is . + + + + + + Called when the event fires + + the that is exiting + null + + + Called when the event fires. + + + When the event is triggered the log4net system is . + + + + + + The fully qualified type of the LoggerManager class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Initialize the default repository selector + + + + + Gets or sets the repository selector used by the . + + + The repository selector used by the . + + + + The repository selector () is used by + the to create and select repositories + (). + + + The caller to supplies either a string name + or an assembly (if not supplied the assembly is inferred using + ). + + + This context is used by the selector to lookup a specific repository. + + + For the full .NET Framework, the default repository is DefaultRepositorySelector; + for the .NET Compact Framework CompactRepositorySelector is the default + repository. + + + + + + Implementation of the interface. + + + + This class should be used as the base for all wrapper implementations. + + + Nicko Cadell + Gert Driesen + + + + Constructs a new wrapper for the specified logger. + + The logger to wrap. + + + Constructs a new wrapper for the specified logger. + + + + + + The logger that this object is wrapping + + + + + Gets the implementation behind this wrapper object. + + + The object that this object is implementing. + + + + The Logger object may not be the same object as this object + because of logger decorators. + + + This gets the actual underlying objects that is used to process + the log events. + + + + + + Portable data structure used by + + + + Portable data structure used by + + + Nicko Cadell + + + + The logger name. + + + + The logger name. + + + + + + Level of logging event. + + + + Level of logging event. Level cannot be Serializable + because it is a flyweight. Due to its special serialization it + cannot be declared final either. + + + + + + The application supplied message. + + + + The application supplied message of logging event. + + + + + + The name of thread + + + + The name of thread in which this logging event was generated + + + + + + The time the event was logged + + + + The TimeStamp is stored in the local time zone for this computer. + + + + + + Location information for the caller. + + + + Location information for the caller. + + + + + + String representation of the user + + + + String representation of the user's windows name, + like DOMAIN\username + + + + + + String representation of the identity. + + + + String representation of the current thread's principal identity. + + + + + + The string representation of the exception + + + + The string representation of the exception + + + + + + String representation of the AppDomain. + + + + String representation of the AppDomain. + + + + + + Additional event specific properties + + + + A logger or an appender may attach additional + properties to specific events. These properties + have a string key and an object value. + + + + + + Flags passed to the property + + + + Flags passed to the property + + + Nicko Cadell + + + + Fix the MDC + + + + + Fix the NDC + + + + + Fix the rendered message + + + + + Fix the thread name + + + + + Fix the callers location information + + + CAUTION: Very slow to generate + + + + + Fix the callers windows user name + + + CAUTION: Slow to generate + + + + + Fix the domain friendly name + + + + + Fix the callers principal name + + + CAUTION: May be slow to generate + + + + + Fix the exception text + + + + + Fix the event properties. Active properties must implement in order to be eligible for fixing. + + + + + No fields fixed + + + + + All fields fixed + + + + + Partial fields fixed + + + + This set of partial fields gives good performance. The following fields are fixed: + + + + + + + + + + + + + The internal representation of logging events. + + + + When an affirmative decision is made to log then a + instance is created. This instance + is passed around to the different log4net components. + + + This class is of concern to those wishing to extend log4net. + + + Some of the values in instances of + are considered volatile, that is the values are correct at the + time the event is delivered to appenders, but will not be consistent + at any time afterwards. If an event is to be stored and then processed + at a later time these volatile values must be fixed by calling + . There is a performance penalty + for incurred by calling but it + is essential to maintaining data consistency. + + + Nicko Cadell + Gert Driesen + Douglas de la Torre + Daniel Cazzulino + + + + The key into the Properties map for the host name value. + + + + + The key into the Properties map for the thread identity value. + + + + + The key into the Properties map for the user name value. + + + + + Initializes a new instance of the class + from the supplied parameters. + + The declaring type of the method that is + the stack boundary into the logging system for this call. + The repository this event is logged in. + The name of the logger of this event. + The level of this event. + The message of this event. + The exception for this event. + + + Except , and , + all fields of LoggingEvent are filled when actually needed. Call + to cache all data locally + to prevent inconsistencies. + + This method is called by the log4net framework + to create a logging event. + + + + + + Initializes a new instance of the class + using specific data. + + The declaring type of the method that is + the stack boundary into the logging system for this call. + The repository this event is logged in. + Data used to initialize the logging event. + The fields in the struct that have already been fixed. + + + This constructor is provided to allow a + to be created independently of the log4net framework. This can + be useful if you require a custom serialization scheme. + + + Use the method to obtain an + instance of the class. + + + The parameter should be used to specify which fields in the + struct have been preset. Fields not specified in the + will be captured from the environment if requested or fixed. + + + + + + Initializes a new instance of the class + using specific data. + + The declaring type of the method that is + the stack boundary into the logging system for this call. + The repository this event is logged in. + Data used to initialize the logging event. + + + This constructor is provided to allow a + to be created independently of the log4net framework. This can + be useful if you require a custom serialization scheme. + + + Use the method to obtain an + instance of the class. + + + This constructor sets this objects flags to , + this assumes that all the data relating to this event is passed in via the + parameter and no other data should be captured from the environment. + + + + + + Initializes a new instance of the class + using specific data. + + Data used to initialize the logging event. + + + This constructor is provided to allow a + to be created independently of the log4net framework. This can + be useful if you require a custom serialization scheme. + + + Use the method to obtain an + instance of the class. + + + This constructor sets this objects flags to , + this assumes that all the data relating to this event is passed in via the + parameter and no other data should be captured from the environment. + + + + + + Serialization constructor + + The that holds the serialized object data. + The that contains contextual information about the source or destination. + + + Initializes a new instance of the class + with serialized data. + + + + + + Ensure that the repository is set. + + the value for the repository + + + + Write the rendered message to a TextWriter + + the writer to write the message to + + + Unlike the property this method + does store the message data in the internal cache. Therefore + if called only once this method should be faster than the + property, however if the message is + to be accessed multiple times then the property will be more efficient. + + + + + + Serializes this object into the provided. + + The to populate with data. + The destination for this serialization. + + + The data in this event must be fixed before it can be serialized. + + + The method must be called during the + method call if this event + is to be used outside that method. + + + + + + Gets the portable data for this . + + The for this event. + + + A new can be constructed using a + instance. + + + Does a fix of the data + in the logging event before returning the event data. + + + + + + Gets the portable data for this . + + The set of data to ensure is fixed in the LoggingEventData + The for this event. + + + A new can be constructed using a + instance. + + + + + + Returns this event's exception's rendered using the + . + + + This event's exception's rendered using the . + + + + Obsolete. Use instead. + + + + + + Returns this event's exception's rendered using the + . + + + This event's exception's rendered using the . + + + + Returns this event's exception's rendered using the + . + + + + + + Fix instance fields that hold volatile data. + + + + Some of the values in instances of + are considered volatile, that is the values are correct at the + time the event is delivered to appenders, but will not be consistent + at any time afterwards. If an event is to be stored and then processed + at a later time these volatile values must be fixed by calling + . There is a performance penalty + incurred by calling but it + is essential to maintaining data consistency. + + + Calling is equivalent to + calling passing the parameter + false. + + + See for more + information. + + + + + + Fixes instance fields that hold volatile data. + + Set to true to not fix data that takes a long time to fix. + + + Some of the values in instances of + are considered volatile, that is the values are correct at the + time the event is delivered to appenders, but will not be consistent + at any time afterwards. If an event is to be stored and then processed + at a later time these volatile values must be fixed by calling + . There is a performance penalty + for incurred by calling but it + is essential to maintaining data consistency. + + + The param controls the data that + is fixed. Some of the data that can be fixed takes a long time to + generate, therefore if you do not require those settings to be fixed + they can be ignored by setting the param + to true. This setting will ignore the + and settings. + + + Set to false to ensure that all + settings are fixed. + + + + + + Fix the fields specified by the parameter + + the fields to fix + + + Only fields specified in the will be fixed. + Fields will not be fixed if they have previously been fixed. + It is not possible to 'unfix' a field. + + + + + + Lookup a composite property in this event + + the key for the property to lookup + the value for the property + + + This event has composite properties that combine together properties from + several different contexts in the following order: + + + this events properties + + This event has that can be set. These + properties are specific to this event only. + + + + the thread properties + + The that are set on the current + thread. These properties are shared by all events logged on this thread. + + + + the global properties + + The that are set globally. These + properties are shared by all the threads in the AppDomain. + + + + + + + + + Get all the composite properties in this event + + the containing all the properties + + + See for details of the composite properties + stored by the event. + + + This method returns a single containing all the + properties defined for this event. + + + + + + The internal logging event data. + + + + + The internal logging event data. + + + + + The internal logging event data. + + + + + The fully qualified Type of the calling + logger class in the stack frame (i.e. the declaring type of the method). + + + + + The application supplied message of logging event. + + + + + The exception that was thrown. + + + This is not serialized. The string representation + is serialized instead. + + + + + The repository that generated the logging event + + + This is not serialized. + + + + + The fix state for this event + + + These flags indicate which fields have been fixed. + Not serialized. + + + + + Indicated that the internal cache is updateable (ie not fixed) + + + This is a seperate flag to m_fixFlags as it allows incrementel fixing and simpler + changes in the caching strategy. + + + + + Gets the time when the current process started. + + + This is the time when this process started. + + + + The TimeStamp is stored in the local time zone for this computer. + + + Tries to get the start time for the current process. + Failing that it returns the time of the first call to + this property. + + + Note that AppDomains may be loaded and unloaded within the + same process without the process terminating and therefore + without the process start time being reset. + + + + + + Gets the of the logging event. + + + The of the logging event. + + + + Gets the of the logging event. + + + + + + Gets the time of the logging event. + + + The time of the logging event. + + + + The TimeStamp is stored in the local time zone for this computer. + + + + + + Gets the name of the logger that logged the event. + + + The name of the logger that logged the event. + + + + Gets the name of the logger that logged the event. + + + + + + Gets the location information for this logging event. + + + The location information for this logging event. + + + + The collected information is cached for future use. + + + See the class for more information on + supported frameworks and the different behavior in Debug and + Release builds. + + + + + + Gets the message object used to initialize this event. + + + The message object used to initialize this event. + + + + Gets the message object used to initialize this event. + Note that this event may not have a valid message object. + If the event is serialized the message object will not + be transferred. To get the text of the message the + property must be used + not this property. + + + If there is no defined message object for this event then + null will be returned. + + + + + + Gets the exception object used to initialize this event. + + + The exception object used to initialize this event. + + + + Gets the exception object used to initialize this event. + Note that this event may not have a valid exception object. + If the event is serialized the exception object will not + be transferred. To get the text of the exception the + method must be used + not this property. + + + If there is no defined exception object for this event then + null will be returned. + + + + + + The that this event was created in. + + + + The that this event was created in. + + + + + + Gets the message, rendered through the . + + + The message rendered through the . + + + + The collected information is cached for future use. + + + + + + Gets the name of the current thread. + + + The name of the current thread, or the thread ID when + the name is not available. + + + + The collected information is cached for future use. + + + + + + Gets the name of the current user. + + + The name of the current user, or NOT AVAILABLE when the + underlying runtime has no support for retrieving the name of the + current user. + + + + Calls WindowsIdentity.GetCurrent().Name to get the name of + the current windows user. + + + To improve performance, we could cache the string representation of + the name, and reuse that as long as the identity stayed constant. + Once the identity changed, we would need to re-assign and re-render + the string. + + + However, the WindowsIdentity.GetCurrent() call seems to + return different objects every time, so the current implementation + doesn't do this type of caching. + + + Timing for these operations: + + + + Method + Results + + + WindowsIdentity.GetCurrent() + 10000 loops, 00:00:00.2031250 seconds + + + WindowsIdentity.GetCurrent().Name + 10000 loops, 00:00:08.0468750 seconds + + + + This means we could speed things up almost 40 times by caching the + value of the WindowsIdentity.GetCurrent().Name property, since + this takes (8.04-0.20) = 7.84375 seconds. + + + + + + Gets the identity of the current thread principal. + + + The string name of the identity of the current thread principal. + + + + Calls System.Threading.Thread.CurrentPrincipal.Identity.Name to get + the name of the current thread principal. + + + + + + Gets the AppDomain friendly name. + + + The AppDomain friendly name. + + + + Gets the AppDomain friendly name. + + + + + + Additional event specific properties. + + + Additional event specific properties. + + + + A logger or an appender may attach additional + properties to specific events. These properties + have a string key and an object value. + + + This property is for events that have been added directly to + this event. The aggregate properties (which include these + event properties) can be retrieved using + and . + + + Once the properties have been fixed this property + returns the combined cached properties. This ensures that updates to + this property are always reflected in the underlying storage. When + returning the combined properties there may be more keys in the + Dictionary than expected. + + + + + + The fixed fields in this event + + + The set of fields that are fixed in this event + + + + Fields will not be fixed if they have previously been fixed. + It is not possible to 'unfix' a field. + + + + + + Implementation of wrapper interface. + + + + This implementation of the interface + forwards to the held by the base class. + + + This logger has methods to allow the caller to log at the following + levels: + + + + DEBUG + + The and methods log messages + at the DEBUG level. That is the level with that name defined in the + repositories . The default value + for this level is . The + property tests if this level is enabled for logging. + + + + INFO + + The and methods log messages + at the INFO level. That is the level with that name defined in the + repositories . The default value + for this level is . The + property tests if this level is enabled for logging. + + + + WARN + + The and methods log messages + at the WARN level. That is the level with that name defined in the + repositories . The default value + for this level is . The + property tests if this level is enabled for logging. + + + + ERROR + + The and methods log messages + at the ERROR level. That is the level with that name defined in the + repositories . The default value + for this level is . The + property tests if this level is enabled for logging. + + + + FATAL + + The and methods log messages + at the FATAL level. That is the level with that name defined in the + repositories . The default value + for this level is . The + property tests if this level is enabled for logging. + + + + + The values for these levels and their semantic meanings can be changed by + configuring the for the repository. + + + Nicko Cadell + Gert Driesen + + + + The ILog interface is use by application to log messages into + the log4net framework. + + + + Use the to obtain logger instances + that implement this interface. The + static method is used to get logger instances. + + + This class contains methods for logging at different levels and also + has properties for determining if those logging levels are + enabled in the current configuration. + + + This interface can be implemented in different ways. This documentation + specifies reasonable behavior that a caller can expect from the actual + implementation, however different implementations reserve the right to + do things differently. + + + Simple example of logging messages + + ILog log = LogManager.GetLogger("application-log"); + + log.Info("Application Start"); + log.Debug("This is a debug message"); + + if (log.IsDebugEnabled) + { + log.Debug("This is another debug message"); + } + + + + + Nicko Cadell + Gert Driesen + + + Log a message object with the level. + + Log a message object with the level. + + The message object to log. + + + This method first checks if this logger is DEBUG + enabled by comparing the level of this logger with the + level. If this logger is + DEBUG enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a formatted string with the level. + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + Log a message object with the level. + + Logs a message object with the level. + + + + This method first checks if this logger is INFO + enabled by comparing the level of this logger with the + level. If this logger is + INFO enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of the + additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + The message object to log. + + + + + + Logs a message object with the INFO level including + the stack trace of the passed + as a parameter. + + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a formatted message string with the level. + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + Log a message object with the level. + + Log a message object with the level. + + + + This method first checks if this logger is WARN + enabled by comparing the level of this logger with the + level. If this logger is + WARN enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of the + additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + The message object to log. + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a formatted message string with the level. + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + Log a message object with the level. + + Logs a message object with the level. + + The message object to log. + + + This method first checks if this logger is ERROR + enabled by comparing the level of this logger with the + level. If this logger is + ERROR enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of the + additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a formatted message string with the level. + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + Log a message object with the level. + + Log a message object with the level. + + + + This method first checks if this logger is FATAL + enabled by comparing the level of this logger with the + level. If this logger is + FATAL enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of the + additivity flag. + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + The message object to log. + + + + + + Log a message object with the level including + the stack trace of the passed + as a parameter. + + The message object to log. + The exception to log, including its stack trace. + + + See the form for more detailed information. + + + + + + + Log a formatted message string with the level. + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Logs a formatted message string with the level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the String.Format method. See + for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + + + Checks if this logger is enabled for the level. + + + true if this logger is enabled for events, false otherwise. + + + + This function is intended to lessen the computational cost of + disabled log debug statements. + + For some ILog interface log, when you write: + + log.Debug("This is entry number: " + i ); + + + You incur the cost constructing the message, string construction and concatenation in + this case, regardless of whether the message is logged or not. + + + If you are worried about speed (who isn't), then you should write: + + + if (log.IsDebugEnabled) + { + log.Debug("This is entry number: " + i ); + } + + + This way you will not incur the cost of parameter + construction if debugging is disabled for log. On + the other hand, if the log is debug enabled, you + will incur the cost of evaluating whether the logger is debug + enabled twice. Once in and once in + the . This is an insignificant overhead + since evaluating a logger takes about 1% of the time it + takes to actually log. This is the preferred style of logging. + + Alternatively if your logger is available statically then the is debug + enabled state can be stored in a static variable like this: + + + private static readonly bool isDebugEnabled = log.IsDebugEnabled; + + + Then when you come to log you can write: + + + if (isDebugEnabled) + { + log.Debug("This is entry number: " + i ); + } + + + This way the debug enabled state is only queried once + when the class is loaded. Using a private static readonly + variable is the most efficient because it is a run time constant + and can be heavily optimized by the JIT compiler. + + + Of course if you use a static readonly variable to + hold the enabled state of the logger then you cannot + change the enabled state at runtime to vary the logging + that is produced. You have to decide if you need absolute + speed or runtime flexibility. + + + + + + + + Checks if this logger is enabled for the level. + + + true if this logger is enabled for events, false otherwise. + + + For more information see . + + + + + + + + Checks if this logger is enabled for the level. + + + true if this logger is enabled for events, false otherwise. + + + For more information see . + + + + + + + + Checks if this logger is enabled for the level. + + + true if this logger is enabled for events, false otherwise. + + + For more information see . + + + + + + + + Checks if this logger is enabled for the level. + + + true if this logger is enabled for events, false otherwise. + + + For more information see . + + + + + + + + Construct a new wrapper for the specified logger. + + The logger to wrap. + + + Construct a new wrapper for the specified logger. + + + + + + Virtual method called when the configuration of the repository changes + + the repository holding the levels + + + Virtual method called when the configuration of the repository changes + + + + + + Logs a message object with the DEBUG level. + + The message object to log. + + + This method first checks if this logger is DEBUG + enabled by comparing the level of this logger with the + DEBUG level. If this logger is + DEBUG enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of the + additivity flag. + + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + Logs a message object with the DEBUG level + + The message object to log. + The exception to log, including its stack trace. + + + Logs a message object with the DEBUG level including + the stack trace of the passed + as a parameter. + + + See the form for more detailed information. + + + + + + + Logs a formatted message string with the DEBUG level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the DEBUG level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the DEBUG level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the DEBUG level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the DEBUG level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a message object with the INFO level. + + The message object to log. + + + This method first checks if this logger is INFO + enabled by comparing the level of this logger with the + INFO level. If this logger is + INFO enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger + and also higher in the hierarchy depending on the value of + the additivity flag. + + + WARNING Note that passing an + to this method will print the name of the + but no stack trace. To print a stack trace use the + form instead. + + + + + + Logs a message object with the INFO level. + + The message object to log. + The exception to log, including its stack trace. + + + Logs a message object with the INFO level including + the stack trace of the + passed as a parameter. + + + See the form for more detailed information. + + + + + + + Logs a formatted message string with the INFO level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the INFO level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the INFO level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the INFO level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the INFO level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a message object with the WARN level. + + the message object to log + + + This method first checks if this logger is WARN + enabled by comparing the level of this logger with the + WARN level. If this logger is + WARN enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger and + also higher in the hierarchy depending on the value of the + additivity flag. + + + WARNING Note that passing an to this + method will print the name of the but no + stack trace. To print a stack trace use the + form instead. + + + + + + Logs a message object with the WARN level + + The message object to log. + The exception to log, including its stack trace. + + + Logs a message object with the WARN level including + the stack trace of the + passed as a parameter. + + + See the form for more detailed information. + + + + + + + Logs a formatted message string with the WARN level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the WARN level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the WARN level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the WARN level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the WARN level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a message object with the ERROR level. + + The message object to log. + + + This method first checks if this logger is ERROR + enabled by comparing the level of this logger with the + ERROR level. If this logger is + ERROR enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger and + also higher in the hierarchy depending on the value of the + additivity flag. + + + WARNING Note that passing an to this + method will print the name of the but no + stack trace. To print a stack trace use the + form instead. + + + + + + Logs a message object with the ERROR level + + The message object to log. + The exception to log, including its stack trace. + + + Logs a message object with the ERROR level including + the stack trace of the + passed as a parameter. + + + See the form for more detailed information. + + + + + + + Logs a formatted message string with the ERROR level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the ERROR level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the ERROR level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the ERROR level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the ERROR level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a message object with the FATAL level. + + The message object to log. + + + This method first checks if this logger is FATAL + enabled by comparing the level of this logger with the + FATAL level. If this logger is + FATAL enabled, then it converts the message object + (passed as parameter) to a string by invoking the appropriate + . It then + proceeds to call all the registered appenders in this logger and + also higher in the hierarchy depending on the value of the + additivity flag. + + + WARNING Note that passing an to this + method will print the name of the but no + stack trace. To print a stack trace use the + form instead. + + + + + + Logs a message object with the FATAL level + + The message object to log. + The exception to log, including its stack trace. + + + Logs a message object with the FATAL level including + the stack trace of the + passed as a parameter. + + + See the form for more detailed information. + + + + + + + Logs a formatted message string with the FATAL level. + + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the FATAL level. + + A String containing zero or more format items + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the FATAL level. + + A String containing zero or more format items + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the FATAL level. + + A String containing zero or more format items + An Object to format + An Object to format + An Object to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + The string is formatted using the + format provider. To specify a localized provider use the + method. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Logs a formatted message string with the FATAL level. + + An that supplies culture-specific formatting information + A String containing zero or more format items + An Object array containing zero or more objects to format + + + The message is formatted using the method. See + String.Format for details of the syntax of the format string and the behavior + of the formatting. + + + This method does not take an object to include in the + log event. To pass an use one of the + methods instead. + + + + + + Event handler for the event + + the repository + Empty + + + + The fully qualified name of this declaring type not the type of any subclass. + + + + + Checks if this logger is enabled for the DEBUG + level. + + + true if this logger is enabled for DEBUG events, + false otherwise. + + + + This function is intended to lessen the computational cost of + disabled log debug statements. + + + For some log Logger object, when you write: + + + log.Debug("This is entry number: " + i ); + + + You incur the cost constructing the message, concatenation in + this case, regardless of whether the message is logged or not. + + + If you are worried about speed, then you should write: + + + if (log.IsDebugEnabled()) + { + log.Debug("This is entry number: " + i ); + } + + + This way you will not incur the cost of parameter + construction if debugging is disabled for log. On + the other hand, if the log is debug enabled, you + will incur the cost of evaluating whether the logger is debug + enabled twice. Once in IsDebugEnabled and once in + the Debug. This is an insignificant overhead + since evaluating a logger takes about 1% of the time it + takes to actually log. + + + + + + Checks if this logger is enabled for the INFO level. + + + true if this logger is enabled for INFO events, + false otherwise. + + + + See for more information and examples + of using this method. + + + + + + + Checks if this logger is enabled for the WARN level. + + + true if this logger is enabled for WARN events, + false otherwise. + + + + See for more information and examples + of using this method. + + + + + + + Checks if this logger is enabled for the ERROR level. + + + true if this logger is enabled for ERROR events, + false otherwise. + + + + See for more information and examples of using this method. + + + + + + + Checks if this logger is enabled for the FATAL level. + + + true if this logger is enabled for FATAL events, + false otherwise. + + + + See for more information and examples of using this method. + + + + + + + A SecurityContext used by log4net when interacting with protected resources + + + + A SecurityContext used by log4net when interacting with protected resources + for example with operating system services. This can be used to impersonate + a principal that has been granted privileges on the system resources. + + + Nicko Cadell + + + + Impersonate this SecurityContext + + State supplied by the caller + An instance that will + revoke the impersonation of this SecurityContext, or null + + + Impersonate this security context. Further calls on the current + thread should now be made in the security context provided + by this object. When the result + method is called the security + context of the thread should be reverted to the state it was in + before was called. + + + + + + The providers default instances. + + + + A configured component that interacts with potentially protected system + resources uses a to provide the elevated + privileges required. If the object has + been not been explicitly provided to the component then the component + will request one from this . + + + By default the is + an instance of which returns only + objects. This is a reasonable default + where the privileges required are not know by the system. + + + This default behavior can be overridden by subclassing the + and overriding the method to return + the desired objects. The default provider + can be replaced by programmatically setting the value of the + property. + + + An alternative is to use the log4net.Config.SecurityContextProviderAttribute + This attribute can be applied to an assembly in the same way as the + log4net.Config.XmlConfiguratorAttribute". The attribute takes + the type to use as the as an argument. + + + Nicko Cadell + + + + The default provider + + + + + Protected default constructor to allow subclassing + + + + Protected default constructor to allow subclassing + + + + + + Create a SecurityContext for a consumer + + The consumer requesting the SecurityContext + An impersonation context + + + The default implementation is to return a . + + + Subclasses should override this method to provide their own + behavior. + + + + + + Gets or sets the default SecurityContextProvider + + + The default SecurityContextProvider + + + + The default provider is used by configured components that + require a and have not had one + given to them. + + + By default this is an instance of + that returns objects. + + + The default provider can be set programmatically by setting + the value of this property to a sub class of + that has the desired behavior. + + + + + + An evaluator that triggers after specified number of seconds. + + + + This evaluator will trigger if the specified time period + has passed since last check. + + + Robert Sevcik + + + + The default time threshold for triggering in seconds. Zero means it won't trigger at all. + + + + + The time threshold for triggering in seconds. Zero means it won't trigger at all. + + + + + The time of last check. This gets updated when the object is created and when the evaluator triggers. + + + + + Create a new evaluator using the time threshold in seconds. + + + + Create a new evaluator using the time threshold in seconds. + + + This evaluator will trigger if the specified time period + has passed since last check. + + + + + + Create a new evaluator using the specified time threshold in seconds. + + + The time threshold in seconds to trigger after. + Zero means it won't trigger at all. + + + + Create a new evaluator using the specified time threshold in seconds. + + + This evaluator will trigger if the specified time period + has passed since last check. + + + + + + Is this the triggering event? + + The event to check + This method returns true, if the specified time period + has passed since last check.. + Otherwise it returns false + + + This evaluator will trigger if the specified time period + has passed since last check. + + + + + + The time threshold in seconds to trigger after + + + The time threshold in seconds to trigger after. + Zero means it won't trigger at all. + + + + This evaluator will trigger if the specified time period + has passed since last check. + + + + + + Delegate used to handle creation of new wrappers. + + The logger to wrap in a wrapper. + + + Delegate used to handle creation of new wrappers. This delegate + is called from the + method to construct the wrapper for the specified logger. + + + The delegate to use is supplied to the + constructor. + + + + + + Maps between logger objects and wrapper objects. + + + + This class maintains a mapping between objects and + objects. Use the method to + lookup the for the specified . + + + New wrapper instances are created by the + method. The default behavior is for this method to delegate construction + of the wrapper to the delegate supplied + to the constructor. This allows specialization of the behavior without + requiring subclassing of this type. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the + + The handler to use to create the wrapper objects. + + + Initializes a new instance of the class with + the specified handler to create the wrapper objects. + + + + + + Gets the wrapper object for the specified logger. + + The wrapper object for the specified logger + + + If the logger is null then the corresponding wrapper is null. + + + Looks up the wrapper it it has previously been requested and + returns it. If the wrapper has never been requested before then + the virtual method is + called. + + + + + + Creates the wrapper object for the specified logger. + + The logger to wrap in a wrapper. + The wrapper object for the logger. + + + This implementation uses the + passed to the constructor to create the wrapper. This method + can be overridden in a subclass. + + + + + + Called when a monitored repository shutdown event is received. + + The that is shutting down + + + This method is called when a that this + is holding loggers for has signaled its shutdown + event . The default + behavior of this method is to release the references to the loggers + and their wrappers generated for this repository. + + + + + + Event handler for repository shutdown event. + + The sender of the event. + The event args. + + + + Map of logger repositories to hashtables of ILogger to ILoggerWrapper mappings + + + + + The handler to use to create the extension wrapper objects. + + + + + Internal reference to the delegate used to register for repository shutdown events. + + + + + Gets the map of logger repositories. + + + Map of logger repositories. + + + + Gets the hashtable that is keyed on . The + values are hashtables keyed on with the + value being the corresponding . + + + + + + Formats a as "HH:mm:ss,fff". + + + + Formats a in the format "HH:mm:ss,fff" for example, "15:49:37,459". + + + Nicko Cadell + Gert Driesen + + + + Render a as a string. + + + + Interface to abstract the rendering of a + instance into a string. + + + The method is used to render the + date to a text writer. + + + Nicko Cadell + Gert Driesen + + + + Formats the specified date as a string. + + The date to format. + The writer to write to. + + + Format the as a string and write it + to the provided. + + + + + + String constant used to specify AbsoluteTimeDateFormat in layouts. Current value is ABSOLUTE. + + + + + String constant used to specify DateTimeDateFormat in layouts. Current value is DATE. + + + + + String constant used to specify ISO8601DateFormat in layouts. Current value is ISO8601. + + + + + Renders the date into a string. Format is "HH:mm:ss". + + The date to render into a string. + The string builder to write to. + + + Subclasses should override this method to render the date + into a string using a precision up to the second. This method + will be called at most once per second and the result will be + reused if it is needed again during the same second. + + + + + + Renders the date into a string. Format is "HH:mm:ss,fff". + + The date to render into a string. + The writer to write to. + + + Uses the method to generate the + time string up to the seconds and then appends the current + milliseconds. The results from are + cached and is called at most once + per second. + + + Sub classes should override + rather than . + + + + + + Last stored time with precision up to the second. + + + + + Last stored time with precision up to the second, formatted + as a string. + + + + + Last stored time with precision up to the second, formatted + as a string. + + + + + Formats a as "dd MMM yyyy HH:mm:ss,fff" + + + + Formats a in the format + "dd MMM yyyy HH:mm:ss,fff" for example, + "06 Nov 1994 15:49:37,459". + + + Nicko Cadell + Gert Driesen + Angelika Schnagl + + + + Default constructor. + + + + Initializes a new instance of the class. + + + + + + Formats the date without the milliseconds part + + The date to format. + The string builder to write to. + + + Formats a DateTime in the format "dd MMM yyyy HH:mm:ss" + for example, "06 Nov 1994 15:49:37". + + + The base class will append the ",fff" milliseconds section. + This method will only be called at most once per second. + + + + + + The format info for the invariant culture. + + + + + Formats the as "yyyy-MM-dd HH:mm:ss,fff". + + + + Formats the specified as a string: "yyyy-MM-dd HH:mm:ss,fff". + + + Nicko Cadell + Gert Driesen + + + + Default constructor + + + + Initializes a new instance of the class. + + + + + + Formats the date without the milliseconds part + + The date to format. + The string builder to write to. + + + Formats the date specified as a string: "yyyy-MM-dd HH:mm:ss". + + + The base class will append the ",fff" milliseconds section. + This method will only be called at most once per second. + + + + + + Formats the using the method. + + + + Formats the using the method. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + The format string. + + + Initializes a new instance of the class + with the specified format string. + + + The format string must be compatible with the options + that can be supplied to . + + + + + + Formats the date using . + + The date to convert to a string. + The writer to write to. + + + Uses the date format string supplied to the constructor to call + the method to format the date. + + + + + + The format string used to format the . + + + + The format string must be compatible with the options + that can be supplied to . + + + + + + This filter drops all . + + + + You can add this filter to the end of a filter chain to + switch from the default "accept all unless instructed otherwise" + filtering behavior to a "deny all unless instructed otherwise" + behavior. + + + Nicko Cadell + Gert Driesen + + + + Subclass this type to implement customized logging event filtering + + + + Users should extend this class to implement customized logging + event filtering. Note that and + , the parent class of all standard + appenders, have built-in filtering rules. It is suggested that you + first use and understand the built-in rules before rushing to write + your own custom filters. + + + This abstract class assumes and also imposes that filters be + organized in a linear chain. The + method of each filter is called sequentially, in the order of their + addition to the chain. + + + The method must return one + of the integer constants , + or . + + + If the value is returned, then the log event is dropped + immediately without consulting with the remaining filters. + + + If the value is returned, then the next filter + in the chain is consulted. If there are no more filters in the + chain, then the log event is logged. Thus, in the presence of no + filters, the default behavior is to log all logging events. + + + If the value is returned, then the log + event is logged without consulting the remaining filters. + + + The philosophy of log4net filters is largely inspired from the + Linux ipchains. + + + Nicko Cadell + Gert Driesen + + + + Implement this interface to provide customized logging event filtering + + + + Users should implement this interface to implement customized logging + event filtering. Note that and + , the parent class of all standard + appenders, have built-in filtering rules. It is suggested that you + first use and understand the built-in rules before rushing to write + your own custom filters. + + + This abstract class assumes and also imposes that filters be + organized in a linear chain. The + method of each filter is called sequentially, in the order of their + addition to the chain. + + + The method must return one + of the integer constants , + or . + + + If the value is returned, then the log event is dropped + immediately without consulting with the remaining filters. + + + If the value is returned, then the next filter + in the chain is consulted. If there are no more filters in the + chain, then the log event is logged. Thus, in the presence of no + filters, the default behavior is to log all logging events. + + + If the value is returned, then the log + event is logged without consulting the remaining filters. + + + The philosophy of log4net filters is largely inspired from the + Linux ipchains. + + + Nicko Cadell + Gert Driesen + + + + Decide if the logging event should be logged through an appender. + + The LoggingEvent to decide upon + The decision of the filter + + + If the decision is , then the event will be + dropped. If the decision is , then the next + filter, if any, will be invoked. If the decision is then + the event will be logged without consulting with other filters in + the chain. + + + + + + Property to get and set the next filter + + + The next filter in the chain + + + + Filters are typically composed into chains. This property allows the next filter in + the chain to be accessed. + + + + + + Points to the next filter in the filter chain. + + + + See for more information. + + + + + + Initialize the filter with the options set + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + Typically filter's options become active immediately on set, + however this method must still be called. + + + + + + Decide if the should be logged through an appender. + + The to decide upon + The decision of the filter + + + If the decision is , then the event will be + dropped. If the decision is , then the next + filter, if any, will be invoked. If the decision is then + the event will be logged without consulting with other filters in + the chain. + + + This method is marked abstract and must be implemented + in a subclass. + + + + + + Property to get and set the next filter + + + The next filter in the chain + + + + Filters are typically composed into chains. This property allows the next filter in + the chain to be accessed. + + + + + + Default constructor + + + + + Always returns the integer constant + + the LoggingEvent to filter + Always returns + + + Ignores the event being logged and just returns + . This can be used to change the default filter + chain behavior from to . This filter + should only be used as the last filter in the chain + as any further filters will be ignored! + + + + + + The return result from + + + + The return result from + + + + + + The log event must be dropped immediately without + consulting with the remaining filters, if any, in the chain. + + + + + This filter is neutral with respect to the log event. + The remaining filters, if any, should be consulted for a final decision. + + + + + The log event must be logged immediately without + consulting with the remaining filters, if any, in the chain. + + + + + This is a very simple filter based on matching. + + + + The filter admits two options and + . If there is an exact match between the value + of the option and the of the + , then the method returns in + case the option value is set + to true, if it is false then + is returned. If the does not match then + the result will be . + + + Nicko Cadell + Gert Driesen + + + + flag to indicate if the filter should on a match + + + + + the to match against + + + + + Default constructor + + + + + Tests if the of the logging event matches that of the filter + + the event to filter + see remarks + + + If the of the event matches the level of the + filter then the result of the function depends on the + value of . If it is true then + the function will return , it it is false then it + will return . If the does not match then + the result will be . + + + + + + when matching + + + + The property is a flag that determines + the behavior when a matching is found. If the + flag is set to true then the filter will the + logging event, otherwise it will the event. + + + The default is true i.e. to the event. + + + + + + The that the filter will match + + + + The level that this filter will attempt to match against the + level. If a match is found then + the result depends on the value of . + + + + + + This is a simple filter based on matching. + + + + The filter admits three options and + that determine the range of priorities that are matched, and + . If there is a match between the range + of priorities and the of the , then the + method returns in case the + option value is set to true, if it is false + then is returned. If there is no match, is returned. + + + Nicko Cadell + Gert Driesen + + + + Flag to indicate the behavior when matching a + + + + + the minimum value to match + + + + + the maximum value to match + + + + + Default constructor + + + + + Check if the event should be logged. + + the logging event to check + see remarks + + + If the of the logging event is outside the range + matched by this filter then + is returned. If the is matched then the value of + is checked. If it is true then + is returned, otherwise + is returned. + + + + + + when matching and + + + + The property is a flag that determines + the behavior when a matching is found. If the + flag is set to true then the filter will the + logging event, otherwise it will the event. + + + The default is true i.e. to the event. + + + + + + Set the minimum matched + + + + The minimum level that this filter will attempt to match against the + level. If a match is found then + the result depends on the value of . + + + + + + Sets the maximum matched + + + + The maximum level that this filter will attempt to match against the + level. If a match is found then + the result depends on the value of . + + + + + + Simple filter to match a string in the event's logger name. + + + + The works very similar to the . It admits two + options and . If the + of the starts + with the value of the option, then the + method returns in + case the option value is set to true, + if it is false then is returned. + + + Daniel Cazzulino + + + + Flag to indicate the behavior when we have a match + + + + + The logger name string to substring match against the event + + + + + Default constructor + + + + + Check if this filter should allow the event to be logged + + the event being logged + see remarks + + + The rendered message is matched against the . + If the equals the beginning of + the incoming () + then a match will have occurred. If no match occurs + this function will return + allowing other filters to check the event. If a match occurs then + the value of is checked. If it is + true then is returned otherwise + is returned. + + + + + + when matching + + + + The property is a flag that determines + the behavior when a matching is found. If the + flag is set to true then the filter will the + logging event, otherwise it will the event. + + + The default is true i.e. to the event. + + + + + + The that the filter will match + + + + This filter will attempt to match this value against logger name in + the following way. The match will be done against the beginning of the + logger name (using ). The match is + case sensitive. If a match is found then + the result depends on the value of . + + + + + + Simple filter to match a keyed string in the + + + + Simple filter to match a keyed string in the + + + As the MDC has been replaced with layered properties the + should be used instead. + + + Nicko Cadell + Gert Driesen + + + + Simple filter to match a string an event property + + + + Simple filter to match a string in the value for a + specific event property + + + Nicko Cadell + + + + Simple filter to match a string in the rendered message + + + + Simple filter to match a string in the rendered message + + + Nicko Cadell + Gert Driesen + + + + Flag to indicate the behavior when we have a match + + + + + The string to substring match against the message + + + + + A string regex to match + + + + + A regex object to match (generated from m_stringRegexToMatch) + + + + + Default constructor + + + + + Initialize and precompile the Regex if required + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Check if this filter should allow the event to be logged + + the event being logged + see remarks + + + The rendered message is matched against the . + If the occurs as a substring within + the message then a match will have occurred. If no match occurs + this function will return + allowing other filters to check the event. If a match occurs then + the value of is checked. If it is + true then is returned otherwise + is returned. + + + + + + when matching or + + + + The property is a flag that determines + the behavior when a matching is found. If the + flag is set to true then the filter will the + logging event, otherwise it will the event. + + + The default is true i.e. to the event. + + + + + + Sets the static string to match + + + + The string that will be substring matched against + the rendered message. If the message contains this + string then the filter will match. If a match is found then + the result depends on the value of . + + + One of or + must be specified. + + + + + + Sets the regular expression to match + + + + The regular expression pattern that will be matched against + the rendered message. If the message matches this + pattern then the filter will match. If a match is found then + the result depends on the value of . + + + One of or + must be specified. + + + + + + The key to use to lookup the string from the event properties + + + + + Default constructor + + + + + Check if this filter should allow the event to be logged + + the event being logged + see remarks + + + The event property for the is matched against + the . + If the occurs as a substring within + the property value then a match will have occurred. If no match occurs + this function will return + allowing other filters to check the event. If a match occurs then + the value of is checked. If it is + true then is returned otherwise + is returned. + + + + + + The key to lookup in the event properties and then match against. + + + + The key name to use to lookup in the properties map of the + . The match will be performed against + the value of this property if it exists. + + + + + + Simple filter to match a string in the + + + + Simple filter to match a string in the + + + As the MDC has been replaced with named stacks stored in the + properties collections the should + be used instead. + + + Nicko Cadell + Gert Driesen + + + + Default constructor + + + + Sets the to "NDC". + + + + + + Write the event appdomain name to the output + + + + Writes the to the output writer. + + + Daniel Cazzulino + Nicko Cadell + + + + Abstract class that provides the formatting functionality that + derived classes need. + + + Conversion specifiers in a conversion patterns are parsed to + individual PatternConverters. Each of which is responsible for + converting a logging event in a converter specific manner. + + Nicko Cadell + + + + Abstract class that provides the formatting functionality that + derived classes need. + + + + Conversion specifiers in a conversion patterns are parsed to + individual PatternConverters. Each of which is responsible for + converting a logging event in a converter specific manner. + + + Nicko Cadell + Gert Driesen + + + + Initial buffer size + + + + + Maximum buffer size before it is recycled + + + + + Protected constructor + + + + Initializes a new instance of the class. + + + + + + Evaluate this pattern converter and write the output to a writer. + + that will receive the formatted result. + The state object on which the pattern converter should be executed. + + + Derived pattern converters must override this method in order to + convert conversion specifiers in the appropriate way. + + + + + + Set the next pattern converter in the chains + + the pattern converter that should follow this converter in the chain + the next converter + + + The PatternConverter can merge with its neighbor during this method (or a sub class). + Therefore the return value may or may not be the value of the argument passed in. + + + + + + Write the pattern converter to the writer with appropriate formatting + + that will receive the formatted result. + The state object on which the pattern converter should be executed. + + + This method calls to allow the subclass to perform + appropriate conversion of the pattern converter. If formatting options have + been specified via the then this method will + apply those formattings before writing the output. + + + + + + Fast space padding method. + + to which the spaces will be appended. + The number of spaces to be padded. + + + Fast space padding method. + + + + + + The option string to the converter + + + + + Write an dictionary to a + + the writer to write to + a to use for object conversion + the value to write to the writer + + + Writes the to a writer in the form: + + + {key1=value1, key2=value2, key3=value3} + + + If the specified + is not null then it is used to render the key and value to text, otherwise + the object's ToString method is called. + + + + + + Write an dictionary to a + + the writer to write to + a to use for object conversion + the value to write to the writer + + + Writes the to a writer in the form: + + + {key1=value1, key2=value2, key3=value3} + + + If the specified + is not null then it is used to render the key and value to text, otherwise + the object's ToString method is called. + + + + + + Write an object to a + + the writer to write to + a to use for object conversion + the value to write to the writer + + + Writes the Object to a writer. If the specified + is not null then it is used to render the object to text, otherwise + the object's ToString method is called. + + + + + + Get the next pattern converter in the chain + + + the next pattern converter in the chain + + + + Get the next pattern converter in the chain + + + + + + Gets or sets the formatting info for this converter + + + The formatting info for this converter + + + + Gets or sets the formatting info for this converter + + + + + + Gets or sets the option value for this converter + + + The option for this converter + + + + Gets or sets the option value for this converter + + + + + + + + + + + Initializes a new instance of the class. + + + + + Derived pattern converters must override this method in order to + convert conversion specifiers in the correct way. + + that will receive the formatted result. + The on which the pattern converter should be executed. + + + + Derived pattern converters must override this method in order to + convert conversion specifiers in the correct way. + + that will receive the formatted result. + The state object on which the pattern converter should be executed. + + + + Flag indicating if this converter handles exceptions + + + false if this converter handles exceptions + + + + + Flag indicating if this converter handles the logging event exception + + false if this converter handles the logging event exception + + + If this converter handles the exception object contained within + , then this property should be set to + false. Otherwise, if the layout ignores the exception + object, then the property should be set to true. + + + Set this value to override a this default setting. The default + value is true, this converter does not handle the exception. + + + + + + Write the event appdomain name to the output + + that will receive the formatted result. + the event being logged + + + Writes the to the output . + + + + + + Converter for items in the ASP.Net Cache. + + + + Outputs an item from the . + + + Ron Grabowski + + + + Abstract class that provides access to the current HttpContext () that + derived classes need. + + + This class handles the case when HttpContext.Current is null by writing + to the writer. + + Ron Grabowski + + + + Derived pattern converters must override this method in order to + convert conversion specifiers in the correct way. + + that will receive the formatted result. + The on which the pattern converter should be executed. + The under which the ASP.Net request is running. + + + + Write the ASP.Net Cache item to the output + + that will receive the formatted result. + The on which the pattern converter should be executed. + The under which the ASP.Net request is running. + + + Writes out the value of a named property. The property name + should be set in the + property. If no property has been set, all key value pairs from the Cache will + be written to the output. + + + + + + Converter for items in the . + + + + Outputs an item from the . + + + Ron Grabowski + + + + Write the ASP.Net HttpContext item to the output + + that will receive the formatted result. + The on which the pattern converter should be executed. + The under which the ASP.Net request is running. + + + Writes out the value of a named property. The property name + should be set in the + property. + + + + + + Converter for items in the ASP.Net Cache. + + + + Outputs an item from the . + + + Ron Grabowski + + + + Write the ASP.Net Cache item to the output + + that will receive the formatted result. + The on which the pattern converter should be executed. + The under which the ASP.Net request is running. + + + Writes out the value of a named property. The property name + should be set in the + property. + + + + + + Converter for items in the ASP.Net Cache. + + + + Outputs an item from the . + + + Ron Grabowski + + + + Write the ASP.Net Cache item to the output + + that will receive the formatted result. + The on which the pattern converter should be executed. + The under which the ASP.Net request is running. + + + Writes out the value of a named property. The property name + should be set in the + property. If no property has been set, all key value pairs from the Session will + be written to the output. + + + + + + Date pattern converter, uses a to format + the date of a . + + + + Render the to the writer as a string. + + + The value of the determines + the formatting of the date. The following values are allowed: + + + Option value + Output + + + ISO8601 + + Uses the formatter. + Formats using the "yyyy-MM-dd HH:mm:ss,fff" pattern. + + + + DATE + + Uses the formatter. + Formats using the "dd MMM yyyy HH:mm:ss,fff" for example, "06 Nov 1994 15:49:37,459". + + + + ABSOLUTE + + Uses the formatter. + Formats using the "HH:mm:ss,yyyy" for example, "15:49:37,459". + + + + other + + Any other pattern string uses the formatter. + This formatter passes the pattern string to the + method. + For details on valid patterns see + DateTimeFormatInfo Class. + + + + + + The is in the local time zone and is rendered in that zone. + To output the time in Universal time see . + + + Nicko Cadell + + + + The used to render the date to a string + + + + The used to render the date to a string + + + + + + Initialize the converter pattern based on the property. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Convert the pattern into the rendered message + + that will receive the formatted result. + the event being logged + + + Pass the to the + for it to render it to the writer. + + + The passed is in the local time zone. + + + + + + The fully qualified type of the DatePatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Write the exception text to the output + + + + If an exception object is stored in the logging event + it will be rendered into the pattern output with a + trailing newline. + + + If there is no exception then nothing will be output + and no trailing newline will be appended. + It is typical to put a newline before the exception + and to have the exception as the last data in the pattern. + + + Nicko Cadell + + + + Default constructor + + + + + Write the exception text to the output + + that will receive the formatted result. + the event being logged + + + If an exception object is stored in the logging event + it will be rendered into the pattern output with a + trailing newline. + + + If there is no exception or the exception property specified + by the Option value does not exist then nothing will be output + and no trailing newline will be appended. + It is typical to put a newline before the exception + and to have the exception as the last data in the pattern. + + + Recognized values for the Option parameter are: + + + + Message + + + Source + + + StackTrace + + + TargetSite + + + HelpLink + + + + + + + Writes the caller location file name to the output + + + + Writes the value of the for + the event to the output writer. + + + Nicko Cadell + + + + Write the caller location file name to the output + + that will receive the formatted result. + the event being logged + + + Writes the value of the for + the to the output . + + + + + + Write the caller location info to the output + + + + Writes the to the output writer. + + + Nicko Cadell + + + + Write the caller location info to the output + + that will receive the formatted result. + the event being logged + + + Writes the to the output writer. + + + + + + Writes the event identity to the output + + + + Writes the value of the to + the output writer. + + + Daniel Cazzulino + Nicko Cadell + + + + Writes the event identity to the output + + that will receive the formatted result. + the event being logged + + + Writes the value of the + to + the output . + + + + + + Write the event level to the output + + + + Writes the display name of the event + to the writer. + + + Nicko Cadell + + + + Write the event level to the output + + that will receive the formatted result. + the event being logged + + + Writes the of the + to the . + + + + + + Write the caller location line number to the output + + + + Writes the value of the for + the event to the output writer. + + + Nicko Cadell + + + + Write the caller location line number to the output + + that will receive the formatted result. + the event being logged + + + Writes the value of the for + the to the output . + + + + + + Converter for logger name + + + + Outputs the of the event. + + + Nicko Cadell + + + + Converter to output and truncate '.' separated strings + + + + This abstract class supports truncating a '.' separated string + to show a specified number of elements from the right hand side. + This is used to truncate class names that are fully qualified. + + + Subclasses should override the method to + return the fully qualified string. + + + Nicko Cadell + + + + Initialize the converter + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Get the fully qualified string data + + the event being logged + the fully qualified name + + + Overridden by subclasses to get the fully qualified name before the + precision is applied to it. + + + Return the fully qualified '.' (dot/period) separated string. + + + + + + Convert the pattern to the rendered message + + that will receive the formatted result. + the event being logged + + Render the to the precision + specified by the property. + + + + + The fully qualified type of the NamedPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets the fully qualified name of the logger + + the event being logged + The fully qualified logger name + + + Returns the of the . + + + + + + Writes the event message to the output + + + + Uses the method + to write out the event message. + + + Nicko Cadell + + + + Writes the event message to the output + + that will receive the formatted result. + the event being logged + + + Uses the method + to write out the event message. + + + + + + Write the method name to the output + + + + Writes the caller location to + the output. + + + Nicko Cadell + + + + Write the method name to the output + + that will receive the formatted result. + the event being logged + + + Writes the caller location to + the output. + + + + + + Converter to include event NDC + + + + Outputs the value of the event property named NDC. + + + The should be used instead. + + + Nicko Cadell + + + + Write the event NDC to the output + + that will receive the formatted result. + the event being logged + + + As the thread context stacks are now stored in named event properties + this converter simply looks up the value of the NDC property. + + + The should be used instead. + + + + + + Property pattern converter + + + + Writes out the value of a named property. The property name + should be set in the + property. + + + If the is set to null + then all the properties are written as key value pairs. + + + Nicko Cadell + + + + Write the property value to the output + + that will receive the formatted result. + the event being logged + + + Writes out the value of a named property. The property name + should be set in the + property. + + + If the is set to null + then all the properties are written as key value pairs. + + + + + + Converter to output the relative time of the event + + + + Converter to output the time of the event relative to the start of the program. + + + Nicko Cadell + + + + Write the relative time to the output + + that will receive the formatted result. + the event being logged + + + Writes out the relative time of the event in milliseconds. + That is the number of milliseconds between the event + and the . + + + + + + Helper method to get the time difference between two DateTime objects + + start time (in the current local time zone) + end time (in the current local time zone) + the time difference in milliseconds + + + + Write the caller stack frames to the output + + + + Writes the to the output writer, using format: + type3.MethodCall3(type param,...) > type2.MethodCall2(type param,...) > type1.MethodCall1(type param,...) + + + Adam Davies + + + + Write the caller stack frames to the output + + + + Writes the to the output writer, using format: + type3.MethodCall3 > type2.MethodCall2 > type1.MethodCall1 + + + Michael Cromwell + + + + Initialize the converter + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Write the strack frames to the output + + that will receive the formatted result. + the event being logged + + + Writes the to the output writer. + + + + + + Returns the Name of the method + + + This method was created, so this class could be used as a base class for StackTraceDetailPatternConverter + string + + + + The fully qualified type of the StackTracePatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + The fully qualified type of the StackTraceDetailPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Converter to include event thread name + + + + Writes the to the output. + + + Nicko Cadell + + + + Write the ThreadName to the output + + that will receive the formatted result. + the event being logged + + + Writes the to the . + + + + + + Pattern converter for the class name + + + + Outputs the of the event. + + + Nicko Cadell + + + + Gets the fully qualified name of the class + + the event being logged + The fully qualified type name for the caller location + + + Returns the of the . + + + + + + Converter to include event user name + + Douglas de la Torre + Nicko Cadell + + + + Convert the pattern to the rendered message + + that will receive the formatted result. + the event being logged + + + + Write the TimeStamp to the output + + + + Date pattern converter, uses a to format + the date of a . + + + Uses a to format the + in Universal time. + + + See the for details on the date pattern syntax. + + + + Nicko Cadell + + + + Write the TimeStamp to the output + + that will receive the formatted result. + the event being logged + + + Pass the to the + for it to render it to the writer. + + + The passed is in the local time zone, this is converted + to Universal time before it is rendered. + + + + + + + The fully qualified type of the UtcDatePatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + A Layout that renders only the Exception text from the logging event + + + + A Layout that renders only the Exception text from the logging event. + + + This Layout should only be used with appenders that utilize multiple + layouts (e.g. ). + + + Nicko Cadell + Gert Driesen + + + + Extend this abstract class to create your own log layout format. + + + + This is the base implementation of the + interface. Most layout objects should extend this class. + + + + + + Subclasses must implement the + method. + + + Subclasses should set the in their default + constructor. + + + + Nicko Cadell + Gert Driesen + + + + Interface implemented by layout objects + + + + An object is used to format a + as text. The method is called by an + appender to transform the into a string. + + + The layout can also supply and + text that is appender before any events and after all the events respectively. + + + Nicko Cadell + Gert Driesen + + + + Implement this method to create your own layout format. + + The TextWriter to write the formatted event to + The event to format + + + This method is called by an appender to format + the as text and output to a writer. + + + If the caller does not have a and prefers the + event to be formatted as a then the following + code can be used to format the event into a . + + + StringWriter writer = new StringWriter(); + Layout.Format(writer, loggingEvent); + string formattedEvent = writer.ToString(); + + + + + + The content type output by this layout. + + The content type + + + The content type output by this layout. + + + This is a MIME type e.g. "text/plain". + + + + + + The header for the layout format. + + the layout header + + + The Header text will be appended before any logging events + are formatted and appended. + + + + + + The footer for the layout format. + + the layout footer + + + The Footer text will be appended after all the logging events + have been formatted and appended. + + + + + + Flag indicating if this layout handle exceptions + + false if this layout handles exceptions + + + If this layout handles the exception object contained within + , then the layout should return + false. Otherwise, if the layout ignores the exception + object, then the layout should return true. + + + + + + The header text + + + + See for more information. + + + + + + The footer text + + + + See for more information. + + + + + + Flag indicating if this layout handles exceptions + + + + false if this layout handles exceptions + + + + + + Empty default constructor + + + + Empty default constructor + + + + + + Activate component options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + This method must be implemented by the subclass. + + + + + + Implement this method to create your own layout format. + + The TextWriter to write the formatted event to + The event to format + + + This method is called by an appender to format + the as text. + + + + + + Convenience method for easily formatting the logging event into a string variable. + + + + Creates a new StringWriter instance to store the formatted logging event. + + + + + The content type output by this layout. + + The content type is "text/plain" + + + The content type output by this layout. + + + This base class uses the value "text/plain". + To change this value a subclass must override this + property. + + + + + + The header for the layout format. + + the layout header + + + The Header text will be appended before any logging events + are formatted and appended. + + + + + + The footer for the layout format. + + the layout footer + + + The Footer text will be appended after all the logging events + have been formatted and appended. + + + + + + Flag indicating if this layout handles exceptions + + false if this layout handles exceptions + + + If this layout handles the exception object contained within + , then the layout should return + false. Otherwise, if the layout ignores the exception + object, then the layout should return true. + + + Set this value to override a this default setting. The default + value is true, this layout does not handle the exception. + + + + + + Default constructor + + + + Constructs a ExceptionLayout + + + + + + Activate component options + + + + Part of the component activation + framework. + + + This method does nothing as options become effective immediately. + + + + + + Gets the exception text from the logging event + + The TextWriter to write the formatted event to + the event being logged + + + Write the exception string to the . + The exception string is retrieved from . + + + + + + Interface for raw layout objects + + + + Interface used to format a + to an object. + + + This interface should not be confused with the + interface. This interface is used in + only certain specialized situations where a raw object is + required rather than a formatted string. The + is not generally useful than this interface. + + + Nicko Cadell + Gert Driesen + + + + Implement this method to create your own layout format. + + The event to format + returns the formatted event + + + Implement this method to create your own layout format. + + + + + + Adapts any to a + + + + Where an is required this adapter + allows a to be specified. + + + Nicko Cadell + Gert Driesen + + + + The layout to adapt + + + + + Construct a new adapter + + the layout to adapt + + + Create the adapter for the specified . + + + + + + Format the logging event as an object. + + The event to format + returns the formatted event + + + Format the logging event as an object. + + + Uses the object supplied to + the constructor to perform the formatting. + + + + + + A flexible layout configurable with pattern string. + + + + The goal of this class is to a + as a string. The results + depend on the conversion pattern. + + + The conversion pattern is closely related to the conversion + pattern of the printf function in C. A conversion pattern is + composed of literal text and format control expressions called + conversion specifiers. + + + You are free to insert any literal text within the conversion + pattern. + + + Each conversion specifier starts with a percent sign (%) and is + followed by optional format modifiers and a conversion + pattern name. The conversion pattern name specifies the type of + data, e.g. logger, level, date, thread name. The format + modifiers control such things as field width, padding, left and + right justification. The following is a simple example. + + + Let the conversion pattern be "%-5level [%thread]: %message%newline" and assume + that the log4net environment was set to use a PatternLayout. Then the + statements + + + ILog log = LogManager.GetLogger(typeof(TestApp)); + log.Debug("Message 1"); + log.Warn("Message 2"); + + would yield the output + + DEBUG [main]: Message 1 + WARN [main]: Message 2 + + + Note that there is no explicit separator between text and + conversion specifiers. The pattern parser knows when it has reached + the end of a conversion specifier when it reads a conversion + character. In the example above the conversion specifier + %-5level means the level of the logging event should be left + justified to a width of five characters. + + + The recognized conversion pattern names are: + + + + Conversion Pattern Name + Effect + + + a + Equivalent to appdomain + + + appdomain + + Used to output the friendly name of the AppDomain where the + logging event was generated. + + + + aspnet-cache + + + Used to output all cache items in the case of %aspnet-cache or just one named item if used as %aspnet-cache{key} + + + This pattern is not available for Compact Framework or Client Profile assemblies. + + + + + aspnet-context + + + Used to output all context items in the case of %aspnet-context or just one named item if used as %aspnet-context{key} + + + This pattern is not available for Compact Framework or Client Profile assemblies. + + + + + aspnet-request + + + Used to output all request parameters in the case of %aspnet-request or just one named param if used as %aspnet-request{key} + + + This pattern is not available for Compact Framework or Client Profile assemblies. + + + + + aspnet-session + + + Used to output all session items in the case of %aspnet-session or just one named item if used as %aspnet-session{key} + + + This pattern is not available for Compact Framework or Client Profile assemblies. + + + + + c + Equivalent to logger + + + C + Equivalent to type + + + class + Equivalent to type + + + d + Equivalent to date + + + date + + + Used to output the date of the logging event in the local time zone. + To output the date in universal time use the %utcdate pattern. + The date conversion + specifier may be followed by a date format specifier enclosed + between braces. For example, %date{HH:mm:ss,fff} or + %date{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is + given then ISO8601 format is + assumed (). + + + The date format specifier admits the same syntax as the + time pattern string of the . + + + For better results it is recommended to use the log4net date + formatters. These can be specified using one of the strings + "ABSOLUTE", "DATE" and "ISO8601" for specifying + , + and respectively + . For example, + %date{ISO8601} or %date{ABSOLUTE}. + + + These dedicated date formatters perform significantly + better than . + + + + + exception + + + Used to output the exception passed in with the log message. + + + If an exception object is stored in the logging event + it will be rendered into the pattern output with a + trailing newline. + If there is no exception then nothing will be output + and no trailing newline will be appended. + It is typical to put a newline before the exception + and to have the exception as the last data in the pattern. + + + + + F + Equivalent to file + + + file + + + Used to output the file name where the logging request was + issued. + + + WARNING Generating caller location information is + extremely slow. Its use should be avoided unless execution speed + is not an issue. + + + See the note below on the availability of caller location information. + + + + + identity + + + Used to output the user name for the currently active user + (Principal.Identity.Name). + + + WARNING Generating caller information is + extremely slow. Its use should be avoided unless execution speed + is not an issue. + + + + + l + Equivalent to location + + + L + Equivalent to line + + + location + + + Used to output location information of the caller which generated + the logging event. + + + The location information depends on the CLI implementation but + usually consists of the fully qualified name of the calling + method followed by the callers source the file name and line + number between parentheses. + + + The location information can be very useful. However, its + generation is extremely slow. Its use should be avoided + unless execution speed is not an issue. + + + See the note below on the availability of caller location information. + + + + + level + + + Used to output the level of the logging event. + + + + + line + + + Used to output the line number from where the logging request + was issued. + + + WARNING Generating caller location information is + extremely slow. Its use should be avoided unless execution speed + is not an issue. + + + See the note below on the availability of caller location information. + + + + + logger + + + Used to output the logger of the logging event. The + logger conversion specifier can be optionally followed by + precision specifier, that is a decimal constant in + brackets. + + + If a precision specifier is given, then only the corresponding + number of right most components of the logger name will be + printed. By default the logger name is printed in full. + + + For example, for the logger name "a.b.c" the pattern + %logger{2} will output "b.c". + + + + + m + Equivalent to message + + + M + Equivalent to method + + + message + + + Used to output the application supplied message associated with + the logging event. + + + + + mdc + + + The MDC (old name for the ThreadContext.Properties) is now part of the + combined event properties. This pattern is supported for compatibility + but is equivalent to property. + + + + + method + + + Used to output the method name where the logging request was + issued. + + + WARNING Generating caller location information is + extremely slow. Its use should be avoided unless execution speed + is not an issue. + + + See the note below on the availability of caller location information. + + + + + n + Equivalent to newline + + + newline + + + Outputs the platform dependent line separator character or + characters. + + + This conversion pattern offers the same performance as using + non-portable line separator strings such as "\n", or "\r\n". + Thus, it is the preferred way of specifying a line separator. + + + + + ndc + + + Used to output the NDC (nested diagnostic context) associated + with the thread that generated the logging event. + + + + + p + Equivalent to level + + + P + Equivalent to property + + + properties + Equivalent to property + + + property + + + Used to output the an event specific property. The key to + lookup must be specified within braces and directly following the + pattern specifier, e.g. %property{user} would include the value + from the property that is keyed by the string 'user'. Each property value + that is to be included in the log must be specified separately. + Properties are added to events by loggers or appenders. By default + the log4net:HostName property is set to the name of machine on + which the event was originally logged. + + + If no key is specified, e.g. %property then all the keys and their + values are printed in a comma separated list. + + + The properties of an event are combined from a number of different + contexts. These are listed below in the order in which they are searched. + + + + the event properties + + The event has that can be set. These + properties are specific to this event only. + + + + the thread properties + + The that are set on the current + thread. These properties are shared by all events logged on this thread. + + + + the global properties + + The that are set globally. These + properties are shared by all the threads in the AppDomain. + + + + + + + + r + Equivalent to timestamp + + + stacktrace + + + Used to output the stack trace of the logging event + The stack trace level specifier may be enclosed + between braces. For example, %stacktrace{level}. + If no stack trace level specifier is given then 1 is assumed + + + Output uses the format: + type3.MethodCall3 > type2.MethodCall2 > type1.MethodCall1 + + + This pattern is not available for Compact Framework assemblies. + + + + + stacktracedetail + + + Used to output the stack trace of the logging event + The stack trace level specifier may be enclosed + between braces. For example, %stacktracedetail{level}. + If no stack trace level specifier is given then 1 is assumed + + + Output uses the format: + type3.MethodCall3(type param,...) > type2.MethodCall2(type param,...) > type1.MethodCall1(type param,...) + + + This pattern is not available for Compact Framework assemblies. + + + + + t + Equivalent to thread + + + timestamp + + + Used to output the number of milliseconds elapsed since the start + of the application until the creation of the logging event. + + + + + thread + + + Used to output the name of the thread that generated the + logging event. Uses the thread number if no name is available. + + + + + type + + + Used to output the fully qualified type name of the caller + issuing the logging request. This conversion specifier + can be optionally followed by precision specifier, that + is a decimal constant in brackets. + + + If a precision specifier is given, then only the corresponding + number of right most components of the class name will be + printed. By default the class name is output in fully qualified form. + + + For example, for the class name "log4net.Layout.PatternLayout", the + pattern %type{1} will output "PatternLayout". + + + WARNING Generating the caller class information is + slow. Thus, its use should be avoided unless execution speed is + not an issue. + + + See the note below on the availability of caller location information. + + + + + u + Equivalent to identity + + + username + + + Used to output the WindowsIdentity for the currently + active user. + + + WARNING Generating caller WindowsIdentity information is + extremely slow. Its use should be avoided unless execution speed + is not an issue. + + + + + utcdate + + + Used to output the date of the logging event in universal time. + The date conversion + specifier may be followed by a date format specifier enclosed + between braces. For example, %utcdate{HH:mm:ss,fff} or + %utcdate{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is + given then ISO8601 format is + assumed (). + + + The date format specifier admits the same syntax as the + time pattern string of the . + + + For better results it is recommended to use the log4net date + formatters. These can be specified using one of the strings + "ABSOLUTE", "DATE" and "ISO8601" for specifying + , + and respectively + . For example, + %utcdate{ISO8601} or %utcdate{ABSOLUTE}. + + + These dedicated date formatters perform significantly + better than . + + + + + w + Equivalent to username + + + x + Equivalent to ndc + + + X + Equivalent to mdc + + + % + + + The sequence %% outputs a single percent sign. + + + + + + The single letter patterns are deprecated in favor of the + longer more descriptive pattern names. + + + By default the relevant information is output as is. However, + with the aid of format modifiers it is possible to change the + minimum field width, the maximum field width and justification. + + + The optional format modifier is placed between the percent sign + and the conversion pattern name. + + + The first optional format modifier is the left justification + flag which is just the minus (-) character. Then comes the + optional minimum field width modifier. This is a decimal + constant that represents the minimum number of characters to + output. If the data item requires fewer characters, it is padded on + either the left or the right until the minimum width is + reached. The default is to pad on the left (right justify) but you + can specify right padding with the left justification flag. The + padding character is space. If the data item is larger than the + minimum field width, the field is expanded to accommodate the + data. The value is never truncated. + + + This behavior can be changed using the maximum field + width modifier which is designated by a period followed by a + decimal constant. If the data item is longer than the maximum + field, then the extra characters are removed from the + beginning of the data item and not from the end. For + example, it the maximum field width is eight and the data item is + ten characters long, then the first two characters of the data item + are dropped. This behavior deviates from the printf function in C + where truncation is done from the end. + + + Below are various format modifier examples for the logger + conversion specifier. + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Format modifierleft justifyminimum widthmaximum widthcomment
%20loggerfalse20none + + Left pad with spaces if the logger name is less than 20 + characters long. + +
%-20loggertrue20none + + Right pad with spaces if the logger + name is less than 20 characters long. + +
%.30loggerNAnone30 + + Truncate from the beginning if the logger + name is longer than 30 characters. + +
%20.30loggerfalse2030 + + Left pad with spaces if the logger name is shorter than 20 + characters. However, if logger name is longer than 30 characters, + then truncate from the beginning. + +
%-20.30loggertrue2030 + + Right pad with spaces if the logger name is shorter than 20 + characters. However, if logger name is longer than 30 characters, + then truncate from the beginning. + +
+
+ + Note about caller location information.
+ The following patterns %type %file %line %method %location %class %C %F %L %l %M + all generate caller location information. + Location information uses the System.Diagnostics.StackTrace class to generate + a call stack. The caller's information is then extracted from this stack. +
+ + + The System.Diagnostics.StackTrace class is not supported on the + .NET Compact Framework 1.0 therefore caller location information is not + available on that framework. + + + + + The System.Diagnostics.StackTrace class has this to say about Release builds: + + + "StackTrace information will be most informative with Debug build configurations. + By default, Debug builds include debug symbols, while Release builds do not. The + debug symbols contain most of the file, method name, line number, and column + information used in constructing StackFrame and StackTrace objects. StackTrace + might not report as many method calls as expected, due to code transformations + that occur during optimization." + + + This means that in a Release build the caller information may be incomplete or may + not exist at all! Therefore caller location information cannot be relied upon in a Release build. + + + + Additional pattern converters may be registered with a specific + instance using the method. + +
+ + This is a more detailed pattern. + %timestamp [%thread] %level %logger %ndc - %message%newline + + + A similar pattern except that the relative time is + right padded if less than 6 digits, thread name is right padded if + less than 15 characters and truncated if longer and the logger + name is left padded if shorter than 30 characters and truncated if + longer. + %-6timestamp [%15.15thread] %-5level %30.30logger %ndc - %message%newline + + Nicko Cadell + Gert Driesen + Douglas de la Torre + Daniel Cazzulino +
+ + + Default pattern string for log output. + + + + Default pattern string for log output. + Currently set to the string "%message%newline" + which just prints the application supplied message. + + + + + + A detailed conversion pattern + + + + A conversion pattern which includes Time, Thread, Logger, and Nested Context. + Current value is %timestamp [%thread] %level %logger %ndc - %message%newline. + + + + + + Internal map of converter identifiers to converter types. + + + + This static map is overridden by the m_converterRegistry instance map + + + + + + the pattern + + + + + the head of the pattern converter chain + + + + + patterns defined on this PatternLayout only + + + + + Initialize the global registry + + + + Defines the builtin global rules. + + + + + + Constructs a PatternLayout using the DefaultConversionPattern + + + + The default pattern just produces the application supplied message. + + + Note to Inheritors: This constructor calls the virtual method + . If you override this method be + aware that it will be called before your is called constructor. + + + As per the contract the + method must be called after the properties on this object have been + configured. + + + + + + Constructs a PatternLayout using the supplied conversion pattern + + the pattern to use + + + Note to Inheritors: This constructor calls the virtual method + . If you override this method be + aware that it will be called before your is called constructor. + + + When using this constructor the method + need not be called. This may not be the case when using a subclass. + + + + + + Create the pattern parser instance + + the pattern to parse + The that will format the event + + + Creates the used to parse the conversion string. Sets the + global and instance rules on the . + + + + + + Initialize layout options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Produces a formatted string as specified by the conversion pattern. + + the event being logged + The TextWriter to write the formatted event to + + + Parse the using the patter format + specified in the property. + + + + + + Add a converter to this PatternLayout + + the converter info + + + This version of the method is used by the configurator. + Programmatic users should use the alternative method. + + + + + + Add a converter to this PatternLayout + + the name of the conversion pattern for this converter + the type of the converter + + + Add a named pattern converter to this instance. This + converter will be used in the formatting of the event. + This method must be called before . + + + The specified must extend the + type. + + + + + + The pattern formatting string + + + + The ConversionPattern option. This is the string which + controls formatting and consists of a mix of literal content and + conversion specifiers. + + + + + + Type converter for the interface + + + + Used to convert objects to the interface. + Supports converting from the interface to + the interface using the . + + + Nicko Cadell + Gert Driesen + + + + Interface supported by type converters + + + + This interface supports conversion from arbitrary types + to a single target type. See . + + + Nicko Cadell + Gert Driesen + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Test if the can be converted to the + type supported by this converter. + + + + + + Convert the source object to the type supported by this object + + the object to convert + the converted object + + + Converts the to the type supported + by this converter. + + + + + + Can the sourceType be converted to an + + the source to be to be converted + true if the source type can be converted to + + + Test if the can be converted to a + . Only is supported + as the . + + + + + + Convert the value to a object + + the value to convert + the object + + + Convert the object to a + object. If the object + is a then the + is used to adapt between the two interfaces, otherwise an + exception is thrown. + + + + + + Extract the value of a property from the + + + + Extract the value of a property from the + + + Nicko Cadell + + + + Constructs a RawPropertyLayout + + + + + Lookup the property for + + The event to format + returns property value + + + Looks up and returns the object value of the property + named . If there is no property defined + with than name then null will be returned. + + + + + + The name of the value to lookup in the LoggingEvent Properties collection. + + + Value to lookup in the LoggingEvent Properties collection + + + + String name of the property to lookup in the . + + + + + + Extract the date from the + + + + Extract the date from the + + + Nicko Cadell + Gert Driesen + + + + Constructs a RawTimeStampLayout + + + + + Gets the as a . + + The event to format + returns the time stamp + + + Gets the as a . + + + The time stamp is in local time. To format the time stamp + in universal time use . + + + + + + Extract the date from the + + + + Extract the date from the + + + Nicko Cadell + Gert Driesen + + + + Constructs a RawUtcTimeStampLayout + + + + + Gets the as a . + + The event to format + returns the time stamp + + + Gets the as a . + + + The time stamp is in universal time. To format the time stamp + in local time use . + + + + + + A very simple layout + + + + SimpleLayout consists of the level of the log statement, + followed by " - " and then the log message itself. For example, + + DEBUG - Hello world + + + + Nicko Cadell + Gert Driesen + + + + Constructs a SimpleLayout + + + + + Initialize layout options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Produces a simple formatted output. + + the event being logged + The TextWriter to write the formatted event to + + + Formats the event as the level of the even, + followed by " - " and then the log message itself. The + output is terminated by a newline. + + + + + + Layout that formats the log events as XML elements. + + + + The output of the consists of a series of + log4net:event elements. It does not output a complete well-formed XML + file. The output is designed to be included as an external entity + in a separate file to form a correct XML file. + + + For example, if abc is the name of the file where + the output goes, then a well-formed XML file would + be: + + + <?xml version="1.0" ?> + + <!DOCTYPE log4net:events SYSTEM "log4net-events.dtd" [<!ENTITY data SYSTEM "abc">]> + + <log4net:events version="1.2" xmlns:log4net="http://logging.apache.org/log4net/schemas/log4net-events-1.2> + &data; + </log4net:events> + + + This approach enforces the independence of the + and the appender where it is embedded. + + + The version attribute helps components to correctly + interpret output generated by . The value of + this attribute should be "1.2" for release 1.2 and later. + + + Alternatively the Header and Footer properties can be + configured to output the correct XML header, open tag and close tag. + When setting the Header and Footer properties it is essential + that the underlying data store not be appendable otherwise the data + will become invalid XML. + + + Nicko Cadell + Gert Driesen + + + + Layout that formats the log events as XML elements. + + + + This is an abstract class that must be subclassed by an implementation + to conform to a specific schema. + + + Deriving classes must implement the method. + + + Nicko Cadell + Gert Driesen + + + + Protected constructor to support subclasses + + + + Initializes a new instance of the class + with no location info. + + + + + + Protected constructor to support subclasses + + + + The parameter determines whether + location information will be output by the layout. If + is set to true, then the + file name and line number of the statement at the origin of the log + statement will be output. + + + If you are embedding this layout within an SMTPAppender + then make sure to set the LocationInfo option of that + appender as well. + + + + + + Initialize layout options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Produces a formatted string. + + The event being logged. + The TextWriter to write the formatted event to + + + Format the and write it to the . + + + This method creates an that writes to the + . The is passed + to the method. Subclasses should override the + method rather than this method. + + + + + + Does the actual writing of the XML. + + The writer to use to output the event to. + The event to write. + + + Subclasses should override this method to format + the as XML. + + + + + + Flag to indicate if location information should be included in + the XML events. + + + + + The string to replace invalid chars with + + + + + Gets a value indicating whether to include location information in + the XML events. + + + true if location information should be included in the XML + events; otherwise, false. + + + + If is set to true, then the file + name and line number of the statement at the origin of the log + statement will be output. + + + If you are embedding this layout within an SMTPAppender + then make sure to set the LocationInfo option of that + appender as well. + + + + + + The string to replace characters that can not be expressed in XML with. + + + Not all characters may be expressed in XML. This property contains the + string to replace those that can not with. This defaults to a ?. Set it + to the empty string to simply remove offending characters. For more + details on the allowed character ranges see http://www.w3.org/TR/REC-xml/#charsets + Character replacement will occur in the log message, the property names + and the property values. + + + + + + + Gets the content type output by this layout. + + + As this is the XML layout, the value is always "text/xml". + + + + As this is the XML layout, the value is always "text/xml". + + + + + + Constructs an XmlLayout + + + + + Constructs an XmlLayout. + + + + The LocationInfo option takes a boolean value. By + default, it is set to false which means there will be no location + information output by this layout. If the the option is set to + true, then the file name and line number of the statement + at the origin of the log statement will be output. + + + If you are embedding this layout within an SmtpAppender + then make sure to set the LocationInfo option of that + appender as well. + + + + + + Initialize layout options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + Builds a cache of the element names + + + + + + Does the actual writing of the XML. + + The writer to use to output the event to. + The event to write. + + + Override the base class method + to write the to the . + + + + + + The prefix to use for all generated element names + + + + + The prefix to use for all element names + + + + The default prefix is log4net. Set this property + to change the prefix. If the prefix is set to an empty string + then no prefix will be written. + + + + + + Set whether or not to base64 encode the message. + + + + By default the log message will be written as text to the xml + output. This can cause problems when the message contains binary + data. By setting this to true the contents of the message will be + base64 encoded. If this is set then invalid character replacement + (see ) will not be performed + on the log message. + + + + + + Set whether or not to base64 encode the property values. + + + + By default the properties will be written as text to the xml + output. This can cause problems when one or more properties contain + binary data. By setting this to true the values of the properties + will be base64 encoded. If this is set then invalid character replacement + (see ) will not be performed + on the property values. + + + + + + Layout that formats the log events as XML elements compatible with the log4j schema + + + + Formats the log events according to the http://logging.apache.org/log4j schema. + + + Nicko Cadell + + + + The 1st of January 1970 in UTC + + + + + Constructs an XMLLayoutSchemaLog4j + + + + + Constructs an XMLLayoutSchemaLog4j. + + + + The LocationInfo option takes a boolean value. By + default, it is set to false which means there will be no location + information output by this layout. If the the option is set to + true, then the file name and line number of the statement + at the origin of the log statement will be output. + + + If you are embedding this layout within an SMTPAppender + then make sure to set the LocationInfo option of that + appender as well. + + + + + + Actually do the writing of the xml + + the writer to use + the event to write + + + Generate XML that is compatible with the log4j schema. + + + + + + The version of the log4j schema to use. + + + + Only version 1.2 of the log4j schema is supported. + + + + + + The default object Renderer. + + + + The default renderer supports rendering objects and collections to strings. + + + See the method for details of the output. + + + Nicko Cadell + Gert Driesen + + + + Implement this interface in order to render objects as strings + + + + Certain types require special case conversion to + string form. This conversion is done by an object renderer. + Object renderers implement the + interface. + + + Nicko Cadell + Gert Driesen + + + + Render the object to a string + + The map used to lookup renderers + The object to render + The writer to render to + + + Render the object to a + string. + + + The parameter is + provided to lookup and render other objects. This is + very useful where contains + nested objects of unknown type. The + method can be used to render these objects. + + + + + + Default constructor + + + + Default constructor + + + + + + Render the object to a string + + The map used to lookup renderers + The object to render + The writer to render to + + + Render the object to a string. + + + The parameter is + provided to lookup and render other objects. This is + very useful where contains + nested objects of unknown type. The + method can be used to render these objects. + + + The default renderer supports rendering objects to strings as follows: + + + + Value + Rendered String + + + null + + "(null)" + + + + + + + For a one dimensional array this is the + array type name, an open brace, followed by a comma + separated list of the elements (using the appropriate + renderer), followed by a close brace. + + + For example: int[] {1, 2, 3}. + + + If the array is not one dimensional the + Array.ToString() is returned. + + + + + , & + + + Rendered as an open brace, followed by a comma + separated list of the elements (using the appropriate + renderer), followed by a close brace. + + + For example: {a, b, c}. + + + All collection classes that implement its subclasses, + or generic equivalents all implement the interface. + + + + + + + + Rendered as the key, an equals sign ('='), and the value (using the appropriate + renderer). + + + For example: key=value. + + + + + other + + Object.ToString() + + + + + + + + Render the array argument into a string + + The map used to lookup renderers + the array to render + The writer to render to + + + For a one dimensional array this is the + array type name, an open brace, followed by a comma + separated list of the elements (using the appropriate + renderer), followed by a close brace. For example: + int[] {1, 2, 3}. + + + If the array is not one dimensional the + Array.ToString() is returned. + + + + + + Render the enumerator argument into a string + + The map used to lookup renderers + the enumerator to render + The writer to render to + + + Rendered as an open brace, followed by a comma + separated list of the elements (using the appropriate + renderer), followed by a close brace. For example: + {a, b, c}. + + + + + + Render the DictionaryEntry argument into a string + + The map used to lookup renderers + the DictionaryEntry to render + The writer to render to + + + Render the key, an equals sign ('='), and the value (using the appropriate + renderer). For example: key=value. + + + + + + Map class objects to an . + + + + Maintains a mapping between types that require special + rendering and the that + is used to render them. + + + The method is used to render an + object using the appropriate renderers defined in this map. + + + Nicko Cadell + Gert Driesen + + + + Default Constructor + + + + Default constructor. + + + + + + Render using the appropriate renderer. + + the object to render to a string + the object rendered as a string + + + This is a convenience method used to render an object to a string. + The alternative method + should be used when streaming output to a . + + + + + + Render using the appropriate renderer. + + the object to render to a string + The writer to render to + + + Find the appropriate renderer for the type of the + parameter. This is accomplished by calling the + method. Once a renderer is found, it is + applied on the object and the result is returned + as a . + + + + + + Gets the renderer for the specified object type + + the object to lookup the renderer for + the renderer for + + + Gets the renderer for the specified object type. + + + Syntactic sugar method that calls + with the type of the object parameter. + + + + + + Gets the renderer for the specified type + + the type to lookup the renderer for + the renderer for the specified type + + + Returns the renderer for the specified type. + If no specific renderer has been defined the + will be returned. + + + + + + Internal function to recursively search interfaces + + the type to lookup the renderer for + the renderer for the specified type + + + + Clear the map of renderers + + + + Clear the custom renderers defined by using + . The + cannot be removed. + + + + + + Register an for . + + the type that will be rendered by + the renderer for + + + Register an object renderer for a specific source type. + This renderer will be returned from a call to + specifying the same as an argument. + + + + + + Get the default renderer instance + + the default renderer + + + Get the default renderer + + + + + + Interface implemented by logger repository plugins. + + + + Plugins define additional behavior that can be associated + with a . + The held by the + property is used to store the plugins for a repository. + + + The log4net.Config.PluginAttribute can be used to + attach plugins to repositories created using configuration + attributes. + + + Nicko Cadell + Gert Driesen + + + + Attaches the plugin to the specified . + + The that this plugin should be attached to. + + + A plugin may only be attached to a single repository. + + + This method is called when the plugin is attached to the repository. + + + + + + Is called when the plugin is to shutdown. + + + + This method is called to notify the plugin that + it should stop operating and should detach from + the repository. + + + + + + Gets the name of the plugin. + + + The name of the plugin. + + + + Plugins are stored in the + keyed by name. Each plugin instance attached to a + repository must be a unique name. + + + + + + A strongly-typed collection of objects. + + Nicko Cadell + + + + Creates a read-only wrapper for a PluginCollection instance. + + list to create a readonly wrapper arround + + A PluginCollection wrapper that is read-only. + + + + + Initializes a new instance of the PluginCollection class + that is empty and has the default initial capacity. + + + + + Initializes a new instance of the PluginCollection class + that has the specified initial capacity. + + + The number of elements that the new PluginCollection is initially capable of storing. + + + + + Initializes a new instance of the PluginCollection class + that contains elements copied from the specified PluginCollection. + + The PluginCollection whose elements are copied to the new collection. + + + + Initializes a new instance of the PluginCollection class + that contains elements copied from the specified array. + + The array whose elements are copied to the new list. + + + + Initializes a new instance of the PluginCollection class + that contains elements copied from the specified collection. + + The collection whose elements are copied to the new list. + + + + Allow subclasses to avoid our default constructors + + + + + + + Copies the entire PluginCollection to a one-dimensional + array. + + The one-dimensional array to copy to. + + + + Copies the entire PluginCollection to a one-dimensional + array, starting at the specified index of the target array. + + The one-dimensional array to copy to. + The zero-based index in at which copying begins. + + + + Adds a to the end of the PluginCollection. + + The to be added to the end of the PluginCollection. + The index at which the value has been added. + + + + Removes all elements from the PluginCollection. + + + + + Creates a shallow copy of the . + + A new with a shallow copy of the collection data. + + + + Determines whether a given is in the PluginCollection. + + The to check for. + true if is found in the PluginCollection; otherwise, false. + + + + Returns the zero-based index of the first occurrence of a + in the PluginCollection. + + The to locate in the PluginCollection. + + The zero-based index of the first occurrence of + in the entire PluginCollection, if found; otherwise, -1. + + + + + Inserts an element into the PluginCollection at the specified index. + + The zero-based index at which should be inserted. + The to insert. + + is less than zero + -or- + is equal to or greater than . + + + + + Removes the first occurrence of a specific from the PluginCollection. + + The to remove from the PluginCollection. + + The specified was not found in the PluginCollection. + + + + + Removes the element at the specified index of the PluginCollection. + + The zero-based index of the element to remove. + + is less than zero. + -or- + is equal to or greater than . + + + + + Returns an enumerator that can iterate through the PluginCollection. + + An for the entire PluginCollection. + + + + Adds the elements of another PluginCollection to the current PluginCollection. + + The PluginCollection whose elements should be added to the end of the current PluginCollection. + The new of the PluginCollection. + + + + Adds the elements of a array to the current PluginCollection. + + The array whose elements should be added to the end of the PluginCollection. + The new of the PluginCollection. + + + + Adds the elements of a collection to the current PluginCollection. + + The collection whose elements should be added to the end of the PluginCollection. + The new of the PluginCollection. + + + + Sets the capacity to the actual number of elements. + + + + + is less than zero. + -or- + is equal to or greater than . + + + + + is less than zero. + -or- + is equal to or greater than . + + + + + Gets the number of elements actually contained in the PluginCollection. + + + + + Gets a value indicating whether access to the collection is synchronized (thread-safe). + + true if access to the ICollection is synchronized (thread-safe); otherwise, false. + + + + Gets an object that can be used to synchronize access to the collection. + + + An object that can be used to synchronize access to the collection. + + + + + Gets or sets the at the specified index. + + + The at the specified index. + + The zero-based index of the element to get or set. + + is less than zero. + -or- + is equal to or greater than . + + + + + Gets a value indicating whether the collection has a fixed size. + + true if the collection has a fixed size; otherwise, false. The default is false. + + + + Gets a value indicating whether the IList is read-only. + + true if the collection is read-only; otherwise, false. The default is false. + + + + Gets or sets the number of elements the PluginCollection can contain. + + + The number of elements the PluginCollection can contain. + + + + + Supports type-safe iteration over a . + + + + + + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + Gets the current element in the collection. + + + + + Type visible only to our subclasses + Used to access protected constructor + + + + + + A value + + + + + Supports simple iteration over a . + + + + + + Initializes a new instance of the Enumerator class. + + + + + + Advances the enumerator to the next element in the collection. + + + true if the enumerator was successfully advanced to the next element; + false if the enumerator has passed the end of the collection. + + + The collection was modified after the enumerator was created. + + + + + Sets the enumerator to its initial position, before the first element in the collection. + + + + + Gets the current element in the collection. + + + The current element in the collection. + + + + + + + + Map of repository plugins. + + + + This class is a name keyed map of the plugins that are + attached to a repository. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + The repository that the plugins should be attached to. + + + Initialize a new instance of the class with a + repository that the plugins should be attached to. + + + + + + Adds a to the map. + + The to add to the map. + + + The will be attached to the repository when added. + + + If there already exists a plugin with the same name + attached to the repository then the old plugin will + be and replaced with + the new plugin. + + + + + + Removes a from the map. + + The to remove from the map. + + + Remove a specific plugin from this map. + + + + + + Gets a by name. + + The name of the to lookup. + + The from the map with the name specified, or + null if no plugin is found. + + + + Lookup a plugin by name. If the plugin is not found null + will be returned. + + + + + + Gets all possible plugins as a list of objects. + + All possible plugins as a list of objects. + + + Get a collection of all the plugins defined in this map. + + + + + + Base implementation of + + + + Default abstract implementation of the + interface. This base class can be used by implementors + of the interface. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + the name of the plugin + + Initializes a new Plugin with the specified name. + + + + + Attaches this plugin to a . + + The that this plugin should be attached to. + + + A plugin may only be attached to a single repository. + + + This method is called when the plugin is attached to the repository. + + + + + + Is called when the plugin is to shutdown. + + + + This method is called to notify the plugin that + it should stop operating and should detach from + the repository. + + + + + + The name of this plugin. + + + + + The repository this plugin is attached to. + + + + + Gets or sets the name of the plugin. + + + The name of the plugin. + + + + Plugins are stored in the + keyed by name. Each plugin instance attached to a + repository must be a unique name. + + + The name of the plugin must not change one the + plugin has been attached to a repository. + + + + + + The repository for this plugin + + + The that this plugin is attached to. + + + + Gets or sets the that this plugin is + attached to. + + + + + + Plugin that listens for events from the + + + + This plugin publishes an instance of + on a specified . This listens for logging events delivered from + a remote . + + + When an event is received it is relogged within the attached repository + as if it had been raised locally. + + + Nicko Cadell + Gert Driesen + + + + Default constructor + + + + Initializes a new instance of the class. + + + The property must be set. + + + + + + Construct with sink Uri. + + The name to publish the sink under in the remoting infrastructure. + See for more details. + + + Initializes a new instance of the class + with specified name. + + + + + + Attaches this plugin to a . + + The that this plugin should be attached to. + + + A plugin may only be attached to a single repository. + + + This method is called when the plugin is attached to the repository. + + + + + + Is called when the plugin is to shutdown. + + + + When the plugin is shutdown the remote logging + sink is disconnected. + + + + + + The fully qualified type of the RemoteLoggingServerPlugin class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the URI of this sink. + + + The URI of this sink. + + + + This is the name under which the object is marshaled. + + + + + + + Delivers objects to a remote sink. + + + + Internal class used to listen for logging events + and deliver them to the local repository. + + + + + + Constructor + + The repository to log to. + + + Initializes a new instance of the for the + specified . + + + + + + Logs the events to the repository. + + The events to log. + + + The events passed are logged to the + + + + + + Obtains a lifetime service object to control the lifetime + policy for this instance. + + null to indicate that this instance should live forever. + + + Obtains a lifetime service object to control the lifetime + policy for this instance. This object should live forever + therefore this implementation returns null. + + + + + + The underlying that events should + be logged to. + + + + + Default implementation of + + + + This default implementation of the + interface is used to create the default subclass + of the object. + + + Nicko Cadell + Gert Driesen + + + + Interface abstracts creation of instances + + + + This interface is used by the to + create new objects. + + + The method is called + to create a named . + + + Implement this interface to create new subclasses of . + + + Nicko Cadell + Gert Driesen + + + + Create a new instance + + The that will own the . + The name of the . + The instance for the specified name. + + + Create a new instance with the + specified name. + + + Called by the to create + new named instances. + + + If the is null then the root logger + must be returned. + + + + + + Default constructor + + + + Initializes a new instance of the class. + + + + + + Create a new instance + + The that will own the . + The name of the . + The instance for the specified name. + + + Create a new instance with the + specified name. + + + Called by the to create + new named instances. + + + If the is null then the root logger + must be returned. + + + + + + Default internal subclass of + + + + This subclass has no additional behavior over the + class but does allow instances + to be created. + + + + + + Implementation of used by + + + + Internal class used to provide implementation of + interface. Applications should use to get + logger instances. + + + This is one of the central classes in the log4net implementation. One of the + distinctive features of log4net are hierarchical loggers and their + evaluation. The organizes the + instances into a rooted tree hierarchy. + + + The class is abstract. Only concrete subclasses of + can be created. The + is used to create instances of this type for the . + + + Nicko Cadell + Gert Driesen + Aspi Havewala + Douglas de la Torre + + + + This constructor created a new instance and + sets its name. + + The name of the . + + + This constructor is protected and designed to be used by + a subclass that is not abstract. + + + Loggers are constructed by + objects. See for the default + logger creator. + + + + + + Add to the list of appenders of this + Logger instance. + + An appender to add to this logger + + + Add to the list of appenders of this + Logger instance. + + + If is already in the list of + appenders, then it won't be added again. + + + + + + Look for the appender named as name + + The name of the appender to lookup + The appender with the name specified, or null. + + + Returns the named appender, or null if the appender is not found. + + + + + + Remove all previously added appenders from this Logger instance. + + + + Remove all previously added appenders from this Logger instance. + + + This is useful when re-reading configuration information. + + + + + + Remove the appender passed as parameter form the list of appenders. + + The appender to remove + The appender removed from the list + + + Remove the appender passed as parameter form the list of appenders. + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + + Remove the appender passed as parameter form the list of appenders. + + The name of the appender to remove + The appender removed from the list + + + Remove the named appender passed as parameter form the list of appenders. + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + + This generic form is intended to be used by wrappers. + + The declaring type of the method that is + the stack boundary into the logging system for this call. + The level of the message to be logged. + The message object to log. + The exception to log, including its stack trace. + + + Generate a logging event for the specified using + the and . + + + This method must not throw any exception to the caller. + + + + + + This is the most generic printing method that is intended to be used + by wrappers. + + The event being logged. + + + Logs the specified logging event through this logger. + + + This method must not throw any exception to the caller. + + + + + + Checks if this logger is enabled for a given passed as parameter. + + The level to check. + + true if this logger is enabled for level, otherwise false. + + + + Test if this logger is going to log events of the specified . + + + This method must not throw any exception to the caller. + + + + + + Deliver the to the attached appenders. + + The event to log. + + + Call the appenders in the hierarchy starting at + this. If no appenders could be found, emit a + warning. + + + This method calls all the appenders inherited from the + hierarchy circumventing any evaluation of whether to log or not + to log the particular log request. + + + + + + Closes all attached appenders implementing the interface. + + + + Used to ensure that the appenders are correctly shutdown. + + + + + + This is the most generic printing method. This generic form is intended to be used by wrappers + + The level of the message to be logged. + The message object to log. + The exception to log, including its stack trace. + + + Generate a logging event for the specified using + the . + + + + + + Creates a new logging event and logs the event without further checks. + + The declaring type of the method that is + the stack boundary into the logging system for this call. + The level of the message to be logged. + The message object to log. + The exception to log, including its stack trace. + + + Generates a logging event and delivers it to the attached + appenders. + + + + + + Creates a new logging event and logs the event without further checks. + + The event being logged. + + + Delivers the logging event to the attached appenders. + + + + + + The fully qualified type of the Logger class. + + + + + The name of this logger. + + + + + The assigned level of this logger. + + + + The level variable need not be + assigned a value in which case it is inherited + form the hierarchy. + + + + + + The parent of this logger. + + + + The parent of this logger. + All loggers have at least one ancestor which is the root logger. + + + + + + Loggers need to know what Hierarchy they are in. + + + + Loggers need to know what Hierarchy they are in. + The hierarchy that this logger is a member of is stored + here. + + + + + + Helper implementation of the interface + + + + + Flag indicating if child loggers inherit their parents appenders + + + + Additivity is set to true by default, that is children inherit + the appenders of their ancestors by default. If this variable is + set to false then the appenders found in the + ancestors of this logger are not used. However, the children + of this logger will inherit its appenders, unless the children + have their additivity flag set to false too. See + the user manual for more details. + + + + + + Lock to protect AppenderAttachedImpl variable m_appenderAttachedImpl + + + + + Gets or sets the parent logger in the hierarchy. + + + The parent logger in the hierarchy. + + + + Part of the Composite pattern that makes the hierarchy. + The hierarchy is parent linked rather than child linked. + + + + + + Gets or sets a value indicating if child loggers inherit their parent's appenders. + + + true if child loggers inherit their parent's appenders. + + + + Additivity is set to true by default, that is children inherit + the appenders of their ancestors by default. If this variable is + set to false then the appenders found in the + ancestors of this logger are not used. However, the children + of this logger will inherit its appenders, unless the children + have their additivity flag set to false too. See + the user manual for more details. + + + + + + Gets the effective level for this logger. + + The nearest level in the logger hierarchy. + + + Starting from this logger, searches the logger hierarchy for a + non-null level and returns it. Otherwise, returns the level of the + root logger. + + The Logger class is designed so that this method executes as + quickly as possible. + + + + + Gets or sets the where this + Logger instance is attached to. + + The hierarchy that this logger belongs to. + + + This logger must be attached to a single . + + + + + + Gets or sets the assigned , if any, for this Logger. + + + The of this logger. + + + + The assigned can be null. + + + + + + Get the appenders contained in this logger as an + . + + A collection of the appenders in this logger + + + Get the appenders contained in this logger as an + . If no appenders + can be found, then a is returned. + + + + + + Gets the logger name. + + + The name of the logger. + + + + The name of this logger + + + + + + Gets the where this + Logger instance is attached to. + + + The that this logger belongs to. + + + + Gets the where this + Logger instance is attached to. + + + + + + Construct a new Logger + + the name of the logger + + + Initializes a new instance of the class + with the specified name. + + + + + + Delegate used to handle logger creation event notifications. + + The in which the has been created. + The event args that hold the instance that has been created. + + + Delegate used to handle logger creation event notifications. + + + + + + Provides data for the event. + + + + A event is raised every time a + is created. + + + + + + The created + + + + + Constructor + + The that has been created. + + + Initializes a new instance of the event argument + class,with the specified . + + + + + + Gets the that has been created. + + + The that has been created. + + + + The that has been created. + + + + + + Hierarchical organization of loggers + + + + The casual user should not have to deal with this class + directly. + + + This class is specialized in retrieving loggers by name and + also maintaining the logger hierarchy. Implements the + interface. + + + The structure of the logger hierarchy is maintained by the + method. The hierarchy is such that children + link to their parent but parents do not have any references to their + children. Moreover, loggers can be instantiated in any order, in + particular descendant before ancestor. + + + In case a descendant is created before a particular ancestor, + then it creates a provision node for the ancestor and adds itself + to the provision node. Other descendants of the same ancestor add + themselves to the previously created provision node. + + + Nicko Cadell + Gert Driesen + + + + Base implementation of + + + + Default abstract implementation of the interface. + + + Skeleton implementation of the interface. + All types can extend this type. + + + Nicko Cadell + Gert Driesen + + + + Interface implemented by logger repositories. + + + + This interface is implemented by logger repositories. e.g. + . + + + This interface is used by the + to obtain interfaces. + + + Nicko Cadell + Gert Driesen + + + + Check if the named logger exists in the repository. If so return + its reference, otherwise returns null. + + The name of the logger to lookup + The Logger object with the name specified + + + If the names logger exists it is returned, otherwise + null is returned. + + + + + + Returns all the currently defined loggers as an Array. + + All the defined loggers + + + Returns all the currently defined loggers as an Array. + + + + + + Returns a named logger instance + + The name of the logger to retrieve + The logger object with the name specified + + + Returns a named logger instance. + + + If a logger of that name already exists, then it will be + returned. Otherwise, a new logger will be instantiated and + then linked with its existing ancestors as well as children. + + + + + Shutdown the repository + + + Shutting down a repository will safely close and remove + all appenders in all loggers including the root logger. + + + Some appenders need to be closed before the + application exists. Otherwise, pending logging events might be + lost. + + + The method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + + Reset the repositories configuration to a default state + + + + Reset all values contained in this instance to their + default state. + + + Existing loggers are not removed. They are just reset. + + + This method should be used sparingly and with care as it will + block all logging until it is completed. + + + + + + Log the through this repository. + + the event to log + + + This method should not normally be used to log. + The interface should be used + for routine logging. This interface can be obtained + using the method. + + + The logEvent is delivered to the appropriate logger and + that logger is then responsible for logging the event. + + + + + + Returns all the Appenders that are configured as an Array. + + All the Appenders + + + Returns all the Appenders that are configured as an Array. + + + + + + The name of the repository + + + The name of the repository + + + + The name of the repository. + + + + + + RendererMap accesses the object renderer map for this repository. + + + RendererMap accesses the object renderer map for this repository. + + + + RendererMap accesses the object renderer map for this repository. + + + The RendererMap holds a mapping between types and + objects. + + + + + + The plugin map for this repository. + + + The plugin map for this repository. + + + + The plugin map holds the instances + that have been attached to this repository. + + + + + + Get the level map for the Repository. + + + + Get the level map for the Repository. + + + The level map defines the mappings between + level names and objects in + this repository. + + + + + + The threshold for all events in this repository + + + The threshold for all events in this repository + + + + The threshold for all events in this repository. + + + + + + Flag indicates if this repository has been configured. + + + Flag indicates if this repository has been configured. + + + + Flag indicates if this repository has been configured. + + + + + + Collection of internal messages captured during the most + recent configuration process. + + + + + Event to notify that the repository has been shutdown. + + + Event to notify that the repository has been shutdown. + + + + Event raised when the repository has been shutdown. + + + + + + Event to notify that the repository has had its configuration reset. + + + Event to notify that the repository has had its configuration reset. + + + + Event raised when the repository's configuration has been + reset to default. + + + + + + Event to notify that the repository has had its configuration changed. + + + Event to notify that the repository has had its configuration changed. + + + + Event raised when the repository's configuration has been changed. + + + + + + Repository specific properties + + + Repository specific properties + + + + These properties can be specified on a repository specific basis. + + + + + + Default Constructor + + + + Initializes the repository with default (empty) properties. + + + + + + Construct the repository using specific properties + + the properties to set for this repository + + + Initializes the repository with specified properties. + + + + + + Test if logger exists + + The name of the logger to lookup + The Logger object with the name specified + + + Check if the named logger exists in the repository. If so return + its reference, otherwise returns null. + + + + + + Returns all the currently defined loggers in the repository + + All the defined loggers + + + Returns all the currently defined loggers in the repository as an Array. + + + + + + Return a new logger instance + + The name of the logger to retrieve + The logger object with the name specified + + + Return a new logger instance. + + + If a logger of that name already exists, then it will be + returned. Otherwise, a new logger will be instantiated and + then linked with its existing ancestors as well as children. + + + + + + Shutdown the repository + + + + Shutdown the repository. Can be overridden in a subclass. + This base class implementation notifies the + listeners and all attached plugins of the shutdown event. + + + + + + Reset the repositories configuration to a default state + + + + Reset all values contained in this instance to their + default state. + + + Existing loggers are not removed. They are just reset. + + + This method should be used sparingly and with care as it will + block all logging until it is completed. + + + + + + Log the logEvent through this repository. + + the event to log + + + This method should not normally be used to log. + The interface should be used + for routine logging. This interface can be obtained + using the method. + + + The logEvent is delivered to the appropriate logger and + that logger is then responsible for logging the event. + + + + + + Returns all the Appenders that are configured as an Array. + + All the Appenders + + + Returns all the Appenders that are configured as an Array. + + + + + + The fully qualified type of the LoggerRepositorySkeleton class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Adds an object renderer for a specific class. + + The type that will be rendered by the renderer supplied. + The object renderer used to render the object. + + + Adds an object renderer for a specific class. + + + + + + Notify the registered listeners that the repository is shutting down + + Empty EventArgs + + + Notify any listeners that this repository is shutting down. + + + + + + Notify the registered listeners that the repository has had its configuration reset + + Empty EventArgs + + + Notify any listeners that this repository's configuration has been reset. + + + + + + Notify the registered listeners that the repository has had its configuration changed + + Empty EventArgs + + + Notify any listeners that this repository's configuration has changed. + + + + + + Raise a configuration changed event on this repository + + EventArgs.Empty + + + Applications that programmatically change the configuration of the repository should + raise this event notification to notify listeners. + + + + + + The name of the repository + + + The string name of the repository + + + + The name of this repository. The name is + used to store and lookup the repositories + stored by the . + + + + + + The threshold for all events in this repository + + + The threshold for all events in this repository + + + + The threshold for all events in this repository + + + + + + RendererMap accesses the object renderer map for this repository. + + + RendererMap accesses the object renderer map for this repository. + + + + RendererMap accesses the object renderer map for this repository. + + + The RendererMap holds a mapping between types and + objects. + + + + + + The plugin map for this repository. + + + The plugin map for this repository. + + + + The plugin map holds the instances + that have been attached to this repository. + + + + + + Get the level map for the Repository. + + + + Get the level map for the Repository. + + + The level map defines the mappings between + level names and objects in + this repository. + + + + + + Flag indicates if this repository has been configured. + + + Flag indicates if this repository has been configured. + + + + Flag indicates if this repository has been configured. + + + + + + Contains a list of internal messages captures during the + last configuration. + + + + + Event to notify that the repository has been shutdown. + + + Event to notify that the repository has been shutdown. + + + + Event raised when the repository has been shutdown. + + + + + + Event to notify that the repository has had its configuration reset. + + + Event to notify that the repository has had its configuration reset. + + + + Event raised when the repository's configuration has been + reset to default. + + + + + + Event to notify that the repository has had its configuration changed. + + + Event to notify that the repository has had its configuration changed. + + + + Event raised when the repository's configuration has been changed. + + + + + + Repository specific properties + + + Repository specific properties + + + These properties can be specified on a repository specific basis + + + + + Basic Configurator interface for repositories + + + + Interface used by basic configurator to configure a + with a default . + + + A should implement this interface to support + configuration by the . + + + Nicko Cadell + Gert Driesen + + + + Initialize the repository using the specified appender + + the appender to use to log all logging events + + + Configure the repository to route all logging events to the + specified appender. + + + + + + Initialize the repository using the specified appenders + + the appenders to use to log all logging events + + + Configure the repository to route all logging events to the + specified appenders. + + + + + + Configure repository using XML + + + + Interface used by Xml configurator to configure a . + + + A should implement this interface to support + configuration by the . + + + Nicko Cadell + Gert Driesen + + + + Initialize the repository using the specified config + + the element containing the root of the config + + + The schema for the XML configuration data is defined by + the implementation. + + + + + + Default constructor + + + + Initializes a new instance of the class. + + + + + + Construct with properties + + The properties to pass to this repository. + + + Initializes a new instance of the class. + + + + + + Construct with a logger factory + + The factory to use to create new logger instances. + + + Initializes a new instance of the class with + the specified . + + + + + + Construct with properties and a logger factory + + The properties to pass to this repository. + The factory to use to create new logger instances. + + + Initializes a new instance of the class with + the specified . + + + + + + Test if a logger exists + + The name of the logger to lookup + The Logger object with the name specified + + + Check if the named logger exists in the hierarchy. If so return + its reference, otherwise returns null. + + + + + + Returns all the currently defined loggers in the hierarchy as an Array + + All the defined loggers + + + Returns all the currently defined loggers in the hierarchy as an Array. + The root logger is not included in the returned + enumeration. + + + + + + Return a new logger instance named as the first parameter using + the default factory. + + + + Return a new logger instance named as the first parameter using + the default factory. + + + If a logger of that name already exists, then it will be + returned. Otherwise, a new logger will be instantiated and + then linked with its existing ancestors as well as children. + + + The name of the logger to retrieve + The logger object with the name specified + + + + Shutting down a hierarchy will safely close and remove + all appenders in all loggers including the root logger. + + + + Shutting down a hierarchy will safely close and remove + all appenders in all loggers including the root logger. + + + Some appenders need to be closed before the + application exists. Otherwise, pending logging events might be + lost. + + + The Shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + + Reset all values contained in this hierarchy instance to their default. + + + + Reset all values contained in this hierarchy instance to their + default. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set its default "off" value. + + + Existing loggers are not removed. They are just reset. + + + This method should be used sparingly and with care as it will + block all logging until it is completed. + + + + + + Log the logEvent through this hierarchy. + + the event to log + + + This method should not normally be used to log. + The interface should be used + for routine logging. This interface can be obtained + using the method. + + + The logEvent is delivered to the appropriate logger and + that logger is then responsible for logging the event. + + + + + + Returns all the Appenders that are currently configured + + An array containing all the currently configured appenders + + + Returns all the instances that are currently configured. + All the loggers are searched for appenders. The appenders may also be containers + for appenders and these are also searched for additional loggers. + + + The list returned is unordered but does not contain duplicates. + + + + + + Collect the appenders from an . + The appender may also be a container. + + + + + + + Collect the appenders from an container + + + + + + + Initialize the log4net system using the specified appender + + the appender to use to log all logging events + + + + Initialize the log4net system using the specified appenders + + the appenders to use to log all logging events + + + + Initialize the log4net system using the specified appenders + + the appenders to use to log all logging events + + + This method provides the same functionality as the + method implemented + on this object, but it is protected and therefore can be called by subclasses. + + + + + + Initialize the log4net system using the specified config + + the element containing the root of the config + + + + Initialize the log4net system using the specified config + + the element containing the root of the config + + + This method provides the same functionality as the + method implemented + on this object, but it is protected and therefore can be called by subclasses. + + + + + + Test if this hierarchy is disabled for the specified . + + The level to check against. + + true if the repository is disabled for the level argument, false otherwise. + + + + If this hierarchy has not been configured then this method will + always return true. + + + This method will return true if this repository is + disabled for level object passed as parameter and + false otherwise. + + + See also the property. + + + + + + Clear all logger definitions from the internal hashtable + + + + This call will clear all logger definitions from the internal + hashtable. Invoking this method will irrevocably mess up the + logger hierarchy. + + + You should really know what you are doing before + invoking this method. + + + + + + Return a new logger instance named as the first parameter using + . + + The name of the logger to retrieve + The factory that will make the new logger instance + The logger object with the name specified + + + If a logger of that name already exists, then it will be + returned. Otherwise, a new logger will be instantiated by the + parameter and linked with its existing + ancestors as well as children. + + + + + + Sends a logger creation event to all registered listeners + + The newly created logger + + Raises the logger creation event. + + + + + Updates all the parents of the specified logger + + The logger to update the parents for + + + This method loops through all the potential parents of + . There 3 possible cases: + + + + No entry for the potential parent of exists + + We create a ProvisionNode for this potential + parent and insert in that provision node. + + + + The entry is of type Logger for the potential parent. + + The entry is 's nearest existing parent. We + update 's parent field with this entry. We also break from + he loop because updating our parent's parent is our parent's + responsibility. + + + + The entry is of type ProvisionNode for this potential parent. + + We add to the list of children for this + potential parent. + + + + + + + + Replace a with a in the hierarchy. + + + + + + We update the links for all the children that placed themselves + in the provision node 'pn'. The second argument 'log' is a + reference for the newly created Logger, parent of all the + children in 'pn'. + + + We loop on all the children 'c' in 'pn'. + + + If the child 'c' has been already linked to a child of + 'log' then there is no need to update 'c'. + + + Otherwise, we set log's parent field to c's parent and set + c's parent field to log. + + + + + + Define or redefine a Level using the values in the argument + + the level values + + + Define or redefine a Level using the values in the argument + + + Supports setting levels via the configuration file. + + + + + + Set a Property using the values in the argument + + the property value + + + Set a Property using the values in the argument. + + + Supports setting property values via the configuration file. + + + + + + The fully qualified type of the Hierarchy class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Event used to notify that a logger has been created. + + + + Event raised when a logger is created. + + + + + + Has no appender warning been emitted + + + + Flag to indicate if we have already issued a warning + about not having an appender warning. + + + + + + Get the root of this hierarchy + + + + Get the root of this hierarchy. + + + + + + Gets or sets the default instance. + + The default + + + The logger factory is used to create logger instances. + + + + + + A class to hold the value, name and display name for a level + + + + A class to hold the value, name and display name for a level + + + + + + Override Object.ToString to return sensible debug info + + string info about this object + + + + Value of the level + + + + If the value is not set (defaults to -1) the value will be looked + up for the current level with the same name. + + + + + + Name of the level + + + The name of the level + + + + The name of the level. + + + + + + Display name for the level + + + The display name of the level + + + + The display name of the level. + + + + + + Used internally to accelerate hash table searches. + + + + Internal class used to improve performance of + string keyed hashtables. + + + The hashcode of the string is cached for reuse. + The string is stored as an interned value. + When comparing two objects for equality + the reference equality of the interned strings is compared. + + + Nicko Cadell + Gert Driesen + + + + Construct key with string name + + + + Initializes a new instance of the class + with the specified name. + + + Stores the hashcode of the string and interns + the string key to optimize comparisons. + + + The Compact Framework 1.0 the + method does not work. On the Compact Framework + the string keys are not interned nor are they + compared by reference. + + + The name of the logger. + + + + Returns a hash code for the current instance. + + A hash code for the current instance. + + + Returns the cached hashcode. + + + + + + Determines whether two instances + are equal. + + The to compare with the current . + + true if the specified is equal to the current ; otherwise, false. + + + + Compares the references of the interned strings. + + + + + + Provision nodes are used where no logger instance has been specified + + + + instances are used in the + when there is no specified + for that node. + + + A provision node holds a list of child loggers on behalf of + a logger that does not exist. + + + Nicko Cadell + Gert Driesen + + + + Create a new provision node with child node + + A child logger to add to this node. + + + Initializes a new instance of the class + with the specified child logger. + + + + + + The sits at the root of the logger hierarchy tree. + + + + The is a regular except + that it provides several guarantees. + + + First, it cannot be assigned a null + level. Second, since the root logger cannot have a parent, the + property always returns the value of the + level field without walking the hierarchy. + + + Nicko Cadell + Gert Driesen + + + + Construct a + + The level to assign to the root logger. + + + Initializes a new instance of the class with + the specified logging level. + + + The root logger names itself as "root". However, the root + logger cannot be retrieved by name. + + + + + + The fully qualified type of the RootLogger class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets the assigned level value without walking the logger hierarchy. + + The assigned level value without walking the logger hierarchy. + + + Because the root logger cannot have a parent and its level + must not be null this property just returns the + value of . + + + + + + Gets or sets the assigned for the root logger. + + + The of the root logger. + + + + Setting the level of the root logger to a null reference + may have catastrophic results. We prevent this here. + + + + + + Initializes the log4net environment using an XML DOM. + + + + Configures a using an XML DOM. + + + Nicko Cadell + Gert Driesen + + + + Construct the configurator for a hierarchy + + The hierarchy to build. + + + Initializes a new instance of the class + with the specified . + + + + + + Configure the hierarchy by parsing a DOM tree of XML elements. + + The root element to parse. + + + Configure the hierarchy by parsing a DOM tree of XML elements. + + + + + + Parse appenders by IDREF. + + The appender ref element. + The instance of the appender that the ref refers to. + + + Parse an XML element that represents an appender and return + the appender. + + + + + + Parses an appender element. + + The appender element. + The appender instance or null when parsing failed. + + + Parse an XML element that represents an appender and return + the appender instance. + + + + + + Parses a logger element. + + The logger element. + + + Parse an XML element that represents a logger. + + + + + + Parses the root logger element. + + The root element. + + + Parse an XML element that represents the root logger. + + + + + + Parses the children of a logger element. + + The category element. + The logger instance. + Flag to indicate if the logger is the root logger. + + + Parse the child elements of a <logger> element. + + + + + + Parses an object renderer. + + The renderer element. + + + Parse an XML element that represents a renderer. + + + + + + Parses a level element. + + The level element. + The logger object to set the level on. + Flag to indicate if the logger is the root logger. + + + Parse an XML element that represents a level. + + + + + + Sets a parameter on an object. + + The parameter element. + The object to set the parameter on. + + The parameter name must correspond to a writable property + on the object. The value of the parameter is a string, + therefore this function will attempt to set a string + property first. If unable to set a string property it + will inspect the property and its argument type. It will + attempt to call a static method called Parse on the + type of the property. This method will take a single + string argument and return a value that can be used to + set the property. + + + + + Test if an element has no attributes or child elements + + the element to inspect + true if the element has any attributes or child elements, false otherwise + + + + Test if a is constructible with Activator.CreateInstance. + + the type to inspect + true if the type is creatable using a default constructor, false otherwise + + + + Look for a method on the that matches the supplied + + the type that has the method + the name of the method + the method info found + + + The method must be a public instance method on the . + The method must be named or "Add" followed by . + The method must take a single parameter. + + + + + + Converts a string value to a target type. + + The type of object to convert the string to. + The string value to use as the value of the object. + + + An object of type with value or + null when the conversion could not be performed. + + + + + + Creates an object as specified in XML. + + The XML element that contains the definition of the object. + The object type to use if not explicitly specified. + The type that the returned object must be or must inherit from. + The object or null + + + Parse an XML element and create an object instance based on the configuration + data. + + + The type of the instance may be specified in the XML. If not + specified then the is used + as the type. However the type is specified it must support the + type. + + + + + + key: appenderName, value: appender. + + + + + The Hierarchy being configured. + + + + + The fully qualified type of the XmlHierarchyConfigurator class. + + + Used by the internal logger to record the Type of the + log message. + + + + + + + + + + + + + + + + + + + + + Delegate used to handle logger repository shutdown event notifications + + The that is shutting down. + Empty event args + + + Delegate used to handle logger repository shutdown event notifications. + + + + + + Delegate used to handle logger repository configuration reset event notifications + + The that has had its configuration reset. + Empty event args + + + Delegate used to handle logger repository configuration reset event notifications. + + + + + + Delegate used to handle event notifications for logger repository configuration changes. + + The that has had its configuration changed. + Empty event arguments. + + + Delegate used to handle event notifications for logger repository configuration changes. + + + + + + Write the name of the current AppDomain to the output + + + + Write the name of the current AppDomain to the output writer + + + Nicko Cadell + + + + Write the name of the current AppDomain to the output + + the writer to write to + null, state is not set + + + Writes name of the current AppDomain to the output . + + + + + + Write the current date to the output + + + + Date pattern converter, uses a to format + the current date and time to the writer as a string. + + + The value of the determines + the formatting of the date. The following values are allowed: + + + Option value + Output + + + ISO8601 + + Uses the formatter. + Formats using the "yyyy-MM-dd HH:mm:ss,fff" pattern. + + + + DATE + + Uses the formatter. + Formats using the "dd MMM yyyy HH:mm:ss,fff" for example, "06 Nov 1994 15:49:37,459". + + + + ABSOLUTE + + Uses the formatter. + Formats using the "HH:mm:ss,fff" for example, "15:49:37,459". + + + + other + + Any other pattern string uses the formatter. + This formatter passes the pattern string to the + method. + For details on valid patterns see + DateTimeFormatInfo Class. + + + + + + The date and time is in the local time zone and is rendered in that zone. + To output the time in Universal time see . + + + Nicko Cadell + + + + The used to render the date to a string + + + + The used to render the date to a string + + + + + + Initialize the converter options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Write the current date to the output + + that will receive the formatted result. + null, state is not set + + + Pass the current date and time to the + for it to render it to the writer. + + + The date and time passed is in the local time zone. + + + + + + The fully qualified type of the DatePatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Write an folder path to the output + + + + Write an special path environment folder path to the output writer. + The value of the determines + the name of the variable to output. + should be a value in the enumeration. + + + Ron Grabowski + + + + Write an special path environment folder path to the output + + the writer to write to + null, state is not set + + + Writes the special path environment folder path to the output . + The name of the special path environment folder path to output must be set + using the + property. + + + + + + The fully qualified type of the EnvironmentFolderPathPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Write an environment variable to the output + + + + Write an environment variable to the output writer. + The value of the determines + the name of the variable to output. + + + Nicko Cadell + + + + Write an environment variable to the output + + the writer to write to + null, state is not set + + + Writes the environment variable to the output . + The name of the environment variable to output must be set + using the + property. + + + + + + The fully qualified type of the EnvironmentPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Write the current thread identity to the output + + + + Write the current thread identity to the output writer + + + Nicko Cadell + + + + Write the current thread identity to the output + + the writer to write to + null, state is not set + + + Writes the current thread identity to the output . + + + + + + The fully qualified type of the IdentityPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Pattern converter for literal string instances in the pattern + + + + Writes the literal string value specified in the + property to + the output. + + + Nicko Cadell + + + + Set the next converter in the chain + + The next pattern converter in the chain + The next pattern converter + + + Special case the building of the pattern converter chain + for instances. Two adjacent + literals in the pattern can be represented by a single combined + pattern converter. This implementation detects when a + is added to the chain + after this converter and combines its value with this converter's + literal value. + + + + + + Write the literal to the output + + the writer to write to + null, not set + + + Override the formatting behavior to ignore the FormattingInfo + because we have a literal instead. + + + Writes the value of + to the output . + + + + + + Convert this pattern into the rendered message + + that will receive the formatted result. + null, not set + + + This method is not used. + + + + + + Writes a newline to the output + + + + Writes the system dependent line terminator to the output. + This behavior can be overridden by setting the : + + + + Option Value + Output + + + DOS + DOS or Windows line terminator "\r\n" + + + UNIX + UNIX line terminator "\n" + + + + Nicko Cadell + + + + Initialize the converter + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Write the current process ID to the output + + + + Write the current process ID to the output writer + + + Nicko Cadell + + + + Write the current process ID to the output + + the writer to write to + null, state is not set + + + Write the current process ID to the output . + + + + + + The fully qualified type of the ProcessIdPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Property pattern converter + + + + This pattern converter reads the thread and global properties. + The thread properties take priority over global properties. + See for details of the + thread properties. See for + details of the global properties. + + + If the is specified then that will be used to + lookup a single property. If no is specified + then all properties will be dumped as a list of key value pairs. + + + Nicko Cadell + + + + Write the property value to the output + + that will receive the formatted result. + null, state is not set + + + Writes out the value of a named property. The property name + should be set in the + property. + + + If the is set to null + then all the properties are written as key value pairs. + + + + + + A Pattern converter that generates a string of random characters + + + + The converter generates a string of random characters. By default + the string is length 4. This can be changed by setting the + to the string value of the length required. + + + The random characters in the string are limited to uppercase letters + and numbers only. + + + The random number generator used by this class is not cryptographically secure. + + + Nicko Cadell + + + + Shared random number generator + + + + + Length of random string to generate. Default length 4. + + + + + Initialize the converter options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Write a randoim string to the output + + the writer to write to + null, state is not set + + + Write a randoim string to the output . + + + + + + The fully qualified type of the RandomStringPatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Write the current threads username to the output + + + + Write the current threads username to the output writer + + + Nicko Cadell + + + + Write the current threads username to the output + + the writer to write to + null, state is not set + + + Write the current threads username to the output . + + + + + + The fully qualified type of the UserNamePatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Write the UTC date time to the output + + + + Date pattern converter, uses a to format + the current date and time in Universal time. + + + See the for details on the date pattern syntax. + + + + Nicko Cadell + + + + Write the current date and time to the output + + that will receive the formatted result. + null, state is not set + + + Pass the current date and time to the + for it to render it to the writer. + + + The date is in Universal time when it is rendered. + + + + + + + The fully qualified type of the UtcDatePatternConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Type converter for Boolean. + + + + Supports conversion from string to bool type. + + + + + + Nicko Cadell + Gert Driesen + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Returns true if the is + the type. + + + + + + Convert the source object to the type supported by this object + + the object to convert + the converted object + + + Uses the method to convert the + argument to a . + + + + The object cannot be converted to the + target type. To check for this condition use the + method. + + + + + Exception base type for conversion errors. + + + + This type extends . It + does not add any new functionality but does differentiate the + type of exception being thrown. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Constructor + + A message to include with the exception. + + + Initializes a new instance of the class + with the specified message. + + + + + + Constructor + + A message to include with the exception. + A nested exception to include. + + + Initializes a new instance of the class + with the specified message and inner exception. + + + + + + Serialization constructor + + The that holds the serialized object data about the exception being thrown. + The that contains contextual information about the source or destination. + + + Initializes a new instance of the class + with serialized data. + + + + + + Creates a new instance of the class. + + The conversion destination type. + The value to convert. + An instance of the . + + + Creates a new instance of the class. + + + + + + Creates a new instance of the class. + + The conversion destination type. + The value to convert. + A nested exception to include. + An instance of the . + + + Creates a new instance of the class. + + + + + + Register of type converters for specific types. + + + + Maintains a registry of type converters used to convert between + types. + + + Use the and + methods to register new converters. + The and methods + lookup appropriate converters to use. + + + + + Nicko Cadell + Gert Driesen + + + + Private constructor + + + Initializes a new instance of the class. + + + + + Static constructor. + + + + This constructor defines the intrinsic type converters. + + + + + + Adds a converter for a specific type. + + The type being converted to. + The type converter to use to convert to the destination type. + + + Adds a converter instance for a specific type. + + + + + + Adds a converter for a specific type. + + The type being converted to. + The type of the type converter to use to convert to the destination type. + + + Adds a converter for a specific type. + + + + + + Gets the type converter to use to convert values to the destination type. + + The type being converted from. + The type being converted to. + + The type converter instance to use for type conversions or null + if no type converter is found. + + + + Gets the type converter to use to convert values to the destination type. + + + + + + Gets the type converter to use to convert values to the destination type. + + The type being converted to. + + The type converter instance to use for type conversions or null + if no type converter is found. + + + + Gets the type converter to use to convert values to the destination type. + + + + + + Lookups the type converter to use as specified by the attributes on the + destination type. + + The type being converted to. + + The type converter instance to use for type conversions or null + if no type converter is found. + + + + + Creates the instance of the type converter. + + The type of the type converter. + + The type converter instance to use for type conversions or null + if no type converter is found. + + + + The type specified for the type converter must implement + the or interfaces + and must have a public default (no argument) constructor. + + + + + + The fully qualified type of the ConverterRegistry class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Mapping from to type converter. + + + + + Supports conversion from string to type. + + + + Supports conversion from string to type. + + + + + + Nicko Cadell + Gert Driesen + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Returns true if the is + the type. + + + + + + Overrides the ConvertFrom method of IConvertFrom. + + the object to convert to an encoding + the encoding + + + Uses the method to + convert the argument to an . + + + + The object cannot be converted to the + target type. To check for this condition use the + method. + + + + + Interface supported by type converters + + + + This interface supports conversion from a single type to arbitrary types. + See . + + + Nicko Cadell + + + + Returns whether this converter can convert the object to the specified type + + A Type that represents the type you want to convert to + true if the conversion is possible + + + Test if the type supported by this converter can be converted to the + . + + + + + + Converts the given value object to the specified type, using the arguments + + the object to convert + The Type to convert the value parameter to + the converted object + + + Converts the (which must be of the type supported + by this converter) to the specified.. + + + + + + Supports conversion from string to type. + + + + Supports conversion from string to type. + + + + + Nicko Cadell + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Returns true if the is + the type. + + + + + + Overrides the ConvertFrom method of IConvertFrom. + + the object to convert to an IPAddress + the IPAddress + + + Uses the method to convert the + argument to an . + If that fails then the string is resolved as a DNS hostname. + + + + The object cannot be converted to the + target type. To check for this condition use the + method. + + + + + Valid characters in an IPv4 or IPv6 address string. (Does not support subnets) + + + + + Supports conversion from string to type. + + + + Supports conversion from string to type. + + + The string is used as the + of the . + + + + + + Nicko Cadell + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Returns true if the is + the type. + + + + + + Overrides the ConvertFrom method of IConvertFrom. + + the object to convert to a PatternLayout + the PatternLayout + + + Creates and returns a new using + the as the + . + + + + The object cannot be converted to the + target type. To check for this condition use the + method. + + + + + Convert between string and + + + + Supports conversion from string to type, + and from a type to a string. + + + The string is used as the + of the . + + + + + + Nicko Cadell + + + + Can the target type be converted to the type supported by this object + + A that represents the type you want to convert to + true if the conversion is possible + + + Returns true if the is + assignable from a type. + + + + + + Converts the given value object to the specified type, using the arguments + + the object to convert + The Type to convert the value parameter to + the converted object + + + Uses the method to convert the + argument to a . + + + + The object cannot be converted to the + . To check for this condition use the + method. + + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Returns true if the is + the type. + + + + + + Overrides the ConvertFrom method of IConvertFrom. + + the object to convert to a PatternString + the PatternString + + + Creates and returns a new using + the as the + . + + + + The object cannot be converted to the + target type. To check for this condition use the + method. + + + + + Supports conversion from string to type. + + + + Supports conversion from string to type. + + + + + + Nicko Cadell + + + + Can the source type be converted to the type supported by this object + + the type to convert + true if the conversion is possible + + + Returns true if the is + the type. + + + + + + Overrides the ConvertFrom method of IConvertFrom. + + the object to convert to a Type + the Type + + + Uses the method to convert the + argument to a . + Additional effort is made to locate partially specified types + by searching the loaded assemblies. + + + + The object cannot be converted to the + target type. To check for this condition use the + method. + + + + + Attribute used to associate a type converter + + + + Class and Interface level attribute that specifies a type converter + to use with the associated type. + + + To associate a type converter with a target type apply a + TypeConverterAttribute to the target type. Specify the + type of the type converter on the attribute. + + + Nicko Cadell + Gert Driesen + + + + The string type name of the type converter + + + + + Default constructor + + + + Default constructor + + + + + + Create a new type converter attribute for the specified type name + + The string type name of the type converter + + + The type specified must implement the + or the interfaces. + + + + + + Create a new type converter attribute for the specified type + + The type of the type converter + + + The type specified must implement the + or the interfaces. + + + + + + The string type name of the type converter + + + The string type name of the type converter + + + + The type specified must implement the + or the interfaces. + + + + + + A straightforward implementation of the interface. + + + + This is the default implementation of the + interface. Implementors of the interface + should aggregate an instance of this type. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Append on on all attached appenders. + + The event being logged. + The number of appenders called. + + + Calls the method on all + attached appenders. + + + + + + Append on on all attached appenders. + + The array of events being logged. + The number of appenders called. + + + Calls the method on all + attached appenders. + + + + + + Calls the DoAppende method on the with + the objects supplied. + + The appender + The events + + + If the supports the + interface then the will be passed + through using that interface. Otherwise the + objects in the array will be passed one at a time. + + + + + + Attaches an appender. + + The appender to add. + + + If the appender is already in the list it won't be added again. + + + + + + Gets an attached appender with the specified name. + + The name of the appender to get. + + The appender with the name specified, or null if no appender with the + specified name is found. + + + + Lookup an attached appender by name. + + + + + + Removes all attached appenders. + + + + Removes and closes all attached appenders + + + + + + Removes the specified appender from the list of attached appenders. + + The appender to remove. + The appender removed from the list + + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + + Removes the appender with the specified name from the list of appenders. + + The name of the appender to remove. + The appender removed from the list + + + The appender removed is not closed. + If you are discarding the appender you must call + on the appender removed. + + + + + + List of appenders + + + + + Array of appenders, used to cache the m_appenderList + + + + + The fully qualified type of the AppenderAttachedImpl class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets all attached appenders. + + + A collection of attached appenders, or null if there + are no attached appenders. + + + + The read only collection of all currently attached appenders. + + + + + + This class aggregates several PropertiesDictionary collections together. + + + + Provides a dictionary style lookup over an ordered list of + collections. + + + Nicko Cadell + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Add a Properties Dictionary to this composite collection + + the properties to add + + + Properties dictionaries added first take precedence over dictionaries added + later. + + + + + + Flatten this composite collection into a single properties dictionary + + the flattened dictionary + + + Reduces the collection of ordered dictionaries to a single dictionary + containing the resultant values for the keys. + + + + + + Gets the value of a property + + + The value for the property with the specified key + + + + Looks up the value for the specified. + The collections are searched + in the order in which they were added to this collection. The value + returned is the value held by the first collection that contains + the specified key. + + + If none of the collections contain the specified key then + null is returned. + + + + + + Base class for Context Properties implementations + + + + This class defines a basic property get set accessor + + + Nicko Cadell + + + + Gets or sets the value of a property + + + The value for the property with the specified key + + + + Gets or sets the value of a property + + + + + + Wrapper class used to map converter names to converter types + + + + Pattern converter info class used during configuration by custom + PatternString and PatternLayer converters. + + + + + + default constructor + + + + + + + + + + + Gets or sets the name of the conversion pattern + + + + The name of the pattern in the format string + + + + + + Gets or sets the type of the converter + + + + The value specified must extend the + type. + + + + + + + + + + + Subclass of that maintains a count of + the number of bytes written. + + + + This writer counts the number of bytes written. + + + Nicko Cadell + Gert Driesen + + + + that does not leak exceptions + + + + does not throw exceptions when things go wrong. + Instead, it delegates error handling to its . + + + Nicko Cadell + Gert Driesen + + + + Adapter that extends and forwards all + messages to an instance of . + + + + Adapter that extends and forwards all + messages to an instance of . + + + Nicko Cadell + + + + The writer to forward messages to + + + + + Create an instance of that forwards all + messages to a . + + The to forward to + + + Create an instance of that forwards all + messages to a . + + + + + + Closes the writer and releases any system resources associated with the writer + + + + + + + + + Dispose this writer + + flag indicating if we are being disposed + + + Dispose this writer + + + + + + Flushes any buffered output + + + + Clears all buffers for the writer and causes any buffered data to be written + to the underlying device + + + + + + Writes a character to the wrapped TextWriter + + the value to write to the TextWriter + + + Writes a character to the wrapped TextWriter + + + + + + Writes a character buffer to the wrapped TextWriter + + the data buffer + the start index + the number of characters to write + + + Writes a character buffer to the wrapped TextWriter + + + + + + Writes a string to the wrapped TextWriter + + the value to write to the TextWriter + + + Writes a string to the wrapped TextWriter + + + + + + Gets or sets the underlying . + + + The underlying . + + + + Gets or sets the underlying . + + + + + + The Encoding in which the output is written + + + The + + + + The Encoding in which the output is written + + + + + + Gets an object that controls formatting + + + The format provider + + + + Gets an object that controls formatting + + + + + + Gets or sets the line terminator string used by the TextWriter + + + The line terminator to use + + + + Gets or sets the line terminator string used by the TextWriter + + + + + + Constructor + + the writer to actually write to + the error handler to report error to + + + Create a new QuietTextWriter using a writer and error handler + + + + + + Writes a character to the underlying writer + + the char to write + + + Writes a character to the underlying writer + + + + + + Writes a buffer to the underlying writer + + the buffer to write + the start index to write from + the number of characters to write + + + Writes a buffer to the underlying writer + + + + + + Writes a string to the output. + + The string data to write to the output. + + + Writes a string to the output. + + + + + + Closes the underlying output writer. + + + + Closes the underlying output writer. + + + + + + The error handler instance to pass all errors to + + + + + Flag to indicate if this writer is closed + + + + + Gets or sets the error handler that all errors are passed to. + + + The error handler that all errors are passed to. + + + + Gets or sets the error handler that all errors are passed to. + + + + + + Gets a value indicating whether this writer is closed. + + + true if this writer is closed, otherwise false. + + + + Gets a value indicating whether this writer is closed. + + + + + + Constructor + + The to actually write to. + The to report errors to. + + + Creates a new instance of the class + with the specified and . + + + + + + Writes a character to the underlying writer and counts the number of bytes written. + + the char to write + + + Overrides implementation of . Counts + the number of bytes written. + + + + + + Writes a buffer to the underlying writer and counts the number of bytes written. + + the buffer to write + the start index to write from + the number of characters to write + + + Overrides implementation of . Counts + the number of bytes written. + + + + + + Writes a string to the output and counts the number of bytes written. + + The string data to write to the output. + + + Overrides implementation of . Counts + the number of bytes written. + + + + + + Total number of bytes written. + + + + + Gets or sets the total number of bytes written. + + + The total number of bytes written. + + + + Gets or sets the total number of bytes written. + + + + + + A fixed size rolling buffer of logging events. + + + + An array backed fixed size leaky bucket. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + The maximum number of logging events in the buffer. + + + Initializes a new instance of the class with + the specified maximum number of buffered logging events. + + + The argument is not a positive integer. + + + + Appends a to the buffer. + + The event to append to the buffer. + The event discarded from the buffer, if the buffer is full, otherwise null. + + + Append an event to the buffer. If the buffer still contains free space then + null is returned. If the buffer is full then an event will be dropped + to make space for the new event, the event dropped is returned. + + + + + + Get and remove the oldest event in the buffer. + + The oldest logging event in the buffer + + + Gets the oldest (first) logging event in the buffer and removes it + from the buffer. + + + + + + Pops all the logging events from the buffer into an array. + + An array of all the logging events in the buffer. + + + Get all the events in the buffer and clear the buffer. + + + + + + Clear the buffer + + + + Clear the buffer of all events. The events in the buffer are lost. + + + + + + Gets the th oldest event currently in the buffer. + + The th oldest event currently in the buffer. + + + If is outside the range 0 to the number of events + currently in the buffer, then null is returned. + + + + + + Gets the maximum size of the buffer. + + The maximum size of the buffer. + + + Gets the maximum size of the buffer + + + + + + Gets the number of logging events in the buffer. + + The number of logging events in the buffer. + + + This number is guaranteed to be in the range 0 to + (inclusive). + + + + + + An always empty . + + + + A singleton implementation of the + interface that always represents an empty collection. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to enforce the singleton pattern. + + + + + + Copies the elements of the to an + , starting at a particular Array index. + + The one-dimensional + that is the destination of the elements copied from + . The Array must have zero-based + indexing. + The zero-based index in array at which + copying begins. + + + As the collection is empty no values are copied into the array. + + + + + + Returns an enumerator that can iterate through a collection. + + + An that can be used to + iterate through the collection. + + + + As the collection is empty a is returned. + + + + + + The singleton instance of the empty collection. + + + + + Gets the singleton instance of the empty collection. + + The singleton instance of the empty collection. + + + Gets the singleton instance of the empty collection. + + + + + + Gets a value indicating if access to the is synchronized (thread-safe). + + + true if access to the is synchronized (thread-safe); otherwise, false. + + + + For the this property is always true. + + + + + + Gets the number of elements contained in the . + + + The number of elements contained in the . + + + + As the collection is empty the is always 0. + + + + + + Gets an object that can be used to synchronize access to the . + + + An object that can be used to synchronize access to the . + + + + As the collection is empty and thread safe and synchronized this instance is also + the object. + + + + + + An always empty . + + + + A singleton implementation of the + interface that always represents an empty collection. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to enforce the singleton pattern. + + + + + + Copies the elements of the to an + , starting at a particular Array index. + + The one-dimensional + that is the destination of the elements copied from + . The Array must have zero-based + indexing. + The zero-based index in array at which + copying begins. + + + As the collection is empty no values are copied into the array. + + + + + + Returns an enumerator that can iterate through a collection. + + + An that can be used to + iterate through the collection. + + + + As the collection is empty a is returned. + + + + + + Adds an element with the provided key and value to the + . + + The to use as the key of the element to add. + The to use as the value of the element to add. + + + As the collection is empty no new values can be added. A + is thrown if this method is called. + + + This dictionary is always empty and cannot be modified. + + + + Removes all elements from the . + + + + As the collection is empty no values can be removed. A + is thrown if this method is called. + + + This dictionary is always empty and cannot be modified. + + + + Determines whether the contains an element + with the specified key. + + The key to locate in the . + false + + + As the collection is empty the method always returns false. + + + + + + Returns an enumerator that can iterate through a collection. + + + An that can be used to + iterate through the collection. + + + + As the collection is empty a is returned. + + + + + + Removes the element with the specified key from the . + + The key of the element to remove. + + + As the collection is empty no values can be removed. A + is thrown if this method is called. + + + This dictionary is always empty and cannot be modified. + + + + The singleton instance of the empty dictionary. + + + + + Gets the singleton instance of the . + + The singleton instance of the . + + + Gets the singleton instance of the . + + + + + + Gets a value indicating if access to the is synchronized (thread-safe). + + + true if access to the is synchronized (thread-safe); otherwise, false. + + + + For the this property is always true. + + + + + + Gets the number of elements contained in the + + + The number of elements contained in the . + + + + As the collection is empty the is always 0. + + + + + + Gets an object that can be used to synchronize access to the . + + + An object that can be used to synchronize access to the . + + + + As the collection is empty and thread safe and synchronized this instance is also + the object. + + + + + + Gets a value indicating whether the has a fixed size. + + true + + + As the collection is empty always returns true. + + + + + + Gets a value indicating whether the is read-only. + + true + + + As the collection is empty always returns true. + + + + + + Gets an containing the keys of the . + + An containing the keys of the . + + + As the collection is empty a is returned. + + + + + + Gets an containing the values of the . + + An containing the values of the . + + + As the collection is empty a is returned. + + + + + + Gets or sets the element with the specified key. + + The key of the element to get or set. + null + + + As the collection is empty no values can be looked up or stored. + If the index getter is called then null is returned. + A is thrown if the setter is called. + + + This dictionary is always empty and cannot be modified. + + + + Contain the information obtained when parsing formatting modifiers + in conversion modifiers. + + + + Holds the formatting information extracted from the format string by + the . This is used by the + objects when rendering the output. + + + Nicko Cadell + Gert Driesen + + + + Defaut Constructor + + + + Initializes a new instance of the class. + + + + + + Constructor + + + + Initializes a new instance of the class + with the specified parameters. + + + + + + Gets or sets the minimum value. + + + The minimum value. + + + + Gets or sets the minimum value. + + + + + + Gets or sets the maximum value. + + + The maximum value. + + + + Gets or sets the maximum value. + + + + + + Gets or sets a flag indicating whether left align is enabled + or not. + + + A flag indicating whether left align is enabled or not. + + + + Gets or sets a flag indicating whether left align is enabled or not. + + + + + + Implementation of Properties collection for the + + + + This class implements a properties collection that is thread safe and supports both + storing properties and capturing a read only copy of the current propertied. + + + This class is optimized to the scenario where the properties are read frequently + and are modified infrequently. + + + Nicko Cadell + + + + The read only copy of the properties. + + + + This variable is declared volatile to prevent the compiler and JIT from + reordering reads and writes of this thread performed on different threads. + + + + + + Lock object used to synchronize updates within this instance + + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Remove a property from the global context + + the key for the entry to remove + + + Removing an entry from the global context properties is relatively expensive compared + with reading a value. + + + + + + Clear the global context properties + + + + + Get a readonly immutable copy of the properties + + the current global context properties + + + This implementation is fast because the GlobalContextProperties class + stores a readonly copy of the properties. + + + + + + Gets or sets the value of a property + + + The value for the property with the specified key + + + + Reading the value for a key is faster than setting the value. + When the value is written a new read only copy of + the properties is created. + + + + + + Manages a mapping from levels to + + + + Manages an ordered mapping from instances + to subclasses. + + + Nicko Cadell + + + + Default constructor + + + + Initialise a new instance of . + + + + + + Add a to this mapping + + the entry to add + + + If a has previously been added + for the same then that entry will be + overwritten. + + + + + + Lookup the mapping for the specified level + + the level to lookup + the for the level or null if no mapping found + + + Lookup the value for the specified level. Finds the nearest + mapping value for the level that is equal to or less than the + specified. + + + If no mapping could be found then null is returned. + + + + + + Initialize options + + + + Caches the sorted list of in an array + + + + + + Implementation of Properties collection for the + + + + Class implements a collection of properties that is specific to each thread. + The class is not synchronized as each thread has its own . + + + This class stores its properties in a slot on the named + log4net.Util.LogicalThreadContextProperties. + + + The requires a link time + for the + . + If the calling code does not have this permission then this context will be disabled. + It will not store any property values set on it. + + + Nicko Cadell + + + + Flag used to disable this context if we don't have permission to access the CallContext. + + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Remove a property + + the key for the entry to remove + + + Remove the value for the specified from the context. + + + + + + Clear all the context properties + + + + Clear all the context properties + + + + + + Get the PropertiesDictionary stored in the LocalDataStoreSlot for this thread. + + create the dictionary if it does not exist, otherwise return null if is does not exist + the properties for this thread + + + The collection returned is only to be used on the calling thread. If the + caller needs to share the collection between different threads then the + caller must clone the collection before doings so. + + + + + + Gets the call context get data. + + The peroperties dictionary stored in the call context + + The method has a + security link demand, therfore we must put the method call in a seperate method + that we can wrap in an exception handler. + + + + + Sets the call context data. + + The properties. + + The method has a + security link demand, therfore we must put the method call in a seperate method + that we can wrap in an exception handler. + + + + + The fully qualified type of the LogicalThreadContextProperties class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets or sets the value of a property + + + The value for the property with the specified key + + + + Get or set the property value for the specified. + + + + + + + + + + + + + Outputs log statements from within the log4net assembly. + + + + Log4net components cannot make log4net logging calls. However, it is + sometimes useful for the user to learn about what log4net is + doing. + + + All log4net internal debug calls go to the standard output stream + whereas internal error messages are sent to the standard error output + stream. + + + Nicko Cadell + Gert Driesen + + + + Formats Prefix, Source, and Message in the same format as the value + sent to Console.Out and Trace.Write. + + + + + + Initializes a new instance of the class. + + + + + + + + + Static constructor that initializes logging by reading + settings from the application configuration file. + + + + The log4net.Internal.Debug application setting + controls internal debugging. This setting should be set + to true to enable debugging. + + + The log4net.Internal.Quiet application setting + suppresses all internal logging including error messages. + This setting should be set to true to enable message + suppression. + + + + + + Raises the LogReceived event when an internal messages is received. + + + + + + + + + Writes log4net internal debug messages to the + standard output stream. + + + The message to log. + + + All internal debug messages are prepended with + the string "log4net: ". + + + + + + Writes log4net internal debug messages to the + standard output stream. + + The Type that generated this message. + The message to log. + An exception to log. + + + All internal debug messages are prepended with + the string "log4net: ". + + + + + + Writes log4net internal warning messages to the + standard error stream. + + The Type that generated this message. + The message to log. + + + All internal warning messages are prepended with + the string "log4net:WARN ". + + + + + + Writes log4net internal warning messages to the + standard error stream. + + The Type that generated this message. + The message to log. + An exception to log. + + + All internal warning messages are prepended with + the string "log4net:WARN ". + + + + + + Writes log4net internal error messages to the + standard error stream. + + The Type that generated this message. + The message to log. + + + All internal error messages are prepended with + the string "log4net:ERROR ". + + + + + + Writes log4net internal error messages to the + standard error stream. + + The Type that generated this message. + The message to log. + An exception to log. + + + All internal debug messages are prepended with + the string "log4net:ERROR ". + + + + + + Writes output to the standard output stream. + + The message to log. + + + Writes to both Console.Out and System.Diagnostics.Trace. + Note that the System.Diagnostics.Trace is not supported + on the Compact Framework. + + + If the AppDomain is not configured with a config file then + the call to System.Diagnostics.Trace may fail. This is only + an issue if you are programmatically creating your own AppDomains. + + + + + + Writes output to the standard error stream. + + The message to log. + + + Writes to both Console.Error and System.Diagnostics.Trace. + Note that the System.Diagnostics.Trace is not supported + on the Compact Framework. + + + If the AppDomain is not configured with a config file then + the call to System.Diagnostics.Trace may fail. This is only + an issue if you are programmatically creating your own AppDomains. + + + + + + Default debug level + + + + + In quietMode not even errors generate any output. + + + + + The event raised when an internal message has been received. + + + + + The Type that generated the internal message. + + + + + The DateTime stamp of when the internal message was received. + + + + + A string indicating the severity of the internal message. + + + "log4net: ", + "log4net:ERROR ", + "log4net:WARN " + + + + + The internal log message. + + + + + The Exception related to the message. + + + Optional. Will be null if no Exception was passed. + + + + + Gets or sets a value indicating whether log4net internal logging + is enabled or disabled. + + + true if log4net internal logging is enabled, otherwise + false. + + + + When set to true, internal debug level logging will be + displayed. + + + This value can be set by setting the application setting + log4net.Internal.Debug in the application configuration + file. + + + The default value is false, i.e. debugging is + disabled. + + + + + The following example enables internal debugging using the + application configuration file : + + + + + + + + + + + + + Gets or sets a value indicating whether log4net should generate no output + from internal logging, not even for errors. + + + true if log4net should generate no output at all from internal + logging, otherwise false. + + + + When set to true will cause internal logging at all levels to be + suppressed. This means that no warning or error reports will be logged. + This option overrides the setting and + disables all debug also. + + This value can be set by setting the application setting + log4net.Internal.Quiet in the application configuration file. + + + The default value is false, i.e. internal logging is not + disabled. + + + + The following example disables internal logging using the + application configuration file : + + + + + + + + + + + + + + + + + Test if LogLog.Debug is enabled for output. + + + true if Debug is enabled + + + + Test if LogLog.Debug is enabled for output. + + + + + + Test if LogLog.Warn is enabled for output. + + + true if Warn is enabled + + + + Test if LogLog.Warn is enabled for output. + + + + + + Test if LogLog.Error is enabled for output. + + + true if Error is enabled + + + + Test if LogLog.Error is enabled for output. + + + + + + Subscribes to the LogLog.LogReceived event and stores messages + to the supplied IList instance. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents a native error code and message. + + + + Represents a Win32 platform native error. + + + Nicko Cadell + Gert Driesen + + + + Create an instance of the class with the specified + error number and message. + + The number of the native error. + The message of the native error. + + + Create an instance of the class with the specified + error number and message. + + + + + + Create a new instance of the class for the last Windows error. + + + An instance of the class for the last windows error. + + + + The message for the error number is lookup up using the + native Win32 FormatMessage function. + + + + + + Create a new instance of the class. + + the error number for the native error + + An instance of the class for the specified + error number. + + + + The message for the specified error number is lookup up using the + native Win32 FormatMessage function. + + + + + + Retrieves the message corresponding with a Win32 message identifier. + + Message identifier for the requested message. + + The message corresponding with the specified message identifier. + + + + The message will be searched for in system message-table resource(s) + using the native FormatMessage function. + + + + + + Return error information string + + error information string + + + Return error information string + + + + + + Formats a message string. + + Formatting options, and how to interpret the parameter. + Location of the message definition. + Message identifier for the requested message. + Language identifier for the requested message. + If includes FORMAT_MESSAGE_ALLOCATE_BUFFER, the function allocates a buffer using the LocalAlloc function, and places the pointer to the buffer at the address specified in . + If the FORMAT_MESSAGE_ALLOCATE_BUFFER flag is not set, this parameter specifies the maximum number of TCHARs that can be stored in the output buffer. If FORMAT_MESSAGE_ALLOCATE_BUFFER is set, this parameter specifies the minimum number of TCHARs to allocate for an output buffer. + Pointer to an array of values that are used as insert values in the formatted message. + + + The function requires a message definition as input. The message definition can come from a + buffer passed into the function. It can come from a message table resource in an + already-loaded module. Or the caller can ask the function to search the system's message + table resource(s) for the message definition. The function finds the message definition + in a message table resource based on a message identifier and a language identifier. + The function copies the formatted message text to an output buffer, processing any embedded + insert sequences if requested. + + + To prevent the usage of unsafe code, this stub does not support inserting values in the formatted message. + + + + + If the function succeeds, the return value is the number of TCHARs stored in the output + buffer, excluding the terminating null character. + + + If the function fails, the return value is zero. To get extended error information, + call . + + + + + + Gets the number of the native error. + + + The number of the native error. + + + + Gets the number of the native error. + + + + + + Gets the message of the native error. + + + The message of the native error. + + + + + Gets the message of the native error. + + + + + An always empty . + + + + A singleton implementation of the over a collection + that is empty and not modifiable. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to enforce the singleton pattern. + + + + + + Test if the enumerator can advance, if so advance. + + false as the cannot advance. + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will always return false. + + + + + + Resets the enumerator back to the start. + + + + As the enumerator is over an empty collection does nothing. + + + + + + The singleton instance of the . + + + + + Gets the singleton instance of the . + + The singleton instance of the . + + + Gets the singleton instance of the . + + + + + + Gets the current object from the enumerator. + + + Throws an because the + never has a current value. + + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will throw an . + + + The collection is empty and + cannot be positioned over a valid location. + + + + Gets the current key from the enumerator. + + + Throws an exception because the + never has a current value. + + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will throw an . + + + The collection is empty and + cannot be positioned over a valid location. + + + + Gets the current value from the enumerator. + + The current value from the enumerator. + + Throws an because the + never has a current value. + + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will throw an . + + + The collection is empty and + cannot be positioned over a valid location. + + + + Gets the current entry from the enumerator. + + + Throws an because the + never has a current entry. + + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will throw an . + + + The collection is empty and + cannot be positioned over a valid location. + + + + An always empty . + + + + A singleton implementation of the over a collection + that is empty and not modifiable. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to enforce the singleton pattern. + + + + + + Test if the enumerator can advance, if so advance + + false as the cannot advance. + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will always return false. + + + + + + Resets the enumerator back to the start. + + + + As the enumerator is over an empty collection does nothing. + + + + + + The singleton instance of the . + + + + + Get the singleton instance of the . + + The singleton instance of the . + + + Gets the singleton instance of the . + + + + + + Gets the current object from the enumerator. + + + Throws an because the + never has a current value. + + + + As the enumerator is over an empty collection its + value cannot be moved over a valid position, therefore + will throw an . + + + The collection is empty and + cannot be positioned over a valid location. + + + + A SecurityContext used when a SecurityContext is not required + + + + The is a no-op implementation of the + base class. It is used where a + is required but one has not been provided. + + + Nicko Cadell + + + + Singleton instance of + + + + Singleton instance of + + + + + + Private constructor + + + + Private constructor for singleton pattern. + + + + + + Impersonate this SecurityContext + + State supplied by the caller + null + + + No impersonation is done and null is always returned. + + + + + + Implements log4net's default error handling policy which consists + of emitting a message for the first error in an appender and + ignoring all subsequent errors. + + + + The error message is processed using the LogLog sub-system. + + + This policy aims at protecting an otherwise working application + from being flooded with error messages when logging fails. + + + Nicko Cadell + Gert Driesen + Ron Grabowski + + + + Default Constructor + + + + Initializes a new instance of the class. + + + + + + Constructor + + The prefix to use for each message. + + + Initializes a new instance of the class + with the specified prefix. + + + + + + Reset the error handler back to its initial disabled state. + + + + + Log an Error + + The error message. + The exception. + The internal error code. + + + Sends the error information to 's Error method. + + + + + + Log an Error + + The error message. + The exception. + + + Prints the message and the stack trace of the exception on the standard + error output stream. + + + + + + Log an error + + The error message. + + + Print a the error message passed as parameter on the standard + error output stream. + + + + + + The date the error was recorded. + + + + + Flag to indicate if it is the first error + + + + + The message recorded during the first error. + + + + + The exception recorded during the first error. + + + + + The error code recorded during the first error. + + + + + String to prefix each message with + + + + + The fully qualified type of the OnlyOnceErrorHandler class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Is error logging enabled + + + + Is error logging enabled. Logging is only enabled for the + first error delivered to the . + + + + + + The date the first error that trigged this error handler occured. + + + + + The message from the first error that trigged this error handler. + + + + + The exception from the first error that trigged this error handler. + + + May be . + + + + + The error code from the first error that trigged this error handler. + + + Defaults to + + + + + A convenience class to convert property values to specific types. + + + + Utility functions for converting types and parsing values. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to prevent instantiation of this class. + + + + + + Converts a string to a value. + + String to convert. + The default value. + The value of . + + + If is "true", then true is returned. + If is "false", then false is returned. + Otherwise, is returned. + + + + + + Parses a file size into a number. + + String to parse. + The default value. + The value of . + + + Parses a file size of the form: number[KB|MB|GB] into a + long value. It is scaled with the appropriate multiplier. + + + is returned when + cannot be converted to a value. + + + + + + Converts a string to an object. + + The target type to convert to. + The string to convert to an object. + + The object converted from a string or null when the + conversion failed. + + + + Converts a string to an object. Uses the converter registry to try + to convert the string value into the specified target type. + + + + + + Checks if there is an appropriate type conversion from the source type to the target type. + + The type to convert from. + The type to convert to. + true if there is a conversion from the source type to the target type. + + Checks if there is an appropriate type conversion from the source type to the target type. + + + + + + + Converts an object to the target type. + + The object to convert to the target type. + The type to convert to. + The converted object. + + + Converts an object to the target type. + + + + + + Instantiates an object given a class name. + + The fully qualified class name of the object to instantiate. + The class to which the new object should belong. + The object to return in case of non-fulfillment. + + An instance of the or + if the object could not be instantiated. + + + + Checks that the is a subclass of + . If that test fails or the object could + not be instantiated, then is returned. + + + + + + Performs variable substitution in string from the + values of keys found in . + + The string on which variable substitution is performed. + The dictionary to use to lookup variables. + The result of the substitutions. + + + The variable substitution delimiters are ${ and }. + + + For example, if props contains key=value, then the call + + + + string s = OptionConverter.SubstituteVariables("Value of key is ${key}."); + + + + will set the variable s to "Value of key is value.". + + + If no value could be found for the specified key, then substitution + defaults to an empty string. + + + For example, if system properties contains no value for the key + "nonExistentKey", then the call + + + + string s = OptionConverter.SubstituteVariables("Value of nonExistentKey is [${nonExistentKey}]"); + + + + will set s to "Value of nonExistentKey is []". + + + An Exception is thrown if contains a start + delimiter "${" which is not balanced by a stop delimiter "}". + + + + + + Converts the string representation of the name or numeric value of one or + more enumerated constants to an equivalent enumerated object. + + The type to convert to. + The enum string value. + If true, ignore case; otherwise, regard case. + An object of type whose value is represented by . + + + + The fully qualified type of the OptionConverter class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Most of the work of the class + is delegated to the PatternParser class. + + + + The PatternParser processes a pattern string and + returns a chain of objects. + + + Nicko Cadell + Gert Driesen + + + + Constructor + + The pattern to parse. + + + Initializes a new instance of the class + with the specified pattern string. + + + + + + Parses the pattern into a chain of pattern converters. + + The head of a chain of pattern converters. + + + Parses the pattern into a chain of pattern converters. + + + + + + Build the unified cache of converters from the static and instance maps + + the list of all the converter names + + + Build the unified cache of converters from the static and instance maps + + + + + + Internal method to parse the specified pattern to find specified matches + + the pattern to parse + the converter names to match in the pattern + + + The matches param must be sorted such that longer strings come before shorter ones. + + + + + + Process a parsed literal + + the literal text + + + + Process a parsed converter pattern + + the name of the converter + the optional option for the converter + the formatting info for the converter + + + + Resets the internal state of the parser and adds the specified pattern converter + to the chain. + + The pattern converter to add. + + + + The first pattern converter in the chain + + + + + the last pattern converter in the chain + + + + + The pattern + + + + + Internal map of converter identifiers to converter types + + + + This map overrides the static s_globalRulesRegistry map. + + + + + + The fully qualified type of the PatternParser class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Get the converter registry used by this parser + + + The converter registry used by this parser + + + + Get the converter registry used by this parser + + + + + + Sort strings by length + + + + that orders strings by string length. + The longest strings are placed first + + + + + + This class implements a patterned string. + + + + This string has embedded patterns that are resolved and expanded + when the string is formatted. + + + This class functions similarly to the + in that it accepts a pattern and renders it to a string. Unlike the + however the PatternString + does not render the properties of a specific but + of the process in general. + + + The recognized conversion pattern names are: + + + + Conversion Pattern Name + Effect + + + appdomain + + + Used to output the friendly name of the current AppDomain. + + + + + date + + + Used to output the current date and time in the local time zone. + To output the date in universal time use the %utcdate pattern. + The date conversion + specifier may be followed by a date format specifier enclosed + between braces. For example, %date{HH:mm:ss,fff} or + %date{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is + given then ISO8601 format is + assumed (). + + + The date format specifier admits the same syntax as the + time pattern string of the . + + + For better results it is recommended to use the log4net date + formatters. These can be specified using one of the strings + "ABSOLUTE", "DATE" and "ISO8601" for specifying + , + and respectively + . For example, + %date{ISO8601} or %date{ABSOLUTE}. + + + These dedicated date formatters perform significantly + better than . + + + + + env + + + Used to output the a specific environment variable. The key to + lookup must be specified within braces and directly following the + pattern specifier, e.g. %env{COMPUTERNAME} would include the value + of the COMPUTERNAME environment variable. + + + The env pattern is not supported on the .NET Compact Framework. + + + + + identity + + + Used to output the user name for the currently active user + (Principal.Identity.Name). + + + + + newline + + + Outputs the platform dependent line separator character or + characters. + + + This conversion pattern name offers the same performance as using + non-portable line separator strings such as "\n", or "\r\n". + Thus, it is the preferred way of specifying a line separator. + + + + + processid + + + Used to output the system process ID for the current process. + + + + + property + + + Used to output a specific context property. The key to + lookup must be specified within braces and directly following the + pattern specifier, e.g. %property{user} would include the value + from the property that is keyed by the string 'user'. Each property value + that is to be included in the log must be specified separately. + Properties are stored in logging contexts. By default + the log4net:HostName property is set to the name of machine on + which the event was originally logged. + + + If no key is specified, e.g. %property then all the keys and their + values are printed in a comma separated list. + + + The properties of an event are combined from a number of different + contexts. These are listed below in the order in which they are searched. + + + + the thread properties + + The that are set on the current + thread. These properties are shared by all events logged on this thread. + + + + the global properties + + The that are set globally. These + properties are shared by all the threads in the AppDomain. + + + + + + + random + + + Used to output a random string of characters. The string is made up of + uppercase letters and numbers. By default the string is 4 characters long. + The length of the string can be specified within braces directly following the + pattern specifier, e.g. %random{8} would output an 8 character string. + + + + + username + + + Used to output the WindowsIdentity for the currently + active user. + + + + + utcdate + + + Used to output the date of the logging event in universal time. + The date conversion + specifier may be followed by a date format specifier enclosed + between braces. For example, %utcdate{HH:mm:ss,fff} or + %utcdate{dd MMM yyyy HH:mm:ss,fff}. If no date format specifier is + given then ISO8601 format is + assumed (). + + + The date format specifier admits the same syntax as the + time pattern string of the . + + + For better results it is recommended to use the log4net date + formatters. These can be specified using one of the strings + "ABSOLUTE", "DATE" and "ISO8601" for specifying + , + and respectively + . For example, + %utcdate{ISO8601} or %utcdate{ABSOLUTE}. + + + These dedicated date formatters perform significantly + better than . + + + + + % + + + The sequence %% outputs a single percent sign. + + + + + + Additional pattern converters may be registered with a specific + instance using or + . + + + See the for details on the + format modifiers supported by the patterns. + + + Nicko Cadell + + + + Internal map of converter identifiers to converter types. + + + + + the pattern + + + + + the head of the pattern converter chain + + + + + patterns defined on this PatternString only + + + + + Initialize the global registry + + + + + Default constructor + + + + Initialize a new instance of + + + + + + Constructs a PatternString + + The pattern to use with this PatternString + + + Initialize a new instance of with the pattern specified. + + + + + + Initialize object options + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + + + + Create the used to parse the pattern + + the pattern to parse + The + + + Returns PatternParser used to parse the conversion string. Subclasses + may override this to return a subclass of PatternParser which recognize + custom conversion pattern name. + + + + + + Produces a formatted string as specified by the conversion pattern. + + The TextWriter to write the formatted event to + + + Format the pattern to the . + + + + + + Format the pattern as a string + + the pattern formatted as a string + + + Format the pattern to a string. + + + + + + Add a converter to this PatternString + + the converter info + + + This version of the method is used by the configurator. + Programmatic users should use the alternative method. + + + + + + Add a converter to this PatternString + + the name of the conversion pattern for this converter + the type of the converter + + + Add a converter to this PatternString + + + + + + Gets or sets the pattern formatting string + + + The pattern formatting string + + + + The ConversionPattern option. This is the string which + controls formatting and consists of a mix of literal content and + conversion specifiers. + + + + + + String keyed object map. + + + + While this collection is serializable only member + objects that are serializable will + be serialized along with this collection. + + + Nicko Cadell + Gert Driesen + + + + String keyed object map that is read only. + + + + This collection is readonly and cannot be modified. + + + While this collection is serializable only member + objects that are serializable will + be serialized along with this collection. + + + Nicko Cadell + Gert Driesen + + + + The Hashtable used to store the properties data + + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Copy Constructor + + properties to copy + + + Initializes a new instance of the class. + + + + + + Deserialization constructor + + The that holds the serialized object data. + The that contains contextual information about the source or destination. + + + Initializes a new instance of the class + with serialized data. + + + + + + Gets the key names. + + An array of all the keys. + + + Gets the key names. + + + + + + Test if the dictionary contains a specified key + + the key to look for + true if the dictionary contains the specified key + + + Test if the dictionary contains a specified key + + + + + + Serializes this object into the provided. + + The to populate with data. + The destination for this serialization. + + + Serializes this object into the provided. + + + + + + See + + + + + See + + + + + + See + + + + + + + Remove all properties from the properties collection + + + + + See + + + + + + + See + + + + + + + See + + + + + Gets or sets the value of the property with the specified key. + + + The value of the property with the specified key. + + The key of the property to get or set. + + + The property value will only be serialized if it is serializable. + If it cannot be serialized it will be silently ignored if + a serialization operation is performed. + + + + + + The hashtable used to store the properties + + + The internal collection used to store the properties + + + + The hashtable used to store the properties + + + + + + See + + + + + See + + + + + See + + + + + See + + + + + See + + + + + See + + + + + The number of properties in this collection + + + + + See + + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Constructor + + properties to copy + + + Initializes a new instance of the class. + + + + + + Initializes a new instance of the class + with serialized data. + + The that holds the serialized object data. + The that contains contextual information about the source or destination. + + + Because this class is sealed the serialization constructor is private. + + + + + + Remove the entry with the specified key from this dictionary + + the key for the entry to remove + + + Remove the entry with the specified key from this dictionary + + + + + + See + + an enumerator + + + Returns a over the contest of this collection. + + + + + + See + + the key to remove + + + Remove the entry with the specified key from this dictionary + + + + + + See + + the key to lookup in the collection + true if the collection contains the specified key + + + Test if this collection contains a specified key. + + + + + + Remove all properties from the properties collection + + + + Remove all properties from the properties collection + + + + + + See + + the key + the value to store for the key + + + Store a value for the specified . + + + Thrown if the is not a string + + + + See + + + + + + + See + + + + + Gets or sets the value of the property with the specified key. + + + The value of the property with the specified key. + + The key of the property to get or set. + + + The property value will only be serialized if it is serializable. + If it cannot be serialized it will be silently ignored if + a serialization operation is performed. + + + + + + See + + + false + + + + This collection is modifiable. This property always + returns false. + + + + + + See + + + The value for the key specified. + + + + Get or set a value for the specified . + + + Thrown if the is not a string + + + + See + + + + + See + + + + + See + + + + + See + + + + + See + + + + + A class to hold the key and data for a property set in the config file + + + + A class to hold the key and data for a property set in the config file + + + + + + Override Object.ToString to return sensible debug info + + string info about this object + + + + Property Key + + + Property Key + + + + Property Key. + + + + + + Property Value + + + Property Value + + + + Property Value. + + + + + + A that ignores the message + + + + This writer is used in special cases where it is necessary + to protect a writer from being closed by a client. + + + Nicko Cadell + + + + Constructor + + the writer to actually write to + + + Create a new ProtectCloseTextWriter using a writer + + + + + + Attach this instance to a different underlying + + the writer to attach to + + + Attach this instance to a different underlying + + + + + + Does not close the underlying output writer. + + + + Does not close the underlying output writer. + This method does nothing. + + + + + + Defines a lock that supports single writers and multiple readers + + + + ReaderWriterLock is used to synchronize access to a resource. + At any given time, it allows either concurrent read access for + multiple threads, or write access for a single thread. In a + situation where a resource is changed infrequently, a + ReaderWriterLock provides better throughput than a simple + one-at-a-time lock, such as . + + + If a platform does not support a System.Threading.ReaderWriterLock + implementation then all readers and writers are serialized. Therefore + the caller must not rely on multiple simultaneous readers. + + + Nicko Cadell + + + + Constructor + + + + Initializes a new instance of the class. + + + + + + Acquires a reader lock + + + + blocks if a different thread has the writer + lock, or if at least one thread is waiting for the writer lock. + + + + + + Decrements the lock count + + + + decrements the lock count. When the count + reaches zero, the lock is released. + + + + + + Acquires the writer lock + + + + This method blocks if another thread has a reader lock or writer lock. + + + + + + Decrements the lock count on the writer lock + + + + ReleaseWriterLock decrements the writer lock count. + When the count reaches zero, the writer lock is released. + + + + + + A that can be and reused + + + + A that can be and reused. + This uses a single buffer for string operations. + + + Nicko Cadell + + + + Create an instance of + + the format provider to use + + + Create an instance of + + + + + + Override Dispose to prevent closing of writer + + flag + + + Override Dispose to prevent closing of writer + + + + + + Reset this string writer so that it can be reused. + + the maximum buffer capacity before it is trimmed + the default size to make the buffer + + + Reset this string writer so that it can be reused. + The internal buffers are cleared and reset. + + + + + + Utility class for system specific information. + + + + Utility class of static methods for system specific information. + + + Nicko Cadell + Gert Driesen + Alexey Solofnenko + + + + Private constructor to prevent instances. + + + + Only static methods are exposed from this type. + + + + + + Initialize default values for private static fields. + + + + Only static methods are exposed from this type. + + + + + + Gets the assembly location path for the specified assembly. + + The assembly to get the location for. + The location of the assembly. + + + This method does not guarantee to return the correct path + to the assembly. If only tries to give an indication as to + where the assembly was loaded from. + + + + + + Gets the fully qualified name of the , including + the name of the assembly from which the was + loaded. + + The to get the fully qualified name for. + The fully qualified name for the . + + + This is equivalent to the Type.AssemblyQualifiedName property, + but this method works on the .NET Compact Framework 1.0 as well as + the full .NET runtime. + + + + + + Gets the short name of the . + + The to get the name for. + The short name of the . + + + The short name of the assembly is the + without the version, culture, or public key. i.e. it is just the + assembly's file name without the extension. + + + Use this rather than Assembly.GetName().Name because that + is not available on the Compact Framework. + + + Because of a FileIOPermission security demand we cannot do + the obvious Assembly.GetName().Name. We are allowed to get + the of the assembly so we + start from there and strip out just the assembly name. + + + + + + Gets the file name portion of the , including the extension. + + The to get the file name for. + The file name of the assembly. + + + Gets the file name portion of the , including the extension. + + + + + + Loads the type specified in the type string. + + A sibling type to use to load the type. + The name of the type to load. + Flag set to true to throw an exception if the type cannot be loaded. + true to ignore the case of the type name; otherwise, false + The type loaded or null if it could not be loaded. + + + If the type name is fully qualified, i.e. if contains an assembly name in + the type name, the type will be loaded from the system using + . + + + If the type name is not fully qualified, it will be loaded from the assembly + containing the specified relative type. If the type is not found in the assembly + then all the loaded assemblies will be searched for the type. + + + + + + Loads the type specified in the type string. + + The name of the type to load. + Flag set to true to throw an exception if the type cannot be loaded. + true to ignore the case of the type name; otherwise, false + The type loaded or null if it could not be loaded. + + + If the type name is fully qualified, i.e. if contains an assembly name in + the type name, the type will be loaded from the system using + . + + + If the type name is not fully qualified it will be loaded from the + assembly that is directly calling this method. If the type is not found + in the assembly then all the loaded assemblies will be searched for the type. + + + + + + Loads the type specified in the type string. + + An assembly to load the type from. + The name of the type to load. + Flag set to true to throw an exception if the type cannot be loaded. + true to ignore the case of the type name; otherwise, false + The type loaded or null if it could not be loaded. + + + If the type name is fully qualified, i.e. if contains an assembly name in + the type name, the type will be loaded from the system using + . + + + If the type name is not fully qualified it will be loaded from the specified + assembly. If the type is not found in the assembly then all the loaded assemblies + will be searched for the type. + + + + + + Generate a new guid + + A new Guid + + + Generate a new guid + + + + + + Create an + + The name of the parameter that caused the exception + The value of the argument that causes this exception + The message that describes the error + the ArgumentOutOfRangeException object + + + Create a new instance of the class + with a specified error message, the parameter name, and the value + of the argument. + + + The Compact Framework does not support the 3 parameter constructor for the + type. This method provides an + implementation that works for all platforms. + + + + + + Parse a string into an value + + the string to parse + out param where the parsed value is placed + true if the string was able to be parsed into an integer + + + Attempts to parse the string into an integer. If the string cannot + be parsed then this method returns false. The method does not throw an exception. + + + + + + Parse a string into an value + + the string to parse + out param where the parsed value is placed + true if the string was able to be parsed into an integer + + + Attempts to parse the string into an integer. If the string cannot + be parsed then this method returns false. The method does not throw an exception. + + + + + + Parse a string into an value + + the string to parse + out param where the parsed value is placed + true if the string was able to be parsed into an integer + + + Attempts to parse the string into an integer. If the string cannot + be parsed then this method returns false. The method does not throw an exception. + + + + + + Lookup an application setting + + the application settings key to lookup + the value for the key, or null + + + Configuration APIs are not supported under the Compact Framework + + + + + + Convert a path into a fully qualified local file path. + + The path to convert. + The fully qualified path. + + + Converts the path specified to a fully + qualified path. If the path is relative it is + taken as relative from the application base + directory. + + + The path specified must be a local file path, a URI is not supported. + + + + + + Creates a new case-insensitive instance of the class with the default initial capacity. + + A new case-insensitive instance of the class with the default initial capacity + + + The new Hashtable instance uses the default load factor, the CaseInsensitiveHashCodeProvider, and the CaseInsensitiveComparer. + + + + + + Gets an empty array of types. + + + + The Type.EmptyTypes field is not available on + the .NET Compact Framework 1.0. + + + + + + The fully qualified type of the SystemInfo class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Cache the host name for the current machine + + + + + Cache the application friendly name + + + + + Text to output when a null is encountered. + + + + + Text to output when an unsupported feature is requested. + + + + + Start time for the current process. + + + + + Gets the system dependent line terminator. + + + The system dependent line terminator. + + + + Gets the system dependent line terminator. + + + + + + Gets the base directory for this . + + The base directory path for the current . + + + Gets the base directory for this . + + + The value returned may be either a local file path or a URI. + + + + + + Gets the path to the configuration file for the current . + + The path to the configuration file for the current . + + + The .NET Compact Framework 1.0 does not have a concept of a configuration + file. For this runtime, we use the entry assembly location as the root for + the configuration file name. + + + The value returned may be either a local file path or a URI. + + + + + + Gets the path to the file that first executed in the current . + + The path to the entry assembly. + + + Gets the path to the file that first executed in the current . + + + + + + Gets the ID of the current thread. + + The ID of the current thread. + + + On the .NET framework, the AppDomain.GetCurrentThreadId method + is used to obtain the thread ID for the current thread. This is the + operating system ID for the thread. + + + On the .NET Compact Framework 1.0 it is not possible to get the + operating system thread ID for the current thread. The native method + GetCurrentThreadId is implemented inline in a header file + and cannot be called. + + + On the .NET Framework 2.0 the Thread.ManagedThreadId is used as this + gives a stable id unrelated to the operating system thread ID which may + change if the runtime is using fibers. + + + + + + Get the host name or machine name for the current machine + + + The hostname or machine name + + + + Get the host name or machine name for the current machine + + + The host name () or + the machine name (Environment.MachineName) for + the current machine, or if neither of these are available + then NOT AVAILABLE is returned. + + + + + + Get this application's friendly name + + + The friendly name of this application as a string + + + + If available the name of the application is retrieved from + the AppDomain using AppDomain.CurrentDomain.FriendlyName. + + + Otherwise the file name of the entry assembly is used. + + + + + + Get the start time for the current process. + + + + This is the time at which the log4net library was loaded into the + AppDomain. Due to reports of a hang in the call to System.Diagnostics.Process.StartTime + this is not the start time for the current process. + + + The log4net library should be loaded by an application early during its + startup, therefore this start time should be a good approximation for + the actual start time. + + + Note that AppDomains may be loaded and unloaded within the + same process without the process terminating, however this start time + will be set per AppDomain. + + + + + + Text to output when a null is encountered. + + + + Use this value to indicate a null has been encountered while + outputting a string representation of an item. + + + The default value is (null). This value can be overridden by specifying + a value for the log4net.NullText appSetting in the application's + .config file. + + + + + + Text to output when an unsupported feature is requested. + + + + Use this value when an unsupported feature is requested. + + + The default value is NOT AVAILABLE. This value can be overridden by specifying + a value for the log4net.NotAvailableText appSetting in the application's + .config file. + + + + + + Utility class that represents a format string. + + + + Utility class that represents a format string. + + + Nicko Cadell + + + + Initialise the + + An that supplies culture-specific formatting information. + A containing zero or more format items. + An array containing zero or more objects to format. + + + + Format the string and arguments + + the formatted string + + + + Replaces the format item in a specified with the text equivalent + of the value of a corresponding instance in a specified array. + A specified parameter supplies culture-specific formatting information. + + An that supplies culture-specific formatting information. + A containing zero or more format items. + An array containing zero or more objects to format. + + A copy of format in which the format items have been replaced by the + equivalent of the corresponding instances of in args. + + + + This method does not throw exceptions. If an exception thrown while formatting the result the + exception and arguments are returned in the result string. + + + + + + Process an error during StringFormat + + + + + Dump the contents of an array into a string builder + + + + + Dump an object to a string + + + + + The fully qualified type of the SystemStringFormat class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Implementation of Properties collection for the + + + + Class implements a collection of properties that is specific to each thread. + The class is not synchronized as each thread has its own . + + + Nicko Cadell + + + + The thread local data slot to use to store a PropertiesDictionary. + + + + + Internal constructor + + + + Initializes a new instance of the class. + + + + + + Remove a property + + the key for the entry to remove + + + Remove a property + + + + + + Clear all properties + + + + Clear all properties + + + + + + Get the PropertiesDictionary for this thread. + + create the dictionary if it does not exist, otherwise return null if is does not exist + the properties for this thread + + + The collection returned is only to be used on the calling thread. If the + caller needs to share the collection between different threads then the + caller must clone the collection before doing so. + + + + + + Gets or sets the value of a property + + + The value for the property with the specified key + + + + Gets or sets the value of a property + + + + + + Implementation of Stack for the + + + + Implementation of Stack for the + + + Nicko Cadell + + + + The stack store. + + + + + Internal constructor + + + + Initializes a new instance of the class. + + + + + + Clears all the contextual information held in this stack. + + + + Clears all the contextual information held in this stack. + Only call this if you think that this tread is being reused after + a previous call execution which may not have completed correctly. + You do not need to use this method if you always guarantee to call + the method of the + returned from even in exceptional circumstances, + for example by using the using(log4net.ThreadContext.Stacks["NDC"].Push("Stack_Message")) + syntax. + + + + + + Removes the top context from this stack. + + The message in the context that was removed from the top of this stack. + + + Remove the top context from this stack, and return + it to the caller. If this stack is empty then an + empty string (not ) is returned. + + + + + + Pushes a new context message into this stack. + + The new context message. + + An that can be used to clean up the context stack. + + + + Pushes a new context onto this stack. An + is returned that can be used to clean up this stack. This + can be easily combined with the using keyword to scope the + context. + + + Simple example of using the Push method with the using keyword. + + using(log4net.ThreadContext.Stacks["NDC"].Push("Stack_Message")) + { + log.Warn("This should have an ThreadContext Stack message"); + } + + + + + + Gets the current context information for this stack. + + The current context information. + + + + Gets the current context information for this stack. + + Gets the current context information + + + Gets the current context information for this stack. + + + + + + Get a portable version of this object + + the portable instance of this object + + + Get a cross thread portable version of this object + + + + + + The number of messages in the stack + + + The current number of messages in the stack + + + + The current number of messages in the stack. That is + the number of times has been called + minus the number of times has been called. + + + + + + Gets and sets the internal stack used by this + + The internal storage stack + + + This property is provided only to support backward compatability + of the . Tytpically the internal stack should not + be modified. + + + + + + Inner class used to represent a single context frame in the stack. + + + + Inner class used to represent a single context frame in the stack. + + + + + + Constructor + + The message for this context. + The parent context in the chain. + + + Initializes a new instance of the class + with the specified message and parent context. + + + + + + Get the message. + + The message. + + + Get the message. + + + + + + Gets the full text of the context down to the root level. + + + The full text of the context down to the root level. + + + + Gets the full text of the context down to the root level. + + + + + + Struct returned from the method. + + + + This struct implements the and is designed to be used + with the pattern to remove the stack frame at the end of the scope. + + + + + + The ThreadContextStack internal stack + + + + + The depth to trim the stack to when this instance is disposed + + + + + Constructor + + The internal stack used by the ThreadContextStack. + The depth to return the stack to when this object is disposed. + + + Initializes a new instance of the class with + the specified stack and return depth. + + + + + + Returns the stack to the correct depth. + + + + Returns the stack to the correct depth. + + + + + + Implementation of Stacks collection for the + + + + Implementation of Stacks collection for the + + + Nicko Cadell + + + + Internal constructor + + + + Initializes a new instance of the class. + + + + + + The fully qualified type of the ThreadContextStacks class. + + + Used by the internal logger to record the Type of the + log message. + + + + + Gets the named thread context stack + + + The named stack + + + + Gets the named thread context stack + + + + + + Utility class for transforming strings. + + + + Utility class for transforming strings. + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + + Uses a private access modifier to prevent instantiation of this class. + + + + + + Write a string to an + + the writer to write to + the string to write + The string to replace non XML compliant chars with + + + The test is escaped either using XML escape entities + or using CDATA sections. + + + + + + Replace invalid XML characters in text string + + the XML text input string + the string to use in place of invalid characters + A string that does not contain invalid XML characters. + + + Certain Unicode code points are not allowed in the XML InfoSet, for + details see: http://www.w3.org/TR/REC-xml/#charsets. + + + This method replaces any illegal characters in the input string + with the mask string specified. + + + + + + Count the number of times that the substring occurs in the text + + the text to search + the substring to find + the number of times the substring occurs in the text + + + The substring is assumed to be non repeating within itself. + + + + + + Characters illegal in XML 1.0 + + + + + Impersonate a Windows Account + + + + This impersonates a Windows account. + + + How the impersonation is done depends on the value of . + This allows the context to either impersonate a set of user credentials specified + using username, domain name and password or to revert to the process credentials. + + + + + + Default constructor + + + + Default constructor + + + + + + Initialize the SecurityContext based on the options set. + + + + This is part of the delayed object + activation scheme. The method must + be called on this object after the configuration properties have + been set. Until is called this + object is in an undefined state and must not be used. + + + If any of the configuration properties are modified then + must be called again. + + + The security context will try to Logon the specified user account and + capture a primary token for impersonation. + + + The required , + or properties were not specified. + + + + Impersonate the Windows account specified by the and properties. + + caller provided state + + An instance that will revoke the impersonation of this SecurityContext + + + + Depending on the property either + impersonate a user using credentials supplied or revert + to the process credentials. + + + + + + Create a given the userName, domainName and password. + + the user name + the domain name + the password + the for the account specified + + + Uses the Windows API call LogonUser to get a principal token for the account. This + token is used to initialize the WindowsIdentity. + + + + + + Gets or sets the impersonation mode for this security context + + + The impersonation mode for this security context + + + + Impersonate either a user with user credentials or + revert this thread to the credentials of the process. + The value is one of the + enum. + + + The default value is + + + When the mode is set to + the user's credentials are established using the + , and + values. + + + When the mode is set to + no other properties need to be set. If the calling thread is + impersonating then it will be reverted back to the process credentials. + + + + + + Gets or sets the Windows username for this security context + + + The Windows username for this security context + + + + This property must be set if + is set to (the default setting). + + + + + + Gets or sets the Windows domain name for this security context + + + The Windows domain name for this security context + + + + The default value for is the local machine name + taken from the property. + + + This property must be set if + is set to (the default setting). + + + + + + Sets the password for the Windows account specified by the and properties. + + + The password for the Windows account specified by the and properties. + + + + This property must be set if + is set to (the default setting). + + + + + + The impersonation modes for the + + + + See the property for + details. + + + + + + Impersonate a user using the credentials supplied + + + + + Revert this the thread to the credentials of the process + + + + + Adds to + + + + Helper class to expose the + through the interface. + + + + + + Constructor + + the impersonation context being wrapped + + + Constructor + + + + + + Revert the impersonation + + + + Revert the impersonation + + + + + + The log4net Global Context. + + + + The GlobalContext provides a location for global debugging + information to be stored. + + + The global context has a properties map and these properties can + be included in the output of log messages. The + supports selecting and outputing these properties. + + + By default the log4net:HostName property is set to the name of + the current machine. + + + + + GlobalContext.Properties["hostname"] = Environment.MachineName; + + + + Nicko Cadell + + + + Private Constructor. + + + Uses a private access modifier to prevent instantiation of this class. + + + + + The global context properties instance + + + + + The global properties map. + + + The global properties map. + + + + The global properties map. + + + + + + Provides information about the environment the assembly has + been built for. + + + + Version of the assembly + + + Version of the framework targeted + + + Type of framework targeted + + + Does it target a client profile? + + + + Identifies the version and target for this assembly. + + + + + The log4net Logical Thread Context. + + + + The LogicalThreadContext provides a location for specific debugging + information to be stored. + The LogicalThreadContext properties override any or + properties with the same name. + + + The Logical Thread Context has a properties map and a stack. + The properties and stack can + be included in the output of log messages. The + supports selecting and outputting these properties. + + + The Logical Thread Context provides a diagnostic context for the current call context. + This is an instrument for distinguishing interleaved log + output from different sources. Log output is typically interleaved + when a server handles multiple clients near-simultaneously. + + + The Logical Thread Context is managed on a per basis. + + + The requires a link time + for the + . + If the calling code does not have this permission then this context will be disabled. + It will not store any property values set on it. + + + Example of using the thread context properties to store a username. + + LogicalThreadContext.Properties["user"] = userName; + log.Info("This log message has a LogicalThreadContext Property called 'user'"); + + + Example of how to push a message into the context stack + + using(LogicalThreadContext.Stacks["LDC"].Push("my context message")) + { + log.Info("This log message has a LogicalThreadContext Stack message that includes 'my context message'"); + + } // at the end of the using block the message is automatically popped + + + + Nicko Cadell + + + + Private Constructor. + + + + Uses a private access modifier to prevent instantiation of this class. + + + + + + The thread context properties instance + + + + + The thread context stacks instance + + + + + The thread properties map + + + The thread properties map + + + + The LogicalThreadContext properties override any + or properties with the same name. + + + + + + The thread stacks + + + stack map + + + + The logical thread stacks. + + + + + + This class is used by client applications to request logger instances. + + + + This class has static methods that are used by a client to request + a logger instance. The method is + used to retrieve a logger. + + + See the interface for more details. + + + Simple example of logging messages + + ILog log = LogManager.GetLogger("application-log"); + + log.Info("Application Start"); + log.Debug("This is a debug message"); + + if (log.IsDebugEnabled) + { + log.Debug("This is another debug message"); + } + + + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + Uses a private access modifier to prevent instantiation of this class. + + + + Returns the named logger if it exists. + + Returns the named logger if it exists. + + + + If the named logger exists (in the default repository) then it + returns a reference to the logger, otherwise it returns null. + + + The fully qualified logger name to look for. + The logger found, or null if no logger could be found. + + + + Returns the named logger if it exists. + + + + If the named logger exists (in the specified repository) then it + returns a reference to the logger, otherwise it returns + null. + + + The repository to lookup in. + The fully qualified logger name to look for. + + The logger found, or null if the logger doesn't exist in the specified + repository. + + + + + Returns the named logger if it exists. + + + + If the named logger exists (in the repository for the specified assembly) then it + returns a reference to the logger, otherwise it returns + null. + + + The assembly to use to lookup the repository. + The fully qualified logger name to look for. + + The logger, or null if the logger doesn't exist in the specified + assembly's repository. + + + + Get the currently defined loggers. + + Returns all the currently defined loggers in the default repository. + + + The root logger is not included in the returned array. + + All the defined loggers. + + + + Returns all the currently defined loggers in the specified repository. + + The repository to lookup in. + + The root logger is not included in the returned array. + + All the defined loggers. + + + + Returns all the currently defined loggers in the specified assembly's repository. + + The assembly to use to lookup the repository. + + The root logger is not included in the returned array. + + All the defined loggers. + + + Get or create a logger. + + Retrieves or creates a named logger. + + + + Retrieves a logger named as the + parameter. If the named logger already exists, then the + existing instance will be returned. Otherwise, a new instance is + created. + + By default, loggers do not have a set level but inherit + it from the hierarchy. This is one of the central features of + log4net. + + + The name of the logger to retrieve. + The logger with the name specified. + + + + Retrieves or creates a named logger. + + + + Retrieve a logger named as the + parameter. If the named logger already exists, then the + existing instance will be returned. Otherwise, a new instance is + created. + + + By default, loggers do not have a set level but inherit + it from the hierarchy. This is one of the central features of + log4net. + + + The repository to lookup in. + The name of the logger to retrieve. + The logger with the name specified. + + + + Retrieves or creates a named logger. + + + + Retrieve a logger named as the + parameter. If the named logger already exists, then the + existing instance will be returned. Otherwise, a new instance is + created. + + + By default, loggers do not have a set level but inherit + it from the hierarchy. This is one of the central features of + log4net. + + + The assembly to use to lookup the repository. + The name of the logger to retrieve. + The logger with the name specified. + + + + Shorthand for . + + + Get the logger for the fully qualified name of the type specified. + + The full name of will be used as the name of the logger to retrieve. + The logger with the name specified. + + + + Shorthand for . + + + Gets the logger for the fully qualified name of the type specified. + + The repository to lookup in. + The full name of will be used as the name of the logger to retrieve. + The logger with the name specified. + + + + Shorthand for . + + + Gets the logger for the fully qualified name of the type specified. + + The assembly to use to lookup the repository. + The full name of will be used as the name of the logger to retrieve. + The logger with the name specified. + + + + Shuts down the log4net system. + + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in all the + default repositories. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + Shutdown a logger repository. + + Shuts down the default repository. + + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in the + default repository. + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + + + + Shuts down the repository for the repository specified. + + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in the + specified. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + The repository to shutdown. + + + + Shuts down the repository specified. + + + + Calling this method will safely close and remove all + appenders in all the loggers including root contained in the + repository. The repository is looked up using + the specified. + + + Some appenders need to be closed before the application exists. + Otherwise, pending logging events might be lost. + + + The shutdown method is careful to close nested + appenders before closing regular appenders. This is allows + configurations where a regular appender is attached to a logger + and again to a nested appender. + + + The assembly to use to lookup the repository. + + + Reset the configuration of a repository + + Resets all values contained in this repository instance to their defaults. + + + + Resets all values contained in the repository instance to their + defaults. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set to its default "off" value. + + + + + + Resets all values contained in this repository instance to their defaults. + + + + Reset all values contained in the repository instance to their + defaults. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set to its default "off" value. + + + The repository to reset. + + + + Resets all values contained in this repository instance to their defaults. + + + + Reset all values contained in the repository instance to their + defaults. This removes all appenders from all loggers, sets + the level of all non-root loggers to null, + sets their additivity flag to true and sets the level + of the root logger to . Moreover, + message disabling is set to its default "off" value. + + + The assembly to use to lookup the repository to reset. + + + Get the logger repository. + + Returns the default instance. + + + + Gets the for the repository specified + by the callers assembly (). + + + The instance for the default repository. + + + + Returns the default instance. + + The default instance. + + + Gets the for the repository specified + by the argument. + + + The repository to lookup in. + + + + Returns the default instance. + + The default instance. + + + Gets the for the repository specified + by the argument. + + + The assembly to use to lookup the repository. + + + Get a logger repository. + + Returns the default instance. + + + + Gets the for the repository specified + by the callers assembly (). + + + The instance for the default repository. + + + + Returns the default instance. + + The default instance. + + + Gets the for the repository specified + by the argument. + + + The repository to lookup in. + + + + Returns the default instance. + + The default instance. + + + Gets the for the repository specified + by the argument. + + + The assembly to use to lookup the repository. + + + Create a domain + + Creates a repository with the specified repository type. + + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + The created will be associated with the repository + specified such that a call to will return + the same repository instance. + + + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + Create a logger repository. + + Creates a repository with the specified repository type. + + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + The created will be associated with the repository + specified such that a call to will return + the same repository instance. + + + + + + Creates a repository with the specified name. + + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + Creates the default type of which is a + object. + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The name of the repository, this must be unique amongst repositories. + The created for the repository. + The specified repository already exists. + + + + Creates a repository with the specified name. + + + + Creates the default type of which is a + object. + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The name of the repository, this must be unique amongst repositories. + The created for the repository. + The specified repository already exists. + + + + Creates a repository with the specified name and repository type. + + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The name of the repository, this must be unique to the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + The specified repository already exists. + + + + Creates a repository with the specified name and repository type. + + + + The name must be unique. Repositories cannot be redefined. + An will be thrown if the repository already exists. + + + The name of the repository, this must be unique to the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + The specified repository already exists. + + + + Creates a repository for the specified assembly and repository type. + + + + CreateDomain is obsolete. Use CreateRepository instead of CreateDomain. + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + The assembly to use to get the name of the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + + Creates a repository for the specified assembly and repository type. + + + + The created will be associated with the repository + specified such that a call to with the + same assembly specified will return the same repository instance. + + + The assembly to use to get the name of the repository. + A that implements + and has a no arg constructor. An instance of this type will be created to act + as the for the repository specified. + The created for the repository. + + + + Gets the list of currently defined repositories. + + + + Get an array of all the objects that have been created. + + + An array of all the known objects. + + + + Looks up the wrapper object for the logger specified. + + The logger to get the wrapper for. + The wrapper for the logger specified. + + + + Looks up the wrapper objects for the loggers specified. + + The loggers to get the wrappers for. + The wrapper objects for the loggers specified. + + + + Create the objects used by + this manager. + + The logger to wrap. + The wrapper for the logger specified. + + + + The wrapper map to use to hold the objects. + + + + + Implementation of Mapped Diagnostic Contexts. + + + + + The MDC is deprecated and has been replaced by the . + The current MDC implementation forwards to the ThreadContext.Properties. + + + + The MDC class is similar to the class except that it is + based on a map instead of a stack. It provides mapped + diagnostic contexts. A Mapped Diagnostic Context, or + MDC in short, is an instrument for distinguishing interleaved log + output from different sources. Log output is typically interleaved + when a server handles multiple clients near-simultaneously. + + + The MDC is managed on a per thread basis. + + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + Uses a private access modifier to prevent instantiation of this class. + + + + + Gets the context value identified by the parameter. + + The key to lookup in the MDC. + The string value held for the key, or a null reference if no corresponding value is found. + + + + The MDC is deprecated and has been replaced by the . + The current MDC implementation forwards to the ThreadContext.Properties. + + + + If the parameter does not look up to a + previously defined context then null will be returned. + + + + + + Add an entry to the MDC + + The key to store the value under. + The value to store. + + + + The MDC is deprecated and has been replaced by the . + The current MDC implementation forwards to the ThreadContext.Properties. + + + + Puts a context value (the parameter) as identified + with the parameter into the current thread's + context map. + + + If a value is already defined for the + specified then the value will be replaced. If the + is specified as null then the key value mapping will be removed. + + + + + + Removes the key value mapping for the key specified. + + The key to remove. + + + + The MDC is deprecated and has been replaced by the . + The current MDC implementation forwards to the ThreadContext.Properties. + + + + Remove the specified entry from this thread's MDC + + + + + + Clear all entries in the MDC + + + + + The MDC is deprecated and has been replaced by the . + The current MDC implementation forwards to the ThreadContext.Properties. + + + + Remove all the entries from this thread's MDC + + + + + + Implementation of Nested Diagnostic Contexts. + + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + A Nested Diagnostic Context, or NDC in short, is an instrument + to distinguish interleaved log output from different sources. Log + output is typically interleaved when a server handles multiple + clients near-simultaneously. + + + Interleaved log output can still be meaningful if each log entry + from different contexts had a distinctive stamp. This is where NDCs + come into play. + + + Note that NDCs are managed on a per thread basis. The NDC class + is made up of static methods that operate on the context of the + calling thread. + + + How to push a message into the context + + using(NDC.Push("my context message")) + { + ... all log calls will have 'my context message' included ... + + } // at the end of the using block the message is automatically removed + + + + Nicko Cadell + Gert Driesen + + + + Initializes a new instance of the class. + + + Uses a private access modifier to prevent instantiation of this class. + + + + + Clears all the contextual information held on the current thread. + + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + Clears the stack of NDC data held on the current thread. + + + + + + Creates a clone of the stack of context information. + + A clone of the context info for this thread. + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + The results of this method can be passed to the + method to allow child threads to inherit the context of their + parent thread. + + + + + + Inherits the contextual information from another thread. + + The context stack to inherit. + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + This thread will use the context information from the stack + supplied. This can be used to initialize child threads with + the same contextual information as their parent threads. These + contexts will NOT be shared. Any further contexts that + are pushed onto the stack will not be visible to the other. + Call to obtain a stack to pass to + this method. + + + + + + Removes the top context from the stack. + + + The message in the context that was removed from the top + of the stack. + + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + Remove the top context from the stack, and return + it to the caller. If the stack is empty then an + empty string (not null) is returned. + + + + + + Pushes a new context message. + + The new context message. + + An that can be used to clean up + the context stack. + + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + Pushes a new context onto the context stack. An + is returned that can be used to clean up the context stack. This + can be easily combined with the using keyword to scope the + context. + + + Simple example of using the Push method with the using keyword. + + using(log4net.NDC.Push("NDC_Message")) + { + log.Warn("This should have an NDC message"); + } + + + + + + Removes the context information for this thread. It is + not required to call this method. + + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + This method is not implemented. + + + + + + Forces the stack depth to be at most . + + The maximum depth of the stack + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + Forces the stack depth to be at most . + This may truncate the head of the stack. This only affects the + stack in the current thread. Also it does not prevent it from + growing, it only sets the maximum depth at the time of the + call. This can be used to return to a known context depth. + + + + + + Gets the current context depth. + + The current context depth. + + + + The NDC is deprecated and has been replaced by the . + The current NDC implementation forwards to the ThreadContext.Stacks["NDC"]. + + + + The number of context values pushed onto the context stack. + + + Used to record the current depth of the context. This can then + be restored using the method. + + + + + + + The log4net Thread Context. + + + + The ThreadContext provides a location for thread specific debugging + information to be stored. + The ThreadContext properties override any + properties with the same name. + + + The thread context has a properties map and a stack. + The properties and stack can + be included in the output of log messages. The + supports selecting and outputting these properties. + + + The Thread Context provides a diagnostic context for the current thread. + This is an instrument for distinguishing interleaved log + output from different sources. Log output is typically interleaved + when a server handles multiple clients near-simultaneously. + + + The Thread Context is managed on a per thread basis. + + + Example of using the thread context properties to store a username. + + ThreadContext.Properties["user"] = userName; + log.Info("This log message has a ThreadContext Property called 'user'"); + + + Example of how to push a message into the context stack + + using(ThreadContext.Stacks["NDC"].Push("my context message")) + { + log.Info("This log message has a ThreadContext Stack message that includes 'my context message'"); + + } // at the end of the using block the message is automatically popped + + + + Nicko Cadell + + + + Private Constructor. + + + + Uses a private access modifier to prevent instantiation of this class. + + + + + + The thread context properties instance + + + + + The thread context stacks instance + + + + + The thread properties map + + + The thread properties map + + + + The ThreadContext properties override any + properties with the same name. + + + + + + The thread stacks + + + stack map + + + + The thread local stacks. + + + + + diff --git a/udsService/rpc/IUDS.cs b/udsService/rpc/IUDS.cs new file mode 100644 index 000000000..2febbdb4a --- /dev/null +++ b/udsService/rpc/IUDS.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Text; +using CookComputing.XmlRpc; + +namespace uds +{ + public interface IUDS : IXmlRpcProxy + { + [XmlRpcMethod("test")] + bool Test(); + + [XmlRpcMethod("message")] + string Message(string id, string message, string data); + + } +} diff --git a/udsService/rpc/Info/Computer.cs b/udsService/rpc/Info/Computer.cs new file mode 100644 index 000000000..4a0e7b503 --- /dev/null +++ b/udsService/rpc/Info/Computer.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Net.NetworkInformation; +using log4net; +using System.Security.Principal; + +namespace uds.Info +{ + public class Computer + { + private static ILog logger = LogManager.GetLogger(typeof(Computer)); + + public struct InterfaceInfo + { + public string ip; + public string mac; + + public InterfaceInfo(string _ip, string _mac) + { + ip = _ip; mac = _mac; + } + } + + public static List GetInterfacesInfo() + { + if (NetworkInterface.GetIsNetworkAvailable() == false) + return null; + + List res = new List(); + + foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces()) + { + if (nic.OperationalStatus == OperationalStatus.Up) + { + byte[] addr = nic.GetPhysicalAddress().GetAddressBytes(); + if (addr.Length != 6) + continue; + IPInterfaceProperties props = nic.GetIPProperties(); + List ips = new List(); + foreach (IPAddressInformation ip in props.UnicastAddresses) + { + if (ip.Address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) + ips.Add(ip.Address.ToString()); + } + string tmp = nic.GetPhysicalAddress().ToString(); + string nc = tmp.Substring(0, 2) + ":" + tmp.Substring(2,2) + ":" + tmp.Substring(4,2) + ":" + tmp.Substring(6,2) + ":" + + tmp.Substring(8,2) + ":" + tmp.Substring(10,2); + res.Add(new InterfaceInfo(string.Join(",", ips.ToArray()), nc)); + } + } + return res; + } + + public static DomainInfo GetDomainInfo() + { + return new DomainInfo(); + } + + public static OsInfo GetOsInfo() + { + return new OsInfo(); + } + + public static bool IsUserAdministrator() + { + //bool value to hold our return value + bool isAdmin; + try + { + //get the currently logged in user + WindowsIdentity user = WindowsIdentity.GetCurrent(); + WindowsPrincipal principal = new WindowsPrincipal(user); + isAdmin = principal.IsInRole(WindowsBuiltInRole.Administrator); + } + catch (UnauthorizedAccessException) + { + isAdmin = false; + } + catch (Exception) + { + isAdmin = false; + } + return isAdmin; + } + + } +} + diff --git a/udsService/rpc/Info/DomainInfo.cs b/udsService/rpc/Info/DomainInfo.cs new file mode 100644 index 000000000..63677ea57 --- /dev/null +++ b/udsService/rpc/Info/DomainInfo.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using log4net; + +namespace uds.Info +{ + public class DomainInfo + { + private static ILog logger = LogManager.GetLogger(typeof(DomainInfo)); + + // Win32 Result Code Constant + const int ErrorSuccess = 0; + + // NetGetJoinInformation() Enumeration + public enum NetJoinStatus + { + NetSetupUnknownStatus = 0, + NetSetupUnjoined, + NetSetupWorkgroupName, + NetSetupDomainName + } + + [DllImport("Netapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)] + static extern int NetGetJoinInformation(string server, out IntPtr domain, out NetJoinStatus status); + + [DllImport("Netapi32.dll")] + static extern int NetApiBufferFree(IntPtr Buffer); + + // Info obtained + private string _computerName; + private string _domainName; + private NetJoinStatus _status; + + + public DomainInfo() + { + _domainName = ""; + _computerName = System.Environment.MachineName; + _status = NetJoinStatus.NetSetupUnknownStatus; + + IntPtr pDomain = IntPtr.Zero; + try + { + int result = 0; + result = NetGetJoinInformation(null, out pDomain, out _status); + if (result == ErrorSuccess ) + { + + if( _status == NetJoinStatus.NetSetupDomainName ) + _domainName = Marshal.PtrToStringAuto(pDomain); + } + } + finally + { + if (pDomain != IntPtr.Zero) NetApiBufferFree(pDomain); + } + + logger.Debug("Name: " + _computerName + ", Domain: " + _domainName + ", status" + _status.ToString()); + } + + public string ComputerName + { + get { return _computerName; } + } + + public string DomainName + { + get { return _domainName; } + } + + public NetJoinStatus Status + { + get { return _status; } + } + + } +} diff --git a/udsService/rpc/Info/OsInfo.cs b/udsService/rpc/Info/OsInfo.cs new file mode 100644 index 000000000..315b040ee --- /dev/null +++ b/udsService/rpc/Info/OsInfo.cs @@ -0,0 +1,111 @@ +using System; +using System.Collections.Generic; +using System.Text; +using log4net; + +namespace uds.Info +{ + public class OsInfo + { + private static ILog logger = LogManager.GetLogger(typeof(OsInfo)); + + public enum WindowsVersion { + Unknown, + Win95, + Win98, + Win98SE, + WinME, + WinNT351, + WinNT40, + Win2000, + WinXP, + WinVista, + Win7 + }; + + WindowsVersion _version; + string _servicePack; + int _architecture; + + public OsInfo() + { + //Get Operating system information. + OperatingSystem os = Environment.OSVersion; + //Get version information about the os. + Version vs = os.Version; + + _version = WindowsVersion.Unknown; + _servicePack = os.ServicePack; + _architecture = 0; + + if (os.Platform == PlatformID.Win32Windows) + { + //This is a pre-NT version of Windows + switch (vs.Minor) + { + case 0: + _version = WindowsVersion.Win95; + break; + case 10: + if (vs.Revision.ToString() == "2222A") + _version = WindowsVersion.Win98SE; + else + _version = WindowsVersion.Win98; + break; + case 90: + _version = WindowsVersion.WinME; + break; + default: + break; + } + } + else if (os.Platform == PlatformID.Win32NT) + { + switch (vs.Major) + { + case 3: + _version = WindowsVersion.WinNT351; + break; + case 4: + _version = WindowsVersion.WinNT40; + break; + case 5: + if (vs.Minor == 0) + _version = WindowsVersion.Win2000; + else + _version = WindowsVersion.WinXP; + break; + case 6: + if (vs.Minor == 0) + _version = WindowsVersion.WinVista; + else + _version = WindowsVersion.Win7; + break; + default: + break; + } + } + //Make sure we actually got something in our OS check + //We don't want to just return " Service Pack 2" or " 32-bit" + //That information is useless without the OS version. + if (_version != WindowsVersion.Unknown) + { + //Append the OS architecture. i.e. "Windows XP Service Pack 3 32-bit" + _architecture = getOSArchitecture(); + } + } + + private static int getOSArchitecture() + { + string pa = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE"); + Console.WriteLine("Arch: " + pa); + return ((String.IsNullOrEmpty(pa) || String.Compare(pa, 0, "x86", 0, 3, true) == 0) ? 32 : 64); + } + + public WindowsVersion Version + { + get { return _version; } + } + + } +} diff --git a/udsService/rpc/Operation.cs b/udsService/rpc/Operation.cs new file mode 100644 index 000000000..96cec0c04 --- /dev/null +++ b/udsService/rpc/Operation.cs @@ -0,0 +1,145 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using log4net; +using System.Runtime.InteropServices; + +namespace uds +{ + public class Operation + { + private static ILog logger = LogManager.GetLogger(typeof(Operation)); + + [StructLayout(LayoutKind.Sequential, Pack = 1)] + internal struct TokPriv1Luid + { + public int Count; + public long Luid; + public int Attr; + } + + [DllImport("kernel32.dll", ExactSpelling = true)] + internal static extern IntPtr GetCurrentProcess(); + + [DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)] + internal static extern bool OpenProcessToken(IntPtr h, int acc, ref IntPtr phtok); + + [DllImport("advapi32.dll", SetLastError = true)] + internal static extern bool LookupPrivilegeValue(string host, string name, ref long pluid); + + [DllImport("advapi32.dll", ExactSpelling = true, SetLastError = true)] + internal static extern bool AdjustTokenPrivileges(IntPtr htok, bool disall, ref TokPriv1Luid newst, + int len, IntPtr prev, IntPtr relen); + + [DllImport("user32.dll", ExactSpelling = true, SetLastError = true)] + internal static extern bool ExitWindowsEx(int flg, int rea); + + [Flags] + public enum JoinOptions + { + NETSETUP_JOIN_DOMAIN = 0x00000001, + NETSETUP_ACCT_CREATE = 0x00000002, + NETSETUP_ACCT_DELETE = 0x00000004, + NETSETUP_WIN9X_UPGRADE = 0x00000010, + NETSETUP_DOMAIN_JOIN_IF_JOINED = 0x00000020, + NETSETUP_JOIN_UNSECURE = 0x00000040, + NETSETUP_MACHINE_PWD_PASSED = 0x00000080, + NETSETUP_JOIN_WITH_NEW_NAME = 0x00000400, + NETSETUP_DEFER_SPN_SET = 0x10000000 + } + + [DllImport("netapi32.dll", CharSet = CharSet.Unicode)] + static extern uint NetJoinDomain(string lpServer, string lpDomain, string lpAccountOU, string lpAccount, string lpPassword, JoinOptions NameType); + + enum COMPUTER_NAME_FORMAT + { + ComputerNameNetBIOS, + ComputerNameDnsHostname, + ComputerNameDnsDomain, + ComputerNameDnsFullyQualified, + ComputerNamePhysicalNetBIOS, + ComputerNamePhysicalDnsHostname, + ComputerNamePhysicalDnsDomain, + ComputerNamePhysicalDnsFullyQualified, + } + [DllImport("kernel32.dll", CharSet = CharSet.Auto)] + static extern bool SetComputerNameEx(COMPUTER_NAME_FORMAT NameType, string lpBuffer); + + internal const int SE_PRIVILEGE_ENABLED = 0x00000002; + internal const int TOKEN_QUERY = 0x00000008; + internal const int TOKEN_ADJUST_PRIVILEGES = 0x00000020; + internal const string SE_SHUTDOWN_NAME = "SeShutdownPrivilege"; + + public const int EWX_LOGOFF = 0x00000000; + public const int EWX_SHUTDOWN = 0x00000001; + public const int EWX_REBOOT = 0x00000002; + public const int EWX_FORCE = 0x00000004; + public const int EWX_POWEROFF = 0x00000008; + public const int EWX_FORCEIFHUNG = 0x00000010; + + public static bool Reboot(int flg = EWX_FORCEIFHUNG|EWX_REBOOT) + { + logger.Debug("Rebooting computer"); + bool ok; + TokPriv1Luid tp; + IntPtr hproc = GetCurrentProcess(); + IntPtr htok = IntPtr.Zero; + ok = OpenProcessToken(hproc, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, ref htok); + tp.Count = 1; + tp.Luid = 0; + tp.Attr = SE_PRIVILEGE_ENABLED; + ok = LookupPrivilegeValue(null, SE_SHUTDOWN_NAME, ref tp.Luid); + ok = AdjustTokenPrivileges(htok, false, ref tp, 0, IntPtr.Zero, IntPtr.Zero); + ok = ExitWindowsEx(flg, 0); + logger.Debug("Result: " + ok.ToString()); + return ok; + } + + public static bool RenameComputer(string newName) + { + logger.Debug("Renaming computer to \"" + newName + "\""); + try + { + return SetComputerNameEx(COMPUTER_NAME_FORMAT.ComputerNamePhysicalDnsHostname, newName); + } + catch (Exception) + { + return false; + } + } + + public static bool JoinDomain(string domain, string ou, string account, string password, bool oneStep = false) + { + if (account.Contains('@') == false && account.Contains('\\') == false) + { + if (domain.Contains('.')) + account = account + "@" + domain; + else + account = domain + "\\" + account; + } + logger.Debug("Joining domain: \"" + domain + "\", \"" + ou + "\", \"" + account + "\", \"" + password + "\"" + ", oneStep = " + oneStep.ToString()); + // Flag NETSETUP_JOIN_WITH_NEW_NAME not supported on win xp/2000 + JoinOptions flags = JoinOptions.NETSETUP_ACCT_CREATE | JoinOptions.NETSETUP_DOMAIN_JOIN_IF_JOINED | JoinOptions.NETSETUP_JOIN_DOMAIN; + + if (oneStep) + flags |= JoinOptions.NETSETUP_JOIN_WITH_NEW_NAME; + + if (ou == "") + ou = null; + try + { + uint res = NetJoinDomain(null, domain, ou, account, password, flags); + logger.Debug("Result of join: " + res); + return res == 0; + } + catch (Exception e) + { + logger.Error("Exception at join domain", e); + return false; + } + + } + + } +} diff --git a/udsService/rpc/Properties/AssemblyInfo.cs b/udsService/rpc/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..386795352 --- /dev/null +++ b/udsService/rpc/Properties/AssemblyInfo.cs @@ -0,0 +1,38 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Resources; + +// La información general sobre un ensamblado se controla mediante el siguiente +// conjunto de atributos. Cambie estos atributos para modificar la información +// asociada con un ensamblado. +[assembly: AssemblyTitle("rpc")] +[assembly: AssemblyDescription("RPC Connection Library")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Virtual Cable S.L.")] +[assembly: AssemblyProduct("UDS Service")] +[assembly: AssemblyCopyright("Copyright © Virtual Cable S.L. 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Si establece ComVisible como false, los tipos de este ensamblado no estarán visibles +// para los componentes COM. Si necesita obtener acceso a un tipo de este ensamblado desde +// COM, establezca el atributo ComVisible como true en este tipo. +[assembly: ComVisible(false)] + +// El siguiente GUID sirve como identificador de typelib si este proyecto se expone a COM +[assembly: Guid("381689d6-aaf1-45b2-b6c5-065184bc7f80")] + +// La información de versión de un ensamblado consta de los cuatro valores siguientes: +// +// Versión principal +// Versión secundaria +// Número de compilación +// Revisión +// +// Puede especificar todos los valores o establecer como predeterminados los números de versión de compilación y de revisión +// mediante el asterisco ('*'), como se muestra a continuación: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: NeutralResourcesLanguageAttribute("en")] diff --git a/udsService/rpc/config.cs b/udsService/rpc/config.cs new file mode 100644 index 000000000..18ea2220f --- /dev/null +++ b/udsService/rpc/config.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using log4net; + +namespace uds +{ + public class config + { + private static ILog logger = LogManager.GetLogger(typeof(config)); + + public static string broker = ""; + public static bool ssl = true; + public static int timeOut = 10; + + // Constants + private const string KEY_SOFTWARE = "Software"; + private const string KEY_VCABLE = "Virtual Cable S.L."; + private const string KEY_UDSACTOR = "UDS Actor"; + private const string VALUE_BROKER = "server"; + private const string VALUE_SSL = "secured"; + private const string VALUE_TIMEOUT = "timeout"; + + public static void LoadConfig() + { + Microsoft.Win32.RegistryKey software = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(KEY_SOFTWARE); + Microsoft.Win32.RegistryKey vcable = software.OpenSubKey(KEY_VCABLE); + // Default values if registry don't exists + if( vcable == null ) + return; + Microsoft.Win32.RegistryKey udssactor = vcable.OpenSubKey(KEY_UDSACTOR); + // Default values if registry don't exists + if (udssactor == null) + return; + broker = (string)udssactor.GetValue(VALUE_BROKER, ""); + string tmp = (string)udssactor.GetValue(VALUE_SSL, "1"); + ssl = (tmp == "1") ? true : false; + tmp = (string)udssactor.GetValue(VALUE_TIMEOUT, "10"); + try { timeOut = Int32.Parse(tmp); } + catch (Exception) { timeOut = 10; } + + } + + public static void SaveConfig() + { + Microsoft.Win32.RegistryKey software = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(KEY_SOFTWARE, true); + Microsoft.Win32.RegistryKey vcable = software.OpenSubKey(KEY_VCABLE, true); + if (vcable == null) + { + // Tries to create subkey + vcable = software.CreateSubKey(KEY_VCABLE); + if (vcable == null) + throw new InvalidOperationException("Can't access registry!!! " + KEY_VCABLE); + } + Microsoft.Win32.RegistryKey udssactor = vcable.OpenSubKey(KEY_UDSACTOR, true); + if (udssactor == null) + { + // Tries to create subkey + udssactor = vcable.CreateSubKey(KEY_UDSACTOR); + if (udssactor == null) + throw new InvalidOperationException("Can't access registry!!! " + KEY_UDSACTOR); + } + + udssactor.SetValue(VALUE_BROKER, broker); + udssactor.SetValue(VALUE_SSL, ssl ? "1" : "0"); + udssactor.SetValue(VALUE_TIMEOUT, timeOut.ToString()); + + } + + + } +} diff --git a/udsService/rpc/rpc.cs b/udsService/rpc/rpc.cs new file mode 100644 index 000000000..5847fabf6 --- /dev/null +++ b/udsService/rpc/rpc.cs @@ -0,0 +1,212 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using CookComputing.XmlRpc; +using log4net; + +namespace uds +{ + public class rpc + { + private static ILog logger = LogManager.GetLogger(typeof(rpc)); + + private static rpc _manager = null; + private static bool _unlocked = false; + private string _id = null; + private IUDS service = null; + + private const string LOGON_MSG = "logon"; + private const string LOGOFF_MSG = "logoff"; + private const string INFO_MSG = "info"; + private const string READY_MSG = "ready"; + private const string IP_MSG = "ip"; + + private rpc(string url) + { + System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; }; + logger.Debug("Initializing rpc at \"" + url + "\" with timeout of " + config.timeOut.ToString()); + _id = null; + service = XmlRpcProxyGen.Create(); + service.Timeout = config.timeOut * 1000; + service.Url = url; + } + + public static void Initialize(string broker, bool useSSl) + { + if (!_unlocked) + throw new Exception("access denied"); + _manager = null; // Release previous manager + string protocol = useSSl ? "https" : "http"; + _manager = new rpc(protocol + "://" + broker + "/xmlrpc"); + } + + public static void Unlock(string pass) + { + if( pass == string.Join("", new string[] {"m","a","m","0" } ) ) + _unlocked = true; + } + + public static rpc Manager + { + get { return _manager; } + } + + private static string Unscramble(string str) + { + if( str == "" || str == null ) + return str; + + StringBuilder sb = new StringBuilder(); + int val = 0x32; + for (int i = 0; i < str.Length; i += 2) + { + int c = Int32.Parse(str.Substring(i, 2), System.Globalization.NumberStyles.HexNumber) ^ val; + val = (val + c) & 0xFF; + sb.Insert(0, Convert.ToString(Convert.ToChar(c))); + } + return sb.ToString(); + } + + public bool Test() + { + try + { + logger.Debug("Invoking service test"); + service.Test(); + } + catch (Exception e) + { + logger.Debug("Exception", e); + return false; + } + return true; + } + + public string Message(string message, string data) + { + if (_id == null) + { + logger.Debug("The id is null, recreating id"); + List interfaces = Info.Computer.GetInterfacesInfo(); + _id = string.Join(",", interfaces.ConvertAll(i => i.mac).ToArray()); + logger.Debug("The id is now " + _id); + } + logger.Debug("Sending message to broker: " + _id + ", " + message + ", " + data); + string ret = Unscramble(service.Message(_id, message, data)); + logger.Debug("Returned value: " + ret); + return ret; + } + + public static void Logon(string username) + { + if (rpc.Manager != null) + { + logger.Debug("Invoking remote logon of user " + username); + try + { + rpc.Manager.Message(LOGON_MSG, username); + } + catch (Exception) + { + logger.Info("Could cont contact broker at " + rpc.Manager.service.Url); + } + } + else + { + logger.Debug("Remote logon not invoked. RPC Disabled"); + } + } + + public static void Logoff(string username) + { + if (rpc.Manager != null) + { + logger.Debug("Invoking remote logoff of user " + username); + try + { + rpc.Manager.Message(LOGOFF_MSG, username); + } + catch (Exception) + { + logger.Info("Could cont contact broker at " + rpc.Manager.service.Url); + } + } + else + { + logger.Debug("Remote logoff not invoked. RPC Disabled"); + } + } + + public static string GetInfo() + { + string res = null; + if (rpc.Manager != null) + { + logger.Debug("Invoking remote GetInfo"); + try + { + res = rpc.Manager.Message(INFO_MSG, ""); + } + catch (Exception) + { + res = null; + } + } + return res; + } + + public static bool SetReady() + { + bool ok = false; + if (rpc.Manager != null) + { + logger.Debug("Informing broker of ready state"); + try + { + List interfaces = Info.Computer.GetInterfacesInfo(); + string info = string.Join(",", interfaces.ConvertAll(i => i.mac + "=" + i.ip).ToArray()); + rpc.Manager.Message(READY_MSG, info); + ok = true; + } + catch (Exception) + { + } + } + return ok; + } + + public static bool NotifyIPChange() + { + bool ok = false; + if (rpc.Manager != null) + { + logger.Debug("Informing broker of ip change"); + try + { + List interfaces = Info.Computer.GetInterfacesInfo(); + string info = string.Join(",", interfaces.ConvertAll(i => i.mac + "=" + i.ip).ToArray()); + rpc.Manager.Message(IP_MSG, info); + ok = true; + } + catch (Exception) + { + } + } + return ok; + } + + public static void ResetId() + { + logger.Debug("Reseting ID of rpc"); + if (rpc.Manager != null) + rpc.Manager._id = null; + } + + public static void ResetManager() + { + logger.Debug("Disabling rpc"); + rpc._manager = null; + } + } +} diff --git a/udsService/rpc/tools.csproj b/udsService/rpc/tools.csproj new file mode 100644 index 000000000..8767a575b --- /dev/null +++ b/udsService/rpc/tools.csproj @@ -0,0 +1,88 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {9861A89C-7007-4A42-8BEB-9914BCF5524C} + Library + Properties + uds + udstools + v3.5 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + prompt + true + true + true + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + false + prompt + true + true + true + + + + ..\xmlrpc\CookComputing.XmlRpcV2.dll + + + ..\log4net\3.5\log4net.dll + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/udsService/udsService.sln b/udsService/udsService.sln new file mode 100644 index 000000000..07e90777c --- /dev/null +++ b/udsService/udsService.sln @@ -0,0 +1,66 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual C# Express 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "udsService", "udsService\udsService.csproj", "{E528C884-A7FA-401F-AE2E-C1796D326461}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "udsgui", "udsgui\udsgui.csproj", "{278F54DB-771A-4EF2-BEF2-9447F988303F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tools", "rpc\tools.csproj", "{9861A89C-7007-4A42-8BEB-9914BCF5524C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E528C884-A7FA-401F-AE2E-C1796D326461}.Debug|Any CPU.ActiveCfg = Debug|x64 + {E528C884-A7FA-401F-AE2E-C1796D326461}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 + {E528C884-A7FA-401F-AE2E-C1796D326461}.Debug|Mixed Platforms.Build.0 = Debug|x64 + {E528C884-A7FA-401F-AE2E-C1796D326461}.Debug|x64.ActiveCfg = Debug|x86 + {E528C884-A7FA-401F-AE2E-C1796D326461}.Debug|x64.Build.0 = Debug|x86 + {E528C884-A7FA-401F-AE2E-C1796D326461}.Debug|x86.ActiveCfg = Debug|x86 + {E528C884-A7FA-401F-AE2E-C1796D326461}.Debug|x86.Build.0 = Debug|x86 + {E528C884-A7FA-401F-AE2E-C1796D326461}.Release|Any CPU.ActiveCfg = Release|x64 + {E528C884-A7FA-401F-AE2E-C1796D326461}.Release|Mixed Platforms.ActiveCfg = Release|x64 + {E528C884-A7FA-401F-AE2E-C1796D326461}.Release|Mixed Platforms.Build.0 = Release|x64 + {E528C884-A7FA-401F-AE2E-C1796D326461}.Release|x64.ActiveCfg = Release|x64 + {E528C884-A7FA-401F-AE2E-C1796D326461}.Release|x64.Build.0 = Release|x64 + {E528C884-A7FA-401F-AE2E-C1796D326461}.Release|x86.ActiveCfg = Release|x86 + {E528C884-A7FA-401F-AE2E-C1796D326461}.Release|x86.Build.0 = Release|x86 + {278F54DB-771A-4EF2-BEF2-9447F988303F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {278F54DB-771A-4EF2-BEF2-9447F988303F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {278F54DB-771A-4EF2-BEF2-9447F988303F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {278F54DB-771A-4EF2-BEF2-9447F988303F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {278F54DB-771A-4EF2-BEF2-9447F988303F}.Debug|x64.ActiveCfg = Debug|Any CPU + {278F54DB-771A-4EF2-BEF2-9447F988303F}.Debug|x86.ActiveCfg = Debug|Any CPU + {278F54DB-771A-4EF2-BEF2-9447F988303F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {278F54DB-771A-4EF2-BEF2-9447F988303F}.Release|Any CPU.Build.0 = Release|Any CPU + {278F54DB-771A-4EF2-BEF2-9447F988303F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {278F54DB-771A-4EF2-BEF2-9447F988303F}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {278F54DB-771A-4EF2-BEF2-9447F988303F}.Release|x64.ActiveCfg = Release|Any CPU + {278F54DB-771A-4EF2-BEF2-9447F988303F}.Release|x86.ActiveCfg = Release|x86 + {278F54DB-771A-4EF2-BEF2-9447F988303F}.Release|x86.Build.0 = Release|x86 + {9861A89C-7007-4A42-8BEB-9914BCF5524C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9861A89C-7007-4A42-8BEB-9914BCF5524C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9861A89C-7007-4A42-8BEB-9914BCF5524C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {9861A89C-7007-4A42-8BEB-9914BCF5524C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {9861A89C-7007-4A42-8BEB-9914BCF5524C}.Debug|x64.ActiveCfg = Debug|Any CPU + {9861A89C-7007-4A42-8BEB-9914BCF5524C}.Debug|x86.ActiveCfg = Debug|Any CPU + {9861A89C-7007-4A42-8BEB-9914BCF5524C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9861A89C-7007-4A42-8BEB-9914BCF5524C}.Release|Any CPU.Build.0 = Release|Any CPU + {9861A89C-7007-4A42-8BEB-9914BCF5524C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {9861A89C-7007-4A42-8BEB-9914BCF5524C}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {9861A89C-7007-4A42-8BEB-9914BCF5524C}.Release|x64.ActiveCfg = Release|Any CPU + {9861A89C-7007-4A42-8BEB-9914BCF5524C}.Release|x86.ActiveCfg = Release|x86 + {9861A89C-7007-4A42-8BEB-9914BCF5524C}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/udsService/udsService/Application.cs b/udsService/udsService/Application.cs new file mode 100644 index 000000000..d4b68daab --- /dev/null +++ b/udsService/udsService/Application.cs @@ -0,0 +1,87 @@ +using System; +using System.Collections.Generic; +using log4net; +using System.ServiceProcess; +using System.Diagnostics; +using System.Linq; + +namespace uds.Services +{ + class Application + { + private static ILog logger = LogManager.GetLogger(typeof(Application)); + + private const string serviceName = "UDSService"; + private const string serviceDisplayName = "UDS Actor"; + private const string serviceDescription = "UDS coordination actor"; + private const string serviceDependencies = "SENS\0COMSysApp"; + private const bool serviceStartOnInstall = false; + + + /*private static void SensLogon_DisplayLock(string userName) + { + Console.WriteLine("Screen Locked: " + userName); + } + private static void SensLogon_DisplayUnlock(string userName) + { + Console.WriteLine("Screen Unlocked: " + userName); + }*/ + + private static void InstallService() + { + if (ServiceInstaller.InstallService(System.Reflection.Assembly.GetEntryAssembly().Location, serviceName, serviceDisplayName, serviceDescription, serviceDependencies, serviceStartOnInstall) == false) + { + Console.WriteLine("Can't install service!!!"); + } + } + + private static void UninstallService() + { + if (ServiceInstaller.UnInstallService("UDSService") == false) + { + Console.WriteLine("Can't uninstall service!!!"); + } + } + + static void Main(string[] args) + { + log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo(AppDomain.CurrentDomain.BaseDirectory + "logging.cfg")); + config.LoadConfig(); // Loads configuration... + // unlocks rpc + rpc.Unlock(string.Join("", new string[] { "m", "a", "m", "0" })); + if (args.Length == 1) + { + switch (args[0]) + { + case "-I": + case "-i": + case "/i": + InstallService(); + return; + case "-U": + case "-u": + case "/u": + UninstallService(); + return; + case "-C": + case "-c": + case "/c": + gui.gui.ShowConfig(); + return; + case "-R": + case "-r": + case "/r": + //Operation.Reboot(); + return; + case "-h": + case "-H": + default: + Console.WriteLine("Usage: udsService.exe [-i|-u|-h|-c]"); + return; + } + } + + ServiceBase.Run(new Service()); + } + } +} diff --git a/udsService/udsService/Properties/AssemblyInfo.cs b/udsService/udsService/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..2669ae2a1 --- /dev/null +++ b/udsService/udsService/Properties/AssemblyInfo.cs @@ -0,0 +1,40 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Resources; + +// La información general sobre un ensamblado se controla mediante el siguiente +// conjunto de atributos. Cambie estos atributos para modificar la información +// asociada con un ensamblado. +[assembly: AssemblyTitle("UDSService")] +[assembly: AssemblyDescription("Service controling the windows's actor of UDS")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Virtual Cable S.L.")] +[assembly: AssemblyProduct("USD Actor")] +[assembly: AssemblyCopyright("Copyright © Virtual Cable S.L. 2011")] +[assembly: AssemblyTrademark("UDS")] +[assembly: AssemblyCulture("")] + +// Si establece ComVisible como false, los tipos de este ensamblado no estarán visibles +// para los componentes COM. Si necesita obtener acceso a un tipo de este ensamblado desde +// COM, establezca el atributo ComVisible como true en este tipo. +[assembly: ComVisible(false)] + +// El siguiente GUID sirve como identificador de typelib si este proyecto se expone a COM +[assembly: Guid("73b2a3ab-22c7-4210-8a56-7ee5531ba482")] + +// La información de versión de un ensamblado consta de los cuatro valores siguientes: +// +// Versión principal +// Versión secundaria +// Número de compilación +// Revisión +// +// Puede especificar todos los valores o establecer como predeterminados los números de versión de compilación y de revisión +// mediante el asterisco ('*'), como se muestra a continuación: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] + +//[assembly: log4net.Config.XmlConfigurator()] +[assembly: NeutralResourcesLanguageAttribute("en")] diff --git a/udsService/udsService/Sens/EventSystemRegistrar.cs b/udsService/udsService/Sens/EventSystemRegistrar.cs new file mode 100644 index 000000000..235110c3e --- /dev/null +++ b/udsService/udsService/Sens/EventSystemRegistrar.cs @@ -0,0 +1,334 @@ +using System.Diagnostics; +using System.Runtime.InteropServices; +using EventSystemLib; +using System; +using SensEvents; +using log4net; + +namespace uds.Services.Sens +{ + //In the ManagesSENS namespace + [ComImport, Guid("4E14FBA2-2E22-11D1-9964-00C04FBBB345")] + class EventSystem { } + [ComImport, Guid("7542E960-79C7-11D1-88F9-0080C7D771BF")] + class EventSubcription { } + [ComImport, Guid("AB944620-79C6-11d1-88F9-0080C7D771BF")] + class EventPublisher { } + [ComImport, Guid("cdbec9c0-7a68-11d1-88f9-0080c7d771bf")] + class EventClass { } + + class EventSystemRegistrar + { + private static ILog logger = LogManager.GetLogger(typeof(EventSystemRegistrar)); + + private const string PROGID_EventSubscription = "EventSystem.EventSubscription"; + static EventSystemRegistrar() { } + + private static IEventSystem es = null; + private static IEventSystem EventSystem + { + get + { + if (es == null) + es = new EventSystem() as IEventSystem; + return es; + } + } + + public static void SubscribeToEvents(string description, string subscriptionName, string + subscriptionID, object subscribingObject, Type subscribingType) + { + // activate subscriber + try + { + //create and populate a subscription object + IEventSubscription sub = new EventSubcription() as IEventSubscription; + sub.Description = description; + sub.SubscriptionName = subscriptionName; + sub.SubscriptionID = subscriptionID; + //Get the GUID from the ISensLogon interface + sub.InterfaceID = GetInterfaceGuid(subscribingType); + sub.SubscriberInterface = subscribingObject; + //Store the actual Event. + EventSystem.Store(PROGID_EventSubscription, sub); + } + catch (Exception ex) + { + logger.Error("Exception cauthg subscribing to SENS events: ", ex); + } + } + + private static string GetInterfaceGuid(Type theType) + { + object[] attributes = theType.GetCustomAttributes(typeof(GuidAttribute), true); + if (attributes.Length > 0) + { + return "{" + ((GuidAttribute)attributes[0]).Value + "}"; + } + else + { + logger.Error("GuidedAttribute not present on the type"); + throw new ArgumentException("GuidAttribute not present on the Type.", "theType"); + } + } + + public static void UnsubscribeToEvents(string subscriptionID) + { + try + { + string strCriteria = "SubscriptionID == " + subscriptionID; + int errorIndex = 0; + EventSystem.Remove("EventSystem.EventSubscription", strCriteria, out errorIndex); + } + catch (Exception ex) + { + logger.Error("Exception cauthg unsubscribing to SENS events: ", ex); + } + } + } + + public delegate void SensLogonEventHandler(string userName); + public class SensLogon + { + private static ILog logger = LogManager.GetLogger(typeof(SensLogon)); + + private static SensLogonInterop eventCatcher; + static SensLogon() { } + + private class SensLogonInterop : ISensLogon, IDisposable + { + private static ILog logger = LogManager.GetLogger(typeof(SensLogonInterop)); + + private const string SubscriptionViewerName = "ManagedSENS.SensLogonInterop"; + // generate a subscriptionID + private static string SubscriptionViewerID = "{" + typeof(SensLogonInterop).GUID.ToString().ToUpper() + "}"; + private const string SubscriptionViewerDesc = "ManagedSENS Event Subscriber"; + + private bool registered; + + public SensLogonInterop() + { + registered = false; + EventSystemRegistrar.SubscribeToEvents(SubscriptionViewerDesc, SubscriptionViewerName, + SubscriptionViewerID, this, typeof(ISensLogon)); + registered = true; + logger.Debug("Sens registered"); + } + + ~SensLogonInterop() + { + this.Dispose(false); + } + + public void Dispose() + { + this.Dispose(true); + } + + protected void Dispose(bool isExplicit) + { + this.Deactivate(); + } + + private void Deactivate() + { + if (registered) + { + EventSystemRegistrar.UnsubscribeToEvents(SubscriptionViewerID); + registered = false; + logger.Debug("Sens unregistered"); + } + } + + public void DisplayLock(string bstrUserName) + { + logger.Debug("SENS Displaylock invoked for user " + bstrUserName); + SensLogon.OnDisplayLock(bstrUserName); + } + public void DisplayUnlock(string bstrUserName) + { + logger.Debug("SENS DisplayUnloock invoked for user " + bstrUserName); + SensLogon.OnDisplayUnlock(bstrUserName); + } + + public void Logoff(string bstrUserName) + { + logger.Debug("SENS Logoff invoked for user " + bstrUserName); + SensLogon.OnLogoff(bstrUserName); + } + + public void Logon(string bstrUserName) + { + logger.Debug("SENS Logon invoked for user " + bstrUserName); + SensLogon.OnLogon(bstrUserName); + } + + public void StartScreenSaver(string bstrUserName) + { + logger.Debug("SENS StartScreenSaver invoked for user " + bstrUserName); + SensLogon.OnStartScreenSaver(bstrUserName); + } + + public void StartShell(string bstrUserName) + { + logger.Debug("SENS StartShell invoked for user " + bstrUserName); + SensLogon.OnStartShell(bstrUserName); + } + + public void StopScreenSaver(string bstrUserName) + { + logger.Debug("SENS StopScreenSaver invoked for user " + bstrUserName); + SensLogon.OnStopScreenSaver(bstrUserName); + } + } + + private static int registerCount = 0; + private static bool IsRegistered + { + get + { + return (registerCount > 0); + } + } + + private static SensLogonEventHandler RegisterEvent(SensLogonEventHandler original, + SensLogonEventHandler newDel) + { + bool shouldRegister = (original == null); + original = original + newDel; + if (shouldRegister) + { + if (registerCount <= 0) + { + if (SensLogon.eventCatcher == null) + SensLogon.eventCatcher = new SensLogonInterop(); + registerCount = 1; + } + else + { + //Just count them. + registerCount++; + } + } + return original; + } + + private static SensLogonEventHandler UnregisterEvent(SensLogonEventHandler original, + SensLogonEventHandler oldDel) + { + original = original - oldDel; + if (original == null) + { + registerCount--; + if (registerCount == 0) + { + //unregister for those events. + SensLogon.eventCatcher.Dispose(); + SensLogon.eventCatcher = null; + } + } + return original; + } + + private static void exec(string name, SensLogonEventHandler ev, string bStrUsername) + { + if (ev != null) + { + try + { + logger.Debug("Executing " + name + " for user " + bStrUsername ); + ev(bStrUsername); + } + catch (Exception ex) + { + logger.Error("Exception cauthg executing sens event " + name, ex); + } + } + } + + protected static void OnDisplayLock(string bstrUserName) + { + exec("DisplayLock", SensLogon.displayLock, bstrUserName); + } + protected static void OnDisplayUnlock(string bstrUserName) + { + exec("DisplayUnlock", SensLogon.displayUnlock, bstrUserName); + } + protected static void OnLogoff(string bstrUserName) + { + exec("Logoff", SensLogon.logoff, bstrUserName); + } + protected static void OnLogon(string bstrUserName) + { + exec("Logon", SensLogon.logon, bstrUserName); + } + protected static void OnStartScreenSaver(string bstrUserName) + { + exec("StartScreenSaver", SensLogon.startScreenSaver, bstrUserName); + } + protected static void OnStartShell(string bstrUserName) + { + exec("Startshell", SensLogon.startShell, bstrUserName); + } + protected static void OnStopScreenSaver(string bstrUserName) + { + exec("StopScreenSaver", SensLogon.stopScreenSaver, bstrUserName); + } + + + private static SensLogonEventHandler displayLock = null; + private static SensLogonEventHandler displayUnlock = null; + private static SensLogonEventHandler logoff = null; + private static SensLogonEventHandler logon = null; + private static SensLogonEventHandler startScreenSaver = null; + private static SensLogonEventHandler startShell = null; + private static SensLogonEventHandler stopScreenSaver = null; + + + public static event SensLogonEventHandler DisplayLock + { + add { SensLogon.displayLock = SensLogon.RegisterEvent(SensLogon.displayLock, value); } + remove { SensLogon.displayLock = SensLogon.UnregisterEvent(SensLogon.displayLock, value); } + } + + public static event SensLogonEventHandler DisplayUnlock + { + add { SensLogon.displayUnlock = SensLogon.RegisterEvent(SensLogon.displayUnlock, value); } + remove { SensLogon.displayUnlock = SensLogon.UnregisterEvent(SensLogon.displayUnlock, value); } + } + + public static event SensLogonEventHandler Logoff + { + add { SensLogon.logoff = SensLogon.RegisterEvent(SensLogon.logoff, value); } + remove { SensLogon.logoff = SensLogon.UnregisterEvent(SensLogon.logoff, value); } + } + + public static event SensLogonEventHandler Logon + { + add { SensLogon.logon = SensLogon.RegisterEvent(SensLogon.logon, value); } + remove { SensLogon.logon = SensLogon.UnregisterEvent(SensLogon.logon, value); } + } + + public static event SensLogonEventHandler StartScreenSaver + { + add { SensLogon.startScreenSaver = SensLogon.RegisterEvent(SensLogon.startScreenSaver, value); } + remove { SensLogon.startScreenSaver = SensLogon.UnregisterEvent(SensLogon.startScreenSaver, value); } + } + + public static event SensLogonEventHandler StartShell + { + add { SensLogon.startShell = SensLogon.RegisterEvent(SensLogon.startShell, value); } + remove { SensLogon.startShell = SensLogon.UnregisterEvent(SensLogon.startShell, value); } + } + + public static event SensLogonEventHandler StopScreenSaver + { + add { SensLogon.stopScreenSaver = SensLogon.RegisterEvent(SensLogon.stopScreenSaver, value); } + remove { SensLogon.stopScreenSaver = SensLogon.UnregisterEvent(SensLogon.stopScreenSaver, value); } + } + + + } + +} + diff --git a/udsService/udsService/Service.cs b/udsService/udsService/Service.cs new file mode 100644 index 000000000..bcd1f5421 --- /dev/null +++ b/udsService/udsService/Service.cs @@ -0,0 +1,336 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Diagnostics; +using System.ServiceProcess; +using System.Threading; +using log4net; + +namespace uds.Services +{ + public class Service : System.ServiceProcess.ServiceBase + { + private static ILog logger = LogManager.GetLogger(typeof(Service)); + const int secsDelay = 5; + + private Thread _thread; + private ManualResetEvent _stopEvent; + private TimeSpan _delay; + private bool _reboot; + + private static void SensLogon_Logon(string userName) + { + logger.Info("User " + userName + " has logged in"); + rpc.Logon(userName); + } + + + private static void SensLogon_Logout(string userName) + { + logger.Info("User " + userName + " has logged out"); + rpc.Logoff(userName); + } + + public Service() + { + ServiceName = "UDS Actor"; + _thread = null; + _stopEvent = null; + _delay = new TimeSpan(0, 0, 0, secsDelay, 0); + _reboot = false; + } + + protected override void OnStart(string[] args) + { + logger.Debug("Initiated OnStart of service"); + ThreadStart start = new ThreadStart(this.ParallelThread); + _thread = new Thread(start); + _stopEvent = new ManualResetEvent(false); + (_thread).Start(); + + // Prepare SENS events + Sens.SensLogon.Logon += SensLogon_Logon; + Sens.SensLogon.Logoff += SensLogon_Logout; + + logger.Debug("Invoking base OnStart"); + // Invoke base OnStart + base.OnStart(args); + } + + protected override void OnStop() + { + logger.Debug("Initiated service shutdown"); + // Signal thread if already running + _stopEvent.Set(); + // Prepare SENS events + Sens.SensLogon.Logon -= SensLogon_Logon; + Sens.SensLogon.Logoff -= SensLogon_Logout; + + _thread.Join((2 + secsDelay) * 1000); + + base.OnStop(); + } + + private void ParallelThread() + { + logger.Debug("Initiated Service main"); + + // We have to wait till we have ip + List interfaces = null; + while (interfaces == null) + { + logger.Debug("Trying to get network info.."); + try + { + interfaces = Info.Computer.GetInterfacesInfo(); + } + catch (Exception e) + { + logger.Debug("Exception!!!",e); + } + if (interfaces == null) + { + bool exit = _stopEvent.WaitOne(_delay); + if (exit) + { + logger.Debug("Exit requested waiting for interfaces"); + return; + } + } + } + // We have now interfaces info, intialize the connection and try to connect + // In fact, we do not use the interfaces received except for logging, initialize gets their own data from there + logger.Debug("Interfaces: " + string.Join(",", interfaces.ConvertAll(i => i.mac + "=" + i.ip).ToArray())); + rpc.Initialize(config.broker, config.ssl); + string action = null; + while (action == null) + { + logger.Debug("Trying to contact server to get action"); + rpc.ResetId(); // So we get interfaces info every time we try to contact broker + action = rpc.GetInfo(); // Get action to execute + if (action == null) + { + bool exit = _stopEvent.WaitOne(_delay); + if (exit) + { + logger.Debug("Exit requested waiting for broker info"); + return; + } + } + } + + if (action == "") + { + logger.Debug("Unmanaged machine, exiting..."); + // Reset rpc so next calls are simply ignored... + rpc.ResetManager(); + return; + } + // Message is in the form "action:params", where we can identify: + // rename:computername + // domain:computername\tdomain\tou\tuserToAuth\tpassToAuth + string[] data = action.Split(':'); + if (data.Length != 2) + { + logger.Error("Unrecognized instruction: \"" + action + "\""); + rpc.ResetManager(); // Invalidates manager, cause we don't recognized it + return; + } + + switch (data[0]) + { + case "rename": + Rename(data[1]); + break; + case "domain": + { + string[] parms = data[1].Split('\t'); + if (parms.Length != 5) + { + logger.Error("Unrecognized parameters: " + data[1]); + rpc.ResetManager(); // Invalidates manager, cause we don't recognized it + return; + } + JoinDomain(parms[0], parms[1], parms[2], parms[3], parms[4]); + } + break; + default: + logger.Error("Unrecognized action: \"" + data[0] + "\""); + rpc.ResetManager(); // Invalidates manager, cause we don't recognized it + return; + } + // Reboot process or no process at all, exit + if (_reboot || rpc.Manager == null) + { + logger.Debug("Returning, reboot = '" + _reboot.ToString() + "' + rcp.Manager = '" + rpc.Manager.ToString() + "'"); + return; + } + logger.Debug("Main loop waiting for ip change"); + // Now, every secs delay, get if the interfaces ips changes and notify service + Dictionary knownIps = new Dictionary(); + try + { + foreach (Info.Computer.InterfaceInfo i in Info.Computer.GetInterfacesInfo()) + knownIps.Add(i.mac, i.ip); + } + catch (Exception e) + { + logger.Error("Could not accesss ip adresses!!", e); + return; + } + + while (true) + { + try + { + foreach (Info.Computer.InterfaceInfo i in Info.Computer.GetInterfacesInfo()) + { + + /*logger.Debug(knownIps.ContainsKey(i.mac)); + logger.Debug(i.mac + ", " + i.ip);*/ + + if (knownIps.ContainsKey(i.mac) && knownIps[i.mac] != i.ip) + { + if (rpc.NotifyIPChange() == true) // if Could not send ip addresses, try again in a while, else save it + knownIps[i.mac] = i.ip; + else + logger.Info("Could not notify ip, will retry later"); + break; + } + } + } + catch (Exception e) + { + logger.Error("Error getting interfaces", e); + } + bool exit = _stopEvent.WaitOne(_delay); + if (exit) + { + logger.Debug("Exit requested on main loop"); + return; + } + } + } + + private void Rename(string name) + { + logger.Info("Requested renaming of computer to \"" + name + "\""); + // name and newName can be different case, but still same + Info.DomainInfo info = Info.Computer.GetDomainInfo(); + if ( string.Equals(info.ComputerName, name, StringComparison.CurrentCultureIgnoreCase)) + { + logger.Debug("Computer do not needs to be renamed"); + rpc.SetReady(); + return; + } + if (Operation.RenameComputer(name) == false) + { + logger.Error("Could not rename machine to \"" + name + "\""); + rpc.ResetManager(); + return; + } + Reboot(); + } + + + private void OneStepJoin(string name, string domain, string ou, string account, string pass) + { + logger.Info("Requested one step join of computer to \"" + domain + "\" with name \"" + name + "\" under ou \"" + ou + "\"" ); + // name and newName can be different case, but still same + Info.DomainInfo info = Info.Computer.GetDomainInfo(); + if (string.Equals(info.ComputerName, name, StringComparison.CurrentCultureIgnoreCase)) + { + // We should be already in the domain, if not, will try second step of "multiStepJoin" + if(info.Status == Info.DomainInfo.NetJoinStatus.NetSetupDomainName ) // Already in domain + { + logger.Debug("Machine already in the domain"); + rpc.SetReady(); + return; + } + // Call multiStep, cause name is good but domain don't + MultiStepJoin(name, domain, ou, account, pass); + return; + } + // Needs to rename + join + if (Operation.RenameComputer(name) == false) + { + logger.Error("Could not rename machine to \"" + name + "\""); + rpc.ResetManager(); + return; + } + // Now try to join domain + if (Operation.JoinDomain(domain, ou, account, pass, true) == false) + { + logger.Error("Could not join domain \"" + domain + "\", ou \"" + ou + "\""); + rpc.ResetManager(); + return; + } + // Fine, now reboot + Reboot(); + } + + private void MultiStepJoin(string name, string domain, string ou, string account, string pass) + { + logger.Info("Requested two step join of computer to \"" + domain + "\" with name \"" + name + "\" under ou \"" + ou + "\""); + Info.DomainInfo info = Info.Computer.GetDomainInfo(); + if (string.Equals(info.ComputerName, name, StringComparison.CurrentCultureIgnoreCase)) + { + // Name already, now see if already in domain + if (info.Status == Info.DomainInfo.NetJoinStatus.NetSetupDomainName) // Already in domain + { + logger.Debug("Machine already in the domain"); + rpc.SetReady(); + return; + } + // Now try to join domain + if (Operation.JoinDomain(domain, ou, account, pass, true) == false) + { + logger.Error("Could not join domain \"" + domain + "\", ou \"" + ou + "\""); + rpc.ResetManager(); + return; + } + } + else + { + // Try to rename machine + if (Operation.RenameComputer(name) == false) + { + logger.Error("Could not rename machine to \"" + name + "\""); + rpc.ResetManager(); + return; + } + } + // Fine, now reboot + Reboot(); + } + + private void JoinDomain(string name, string domain, string ou, string account, string pass) + { + // Test to see if it is windows 7 + logger.Info("Joining domain " + domain + ", under ou " + ou); + Info.OsInfo winVer = new Info.OsInfo(); + if (winVer.Version == Info.OsInfo.WindowsVersion.Win7) + { + // Will do it in one step + OneStepJoin(name, domain, ou, account, pass); + } + else + { + MultiStepJoin(name, domain, ou, account, pass); + } + } + + private void Reboot() + { + if (Operation.Reboot() == false) + { + logger.Error("Could not reboot machine"); + rpc.ResetManager(); + } + else + _reboot = true; + + } + } +} diff --git a/udsService/udsService/ServiceInstaller.cs b/udsService/udsService/ServiceInstaller.cs new file mode 100644 index 000000000..77bc68b95 --- /dev/null +++ b/udsService/udsService/ServiceInstaller.cs @@ -0,0 +1,171 @@ +using System; +using System.Runtime.InteropServices; +using log4net; + +namespace uds.Services +{ + class ServiceInstaller + { + private static ILog logger = LogManager.GetLogger(typeof(ServiceInstaller)); + + #region DLLImport + [DllImport("advapi32.dll")] + public static extern IntPtr OpenSCManager(string lpMachineName, string lpSCDB, int scParameter); + [DllImport("Advapi32.dll")] + public static extern IntPtr CreateService(IntPtr SC_HANDLE, string lpSvcName, string lpDisplayName, + int dwDesiredAccess, int dwServiceType, int dwStartType, int dwErrorControl, string lpPathName, + string lpLoadOrderGroup, int lpdwTagId, string lpDependencies, string lpServiceStartName, string lpPassword); + [DllImport("advapi32.dll")] + public static extern void CloseServiceHandle(IntPtr SCHANDLE); + [DllImport("advapi32.dll")] + public static extern int StartService(IntPtr SVHANDLE, int dwNumServiceArgs, string lpServiceArgVectors); + [DllImport("advapi32.dll", SetLastError = true)] + public static extern IntPtr OpenService(IntPtr SCHANDLE, string lpSvcName, int dwNumServiceArgs); + [DllImport("advapi32.dll")] + public static extern int DeleteService(IntPtr SVHANDLE); + [DllImport("kernel32.dll")] + public static extern int GetLastError(); + #endregion DLLImport + + /// + /// This method installs and runs the service in the service control manager. + /// + /// The complete path of the service. + /// Name of the service. + /// Display name of the service. + /// True if the process went thro successfully. False if there was anyerror. + public static bool InstallService(string svcPath, string svcName, string svcDispName, string description, string dependencies, bool startNow) + { + logger.Info("Installing service \"" + svcName + "\" at \"" + svcPath + "\""); + + int SC_MANAGER_CREATE_SERVICE = 0x0002; + int SERVICE_WIN32_OWN_PROCESS = 0x00000010; + //int SERVICE_DEMAND_START = 0x00000003; + int SERVICE_ERROR_NORMAL = 0x00000001; + int STANDARD_RIGHTS_REQUIRED = 0xF0000; + int SERVICE_QUERY_CONFIG = 0x0001; + int SERVICE_CHANGE_CONFIG = 0x0002; + int SERVICE_QUERY_STATUS = 0x0004; + int SERVICE_ENUMERATE_DEPENDENTS = 0x0008; + int SERVICE_START = 0x0010; + int SERVICE_STOP = 0x0020; + int SERVICE_PAUSE_CONTINUE = 0x0040; + int SERVICE_INTERROGATE = 0x0080; + int SERVICE_USER_DEFINED_CONTROL = 0x0100; + int SERVICE_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED | SERVICE_QUERY_CONFIG | SERVICE_CHANGE_CONFIG | SERVICE_QUERY_STATUS | + SERVICE_ENUMERATE_DEPENDENTS | SERVICE_START | SERVICE_STOP | SERVICE_PAUSE_CONTINUE | SERVICE_INTERROGATE | SERVICE_USER_DEFINED_CONTROL); + int SERVICE_AUTO_START = 0x00000002; + + try + { + IntPtr sc_handle = OpenSCManager(null, null, SC_MANAGER_CREATE_SERVICE); + if (sc_handle.ToInt32() != 0) + { + IntPtr sv_handle = CreateService(sc_handle, svcName, svcDispName, SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, svcPath, null, 0, dependencies, null, null); + if (sv_handle.ToInt32() == 0) + { + logger.Error("Service can't be installed!!"); + CloseServiceHandle(sc_handle); + return false; + } + else + { + logger.Info("Service installed"); + if (startNow) + { + //now trying to start the service + int i = StartService(sv_handle, 0, null); + // If the value i is zero, then there was an error starting the service. + // note: error may arise if the service is already running or some other problem. + if (i == 0) + { + logger.Error("Can't start service!!!"); + //Console.WriteLine("Couldnt start service"); + return false; + } + //Console.WriteLine("Success"); + } + CloseServiceHandle(sc_handle); + + Microsoft.Win32.RegistryKey system, currentControlSet, services, service; + system = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("System"); + //Open CurrentControlSet + + currentControlSet = system.OpenSubKey("CurrentControlSet"); + services = currentControlSet.OpenSubKey("Services"); + service = services.OpenSubKey(svcName, true); + service.SetValue("Description", description); + return true; + } + } + else + { + logger.Error("SCM not opened successfully"); + return false; + } + } + catch (Exception e) + { + throw e; + } + } + + public static void StopService(string svcName, int timeoutMilliseconds = 10000) + { + logger.Debug("Stoping service " + svcName + " with timeout " + timeoutMilliseconds); + System.ServiceProcess.ServiceController service = new System.ServiceProcess.ServiceController(svcName); + try + { + TimeSpan timeout = TimeSpan.FromMilliseconds(timeoutMilliseconds); + + service.Stop(); + service.WaitForStatus(System.ServiceProcess.ServiceControllerStatus.Stopped, timeout); + logger.Debug("Service correctly stopped"); + } + catch(Exception e) + { + // ... + logger.Debug("Service could not been stoped", e); + } + } + + + public static bool UnInstallService(string svcName) + { + logger.Info("Uninstalling service " + svcName); + StopService(svcName); + // First, stop service + int GENERIC_WRITE = 0x40000000; + IntPtr sc_hndl = OpenSCManager(null, null, GENERIC_WRITE); + if (sc_hndl.ToInt32() != 0) + { + int DELETE = 0x10000; + IntPtr svc_hndl = OpenService(sc_hndl, svcName, DELETE); + //Console.WriteLine(svc_hndl.ToInt32()); + if (svc_hndl.ToInt32() != 0) + { + int i = DeleteService(svc_hndl); + if (i != 0) + { + logger.Info("Service correctly removed"); + CloseServiceHandle(sc_hndl); + return true; + } + else + { + logger.Error("Can't remove service: " + i.ToString()); + CloseServiceHandle(sc_hndl); + return false; + } + } + else + return false; + } + else + { + logger.Error("SCM not opened successfully!!"); + return false; + } + } + } +} \ No newline at end of file diff --git a/udsService/udsService/app.config b/udsService/udsService/app.config new file mode 100644 index 000000000..b53287494 --- /dev/null +++ b/udsService/udsService/app.config @@ -0,0 +1,7 @@ + + + + + + + diff --git a/udsService/udsService/logging.cfg b/udsService/udsService/logging.cfg new file mode 100644 index 000000000..c6d56116c --- /dev/null +++ b/udsService/udsService/logging.cfg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/udsService/udsService/udsService.csproj b/udsService/udsService/udsService.csproj new file mode 100644 index 000000000..133d4f667 --- /dev/null +++ b/udsService/udsService/udsService.csproj @@ -0,0 +1,139 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {E528C884-A7FA-401F-AE2E-C1796D326461} + WinExe + Properties + uds.Services + udsService + v3.5 + + + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + false + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + uds.Services.Application + + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + prompt + false + false + true + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + prompt + false + false + true + + + + udsService.manifest + + + + False + ..\log4net\3.5\log4net.dll + + + + + + + + + + + + + + Component + + + + + + Designer + + + Always + Designer + + + + + + {4E14FB90-2E22-11D1-9964-00C04FBBB345} + 1 + 0 + 0 + tlbimp + False + True + + + {D597DEED-5B9F-11D1-8DD2-00AA004ABD5E} + 2 + 0 + 0 + tlbimp + False + True + + + + + {9861A89C-7007-4A42-8BEB-9914BCF5524C} + tools + + + {278F54DB-771A-4EF2-BEF2-9447F988303F} + udsgui + + + + + \ No newline at end of file diff --git a/udsService/udsService/udsService.manifest b/udsService/udsService/udsService.manifest new file mode 100644 index 000000000..61efa899d --- /dev/null +++ b/udsService/udsService/udsService.manifest @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/udsService/udsgui/Lang.Designer.cs b/udsService/udsgui/Lang.Designer.cs new file mode 100644 index 000000000..e75a1af76 --- /dev/null +++ b/udsService/udsgui/Lang.Designer.cs @@ -0,0 +1,108 @@ +//------------------------------------------------------------------------------ +// +// Este código fue generado por una herramienta. +// Versión de runtime:4.0.30319.239 +// +// Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si +// se vuelve a generar el código. +// +//------------------------------------------------------------------------------ + +namespace uds.gui { + using System; + + + /// + /// Clase de recurso con establecimiento inflexible de tipos, para buscar cadenas traducidas, etc. + /// + // StronglyTypedResourceBuilder generó automáticamente esta clase + // a través de una herramienta como ResGen o Visual Studio. + // Para agregar o quitar un miembro, edite el archivo .ResX y, a continuación, vuelva a ejecutar ResGen + // con la opción /str o vuelva a generar su proyecto de VS. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Lang { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Lang() { + } + + /// + /// Devuelve la instancia de ResourceManager almacenada en caché utilizada por esta clase. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("uds.gui.Lang", typeof(Lang).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Reemplaza la propiedad CurrentUICulture del subproceso actual para todas las + /// búsquedas de recursos mediante esta clase de recurso con establecimiento inflexible de tipos. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Busca una cadena traducida similar a You need administrator privileges to run this program.. + /// + internal static string AdminNeeded { + get { + return ResourceManager.GetString("AdminNeeded", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a The parameters didn't work as expected. Check them and try again. + /// + internal static string ConnectionError { + get { + return ResourceManager.GetString("ConnectionError", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a The connection test worked.. + /// + internal static string ConnectionOK { + get { + return ResourceManager.GetString("ConnectionOK", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Connection Test Result. + /// + internal static string ConnectionTest { + get { + return ResourceManager.GetString("ConnectionTest", resourceCulture); + } + } + + /// + /// Busca una cadena traducida similar a Error. + /// + internal static string Error { + get { + return ResourceManager.GetString("Error", resourceCulture); + } + } + } +} diff --git a/udsService/udsgui/Lang.de.resx b/udsService/udsgui/Lang.de.resx new file mode 100644 index 000000000..c6efe1a73 --- /dev/null +++ b/udsService/udsgui/Lang.de.resx @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Sie benötigen Administratorrechte zu verkehren dieses Program. + + + Die Parameter funktionieren nicht wie erwartet. Überprüfen Sie sie und versuchen Sie es erneut + + + Der Verbindungstest arbeitete. + + + Verbindung Testergebnis + + + Fehler + + \ No newline at end of file diff --git a/udsService/udsgui/Lang.es.resx b/udsService/udsgui/Lang.es.resx new file mode 100644 index 000000000..983486e16 --- /dev/null +++ b/udsService/udsgui/Lang.es.resx @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Necesita ser administrador para poder ejecutar esta aplicación. + + + Los parametros de conexión son erroneos. Reviselos y pruebe de nuevo. + + + El test de conexión funcionó correctamente. + + + Resultado del test de conexión + + + Error + + \ No newline at end of file diff --git a/udsService/udsgui/Lang.fr.resx b/udsService/udsgui/Lang.fr.resx new file mode 100644 index 000000000..9a17933fe --- /dev/null +++ b/udsService/udsgui/Lang.fr.resx @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Vous avez besoin de privilèges d'administrateur pour exécuter ce programme. + + + Les paramètres n'a pas fonctionné comme prévu. Les vérifier et essayez à nouveau + + + Le test de connexion a travaillé. + + + Résultat de Test de connexion + + + Erreur + + \ No newline at end of file diff --git a/udsService/udsgui/Lang.resx b/udsService/udsgui/Lang.resx new file mode 100644 index 000000000..064bdddb7 --- /dev/null +++ b/udsService/udsgui/Lang.resx @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + You need administrator privileges to run this program. + + + The parameters didn't work as expected. Check them and try again + + + The connection test worked. + + + Connection Test Result + + + Error + + \ No newline at end of file diff --git a/udsService/udsgui/Properties/AssemblyInfo.cs b/udsService/udsgui/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..d8256b978 --- /dev/null +++ b/udsService/udsgui/Properties/AssemblyInfo.cs @@ -0,0 +1,38 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Resources; + +// La información general sobre un ensamblado se controla mediante el siguiente +// conjunto de atributos. Cambie estos atributos para modificar la información +// asociada con un ensamblado. +[assembly: AssemblyTitle("udsgui")] +[assembly: AssemblyDescription("Gui interface for uds actor")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Virtual Cable S.L.")] +[assembly: AssemblyProduct("UDS Actor")] +[assembly: AssemblyCopyright("Copyright © Virtual Cable S.L. 2011")] +[assembly: AssemblyTrademark("UDS")] +[assembly: AssemblyCulture("")] + +// Si establece ComVisible como false, los tipos de este ensamblado no estarán visibles +// para los componentes COM. Si necesita obtener acceso a un tipo de este ensamblado desde +// COM, establezca el atributo ComVisible como true en este tipo. +[assembly: ComVisible(false)] + +// El siguiente GUID sirve como identificador de typelib si este proyecto se expone a COM +[assembly: Guid("839e8c24-f711-4eb6-8ed3-9f94e3bcba6e")] + +// La información de versión de un ensamblado consta de los cuatro valores siguientes: +// +// Versión principal +// Versión secundaria +// Número de compilación +// Revisión +// +// Puede especificar todos los valores o establecer como predeterminados los números de versión de compilación y de revisión +// mediante el asterisco ('*'), como se muestra a continuación: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: NeutralResourcesLanguageAttribute("en")] diff --git a/udsService/udsgui/forms/Config.Designer.cs b/udsService/udsgui/forms/Config.Designer.cs new file mode 100644 index 000000000..593212164 --- /dev/null +++ b/udsService/udsgui/forms/Config.Designer.cs @@ -0,0 +1,115 @@ +namespace uds.gui.forms +{ + partial class Config + { + /// + /// Variable del diseñador requerida. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén utilizando. + /// + /// true si los recursos administrados se deben eliminar; false en caso contrario, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de Windows Forms + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido del método con el editor de código. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Config)); + this.label1 = new System.Windows.Forms.Label(); + this.brokerAddress = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.useSecureConnection = new System.Windows.Forms.ComboBox(); + this.testConnectionButton = new System.Windows.Forms.Button(); + this.acceptButton = new System.Windows.Forms.Button(); + this.cancelButton = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // + // brokerAddress + // + resources.ApplyResources(this.brokerAddress, "brokerAddress"); + this.brokerAddress.Name = "brokerAddress"; + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.Name = "label2"; + // + // useSecureConnection + // + resources.ApplyResources(this.useSecureConnection, "useSecureConnection"); + this.useSecureConnection.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.useSecureConnection.FormattingEnabled = true; + this.useSecureConnection.Items.AddRange(new object[] { + resources.GetString("useSecureConnection.Items"), + resources.GetString("useSecureConnection.Items1")}); + this.useSecureConnection.Name = "useSecureConnection"; + // + // testConnectionButton + // + resources.ApplyResources(this.testConnectionButton, "testConnectionButton"); + this.testConnectionButton.Name = "testConnectionButton"; + this.testConnectionButton.UseVisualStyleBackColor = true; + this.testConnectionButton.Click += new System.EventHandler(this.testConnectionButton_Click); + // + // acceptButton + // + resources.ApplyResources(this.acceptButton, "acceptButton"); + this.acceptButton.Name = "acceptButton"; + this.acceptButton.UseVisualStyleBackColor = true; + this.acceptButton.Click += new System.EventHandler(this.acceptButton_Click); + // + // cancelButton + // + resources.ApplyResources(this.cancelButton, "cancelButton"); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.UseVisualStyleBackColor = true; + this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); + // + // Config + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.cancelButton); + this.Controls.Add(this.acceptButton); + this.Controls.Add(this.testConnectionButton); + this.Controls.Add(this.useSecureConnection); + this.Controls.Add(this.label2); + this.Controls.Add(this.brokerAddress); + this.Controls.Add(this.label1); + this.Name = "Config"; + this.Load += new System.EventHandler(this.Config_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox brokerAddress; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.ComboBox useSecureConnection; + private System.Windows.Forms.Button testConnectionButton; + private System.Windows.Forms.Button acceptButton; + private System.Windows.Forms.Button cancelButton; + } +} \ No newline at end of file diff --git a/udsService/udsgui/forms/Config.cs b/udsService/udsgui/forms/Config.cs new file mode 100644 index 000000000..8bdb15c19 --- /dev/null +++ b/udsService/udsgui/forms/Config.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Resources; +using System.Text; +using System.Windows.Forms; + +namespace uds.gui.forms +{ + public partial class Config : Form + { + public Config() + { + InitializeComponent(); + } + + private void Config_Load(object sender, EventArgs e) + { + brokerAddress.Text = config.broker; + useSecureConnection.SelectedIndex = config.ssl ? 0 : 1; + if (Info.Computer.IsUserAdministrator() == false) + { + MessageBox.Show(Lang.AdminNeeded, Lang.Error, MessageBoxButtons.OK, MessageBoxIcon.Error); + Close(); + return; + } + + } + + private void cancelButton_Click(object sender, EventArgs e) + { + Close(); + } + + private void testConnectionButton_Click(object sender, EventArgs e) + { + rpc.Initialize(brokerAddress.Text, useSecureConnection.SelectedIndex == 0); + if (rpc.Manager.Test() == false) + { + MessageBox.Show(Lang.ConnectionError, Lang.ConnectionTest, MessageBoxButtons.OK, MessageBoxIcon.Error); + } + else + { + MessageBox.Show(Lang.ConnectionOK, Lang.ConnectionTest, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + } + } + + private void acceptButton_Click(object sender, EventArgs e) + { + config.broker = brokerAddress.Text; + config.ssl = useSecureConnection.SelectedIndex == 0; + config.SaveConfig(); + Close(); + } + } +} diff --git a/udsService/udsgui/forms/Config.de.resx b/udsService/udsgui/forms/Config.de.resx new file mode 100644 index 000000000..9ec922ad7 --- /dev/null +++ b/udsService/udsgui/forms/Config.de.resx @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + UDS Actor Configuration + + + Makler-Adresse + + + Abbrechen + + + Testverbindung + + + Akzeptieren && speichern + + + Ja + + + Nr. + + + Verwenden Sie sichere Conection? + + + Testverbindung + + + Akzeptieren && speichern + + + Abbrechen + + \ No newline at end of file diff --git a/udsService/udsgui/forms/Config.es.resx b/udsService/udsgui/forms/Config.es.resx new file mode 100644 index 000000000..27412f47a --- /dev/null +++ b/udsService/udsgui/forms/Config.es.resx @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Dirección del broker + + + Usar conexión segura? + + + Probar conexión + + + Aceptar && Guardar + + + Cancelar + + + Configuración del Actor UDS + + + Cancelar + + + Probar conexión + + + Aceptar && guardar + + + + + + No + + \ No newline at end of file diff --git a/udsService/udsgui/forms/Config.fr.resx b/udsService/udsgui/forms/Config.fr.resx new file mode 100644 index 000000000..7f1d2147b --- /dev/null +++ b/udsService/udsgui/forms/Config.fr.resx @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Courtier adresse + + + Utiliser une connexion sécurisée ? + + + Oui + + + Aucun + + + Tester la connexion + + + Accepter && enregistrer + + + Annuler + + + UDS Actor Configuration + + + Annuler + + + Tester la connexion + + + Accepter && sauver + + \ No newline at end of file diff --git a/udsService/udsgui/forms/Config.resx b/udsService/udsgui/forms/Config.resx new file mode 100644 index 000000000..0d06b7acc --- /dev/null +++ b/udsService/udsgui/forms/Config.resx @@ -0,0 +1,330 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Broker Address + + + + 333, 23 + + + 117, 23 + + + 231, 96 + + + Cancel + + + No + + + + 7 + + + 5 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Config + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Test connection + + + $this + + + $this + + + Cancel + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 117, 23 + + + 15, 97 + + + 4 + + + + CenterScreen + + + $this + + + 6 + + + 15, 67 + + + Test connection + + + 0 + + + 3 + + + testConnectionButton + + + 79, 13 + + + cancelButton + + + 138, 38 + + + Accept && Save + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 3 + + + 138, 12 + + + 4 + + + 120, 13 + + + 1 + + + 1 + + + 0 + + + 6 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 6, 13 + + + Accept && Save + + + Yes + + + $this + + + $this + + + 2 + + + brokerAddress + + + True + + + NoControl + + + $this + + + True + + + label2 + + + 210, 20 + + + $this + + + 12, 16 + + + UDS Actor Configuration + + + Use Secure Conection? + + + 12, 42 + + + useSecureConnection + + + 210, 21 + + + 363, 134 + + + label1 + + + System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + acceptButton + + + System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 5 + + + True + + \ No newline at end of file diff --git a/udsService/udsgui/gui.cs b/udsService/udsgui/gui.cs new file mode 100644 index 000000000..4c223c146 --- /dev/null +++ b/udsService/udsgui/gui.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace uds.gui +{ + public class gui + { + + public static void ShowConfig() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new forms.Config()); + } + + } +} diff --git a/udsService/udsgui/udsgui.csproj b/udsService/udsgui/udsgui.csproj new file mode 100644 index 000000000..d7048b93e --- /dev/null +++ b/udsService/udsgui/udsgui.csproj @@ -0,0 +1,114 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {278F54DB-771A-4EF2-BEF2-9447F988303F} + Library + Properties + uds.gui + udsgui + v3.5 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + prompt + true + true + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + false + prompt + true + true + + + + + + + + + + + + Form + + + Config.cs + + + + True + True + Lang.resx + + + + + + Config.cs + + + Config.cs + + + Config.cs + + + Config.cs + + + + + + ResXFileCodeGenerator + Lang.Designer.cs + + + + + {9861A89C-7007-4A42-8BEB-9914BCF5524C} + tools + + + + + \ No newline at end of file diff --git a/udsService/xmlrpc/CookComputing.XmlRpcV2.dll b/udsService/xmlrpc/CookComputing.XmlRpcV2.dll new file mode 100644 index 000000000..c5efd129f Binary files /dev/null and b/udsService/xmlrpc/CookComputing.XmlRpcV2.dll differ