From a2baf5c92e875d95d66d409f18a4e30eeb5625b8 Mon Sep 17 00:00:00 2001 From: Rans4ckeR Date: Tue, 30 Jan 2024 20:23:58 +0100 Subject: [PATCH] Add generic non-AVM UPnP device search --- .../Entities/GroupedInternetGatewayDevice.cs | 11 + .../Entities/InternetGatewayDevice.cs | 24 +- .../Infrastructure/ExceptionMessageBuilder.cs | 12 +- .../RS.Fritz.Manager.API.csproj | 1 + .../Services/Discovery/DeviceSearchService.cs | 320 ++++++++++++++---- .../Services/Discovery/Entities/AvmDevice.cs | 21 ++ .../Discovery/Entities/AvmDeviceListDevice.cs | 18 + .../Discovery/Entities/AvmIconListItem.cs | 11 + .../Discovery/Entities/AvmServiceListItem.cs | 11 + .../Discovery/Entities/AvmSpecVersion.cs | 8 + .../Discovery/Entities/AvmSystemVersion.cs | 12 + .../Discovery/Entities/AvmUPnPDescription.cs | 9 + .../Services/Discovery/Entities/Device.cs | 34 +- .../Entities/DeviceSearchResponse.cs | 21 ++ .../Discovery/Entities/IconListItem.cs | 10 +- .../Entities/InternetGatewayDeviceResponse.cs | 6 - .../Entities/ServerDeviceResponse.cs | 6 + .../Discovery/Entities/ServiceListItem.cs | 10 +- .../Services/Discovery/Entities/SoapDevice.cs | 21 ++ .../Discovery/Entities/SoapIconListItem.cs | 11 + .../Discovery/Entities/SoapServiceListItem.cs | 11 + .../Discovery/Entities/SoapSpecVersion.cs | 8 + .../Discovery/Entities/SoapUPnPDescription.cs | 9 + .../Discovery/Entities/SpecVersion.cs | 7 +- .../Discovery/Entities/SystemVersion.cs | 11 +- .../Discovery/Entities/UPnPDescription.cs | 8 +- .../Discovery/Entities/UsnDeviceResponse.cs | 5 + .../Discovery/IDeviceSearchService.cs | 4 +- .../Services/Discovery/UPnPConstants.cs | 32 ++ .../Services/Shared/NetworkService.cs | 26 +- .../AvmSpeedtest/IFritzAvmSpeedtestService.cs | 14 +- .../{UPnPFault1.cs => AvmUPnPFault.cs} | 4 +- .../DeviceConfig/IFritzDeviceConfigService.cs | 26 +- .../DeviceInfo/IFritzDeviceInfoService.cs | 26 +- .../Services/Hosts/IFritzHostsService.cs | 50 +-- .../IFritzLanConfigSecurityService.cs | 32 +- ...IFritzLanEthernetInterfaceConfigService.cs | 14 +- .../IFritzLanHostConfigManagementService.cs | 38 +-- .../IFritzLayer3ForwardingService.cs | 20 +- .../IFritzManagementServerService.cs | 62 ++-- .../TR-064/Services/Time/IFritzTimeService.cs | 14 +- .../Services/{UPnPFault2.cs => UPnPFault.cs} | 4 +- .../IFritzUserInterfaceService.cs | 56 +-- .../IFritzWanCommonInterfaceConfigService.cs | 44 +-- .../IFritzWanDslInterfaceConfigService.cs | 26 +- .../IFritzWanDslLinkConfigService.cs | 38 +-- .../IFritzWanEthernetLinkConfigService.cs | 8 +- .../IFritzWanIpConnectionService.cs | 50 +-- .../IFritzWanPppConnectionService.cs | 68 ++-- .../IFritzWlanConfiguration1Service.cs | 104 +++--- .../IFritzWlanConfiguration2Service.cs | 104 +++--- .../IFritzWlanConfiguration3Service.cs | 104 +++--- .../IFritzWlanConfiguration4Service.cs | 104 +++--- .../FritzServiceOperationHandler.cs | 2 +- .../Entities/DeviceLoginInfo.cs | 141 ++++++-- .../ObservableInternetGatewayDevice.cs | 64 +--- .../Entities/UserInterfaceCaptureInterface.cs | 2 +- .../Infrastructure/FritzServiceViewModel.cs | 44 +-- .../NullVisibilityValueConverter.cs | 14 + ...WanAccessTypeAwareFritzServiceViewModel.cs | 11 +- .../MainWindow/MainWindow.xaml | 17 +- .../MainWindow/MainWindowViewModel.cs | 118 +++---- .../RS.Fritz.Manager.UI.csproj | 1 + .../Resources/GeneralResourceDictionary.xaml | 1 + .../Resources/UPnPResourceDictionary.xaml | 88 +++-- .../Capture/CaptureControlCaptureViewModel.cs | 2 +- .../DeviceInfoSetProvisioningCodeViewModel.cs | 18 +- .../HostsGetGenericHostEntryViewModel.cs | 20 +- ...onfigSecuritySetConfigPasswordViewModel.cs | 18 +- ...rdingGetGenericForwardingEntryViewModel.cs | 20 +- ...onnectionRequestAuthenticationViewModel.cs | 24 +- ...verSetManagementServerPasswordViewModel.cs | 21 +- ...ntServerSetManagementServerUrlViewModel.cs | 18 +- ...verSetManagementServerUsernameViewModel.cs | 21 +- ...agementServerSetPeriodicInformViewModel.cs | 24 +- ...ManagementServerSetTr069EnableViewModel.cs | 18 +- ...etTr069FirmwareDownloadEnabledViewModel.cs | 18 +- ...mentServerSetUpgradeManagementViewModel.cs | 18 +- .../Time/TimeSetNtpServersViewModel.cs | 21 +- .../UserInterfaceDoManualUpdateViewModel.cs | 21 +- .../UserInterfaceSetConfigViewModel.cs | 18 +- ...nterfaceSetInternationalConfigViewModel.cs | 24 +- ...nterfaceConfigGetOnlineMonitorViewModel.cs | 17 +- ...nterfaceConfigSetWanAccessTypeViewModel.cs | 18 +- .../WanCommonInterfaceConfigViewModel.cs | 19 ++ ...tionGetGenericPortMappingEntryViewModel.cs | 27 +- .../WanDslInterfaceConfigViewModel.cs | 20 +- .../WlanConfigurationViewModel.cs | 2 +- RS.Fritz.Manager.sln.DotSettings | 7 + 89 files changed, 1398 insertions(+), 1247 deletions(-) create mode 100644 RS.Fritz.Manager.API/Entities/GroupedInternetGatewayDevice.cs create mode 100644 RS.Fritz.Manager.API/Services/Discovery/Entities/AvmDevice.cs create mode 100644 RS.Fritz.Manager.API/Services/Discovery/Entities/AvmDeviceListDevice.cs create mode 100644 RS.Fritz.Manager.API/Services/Discovery/Entities/AvmIconListItem.cs create mode 100644 RS.Fritz.Manager.API/Services/Discovery/Entities/AvmServiceListItem.cs create mode 100644 RS.Fritz.Manager.API/Services/Discovery/Entities/AvmSpecVersion.cs create mode 100644 RS.Fritz.Manager.API/Services/Discovery/Entities/AvmSystemVersion.cs create mode 100644 RS.Fritz.Manager.API/Services/Discovery/Entities/AvmUPnPDescription.cs create mode 100644 RS.Fritz.Manager.API/Services/Discovery/Entities/DeviceSearchResponse.cs delete mode 100644 RS.Fritz.Manager.API/Services/Discovery/Entities/InternetGatewayDeviceResponse.cs create mode 100644 RS.Fritz.Manager.API/Services/Discovery/Entities/ServerDeviceResponse.cs create mode 100644 RS.Fritz.Manager.API/Services/Discovery/Entities/SoapDevice.cs create mode 100644 RS.Fritz.Manager.API/Services/Discovery/Entities/SoapIconListItem.cs create mode 100644 RS.Fritz.Manager.API/Services/Discovery/Entities/SoapServiceListItem.cs create mode 100644 RS.Fritz.Manager.API/Services/Discovery/Entities/SoapSpecVersion.cs create mode 100644 RS.Fritz.Manager.API/Services/Discovery/Entities/SoapUPnPDescription.cs create mode 100644 RS.Fritz.Manager.API/Services/Discovery/Entities/UsnDeviceResponse.cs create mode 100644 RS.Fritz.Manager.API/Services/Discovery/UPnPConstants.cs rename RS.Fritz.Manager.API/Services/TR-064/Services/{UPnPFault1.cs => AvmUPnPFault.cs} (62%) rename RS.Fritz.Manager.API/Services/TR-064/Services/{UPnPFault2.cs => UPnPFault.cs} (64%) create mode 100644 RS.Fritz.Manager.UI/Infrastructure/NullVisibilityValueConverter.cs diff --git a/RS.Fritz.Manager.API/Entities/GroupedInternetGatewayDevice.cs b/RS.Fritz.Manager.API/Entities/GroupedInternetGatewayDevice.cs new file mode 100644 index 00000000..02f4bb00 --- /dev/null +++ b/RS.Fritz.Manager.API/Entities/GroupedInternetGatewayDevice.cs @@ -0,0 +1,11 @@ +namespace RS.Fritz.Manager.API; + +using System.Collections.Frozen; +using System.Net; + +public sealed record GroupedInternetGatewayDevice( + IEnumerable? Locations, + string? Server, + IEnumerable Devices, + Uri? PreferredLocation, + FrozenSet LocalIpAddresses); \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Entities/InternetGatewayDevice.cs b/RS.Fritz.Manager.API/Entities/InternetGatewayDevice.cs index 99cd6486..18b56b4b 100644 --- a/RS.Fritz.Manager.API/Entities/InternetGatewayDevice.cs +++ b/RS.Fritz.Manager.API/Entities/InternetGatewayDevice.cs @@ -1,8 +1,28 @@ namespace RS.Fritz.Manager.API; +using System.Collections.Frozen; using System.Net; -public sealed record InternetGatewayDevice(IFritzServiceOperationHandler FritzServiceOperationHandler, IUsersService UsersService, IEnumerable Locations, string Server, string CacheControl, string? Ext, string SearchTarget, string UniqueServiceName, UPnPDescription UPnPDescription, Uri PreferredLocation, IReadOnlyCollection LocalIpAddresses) +public sealed record InternetGatewayDevice( + IFritzServiceOperationHandler FritzServiceOperationHandler, + IUsersService UsersService, + string? CacheControl, + string? Date, + string? Ext, + IEnumerable? Locations, + string? Server, + string? SearchTarget, + string? UniqueServiceName, + string? Options, + string? Nls, + int? BootId, + int? ConfigId, + ushort? SearchPort, + IEnumerable? SecureLocations, + UPnPDescription? UPnPDescription, + Uri? PreferredLocation, + FrozenSet LocalIpAddresses, + ushort? Version) { private IReadOnlyCollection? services; @@ -13,7 +33,7 @@ public sealed record InternetGatewayDevice(IFritzServiceOperationHandler FritzSe public NetworkCredential? NetworkCredential { get; set; } public IEnumerable Services - => services ??= UPnPDescription.Device.GetServices().ToArray(); + => services ??= UPnPDescription?.Device?.GetServices().ToArray() ?? []; public async ValueTask InitializeAsync() { diff --git a/RS.Fritz.Manager.API/Infrastructure/ExceptionMessageBuilder.cs b/RS.Fritz.Manager.API/Infrastructure/ExceptionMessageBuilder.cs index d17a317e..081bb054 100644 --- a/RS.Fritz.Manager.API/Infrastructure/ExceptionMessageBuilder.cs +++ b/RS.Fritz.Manager.API/Infrastructure/ExceptionMessageBuilder.cs @@ -42,15 +42,15 @@ private static void GetExceptionDetails(this StringBuilder sb, Exception ex) .GetFaultCode(faultException.Code); #pragma warning disable IDE0045 // Convert to conditional expression - if (ex is FaultException upnpFaultFault1Exception) + if (ex is FaultException upnpFaultFaultException) { - _ = sb.AppendLine(FormattableString.Invariant($"{nameof(UPnPFault1)}.{nameof(UPnPFault1.ErrorCode)}: {upnpFaultFault1Exception.Detail.ErrorCode}")) - .AppendLine(FormattableString.Invariant($"{nameof(UPnPFault1)}.{nameof(UPnPFault1.ErrorDescription)}: {upnpFaultFault1Exception.Detail.ErrorDescription}")); + _ = sb.AppendLine(FormattableString.Invariant($"{nameof(UPnPFault)}.{nameof(UPnPFault.ErrorCode)}: {upnpFaultFaultException.Detail.ErrorCode}")) + .AppendLine(FormattableString.Invariant($"{nameof(UPnPFault)}.{nameof(UPnPFault.ErrorDescription)}: {upnpFaultFaultException.Detail.ErrorDescription}")); } - else if (ex is FaultException upnpFaultFault2Exception) + else if (ex is FaultException avmUpnpFaultFaultException) { - _ = sb.AppendLine(FormattableString.Invariant($"{nameof(UPnPFault2)}.{nameof(UPnPFault2.ErrorCode)}: {upnpFaultFault2Exception.Detail.ErrorCode}")) - .AppendLine(FormattableString.Invariant($"{nameof(UPnPFault2)}.{nameof(UPnPFault2.ErrorDescription)}: {upnpFaultFault2Exception.Detail.ErrorDescription}")); + _ = sb.AppendLine(FormattableString.Invariant($"{nameof(AvmUPnPFault)}.{nameof(AvmUPnPFault.ErrorCode)}: {avmUpnpFaultFaultException.Detail.ErrorCode}")) + .AppendLine(FormattableString.Invariant($"{nameof(AvmUPnPFault)}.{nameof(AvmUPnPFault.ErrorDescription)}: {avmUpnpFaultFaultException.Detail.ErrorDescription}")); } else { diff --git a/RS.Fritz.Manager.API/RS.Fritz.Manager.API.csproj b/RS.Fritz.Manager.API/RS.Fritz.Manager.API.csproj index 8e5d9402..2bbe8907 100644 --- a/RS.Fritz.Manager.API/RS.Fritz.Manager.API.csproj +++ b/RS.Fritz.Manager.API/RS.Fritz.Manager.API.csproj @@ -34,6 +34,7 @@ README.md true AnyCPU + true diff --git a/RS.Fritz.Manager.API/Services/Discovery/DeviceSearchService.cs b/RS.Fritz.Manager.API/Services/Discovery/DeviceSearchService.cs index 65956f39..8c3eed57 100644 --- a/RS.Fritz.Manager.API/Services/Discovery/DeviceSearchService.cs +++ b/RS.Fritz.Manager.API/Services/Discovery/DeviceSearchService.cs @@ -1,6 +1,8 @@ namespace RS.Fritz.Manager.API; using System.Buffers; +using System.Collections.Frozen; +using System.Globalization; using System.Net; using System.Net.Sockets; using System.Runtime.Serialization; @@ -10,52 +12,79 @@ internal sealed class DeviceSearchService(IHttpClientFactory httpClientFactory, IFritzServiceOperationHandler fritzServiceOperationHandler, IUsersService usersService, INetworkService networkService) : IDeviceSearchService { - private const string InternetGatewayDeviceDeviceType = "urn:dslforum-org:device:InternetGatewayDevice:1"; - private const int UPnPMultiCastPort = 1900; - private const int ReceiveTimeoutInSeconds = 2; - private const int DefaultSendCount = 1; - - public async ValueTask> GetDevicesAsync(string? deviceType = null, int? sendCount = null, int? timeout = null, CancellationToken cancellationToken = default) + public async ValueTask> GetInternetGatewayDevicesAsync(int sendCount = 1, int timeout = 2000, CancellationToken cancellationToken = default) { - deviceType ??= InternetGatewayDeviceDeviceType; - timeout ??= ReceiveTimeoutInSeconds * 1000; - sendCount ??= DefaultSendCount; - - IEnumerable<(IPAddress LocalIpAddress, IEnumerable Responses)> rawDeviceResponses = await GetRawDeviceResponses(deviceType, sendCount.Value, timeout.Value, cancellationToken).ConfigureAwait(false); - IEnumerable<(IPAddress LocalIpAddress, IEnumerable> Responses)> formattedDeviceResponses = - rawDeviceResponses.Select(q => (q.LocalIpAddress, GetFormattedDeviceResponses(q.Responses))); - IEnumerable> groupedInternetGatewayDeviceResponses = - GetGroupedInternetGatewayDeviceResponses(formattedDeviceResponses); + Task Responses)>>[] tasks = + [ + GetRawDeviceResponses(UPnPConstants.InternetGatewayDeviceV2DeviceType, sendCount, timeout, cancellationToken), + GetRawDeviceResponses(UPnPConstants.InternetGatewayDeviceV1DeviceType, sendCount, timeout, cancellationToken), + GetRawDeviceResponses(UPnPConstants.InternetGatewayDeviceV1AvmDeviceType, sendCount, timeout, cancellationToken) + ]; + IEnumerable<(IPAddress LocalIpAddress, FrozenSet<(IPAddress IPAddress, string Response)> Responses)>[] responses = await TaskExtensions.WhenAllSafe(tasks); + IEnumerable serverDeviceResponses = GetServerDeviceResponses(responses.SelectMany(q => q)); - return await TaskExtensions.WhenAllSafe(groupedInternetGatewayDeviceResponses.Select(q => GetInternetGatewayDeviceAsync(q, cancellationToken))).ConfigureAwait(false); + return await TaskExtensions.WhenAllSafe(serverDeviceResponses.Select(q => ParseInternetGatewayDeviceAsync(q, cancellationToken))).ConfigureAwait(false); } - private static IEnumerable> GetGroupedInternetGatewayDeviceResponses( - IEnumerable<(IPAddress LocalIpAddress, IEnumerable> Responses)> formattedDeviceResponses) + public async ValueTask> GetDevicesAsync(string deviceType = UPnPConstants.RootDeviceDeviceType, int sendCount = 1, int timeout = 2000, CancellationToken cancellationToken = default) { - return formattedDeviceResponses - .SelectMany(q => q.Responses.Select(r => new InternetGatewayDeviceResponse(new(r["LOCATION"]), r["SERVER"], r["CACHE-CONTROL"], r["EXT"], r["ST"], r["USN"], q.LocalIpAddress))) - .GroupBy(q => q.Usn); + IEnumerable<(IPAddress LocalIpAddress, FrozenSet<(IPAddress IPAddress, string Response)> Responses)> rawDeviceResponses = await GetRawDeviceResponses(deviceType, sendCount, timeout, cancellationToken).ConfigureAwait(false); + + return GetServerDeviceResponses(rawDeviceResponses); } - private static IEnumerable> GetFormattedDeviceResponses(IEnumerable responses) + private static IEnumerable GetServerDeviceResponses(IEnumerable<(IPAddress LocalIpAddress, FrozenSet<(IPAddress IPAddress, string Response)> Responses)> rawDeviceResponses) { - return responses.Select(q => q.Split(Environment.NewLine)).Select(q => q.Where(r => r.Contains(':', StringComparison.OrdinalIgnoreCase)).ToDictionary( + IEnumerable<(IPAddress LocalIpAddress, IEnumerable<(IPAddress IPAddress, FrozenDictionary Values)> Responses)> formattedDeviceResponses = + rawDeviceResponses.Select(q => (q.LocalIpAddress, GetFormattedDeviceResponses(q.Responses))); + IEnumerable deviceSearchResponses = formattedDeviceResponses.SelectMany(q => q.Responses.Select(r => new DeviceSearchResponse( + r.Values.GetValueOrDefault("CACHE-CONTROL"), + r.Values.GetValueOrDefault("DATE"), + r.Values.GetValueOrDefault("EXT"), + r.Values.TryGetValue("LOCATION", out string? location) ? new(location) : null, + r.Values.GetValueOrDefault("SERVER"), + r.Values.GetValueOrDefault("ST"), + r.Values.GetValueOrDefault("USN"), + r.Values.GetValueOrDefault("OPT"), + r.Values.GetValueOrDefault("01-NLS"), + r.Values.TryGetValue("BOOTID.UPNP.ORG", out string? bootId) ? int.Parse(bootId, CultureInfo.InvariantCulture) : null, + r.Values.TryGetValue("CONFIGID.UPNP.ORG", out string? configId) ? int.Parse(configId, CultureInfo.InvariantCulture) : null, + r.Values.TryGetValue("SEARCHPORT.UPNP.ORG", out string? searchPort) ? ushort.Parse(searchPort, CultureInfo.InvariantCulture) : null, + r.Values.TryGetValue("SECURELOCATION.UPNP.ORG", out string? secureLocation) ? new(secureLocation) : null, + r.IPAddress, + q.LocalIpAddress))).Distinct(); + IEnumerable> usnGrouping = deviceSearchResponses.GroupBy(q => q.Usn); + var usnDeviceResponses = usnGrouping.Select(q => new UsnDeviceResponse { Usn = q.Key, Server = q.Select(r => r.Server).Distinct().Single(), DeviceSearchResponses = q.ToFrozenSet() }).ToFrozenSet(); + var serverDeviceResponses = new List(); + + foreach (UsnDeviceResponse usnDeviceResponse in usnDeviceResponses) + { + if (serverDeviceResponses.Any(q => q.IpAddresses.OrderBy(r => r.GetHashCode()).SequenceEqual(usnDeviceResponse.DeviceSearchResponses.Select(r => r.IpAddress).Distinct().OrderBy(r => r.GetHashCode())))) + continue; + + var serverDeviceUsnDeviceResponses = usnDeviceResponses.Where(q => q.DeviceSearchResponses.Any(r => usnDeviceResponse.DeviceSearchResponses.Select(s => s.IpAddress).Contains(r.IpAddress))).ToFrozenSet(); + + serverDeviceResponses.Add(new(usnDeviceResponse.Server, serverDeviceUsnDeviceResponses.SelectMany(q => q.DeviceSearchResponses.Select(r => r.IpAddress)).Distinct().ToFrozenSet(), serverDeviceUsnDeviceResponses)); + } + + return serverDeviceResponses; + } + + private static IEnumerable<(IPAddress IPAddress, FrozenDictionary Values)> GetFormattedDeviceResponses(IEnumerable<(IPAddress IPAddress, string Response)> responses) + => responses.Select(q => (q.IPAddress, q.Response.Split("\r\n").Where(r => r.Contains(':', StringComparison.OrdinalIgnoreCase)).ToFrozenDictionary( s => s[..s.IndexOf(':', StringComparison.OrdinalIgnoreCase)], s => { string value = s[s.IndexOf(':', StringComparison.OrdinalIgnoreCase)..]; - if (value.EndsWith(':')) - return value.Replace(":", null, StringComparison.OrdinalIgnoreCase); - - return value.Replace(": ", null, StringComparison.OrdinalIgnoreCase); + return value.Replace(value.EndsWith(':') ? ":" : ": ", null, StringComparison.OrdinalIgnoreCase); }, - StringComparer.OrdinalIgnoreCase)); - } + StringComparer.OrdinalIgnoreCase))); - private static async ValueTask ReceiveAsync(Socket socket, List responses, int receiveTimeout, CancellationToken cancellationToken) + private static async ValueTask> ReceiveAsync(Socket socket, int receiveTimeout, CancellationToken cancellationToken) { + var responses = new List<(IPAddress IPAddress, string Response)>(); + var receivedAddress = new SocketAddress(socket.AddressFamily); using IMemoryOwner memoryOwner = MemoryPool.Shared.Rent(4096); using var timeoutCancellationTokenSource = new CancellationTokenSource(receiveTimeout); using var linkedCancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(timeoutCancellationTokenSource.Token, cancellationToken); @@ -66,40 +95,120 @@ private static async ValueTask ReceiveAsync(Socket socket, List response try { - int bytesReceived = await socket.ReceiveAsync(buffer, SocketFlags.None, linkedCancellationTokenSource.Token).ConfigureAwait(false); + int bytesReceived = await socket.ReceiveFromAsync(buffer, SocketFlags.None, receivedAddress, linkedCancellationTokenSource.Token).ConfigureAwait(false); + var endPoint = (IPEndPoint)new IPEndPoint(0L, 0).Create(receivedAddress); - responses.Add(Encoding.UTF8.GetString(buffer.Span[..bytesReceived])); + responses.Add((endPoint.Address, Encoding.UTF8.GetString(buffer.Span[..bytesReceived]))); } - catch (OperationCanceledException) + catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested) { } } - } - private Uri GetPreferredLocation(IReadOnlyCollection locations) - { - return locations.FirstOrDefault(q => q.HostNameType is UriHostNameType.IPv6 && !networkService.IsPrivateIpAddress(IPAddress.Parse(q.IdnHost))) - ?? locations.FirstOrDefault(q => q.HostNameType is UriHostNameType.IPv6 && networkService.IsPrivateIpAddress(IPAddress.Parse(q.IdnHost))) - ?? locations.First(q => q.HostNameType is UriHostNameType.IPv4); + return responses.ToFrozenSet(); } - private Uri ParseLocation((IPAddress LocalIpAddress, Uri Location) location) + private static SystemVersion GetBaseSystemVersion(AvmSystemVersion systemVersion) + => new(systemVersion.Hw, systemVersion.Major, systemVersion.Minor, systemVersion.Patch, systemVersion.BuildNumber, systemVersion.Display); + + private static SpecVersion GetBaseSpecVersion(AvmSpecVersion specVersion) + => new(specVersion.Major, specVersion.Minor); + + private static ServiceListItem GetBaseServiceListItem(AvmServiceListItem serviceListItem) + => new(serviceListItem.ServiceType, serviceListItem.ServiceId, serviceListItem.ControlUrl, serviceListItem.EventSubUrl, serviceListItem.ScpdUrl); + + private static ServiceListItem GetBaseServiceListItem(SoapServiceListItem serviceListItem) + => new(serviceListItem.ServiceType, serviceListItem.ServiceId, serviceListItem.ControlUrl, serviceListItem.EventSubUrl, serviceListItem.ScpdUrl); + + private static IconListItem GetBaseIconListItem(AvmIconListItem iconListItem) + => new(iconListItem.Mimetype, iconListItem.Width, iconListItem.Height, iconListItem.Depth, iconListItem.Url); + + private static IconListItem GetBaseIconListItem(SoapIconListItem iconListItem) + => new(iconListItem.Mimetype, iconListItem.Width, iconListItem.Height, iconListItem.Depth, iconListItem.Url); + + private static Device GetBaseDevice(SoapDevice device) + => new( + device.DeviceType, + device.FriendlyName, + device.Manufacturer, + device.ManufacturerUrl, + device.ModelDescription, + device.ModelName, + device.ModelNumber, + device.ModelUrl, + device.UniqueDeviceName, + device.UniversalProductCode, + device.SerialNumber, + null, + device.IconList?.Select(GetBaseIconListItem).ToList(), + device.ServiceList?.Select(GetBaseServiceListItem).ToList(), + device.DeviceList?.Select(GetBaseDevice).ToList(), + device.PresentationUrl); + + private static Device GetBaseDevice(AvmDevice device) + => new( + device.DeviceType, + device.FriendlyName, + device.Manufacturer, + device.ManufacturerUrl, + device.ModelDescription, + device.ModelName, + device.ModelNumber, + device.ModelUrl, + device.UniqueDeviceName, + null, + device.SerialNumber, + device.OriginUniqueDeviceName, + device.IconList?.Select(GetBaseIconListItem).ToList(), + device.ServiceList?.Select(GetBaseServiceListItem).ToList(), + device.DeviceList?.Select(GetBaseDevice).ToList(), + device.PresentationUrl); + + private static Device GetBaseDevice(AvmDeviceListDevice device) + => new( + device.DeviceType, + device.FriendlyName, + device.Manufacturer, + device.ManufacturerUrl, + device.ModelDescription, + device.ModelName, + device.ModelNumber, + device.ModelUrl, + device.UniqueDeviceName, + device.UniversalProductCode, + null, + null, + null, + device.ServiceList?.Select(GetBaseServiceListItem).ToList(), + device.DeviceList?.Select(GetBaseDevice).ToList(), + null); + + private Uri? GetPreferredLocation(IReadOnlyCollection secureLocations, IReadOnlyCollection locations) + => secureLocations.FirstOrDefault(q => Socket.OSSupportsIPv6 && q?.HostNameType is UriHostNameType.IPv6 && !networkService.IsPrivateIpAddress(IPAddress.Parse(q.IdnHost))) + ?? secureLocations.FirstOrDefault(q => Socket.OSSupportsIPv6 && q?.HostNameType is UriHostNameType.IPv6 && networkService.IsPrivateIpAddress(IPAddress.Parse(q.IdnHost))) + ?? secureLocations.FirstOrDefault(q => Socket.OSSupportsIPv4 && q?.HostNameType is UriHostNameType.IPv4) + ?? locations.FirstOrDefault(q => Socket.OSSupportsIPv6 && q?.HostNameType is UriHostNameType.IPv6 && !networkService.IsPrivateIpAddress(IPAddress.Parse(q.IdnHost))) + ?? locations.FirstOrDefault(q => Socket.OSSupportsIPv6 && q?.HostNameType is UriHostNameType.IPv6 && networkService.IsPrivateIpAddress(IPAddress.Parse(q.IdnHost))) + ?? locations.FirstOrDefault(q => Socket.OSSupportsIPv4 && q?.HostNameType is UriHostNameType.IPv4); + + private Uri? ParseLocation((IPAddress LocalIpAddress, Uri? Location) location) { - if (location.Location.HostNameType is not UriHostNameType.IPv6 || !IPAddress.TryParse(location.Location.IdnHost, out IPAddress? ipAddress) || !networkService.IsPrivateIpAddress(ipAddress)) + if (location.Location?.HostNameType is not UriHostNameType.IPv6 || !IPAddress.TryParse(location.Location.IdnHost, out IPAddress? ipAddress) || !networkService.IsPrivateIpAddress(ipAddress)) return location.Location; return networkService.FormatUri(new(IPAddress.Parse(FormattableString.Invariant($"{location.Location.IdnHost}%{location.LocalIpAddress.ScopeId}")), location.Location.Port), location.Location.Scheme, location.Location.PathAndQuery); } - private async Task<(IPAddress IpAddress, IEnumerable Responses)> SearchDevicesAsync(IPAddress unicastAddress, IPAddress multicastAddress, string deviceType, int sendCount, int receiveTimeout, CancellationToken cancellationToken) + private async Task<(IPAddress IpAddress, FrozenSet<(IPAddress IPAddress, string Response)> Responses)> SearchDevicesAsync(IPAddress localAddress, IPAddress multicastAddress, string deviceType, int sendCount, int receiveTimeout, CancellationToken cancellationToken) { - var responses = new List(); - using var socket = new Socket(SocketType.Dgram, ProtocolType.Udp); + FrozenSet<(IPAddress IPAddress, string Response)> responses = FrozenSet<(IPAddress IPAddress, string Response)>.Empty; + var localEndPoint = new IPEndPoint(localAddress, 0); + using var socket = new Socket(localAddress.AddressFamily, SocketType.Dgram, ProtocolType.Udp); - socket.Bind(new IPEndPoint(unicastAddress, 0)); + socket.Bind(localEndPoint); - var multiCastIpEndPoint = new IPEndPoint(multicastAddress, UPnPMultiCastPort); - string request = FormattableString.Invariant($"M-SEARCH * HTTP/1.1\r\nHOST: {networkService.FormatUri(multiCastIpEndPoint).Authority}\r\nST: {deviceType}\r\nMAN: \"ssdp:discover\"\r\nMX: {ReceiveTimeoutInSeconds}\r\n\r\n"); + var multiCastIpEndPoint = new IPEndPoint(multicastAddress, UPnPConstants.MultiCastPort); + string request = FormattableString.Invariant($"M-SEARCH * HTTP/1.1\r\nHOST: {networkService.FormatUri(multiCastIpEndPoint).Authority}\r\nMAN: \"ssdp:discover\"\r\nMX: {receiveTimeout}\r\nST: {deviceType}\r\nCPFN.UPNP.ORG: RS.Fritz.Manager\r\n\r\n"); const int charSize = sizeof(char); int bufferSize = request.Length * charSize; using IMemoryOwner memoryOwner = MemoryPool.Shared.Rent(bufferSize); @@ -108,53 +217,116 @@ private Uri ParseLocation((IPAddress LocalIpAddress, Uri Location) location) buffer = buffer[..bytes]; - for (int i = 0; i < sendCount; i++) + SocketAddress multiCastSocketAddress = multiCastIpEndPoint.Serialize(); + + try { - _ = await socket.SendToAsync(buffer, SocketFlags.None, multiCastIpEndPoint, cancellationToken).ConfigureAwait(false); - } + for (int i = 0; i < sendCount; i++) + { + _ = await socket.SendToAsync(buffer, SocketFlags.None, multiCastSocketAddress, cancellationToken).ConfigureAwait(false); + } - await ReceiveAsync(socket, responses, receiveTimeout, cancellationToken).ConfigureAwait(false); + responses = await ReceiveAsync(socket, receiveTimeout, cancellationToken).ConfigureAwait(false); + } + catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested) + { + } - return new(unicastAddress, responses); + return new(localAddress, responses); } - private async ValueTask Responses)>> GetRawDeviceResponses(string deviceType, int sendCount, int timeout, CancellationToken cancellationToken) + private async Task Responses)>> GetRawDeviceResponses(string deviceType, int sendCount, int timeout, CancellationToken cancellationToken) { IEnumerable unicastAddresses = networkService.GetUnicastAddresses(); IEnumerable multicastAddresses = networkService.GetMulticastAddresses(); - (IPAddress LocalIpAddress, IEnumerable Responses)[] localAddressesDeviceResponses = await TaskExtensions.WhenAllSafe(multicastAddresses.SelectMany(q => unicastAddresses.Where(r => r.AddressFamily == q.AddressFamily).Select(r => SearchDevicesAsync(r, q, deviceType, sendCount, timeout, cancellationToken)))).ConfigureAwait(false); + (IPAddress LocalIpAddress, FrozenSet<(IPAddress IPAddress, string Response)> Responses)[] localAddressesDeviceResponses = await TaskExtensions.WhenAllSafe(multicastAddresses.SelectMany(q => unicastAddresses.Where(r => r.AddressFamily == q.AddressFamily).Select(r => SearchDevicesAsync(r, q, deviceType, sendCount, timeout, cancellationToken)))).ConfigureAwait(false); - return localAddressesDeviceResponses.Where(q => q.Responses.Any(r => r.Length is not 0)).Select(q => (q.LocalIpAddress, q.Responses)).Distinct(); + return localAddressesDeviceResponses.Where(q => q.Responses.Any(r => r.Response.Length is not 0)).Select(q => (q.LocalIpAddress, q.Responses)).Distinct(); } - private async ValueTask GetUPnPDescription(Uri uri, CancellationToken cancellationToken) + private async ValueTask GetUPnPDescription(Uri uri, string usn, CancellationToken cancellationToken) { - Stream uPnPDescription = await httpClientFactory.CreateClient(Constants.DefaultHttpClientName).GetStreamAsync(uri, cancellationToken).ConfigureAwait(false); + Stream description = await httpClientFactory.CreateClient(Constants.DefaultHttpClientName).GetStreamAsync(uri, cancellationToken).ConfigureAwait(false); - await using (uPnPDescription.ConfigureAwait(false)) + await using (description.ConfigureAwait(false)) { - using var xmlTextReader = new XmlTextReader(uPnPDescription); + using var xmlTextReader = new XmlTextReader(description); + + if (usn.Contains(UPnPConstants.InternetGatewayDeviceV1AvmDeviceType, StringComparison.OrdinalIgnoreCase)) + { + var uPnPDescription = (AvmUPnPDescription)new DataContractSerializer(typeof(AvmUPnPDescription)).ReadObject(xmlTextReader)!; - return (UPnPDescription)new DataContractSerializer(typeof(UPnPDescription)).ReadObject(xmlTextReader)!; + return new(GetBaseSpecVersion(uPnPDescription.SpecVersion), null, GetBaseDevice(uPnPDescription.Device), GetBaseSystemVersion(uPnPDescription.SystemVersion)); + } + else + { + var uPnPDescription = (SoapUPnPDescription)new DataContractSerializer(typeof(SoapUPnPDescription)).ReadObject(xmlTextReader)!; + + return new(null, uPnPDescription.UrlBase, GetBaseDevice(uPnPDescription.Device), null); + } } } - private async Task GetInternetGatewayDeviceAsync(IGrouping internetGatewayDeviceResponses, CancellationToken cancellationToken) + private async Task ParseInternetGatewayDeviceAsync(ServerDeviceResponse serverDeviceResponse, CancellationToken cancellationToken) { - Uri[] locations = internetGatewayDeviceResponses.Select(q => (q.LocalIpAddress, q.Location)).Distinct().Select(ParseLocation).ToArray(); - Uri preferredLocation = GetPreferredLocation(locations); + var internetGatewayDevices = new List(); + + foreach (UsnDeviceResponse usnDeviceResponse in serverDeviceResponse.UsnDeviceResponses) + { + var locations = usnDeviceResponse.DeviceSearchResponses.Where(r => r.Location is not null).Select(r => (r.IpAddress, r.Location)).Distinct().Select(ParseLocation).ToFrozenSet(); + var secureLocations = usnDeviceResponse.DeviceSearchResponses.Where(r => r.SecureLocation is not null).Select(r => (r.IpAddress, r.SecureLocation)).Distinct().Select(ParseLocation).ToFrozenSet(); + Uri? preferredLocation = GetPreferredLocation(secureLocations, locations); + UPnPDescription? description = null; + + if (preferredLocation is not null) + { + try + { + description = await GetUPnPDescription(preferredLocation, usnDeviceResponse.Usn!, cancellationToken).ConfigureAwait(false); + } + catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested) + { + if (preferredLocation.HostNameType is UriHostNameType.IPv6 && Socket.OSSupportsIPv4 && locations.Any(q => q?.HostNameType is UriHostNameType.IPv4)) + { + try + { + preferredLocation = locations.First(q => q?.HostNameType is UriHostNameType.IPv4); + description = await GetUPnPDescription(preferredLocation!, serverDeviceResponse.UsnDeviceResponses.Select(q => q.Usn).Distinct().Single()!, cancellationToken).ConfigureAwait(false); + } + catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested) + { + } + } + } + } + + internetGatewayDevices.Add(new( + fritzServiceOperationHandler, + usersService, + usnDeviceResponse.DeviceSearchResponses.Select(r => r.CacheControl).Distinct().SingleOrDefault(), + usnDeviceResponse.DeviceSearchResponses.Select(r => r.Date).Distinct().SingleOrDefault(), + usnDeviceResponse.DeviceSearchResponses.Select(r => r.Ext).Distinct().SingleOrDefault(), + usnDeviceResponse.DeviceSearchResponses.Select(r => r.Location), + usnDeviceResponse.DeviceSearchResponses.Select(r => r.Server).Distinct().SingleOrDefault(), + usnDeviceResponse.DeviceSearchResponses.Select(r => r.SearchTarget).Distinct().SingleOrDefault(), + usnDeviceResponse.DeviceSearchResponses.Select(r => r.Usn).Distinct().SingleOrDefault(), + usnDeviceResponse.DeviceSearchResponses.Select(r => r.Opt).Distinct().SingleOrDefault(), + usnDeviceResponse.DeviceSearchResponses.Select(r => r.Nls).Distinct().SingleOrDefault(), + usnDeviceResponse.DeviceSearchResponses.Select(r => r.BootId).Distinct().SingleOrDefault(), + usnDeviceResponse.DeviceSearchResponses.Select(r => r.ConfigId).Distinct().SingleOrDefault(), + usnDeviceResponse.DeviceSearchResponses.Select(r => r.SearchPort).Distinct().SingleOrDefault(), + usnDeviceResponse.DeviceSearchResponses.Select(r => r.SecureLocation), + description, + preferredLocation, + usnDeviceResponse.DeviceSearchResponses.Select(r => r.LocalIpAddress).ToFrozenSet(), + ushort.TryParse(usnDeviceResponse.DeviceSearchResponses.Select(r => r.Usn).Distinct().SingleOrDefault()?[..1], out ushort version) ? version : null)); + } return new( - fritzServiceOperationHandler, - usersService, - locations, - internetGatewayDeviceResponses.Select(r => r.Server).Distinct().Single(), - internetGatewayDeviceResponses.Select(r => r.CacheControl).Distinct().Single(), - internetGatewayDeviceResponses.Select(r => r.Ext).Distinct().Single(), - internetGatewayDeviceResponses.Select(r => r.SearchTarget).Distinct().Single(), - internetGatewayDeviceResponses.Key, - await GetUPnPDescription(preferredLocation, cancellationToken).ConfigureAwait(false), - preferredLocation, - internetGatewayDeviceResponses.Select(r => r.LocalIpAddress).Distinct().ToList().AsReadOnly()); + internetGatewayDevices.SelectMany(q => q.Locations ?? []), + serverDeviceResponse.Server, + internetGatewayDevices, + internetGatewayDevices.MaxBy(q => q.Version)?.PreferredLocation, + serverDeviceResponse.IpAddresses); } } \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/Discovery/Entities/AvmDevice.cs b/RS.Fritz.Manager.API/Services/Discovery/Entities/AvmDevice.cs new file mode 100644 index 00000000..2761fb10 --- /dev/null +++ b/RS.Fritz.Manager.API/Services/Discovery/Entities/AvmDevice.cs @@ -0,0 +1,21 @@ +namespace RS.Fritz.Manager.API; + +using System.Runtime.Serialization; + +[DataContract(Name = UPnPConstants.Device, Namespace = UPnPConstants.Device10AvmNamespace)] +internal readonly record struct AvmDevice( + [property: DataMember(Name = "deviceType", Order = 0)] string DeviceType, + [property: DataMember(Name = "friendlyName", Order = 1)] string FriendlyName, + [property: DataMember(Name = "manufacturer", Order = 2)] string Manufacturer, + [property: DataMember(Name = "manufacturerURL", Order = 3)] string ManufacturerUrl, + [property: DataMember(Name = "modelDescription", Order = 4)] string ModelDescription, + [property: DataMember(Name = "modelName", Order = 5)] string ModelName, + [property: DataMember(Name = "modelNumber", Order = 6)] string ModelNumber, + [property: DataMember(Name = "modelURL", Order = 7)] string ModelUrl, + [property: DataMember(Name = "UDN", Order = 8)] string UniqueDeviceName, + [property: DataMember(Name = "serialNumber", Order = 9)] string? SerialNumber, + [property: DataMember(Name = "originUDN", Order = 10)] string? OriginUniqueDeviceName, + [property: DataMember(Name = "iconList", Order = 11)] ICollection? IconList, + [property: DataMember(Name = "serviceList", Order = 12)] ICollection? ServiceList, + [property: DataMember(Name = "deviceList", Order = 13)] ICollection? DeviceList, + [property: DataMember(Name = "presentationURL", Order = 14)] string? PresentationUrl); \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/Discovery/Entities/AvmDeviceListDevice.cs b/RS.Fritz.Manager.API/Services/Discovery/Entities/AvmDeviceListDevice.cs new file mode 100644 index 00000000..be49aa80 --- /dev/null +++ b/RS.Fritz.Manager.API/Services/Discovery/Entities/AvmDeviceListDevice.cs @@ -0,0 +1,18 @@ +namespace RS.Fritz.Manager.API; + +using System.Runtime.Serialization; + +[DataContract(Name = UPnPConstants.Device, Namespace = UPnPConstants.Device10AvmNamespace)] +internal readonly record struct AvmDeviceListDevice( + [property: DataMember(Name = "deviceType", Order = 0)] string DeviceType, + [property: DataMember(Name = "friendlyName", Order = 1)] string FriendlyName, + [property: DataMember(Name = "manufacturer", Order = 2)] string Manufacturer, + [property: DataMember(Name = "manufacturerURL", Order = 3)] string ManufacturerUrl, + [property: DataMember(Name = "modelDescription", Order = 4)] string ModelDescription, + [property: DataMember(Name = "modelName", Order = 5)] string ModelName, + [property: DataMember(Name = "modelNumber", Order = 6)] string ModelNumber, + [property: DataMember(Name = "modelURL", Order = 7)] string ModelUrl, + [property: DataMember(Name = "UDN", Order = 8)] string UniqueDeviceName, + [property: DataMember(Name = "UPC", Order = 9)] string? UniversalProductCode, + [property: DataMember(Name = "serviceList", Order = 10)] ICollection? ServiceList, + [property: DataMember(Name = "deviceList", Order = 11)] ICollection? DeviceList); \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/Discovery/Entities/AvmIconListItem.cs b/RS.Fritz.Manager.API/Services/Discovery/Entities/AvmIconListItem.cs new file mode 100644 index 00000000..249000a1 --- /dev/null +++ b/RS.Fritz.Manager.API/Services/Discovery/Entities/AvmIconListItem.cs @@ -0,0 +1,11 @@ +namespace RS.Fritz.Manager.API; + +using System.Runtime.Serialization; + +[DataContract(Name = UPnPConstants.Icon, Namespace = UPnPConstants.Device10AvmNamespace)] +internal readonly record struct AvmIconListItem( + [property: DataMember(Name = "mimetype", Order = 0)] string Mimetype, + [property: DataMember(Name = "width", Order = 1)] int Width, + [property: DataMember(Name = "height", Order = 2)] int Height, + [property: DataMember(Name = "depth", Order = 3)] int Depth, + [property: DataMember(Name = "url", Order = 4)] string Url); \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/Discovery/Entities/AvmServiceListItem.cs b/RS.Fritz.Manager.API/Services/Discovery/Entities/AvmServiceListItem.cs new file mode 100644 index 00000000..e5c75525 --- /dev/null +++ b/RS.Fritz.Manager.API/Services/Discovery/Entities/AvmServiceListItem.cs @@ -0,0 +1,11 @@ +namespace RS.Fritz.Manager.API; + +using System.Runtime.Serialization; + +[DataContract(Name = UPnPConstants.Service, Namespace = UPnPConstants.Device10AvmNamespace)] +internal readonly record struct AvmServiceListItem( + [property: DataMember(Name = "serviceType", Order = 0)] string ServiceType, + [property: DataMember(Name = "serviceId", Order = 1)] string ServiceId, + [property: DataMember(Name = "controlURL", Order = 2)] string ControlUrl, + [property: DataMember(Name = "eventSubURL", Order = 3)] string EventSubUrl, + [property: DataMember(Name = "SCPDURL", Order = 4)] string ScpdUrl); \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/Discovery/Entities/AvmSpecVersion.cs b/RS.Fritz.Manager.API/Services/Discovery/Entities/AvmSpecVersion.cs new file mode 100644 index 00000000..4ea3cde2 --- /dev/null +++ b/RS.Fritz.Manager.API/Services/Discovery/Entities/AvmSpecVersion.cs @@ -0,0 +1,8 @@ +namespace RS.Fritz.Manager.API; + +using System.Runtime.Serialization; + +[DataContract(Name = UPnPConstants.SpecVersion, Namespace = UPnPConstants.Device10AvmNamespace)] +internal readonly record struct AvmSpecVersion( + [property: DataMember(Name = "major", Order = 0)] int Major, + [property: DataMember(Name = "minor", Order = 1)] int Minor); \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/Discovery/Entities/AvmSystemVersion.cs b/RS.Fritz.Manager.API/Services/Discovery/Entities/AvmSystemVersion.cs new file mode 100644 index 00000000..6a8ebe8b --- /dev/null +++ b/RS.Fritz.Manager.API/Services/Discovery/Entities/AvmSystemVersion.cs @@ -0,0 +1,12 @@ +namespace RS.Fritz.Manager.API; + +using System.Runtime.Serialization; + +[DataContract(Name = UPnPConstants.SystemVersion, Namespace = UPnPConstants.Device10AvmNamespace)] +internal readonly record struct AvmSystemVersion( + [property: DataMember(Name = "HW", Order = 0)] int Hw, + [property: DataMember(Name = "Major", Order = 1)] int Major, + [property: DataMember(Name = "Minor", Order = 2)] int Minor, + [property: DataMember(Name = "Patch", Order = 3)] int Patch, + [property: DataMember(Name = "Buildnumber", Order = 4)] int BuildNumber, + [property: DataMember(Name = "Display", Order = 5)] string Display); \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/Discovery/Entities/AvmUPnPDescription.cs b/RS.Fritz.Manager.API/Services/Discovery/Entities/AvmUPnPDescription.cs new file mode 100644 index 00000000..c838ed6f --- /dev/null +++ b/RS.Fritz.Manager.API/Services/Discovery/Entities/AvmUPnPDescription.cs @@ -0,0 +1,9 @@ +namespace RS.Fritz.Manager.API; + +using System.Runtime.Serialization; + +[DataContract(Name = UPnPConstants.Root, Namespace = UPnPConstants.Device10AvmNamespace)] +internal readonly record struct AvmUPnPDescription( + [property: DataMember(Name = "specVersion", Order = 0)] AvmSpecVersion SpecVersion, + [property: DataMember(Name = "systemVersion", Order = 1)] AvmSystemVersion SystemVersion, + [property: DataMember(Name = "device", Order = 2)] AvmDevice Device); \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/Discovery/Entities/Device.cs b/RS.Fritz.Manager.API/Services/Discovery/Entities/Device.cs index 7a99041e..1ec2b0d2 100644 --- a/RS.Fritz.Manager.API/Services/Discovery/Entities/Device.cs +++ b/RS.Fritz.Manager.API/Services/Discovery/Entities/Device.cs @@ -1,21 +1,19 @@ namespace RS.Fritz.Manager.API; -using System.Runtime.Serialization; - -[DataContract(Name = "device", Namespace = "urn:dslforum-org:device-1-0")] public readonly record struct Device( - [property: DataMember(Name = "deviceType", Order = 0)] string DeviceType, - [property: DataMember(Name = "friendlyName", Order = 1)] string FriendlyName, - [property: DataMember(Name = "manufacturer", Order = 2)] string Manufacturer, - [property: DataMember(Name = "manufacturerURL", Order = 3)] string ManufacturerUrl, - [property: DataMember(Name = "modelDescription", Order = 4)] string ModelDescription, - [property: DataMember(Name = "modelName", Order = 5)] string ModelName, - [property: DataMember(Name = "modelNumber", Order = 6)] string ModelNumber, - [property: DataMember(Name = "modelURL", Order = 7)] string ModelUrl, - [property: DataMember(Name = "UDN", Order = 8)] string UniqueDeviceName, - [property: DataMember(Name = "serialNumber", Order = 9)] string SerialNumber, - [property: DataMember(Name = "UPC", Order = 10)] string Upc, - [property: DataMember(Name = "iconList", Order = 11)] IconListItem[] IconList, - [property: DataMember(Name = "serviceList", Order = 12)] ServiceListItem[] ServiceList, - [property: DataMember(Name = "deviceList", Order = 13)] Device[]? DeviceList, - [property: DataMember(Name = "presentationURL", Order = 14)] string PresentationUrl); \ No newline at end of file + string DeviceType, + string FriendlyName, + string Manufacturer, + string ManufacturerUrl, + string ModelDescription, + string ModelName, + string ModelNumber, + string ModelUrl, + string UniqueDeviceName, + string? UniversalProductCode, + string? SerialNumber, + string? OriginUniqueDeviceName, + ICollection? IconList, + ICollection? ServiceList, + ICollection? DeviceList, + string? PresentationUrl); \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/Discovery/Entities/DeviceSearchResponse.cs b/RS.Fritz.Manager.API/Services/Discovery/Entities/DeviceSearchResponse.cs new file mode 100644 index 00000000..e7eadd18 --- /dev/null +++ b/RS.Fritz.Manager.API/Services/Discovery/Entities/DeviceSearchResponse.cs @@ -0,0 +1,21 @@ +namespace RS.Fritz.Manager.API; + +using System; +using System.Net; + +public readonly record struct DeviceSearchResponse( + string? CacheControl, + string? Date, + string? Ext, + Uri? Location, + string? Server, + string? SearchTarget, + string? Usn, + string? Opt, + string? Nls, + int? BootId, + int? ConfigId, + ushort? SearchPort, + Uri? SecureLocation, + IPAddress IpAddress, + IPAddress LocalIpAddress); \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/Discovery/Entities/IconListItem.cs b/RS.Fritz.Manager.API/Services/Discovery/Entities/IconListItem.cs index 1986ecd4..71bba901 100644 --- a/RS.Fritz.Manager.API/Services/Discovery/Entities/IconListItem.cs +++ b/RS.Fritz.Manager.API/Services/Discovery/Entities/IconListItem.cs @@ -1,11 +1,3 @@ namespace RS.Fritz.Manager.API; -using System.Runtime.Serialization; - -[DataContract(Name = "icon", Namespace = "urn:dslforum-org:device-1-0")] -public readonly record struct IconListItem( - [property: DataMember(Name = "mimetype", Order = 0)] string Mimetype, - [property: DataMember(Name = "width", Order = 1)] int Width, - [property: DataMember(Name = "height", Order = 2)] int Height, - [property: DataMember(Name = "depth", Order = 3)] int Depth, - [property: DataMember(Name = "url", Order = 4)] string Url); \ No newline at end of file +public readonly record struct IconListItem(string Mimetype, int Width, int Height, int Depth, string Url); \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/Discovery/Entities/InternetGatewayDeviceResponse.cs b/RS.Fritz.Manager.API/Services/Discovery/Entities/InternetGatewayDeviceResponse.cs deleted file mode 100644 index 31ad8448..00000000 --- a/RS.Fritz.Manager.API/Services/Discovery/Entities/InternetGatewayDeviceResponse.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace RS.Fritz.Manager.API; - -using System; -using System.Net; - -internal readonly record struct InternetGatewayDeviceResponse(Uri Location, string Server, string CacheControl, string Ext, string SearchTarget, string Usn, IPAddress LocalIpAddress); \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/Discovery/Entities/ServerDeviceResponse.cs b/RS.Fritz.Manager.API/Services/Discovery/Entities/ServerDeviceResponse.cs new file mode 100644 index 00000000..f023107c --- /dev/null +++ b/RS.Fritz.Manager.API/Services/Discovery/Entities/ServerDeviceResponse.cs @@ -0,0 +1,6 @@ +namespace RS.Fritz.Manager.API; + +using System.Collections.Frozen; +using System.Net; + +public readonly record struct ServerDeviceResponse(string? Server, FrozenSet IpAddresses, FrozenSet UsnDeviceResponses); \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/Discovery/Entities/ServiceListItem.cs b/RS.Fritz.Manager.API/Services/Discovery/Entities/ServiceListItem.cs index 5066249f..4c857792 100644 --- a/RS.Fritz.Manager.API/Services/Discovery/Entities/ServiceListItem.cs +++ b/RS.Fritz.Manager.API/Services/Discovery/Entities/ServiceListItem.cs @@ -1,11 +1,3 @@ namespace RS.Fritz.Manager.API; -using System.Runtime.Serialization; - -[DataContract(Name = "service", Namespace = "urn:dslforum-org:device-1-0")] -public readonly record struct ServiceListItem( - [property: DataMember(Name = "serviceType", Order = 0)] string ServiceType, - [property: DataMember(Name = "serviceId", Order = 1)] string ServiceId, - [property: DataMember(Name = "controlURL", Order = 2)] string ControlUrl, - [property: DataMember(Name = "eventSubURL", Order = 3)] string EventSubUrl, - [property: DataMember(Name = "SCPDURL", Order = 4)] string ScpdUrl); \ No newline at end of file +public readonly record struct ServiceListItem(string ServiceType, string ServiceId, string ControlUrl, string EventSubUrl, string ScpdUrl); \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/Discovery/Entities/SoapDevice.cs b/RS.Fritz.Manager.API/Services/Discovery/Entities/SoapDevice.cs new file mode 100644 index 00000000..dd46a5fb --- /dev/null +++ b/RS.Fritz.Manager.API/Services/Discovery/Entities/SoapDevice.cs @@ -0,0 +1,21 @@ +namespace RS.Fritz.Manager.API; + +using System.Runtime.Serialization; + +[DataContract(Name = UPnPConstants.Device, Namespace = UPnPConstants.Device10Namespace)] +internal readonly record struct SoapDevice( + [property: DataMember(Name = "deviceType", Order = 0)] string DeviceType, + [property: DataMember(Name = "friendlyName", Order = 1)] string FriendlyName, + [property: DataMember(Name = "manufacturer", Order = 2)] string Manufacturer, + [property: DataMember(Name = "manufacturerURL", Order = 3)] string ManufacturerUrl, + [property: DataMember(Name = "modelDescription", Order = 4)] string ModelDescription, + [property: DataMember(Name = "modelName", Order = 5)] string ModelName, + [property: DataMember(Name = "modelNumber", Order = 6)] string ModelNumber, + [property: DataMember(Name = "modelURL", Order = 7)] string ModelUrl, + [property: DataMember(Name = "UDN", Order = 8)] string UniqueDeviceName, + [property: DataMember(Name = "UPC", Order = 9)] string? UniversalProductCode, + [property: DataMember(Name = "serialNumber", Order = 10)] string? SerialNumber, + [property: DataMember(Name = "iconList", Order = 11)] ICollection? IconList, + [property: DataMember(Name = "serviceList", Order = 12)] ICollection? ServiceList, + [property: DataMember(Name = "deviceList", Order = 13)] ICollection? DeviceList, + [property: DataMember(Name = "presentationURL", Order = 14)] string? PresentationUrl); \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/Discovery/Entities/SoapIconListItem.cs b/RS.Fritz.Manager.API/Services/Discovery/Entities/SoapIconListItem.cs new file mode 100644 index 00000000..53bc4d65 --- /dev/null +++ b/RS.Fritz.Manager.API/Services/Discovery/Entities/SoapIconListItem.cs @@ -0,0 +1,11 @@ +namespace RS.Fritz.Manager.API; + +using System.Runtime.Serialization; + +[DataContract(Name = UPnPConstants.Icon, Namespace = UPnPConstants.Device10Namespace)] +internal readonly record struct SoapIconListItem( + [property: DataMember(Name = "mimetype", Order = 0)] string Mimetype, + [property: DataMember(Name = "width", Order = 1)] int Width, + [property: DataMember(Name = "height", Order = 2)] int Height, + [property: DataMember(Name = "depth", Order = 3)] int Depth, + [property: DataMember(Name = "url", Order = 4)] string Url); \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/Discovery/Entities/SoapServiceListItem.cs b/RS.Fritz.Manager.API/Services/Discovery/Entities/SoapServiceListItem.cs new file mode 100644 index 00000000..0ef6e682 --- /dev/null +++ b/RS.Fritz.Manager.API/Services/Discovery/Entities/SoapServiceListItem.cs @@ -0,0 +1,11 @@ +namespace RS.Fritz.Manager.API; + +using System.Runtime.Serialization; + +[DataContract(Name = UPnPConstants.Service, Namespace = UPnPConstants.Device10Namespace)] +internal readonly record struct SoapServiceListItem( + [property: DataMember(Name = "serviceType", Order = 0)] string ServiceType, + [property: DataMember(Name = "serviceId", Order = 1)] string ServiceId, + [property: DataMember(Name = "controlURL", Order = 2)] string ControlUrl, + [property: DataMember(Name = "eventSubURL", Order = 3)] string EventSubUrl, + [property: DataMember(Name = "SCPDURL", Order = 4)] string ScpdUrl); \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/Discovery/Entities/SoapSpecVersion.cs b/RS.Fritz.Manager.API/Services/Discovery/Entities/SoapSpecVersion.cs new file mode 100644 index 00000000..ac3c0f85 --- /dev/null +++ b/RS.Fritz.Manager.API/Services/Discovery/Entities/SoapSpecVersion.cs @@ -0,0 +1,8 @@ +namespace RS.Fritz.Manager.API; + +using System.Runtime.Serialization; + +[DataContract(Name = UPnPConstants.SpecVersion, Namespace = UPnPConstants.Device10Namespace)] +internal readonly record struct SoapSpecVersion( + [property: DataMember(Name = "major", Order = 0)] int Major, + [property: DataMember(Name = "minor", Order = 1)] int Minor); \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/Discovery/Entities/SoapUPnPDescription.cs b/RS.Fritz.Manager.API/Services/Discovery/Entities/SoapUPnPDescription.cs new file mode 100644 index 00000000..cf5b0ca5 --- /dev/null +++ b/RS.Fritz.Manager.API/Services/Discovery/Entities/SoapUPnPDescription.cs @@ -0,0 +1,9 @@ +namespace RS.Fritz.Manager.API; + +using System.Runtime.Serialization; + +[DataContract(Name = UPnPConstants.Root, Namespace = UPnPConstants.Device10Namespace)] +internal readonly record struct SoapUPnPDescription( + [property: DataMember(Name = "specVersion", Order = 0)] SoapSpecVersion SpecVersion, + [property: DataMember(Name = "URLBase", Order = 1)] string? UrlBase, + [property: DataMember(Name = "device", Order = 2)] SoapDevice Device); \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/Discovery/Entities/SpecVersion.cs b/RS.Fritz.Manager.API/Services/Discovery/Entities/SpecVersion.cs index fa0af21d..4a353ceb 100644 --- a/RS.Fritz.Manager.API/Services/Discovery/Entities/SpecVersion.cs +++ b/RS.Fritz.Manager.API/Services/Discovery/Entities/SpecVersion.cs @@ -1,8 +1,3 @@ namespace RS.Fritz.Manager.API; -using System.Runtime.Serialization; - -[DataContract(Name = "specVersion", Namespace = "urn:dslforum-org:device-1-0")] -public readonly record struct SpecVersion( - [property: DataMember(Name = "major", Order = 0)] int Major, - [property: DataMember(Name = "minor", Order = 1)] int Minor); \ No newline at end of file +public readonly record struct SpecVersion(int Major, int Minor); \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/Discovery/Entities/SystemVersion.cs b/RS.Fritz.Manager.API/Services/Discovery/Entities/SystemVersion.cs index db9200aa..c0e1d4f1 100644 --- a/RS.Fritz.Manager.API/Services/Discovery/Entities/SystemVersion.cs +++ b/RS.Fritz.Manager.API/Services/Discovery/Entities/SystemVersion.cs @@ -1,12 +1,3 @@ namespace RS.Fritz.Manager.API; -using System.Runtime.Serialization; - -[DataContract(Name = "systemVersion", Namespace = "urn:dslforum-org:device-1-0")] -public readonly record struct SystemVersion( - [property: DataMember(Name = "HW", Order = 0)] int Hw, - [property: DataMember(Name = "Major", Order = 1)] int Major, - [property: DataMember(Name = "Minor", Order = 2)] int Minor, - [property: DataMember(Name = "Patch", Order = 3)] int Patch, - [property: DataMember(Name = "Buildnumber", Order = 4)] int BuildNumber, - [property: DataMember(Name = "Display", Order = 5)] string Display); \ No newline at end of file +public readonly record struct SystemVersion(int Hw, int Major, int Minor, int Patch, int BuildNumber, string Display); \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/Discovery/Entities/UPnPDescription.cs b/RS.Fritz.Manager.API/Services/Discovery/Entities/UPnPDescription.cs index 44806bb9..b31d2ec5 100644 --- a/RS.Fritz.Manager.API/Services/Discovery/Entities/UPnPDescription.cs +++ b/RS.Fritz.Manager.API/Services/Discovery/Entities/UPnPDescription.cs @@ -1,9 +1,3 @@ namespace RS.Fritz.Manager.API; -using System.Runtime.Serialization; - -[DataContract(Name = "root", Namespace = "urn:dslforum-org:device-1-0")] -public readonly record struct UPnPDescription( - [property: DataMember(Name = "specVersion", Order = 0)] SpecVersion SpecVersion, - [property: DataMember(Name = "systemVersion", Order = 1)] SystemVersion SystemVersion, - [property: DataMember(Name = "device", Order = 2)] Device Device); \ No newline at end of file +public readonly record struct UPnPDescription(SpecVersion? SpecVersion, string? UrlBase, Device? Device, SystemVersion? SystemVersion); \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/Discovery/Entities/UsnDeviceResponse.cs b/RS.Fritz.Manager.API/Services/Discovery/Entities/UsnDeviceResponse.cs new file mode 100644 index 00000000..e2e66129 --- /dev/null +++ b/RS.Fritz.Manager.API/Services/Discovery/Entities/UsnDeviceResponse.cs @@ -0,0 +1,5 @@ +namespace RS.Fritz.Manager.API; + +using System.Collections.Frozen; + +public readonly record struct UsnDeviceResponse(string? Server, string? Usn, FrozenSet DeviceSearchResponses); \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/Discovery/IDeviceSearchService.cs b/RS.Fritz.Manager.API/Services/Discovery/IDeviceSearchService.cs index 1880818d..5fa0d694 100644 --- a/RS.Fritz.Manager.API/Services/Discovery/IDeviceSearchService.cs +++ b/RS.Fritz.Manager.API/Services/Discovery/IDeviceSearchService.cs @@ -2,5 +2,7 @@ public interface IDeviceSearchService { - ValueTask> GetDevicesAsync(string? deviceType = null, int? sendCount = null, int? timeout = null, CancellationToken cancellationToken = default); + ValueTask> GetDevicesAsync(string deviceType = UPnPConstants.RootDeviceDeviceType, int sendCount = 1, int timeout = 2000, CancellationToken cancellationToken = default); + + ValueTask> GetInternetGatewayDevicesAsync(int sendCount = 1, int timeout = 2000, CancellationToken cancellationToken = default); } \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/Discovery/UPnPConstants.cs b/RS.Fritz.Manager.API/Services/Discovery/UPnPConstants.cs new file mode 100644 index 00000000..e401695c --- /dev/null +++ b/RS.Fritz.Manager.API/Services/Discovery/UPnPConstants.cs @@ -0,0 +1,32 @@ +namespace RS.Fritz.Manager.API; + +public static class UPnPConstants +{ + public const string AvmServiceNamespace = $"{AvmNamespace}:{Service}"; + public const string InternetGatewayDeviceNamespace = $"{DeviceNamespace}:{InternetGatewayDevice}"; + public const string InternetGatewayDeviceAvmNamespace = $"{DeviceAvmNamespace}:{InternetGatewayDevice}"; + public const string InternetGatewayDeviceV1DeviceType = $"{InternetGatewayDeviceNamespace}:1"; + public const string InternetGatewayDeviceV2DeviceType = $"{InternetGatewayDeviceNamespace}:2"; + public const string InternetGatewayDeviceV1AvmDeviceType = $"{InternetGatewayDeviceAvmNamespace}:1"; + internal const string Root = "root"; + internal const string Device = "device"; + internal const string Icon = "icon"; + internal const string Service = "service"; + internal const string SpecVersion = "specVersion"; + internal const string SystemVersion = "systemVersion"; + internal const string Control10Namespace = $"{ControlNamespace}-1-0"; + internal const string Control10AvmNamespace = $"{ControlAvmNamespace}-1-0"; + internal const string Device10Namespace = $"{DeviceNamespace}-1-0"; + internal const string Device10AvmNamespace = $"{DeviceAvmNamespace}-1-0"; + internal const string ServiceNamespace = $"{Namespace}:{Service}"; + internal const string RootDeviceDeviceType = "upnp:rootdevice"; + internal const ushort MultiCastPort = 1900; + private const string Namespace = "urn:schemas-upnp-org"; + private const string AvmNamespace = "urn:dslforum-org"; + private const string Control = "control"; + private const string ControlNamespace = $"{Namespace}:{Control}"; + private const string ControlAvmNamespace = $"{AvmNamespace}:{Control}"; + private const string DeviceNamespace = $"{Namespace}:{Device}"; + private const string DeviceAvmNamespace = $"{AvmNamespace}:{Device}"; + private const string InternetGatewayDevice = "InternetGatewayDevice"; +} \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/Shared/NetworkService.cs b/RS.Fritz.Manager.API/Services/Shared/NetworkService.cs index 3c30ffa2..af917b7d 100644 --- a/RS.Fritz.Manager.API/Services/Shared/NetworkService.cs +++ b/RS.Fritz.Manager.API/Services/Shared/NetworkService.cs @@ -1,16 +1,17 @@ namespace RS.Fritz.Manager.API; +using System.Collections.Frozen; using System.Net; using System.Net.NetworkInformation; using System.Net.Sockets; internal sealed class NetworkService : INetworkService { - private static readonly IReadOnlyList SupportedAddressFamilies = new List + private static readonly FrozenSet SupportedAddressFamilies = new[] { AddressFamily.InterNetwork, AddressFamily.InterNetworkV6 - }.AsReadOnly(); + }.ToFrozenSet(); public Uri FormatUri(string scheme, Uri uri, ushort port, string path) { @@ -39,12 +40,12 @@ public bool IsPrivateIpAddress(IPAddress ipAddress) => ipAddress.AddressFamily switch { AddressFamily.InterNetworkV6 => ipAddress.IsIPv6SiteLocal || ipAddress.IsIPv6UniqueLocal || ipAddress.IsIPv6LinkLocal, - AddressFamily.InterNetwork => IsInRange("10.0.0.0", "10.255.255.255", ipAddress) - || IsInRange("172.16.0.0", "172.31.255.255", ipAddress) - || IsInRange("192.168.0.0", "192.168.255.255", ipAddress) - || IsInRange("169.254.0.0", "169.254.255.255", ipAddress) - || IsInRange("127.0.0.0", "127.255.255.255", ipAddress) - || IsInRange("0.0.0.0", "0.255.255.255", ipAddress), + AddressFamily.InterNetwork => IPNetwork.Parse("10.0.0.0/8").Contains(ipAddress) + || IPNetwork.Parse("172.16.0.0/12").Contains(ipAddress) + || IPNetwork.Parse("192.168.0.0/16").Contains(ipAddress) + || IPNetwork.Parse("169.254.0.0/16").Contains(ipAddress) + || IPNetwork.Parse("127.0.0.0/8").Contains(ipAddress) + || IPNetwork.Parse("0.0.0.0/8").Contains(ipAddress), _ => throw new ArgumentOutOfRangeException(nameof(ipAddress), ipAddress, null) }; #pragma warning restore IDE0072 // Add missing cases @@ -59,15 +60,6 @@ public IEnumerable GetMulticastAddresses() .SelectMany(q => q.MulticastAddresses.Select(r => r.Address)) .Where(q => SupportedAddressFamilies.Contains(q.AddressFamily)); - private static bool IsInRange(string startIpAddress, string endIpAddress, IPAddress address) - { - uint ipStart = BitConverter.ToUInt32(IPAddress.Parse(startIpAddress).GetAddressBytes().Reverse().ToArray(), 0); - uint ipEnd = BitConverter.ToUInt32(IPAddress.Parse(endIpAddress).GetAddressBytes().Reverse().ToArray(), 0); - uint ip = BitConverter.ToUInt32(address.GetAddressBytes().Reverse().ToArray(), 0); - - return ip >= ipStart && ip <= ipEnd; - } - private static IEnumerable GetIpInterfaces() => NetworkInterface.GetAllNetworkInterfaces() .Where(q => q.OperationalStatus is OperationalStatus.Up && q.NetworkInterfaceType is not NetworkInterfaceType.Loopback) diff --git a/RS.Fritz.Manager.API/Services/TR-064/Services/AvmSpeedtest/IFritzAvmSpeedtestService.cs b/RS.Fritz.Manager.API/Services/TR-064/Services/AvmSpeedtest/IFritzAvmSpeedtestService.cs index 3c55f36a..887624bd 100644 --- a/RS.Fritz.Manager.API/Services/TR-064/Services/AvmSpeedtest/IFritzAvmSpeedtestService.cs +++ b/RS.Fritz.Manager.API/Services/TR-064/Services/AvmSpeedtest/IFritzAvmSpeedtestService.cs @@ -1,16 +1,16 @@ namespace RS.Fritz.Manager.API; -[ServiceContract(Namespace = "urn:dslforum-org:service:X_AVM-DE_Speedtest:1")] +[ServiceContract(Namespace = $"{UPnPConstants.AvmServiceNamespace}:X_AVM-DE_Speedtest:1")] [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] internal interface IFritzAvmSpeedtestService : IAsyncDisposable { - [OperationContract(Action = "urn:dslforum-org:service:X_AVM-DE_Speedtest:1#GetInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:X_AVM-DE_Speedtest:1#GetInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetInfoAsync(AvmSpeedtestGetInfoRequest avmSpeedtestGetInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:X_AVM-DE_Speedtest:1#GetStatistics")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:X_AVM-DE_Speedtest:1#GetStatistics")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetStatisticsAsync(AvmSpeedtestGetStatisticsRequest avmSpeedtestGetStatisticsRequest); } \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/TR-064/Services/UPnPFault1.cs b/RS.Fritz.Manager.API/Services/TR-064/Services/AvmUPnPFault.cs similarity index 62% rename from RS.Fritz.Manager.API/Services/TR-064/Services/UPnPFault1.cs rename to RS.Fritz.Manager.API/Services/TR-064/Services/AvmUPnPFault.cs index 0f617c37..86e1be36 100644 --- a/RS.Fritz.Manager.API/Services/TR-064/Services/UPnPFault1.cs +++ b/RS.Fritz.Manager.API/Services/TR-064/Services/AvmUPnPFault.cs @@ -2,7 +2,7 @@ using System.Runtime.Serialization; -[DataContract(Name = "UPnPError", Namespace = "urn:schemas-upnp-org:control-1-0")] -public readonly record struct UPnPFault1( +[DataContract(Name = "UPnPError", Namespace = UPnPConstants.Control10AvmNamespace)] +public readonly record struct AvmUPnPFault( [property: DataMember(Name = "errorCode")] ushort ErrorCode, [property: DataMember(Name = "errorDescription")] string ErrorDescription); \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/TR-064/Services/DeviceConfig/IFritzDeviceConfigService.cs b/RS.Fritz.Manager.API/Services/TR-064/Services/DeviceConfig/IFritzDeviceConfigService.cs index d4f343aa..03326980 100644 --- a/RS.Fritz.Manager.API/Services/TR-064/Services/DeviceConfig/IFritzDeviceConfigService.cs +++ b/RS.Fritz.Manager.API/Services/TR-064/Services/DeviceConfig/IFritzDeviceConfigService.cs @@ -1,26 +1,26 @@ namespace RS.Fritz.Manager.API; -[ServiceContract(Namespace = "urn:dslforum-org:service:DeviceConfig:1")] +[ServiceContract(Namespace = $"{UPnPConstants.AvmServiceNamespace}:DeviceConfig:1")] [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] internal interface IFritzDeviceConfigService : IAsyncDisposable { - [OperationContract(Action = "urn:dslforum-org:service:DeviceConfig:1#GetPersistentData")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:DeviceConfig:1#GetPersistentData")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetPersistentDataAsync(DeviceConfigGetPersistentDataRequest deviceConfigGetPersistentDataRequest); - [OperationContract(Action = "urn:dslforum-org:service:DeviceConfig:1#X_GenerateUUID")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:DeviceConfig:1#X_GenerateUUID")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GenerateUuIdAsync(DeviceConfigGenerateUuIdRequest deviceConfigGenerateUuIdRequest); - [OperationContract(Action = "urn:dslforum-org:service:DeviceConfig:1#X_AVM-DE_CreateUrlSID")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:DeviceConfig:1#X_AVM-DE_CreateUrlSID")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task CreateUrlSidAsync(DeviceConfigCreateUrlSidRequest deviceConfigCreateUrlSidRequest); - [OperationContract(Action = "urn:dslforum-org:service:DeviceConfig:1#X_AVM-DE_GetSupportDataInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:DeviceConfig:1#X_AVM-DE_GetSupportDataInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetSupportDataInfoAsync(DeviceConfigGetSupportDataInfoRequest deviceConfigGetSupportDataInfoRequest); } \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/TR-064/Services/DeviceInfo/IFritzDeviceInfoService.cs b/RS.Fritz.Manager.API/Services/TR-064/Services/DeviceInfo/IFritzDeviceInfoService.cs index f48ca392..c8fb5adf 100644 --- a/RS.Fritz.Manager.API/Services/TR-064/Services/DeviceInfo/IFritzDeviceInfoService.cs +++ b/RS.Fritz.Manager.API/Services/TR-064/Services/DeviceInfo/IFritzDeviceInfoService.cs @@ -1,26 +1,26 @@ namespace RS.Fritz.Manager.API; -[ServiceContract(Namespace = "urn:dslforum-org:service:DeviceInfo:1")] +[ServiceContract(Namespace = $"{UPnPConstants.AvmServiceNamespace}:DeviceInfo:1")] [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] internal interface IFritzDeviceInfoService : IAsyncDisposable { - [OperationContract(Action = "urn:dslforum-org:service:DeviceInfo:1#GetSecurityPort")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:DeviceInfo:1#GetSecurityPort")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetSecurityPortAsync(DeviceInfoGetSecurityPortRequest deviceInfoGetSecurityPortRequest); - [OperationContract(Action = "urn:dslforum-org:service:DeviceInfo:1#GetInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:DeviceInfo:1#GetInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetInfoAsync(DeviceInfoGetInfoRequest deviceInfoGetInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:DeviceInfo:1#GetDeviceLog")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:DeviceInfo:1#GetDeviceLog")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetDeviceLogAsync(DeviceInfoGetDeviceLogRequest deviceInfoGetDeviceLogRequest); - [OperationContract(Action = "urn:dslforum-org:service:DeviceInfo:1#SetProvisioningCode")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:DeviceInfo:1#SetProvisioningCode")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task SetProvisioningCodeAsync(DeviceInfoSetProvisioningCodeRequest setProvisioningCodeRequest); } \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/TR-064/Services/Hosts/IFritzHostsService.cs b/RS.Fritz.Manager.API/Services/TR-064/Services/Hosts/IFritzHostsService.cs index 61b8acfe..a84bd3d8 100644 --- a/RS.Fritz.Manager.API/Services/TR-064/Services/Hosts/IFritzHostsService.cs +++ b/RS.Fritz.Manager.API/Services/TR-064/Services/Hosts/IFritzHostsService.cs @@ -1,46 +1,46 @@ namespace RS.Fritz.Manager.API; -[ServiceContract(Namespace = "urn:dslforum-org:service:Hosts:1")] +[ServiceContract(Namespace = $"{UPnPConstants.AvmServiceNamespace}:Hosts:1")] [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] internal interface IFritzHostsService : IAsyncDisposable { - [OperationContract(Action = "urn:dslforum-org:service:Hosts:1#GetHostNumberOfEntries")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:Hosts:1#GetHostNumberOfEntries")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetHostNumberOfEntriesAsync(HostsGetHostNumberOfEntriesRequest hostsGetHostNumberOfEntriesRequest); - [OperationContract(Action = "urn:dslforum-org:service:Hosts:1#X_AVM-DE_HostsCheckUpdate")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:Hosts:1#X_AVM-DE_HostsCheckUpdate")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task HostsCheckUpdateAsync(HostsHostsCheckUpdateRequest hostsHostsCheckUpdateRequest); - [OperationContract(Action = "urn:dslforum-org:service:Hosts:1#X_AVM-DE_GetHostListPath")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:Hosts:1#X_AVM-DE_GetHostListPath")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetHostListPathAsync(HostsGetHostListPathRequest hostsGetHostListPathRequest); - [OperationContract(Action = "urn:dslforum-org:service:Hosts:1#GetGenericHostEntry")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:Hosts:1#GetGenericHostEntry")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetGenericHostEntryAsync(HostsGetGenericHostEntryRequest hostsGetGenericHostEntryRequest); - [OperationContract(Action = "urn:dslforum-org:service:Hosts:1#X_AVM-DE_GetInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:Hosts:1#X_AVM-DE_GetInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetInfoAsync(HostsGetInfoRequest hostsGetInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:Hosts:1#X_AVM-DE_GetChangeCounter")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:Hosts:1#X_AVM-DE_GetChangeCounter")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetChangeCounterAsync(HostsGetChangeCounterRequest hostsGetChangeCounterRequest); - [OperationContract(Action = "urn:dslforum-org:service:Hosts:1#X_AVM-DE_GetMeshListPath")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:Hosts:1#X_AVM-DE_GetMeshListPath")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetMeshListPathAsync(HostsGetMeshListPathRequest hostsGetMeshListPathRequest); - [OperationContract(Action = "urn:dslforum-org:service:Hosts:1#X_AVM-DE_GetFriendlyName")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:Hosts:1#X_AVM-DE_GetFriendlyName")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetFriendlyNameAsync(HostsGetFriendlyNameRequest hostsGetFriendlyNameRequest); } \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/TR-064/Services/LanConfigSecurity/IFritzLanConfigSecurityService.cs b/RS.Fritz.Manager.API/Services/TR-064/Services/LanConfigSecurity/IFritzLanConfigSecurityService.cs index 94380dd9..41b2f3f9 100644 --- a/RS.Fritz.Manager.API/Services/TR-064/Services/LanConfigSecurity/IFritzLanConfigSecurityService.cs +++ b/RS.Fritz.Manager.API/Services/TR-064/Services/LanConfigSecurity/IFritzLanConfigSecurityService.cs @@ -1,31 +1,31 @@ namespace RS.Fritz.Manager.API; -[ServiceContract(Namespace = "urn:dslforum-org:service:LANConfigSecurity:1")] +[ServiceContract(Namespace = $"{UPnPConstants.AvmServiceNamespace}:LANConfigSecurity:1")] [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] internal interface IFritzLanConfigSecurityService : IAsyncDisposable { - [OperationContract(Action = "urn:dslforum-org:service:LANConfigSecurity:1#X_AVM-DE_GetCurrentUser")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:LANConfigSecurity:1#X_AVM-DE_GetCurrentUser")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetCurrentUserAsync(LanConfigSecurityGetCurrentUserRequest lanConfigSecurityGetCurrentUserRequest); - [OperationContract(Action = "urn:dslforum-org:service:LANConfigSecurity:1#X_AVM-DE_GetUserList")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:LANConfigSecurity:1#X_AVM-DE_GetUserList")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetUserListAsync(LanConfigSecurityGetUserListRequest lanConfigSecurityGetUserListRequest); - [OperationContract(Action = "urn:dslforum-org:service:LANConfigSecurity:1#GetInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:LANConfigSecurity:1#GetInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetInfoAsync(LanConfigSecurityGetInfoRequest lanConfigSecurityGetInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:LANConfigSecurity:1#X_AVM-DE_GetAnonymousLogin")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:LANConfigSecurity:1#X_AVM-DE_GetAnonymousLogin")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetAnonymousLoginAsync(LanConfigSecurityGetAnonymousLoginRequest lanConfigSecurityGetAnonymousLoginRequest); - [OperationContract(Action = "urn:dslforum-org:service:LANConfigSecurity:1#SetConfigPassword")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:LANConfigSecurity:1#SetConfigPassword")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task SetConfigPasswordAsync(LanConfigSecuritySetConfigPasswordRequest lanConfigSecuritySetConfigPasswordRequest); } \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/TR-064/Services/LanEthernetInterfaceConfig/IFritzLanEthernetInterfaceConfigService.cs b/RS.Fritz.Manager.API/Services/TR-064/Services/LanEthernetInterfaceConfig/IFritzLanEthernetInterfaceConfigService.cs index 193a2354..b36a5943 100644 --- a/RS.Fritz.Manager.API/Services/TR-064/Services/LanEthernetInterfaceConfig/IFritzLanEthernetInterfaceConfigService.cs +++ b/RS.Fritz.Manager.API/Services/TR-064/Services/LanEthernetInterfaceConfig/IFritzLanEthernetInterfaceConfigService.cs @@ -1,16 +1,16 @@ namespace RS.Fritz.Manager.API; -[ServiceContract(Namespace = "urn:dslforum-org:service:LANEthernetInterfaceConfig:1")] +[ServiceContract(Namespace = $"{UPnPConstants.AvmServiceNamespace}:LANEthernetInterfaceConfig:1")] [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] internal interface IFritzLanEthernetInterfaceConfigService : IAsyncDisposable { - [OperationContract(Action = "urn:dslforum-org:service:LANEthernetInterfaceConfig:1#GetInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:LANEthernetInterfaceConfig:1#GetInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetInfoAsync(LanEthernetInterfaceConfigGetInfoRequest lanEthernetInterfaceConfigGetInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:LANEthernetInterfaceConfig:1#GetStatistics")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:LANEthernetInterfaceConfig:1#GetStatistics")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetStatisticsAsync(LanEthernetInterfaceConfigGetStatisticsRequest lanEthernetInterfaceConfigGetStatisticsRequest); } \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/TR-064/Services/LanHostConfigManagement/IFritzLanHostConfigManagementService.cs b/RS.Fritz.Manager.API/Services/TR-064/Services/LanHostConfigManagement/IFritzLanHostConfigManagementService.cs index d8989b2d..d02119f5 100644 --- a/RS.Fritz.Manager.API/Services/TR-064/Services/LanHostConfigManagement/IFritzLanHostConfigManagementService.cs +++ b/RS.Fritz.Manager.API/Services/TR-064/Services/LanHostConfigManagement/IFritzLanHostConfigManagementService.cs @@ -1,36 +1,36 @@ namespace RS.Fritz.Manager.API; -[ServiceContract(Namespace = "urn:dslforum-org:service:LANHostConfigManagement:1")] +[ServiceContract(Namespace = $"{UPnPConstants.AvmServiceNamespace}:LANHostConfigManagement:1")] [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] internal interface IFritzLanHostConfigManagementService : IAsyncDisposable { - [OperationContract(Action = "urn:dslforum-org:service:LANHostConfigManagement:1#GetInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:LANHostConfigManagement:1#GetInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetInfoAsync(LanHostConfigManagementGetInfoRequest lanHostConfigManagementGetInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:LANHostConfigManagement:1#GetSubnetMask")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:LANHostConfigManagement:1#GetSubnetMask")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetSubnetMaskAsync(LanHostConfigManagementGetSubnetMaskRequest lanHostConfigManagementGetSubnetMaskRequest); - [OperationContract(Action = "urn:dslforum-org:service:LANHostConfigManagement:1#GetIPRoutersList")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:LANHostConfigManagement:1#GetIPRoutersList")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetIpRoutersListAsync(LanHostConfigManagementGetIpRoutersListRequest lanHostConfigManagementGetIpRoutersListRequest); - [OperationContract(Action = "urn:dslforum-org:service:LANHostConfigManagement:1#GetAddressRange")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:LANHostConfigManagement:1#GetAddressRange")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetAddressRangeAsync(LanHostConfigManagementGetAddressRangeRequest lanHostConfigManagementGetAddressRangeRequest); - [OperationContract(Action = "urn:dslforum-org:service:LANHostConfigManagement:1#GetIPInterfaceNumberOfEntries")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:LANHostConfigManagement:1#GetIPInterfaceNumberOfEntries")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetIpInterfaceNumberOfEntriesAsync(LanHostConfigManagementGetIpInterfaceNumberOfEntriesRequest lanHostConfigManagementGetIpInterfaceNumberOfEntriesRequest); - [OperationContract(Action = "urn:dslforum-org:service:LANHostConfigManagement:1#GetDNSServers")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:LANHostConfigManagement:1#GetDNSServers")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetDnsServersAsync(LanHostConfigManagementGetDnsServersRequest lanHostConfigManagementGetDnsServersRequest); } \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/TR-064/Services/Layer3Forwarding/IFritzLayer3ForwardingService.cs b/RS.Fritz.Manager.API/Services/TR-064/Services/Layer3Forwarding/IFritzLayer3ForwardingService.cs index 6abbbf16..48ca94c8 100644 --- a/RS.Fritz.Manager.API/Services/TR-064/Services/Layer3Forwarding/IFritzLayer3ForwardingService.cs +++ b/RS.Fritz.Manager.API/Services/TR-064/Services/Layer3Forwarding/IFritzLayer3ForwardingService.cs @@ -1,21 +1,21 @@ namespace RS.Fritz.Manager.API; -[ServiceContract(Namespace = "urn:dslforum-org:service:Layer3Forwarding:1")] +[ServiceContract(Namespace = $"{UPnPConstants.AvmServiceNamespace}:Layer3Forwarding:1")] [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] internal interface IFritzLayer3ForwardingService : IAsyncDisposable { - [OperationContract(Action = "urn:dslforum-org:service:Layer3Forwarding:1#GetDefaultConnectionService")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:Layer3Forwarding:1#GetDefaultConnectionService")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetDefaultConnectionServiceAsync(Layer3ForwardingGetDefaultConnectionServiceRequest layer3ForwardingGetDefaultConnectionServiceRequest); - [OperationContract(Action = "urn:dslforum-org:service:Layer3Forwarding:1#GetForwardNumberOfEntries")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:Layer3Forwarding:1#GetForwardNumberOfEntries")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetForwardNumberOfEntriesAsync(Layer3ForwardingGetForwardNumberOfEntriesRequest layer3ForwardingGetForwardNumberOfEntriesRequest); - [OperationContract(Action = "urn:dslforum-org:service:Layer3Forwarding:1#GetGenericForwardingEntry")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:Layer3Forwarding:1#GetGenericForwardingEntry")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetGenericForwardingEntryAsync(Layer3ForwardingGetGenericForwardingEntryRequest layer3ForwardingGetGenericForwardingEntryRequest); } \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/TR-064/Services/ManagementServer/IFritzManagementServerService.cs b/RS.Fritz.Manager.API/Services/TR-064/Services/ManagementServer/IFritzManagementServerService.cs index ec757113..71e36cbe 100644 --- a/RS.Fritz.Manager.API/Services/TR-064/Services/ManagementServer/IFritzManagementServerService.cs +++ b/RS.Fritz.Manager.API/Services/TR-064/Services/ManagementServer/IFritzManagementServerService.cs @@ -1,56 +1,56 @@ namespace RS.Fritz.Manager.API; -[ServiceContract(Namespace = "urn:dslforum-org:service:ManagementServer:1")] +[ServiceContract(Namespace = $"{UPnPConstants.AvmServiceNamespace}:ManagementServer:1")] [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] internal interface IFritzManagementServerService : IAsyncDisposable { - [OperationContract(Action = "urn:dslforum-org:service:ManagementServer:1#GetInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:ManagementServer:1#GetInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetInfoAsync(ManagementServerGetInfoRequest managementServerGetInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:ManagementServer:1#X_AVM-DE_GetTR069FirmwareDownloadEnabled")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:ManagementServer:1#X_AVM-DE_GetTR069FirmwareDownloadEnabled")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetTr069FirmwareDownloadEnabledAsync(ManagementServerGetTr069FirmwareDownloadEnabledRequest managementServerGetTr069FirmwareDownloadEnabledRequest); - [OperationContract(Action = "urn:dslforum-org:service:ManagementServer:1#SetManagementServerURL")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:ManagementServer:1#SetManagementServerURL")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task SetManagementServerUrlAsync(ManagementServerSetManagementServerUrlRequest managementServerSetManagementServerUrlRequest); - [OperationContract(Action = "urn:dslforum-org:service:ManagementServer:1#SetManagementServerUsername")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:ManagementServer:1#SetManagementServerUsername")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task SetManagementServerUsernameAsync(ManagementServerSetManagementServerUsernameRequest managementServerSetManagementServerUsernameRequest); - [OperationContract(Action = "urn:dslforum-org:service:ManagementServer:1#SetManagementServerPassword")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:ManagementServer:1#SetManagementServerPassword")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task SetManagementServerPasswordAsync(ManagementServerSetManagementServerPasswordRequest managementServerSetManagementServerPasswordRequest); - [OperationContract(Action = "urn:dslforum-org:service:ManagementServer:1#SetPeriodicInform")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:ManagementServer:1#SetPeriodicInform")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task SetPeriodicInformAsync(ManagementServerSetPeriodicInformRequest managementServerSetPeriodicInformRequest); - [OperationContract(Action = "urn:dslforum-org:service:ManagementServer:1#SetConnectionRequestAuthentication")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:ManagementServer:1#SetConnectionRequestAuthentication")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task SetConnectionRequestAuthenticationAsync(ManagementServerSetConnectionRequestAuthenticationRequest managementServerSetConnectionRequestAuthenticationRequest); - [OperationContract(Action = "urn:dslforum-org:service:ManagementServer:1#SetUpgradeManagement")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:ManagementServer:1#SetUpgradeManagement")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task SetUpgradeManagementAsync(ManagementServerSetUpgradeManagementRequest managementServerSetUpgradeManagementRequest); - [OperationContract(Action = "urn:dslforum-org:service:ManagementServer:1#X_SetTR069Enable")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:ManagementServer:1#X_SetTR069Enable")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task SetTr069EnableAsync(ManagementServerSetTr069EnableRequest managementServerSetTr069EnableRequest); - [OperationContract(Action = "urn:dslforum-org:service:ManagementServer:1#X_AVM-DE_SetTR069FirmwareDownloadEnabled")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:ManagementServer:1#X_AVM-DE_SetTR069FirmwareDownloadEnabled")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task SetTr069FirmwareDownloadEnabledAsync(ManagementServerSetTr069FirmwareDownloadEnabledRequest managementServerSetTr069FirmwareDownloadEnabledRequest); } \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/TR-064/Services/Time/IFritzTimeService.cs b/RS.Fritz.Manager.API/Services/TR-064/Services/Time/IFritzTimeService.cs index b6a6098f..8d0d0460 100644 --- a/RS.Fritz.Manager.API/Services/TR-064/Services/Time/IFritzTimeService.cs +++ b/RS.Fritz.Manager.API/Services/TR-064/Services/Time/IFritzTimeService.cs @@ -1,16 +1,16 @@ namespace RS.Fritz.Manager.API; -[ServiceContract(Namespace = "urn:dslforum-org:service:Time:1")] +[ServiceContract(Namespace = $"{UPnPConstants.AvmServiceNamespace}:Time:1")] [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] internal interface IFritzTimeService : IAsyncDisposable { - [OperationContract(Action = "urn:dslforum-org:service:Time:1#GetInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:Time:1#GetInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetInfoAsync(TimeGetInfoRequest timeGetInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:Time:1#SetNTPServers")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:Time:1#SetNTPServers")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task SetNtpServersAsync(TimeSetNtpServersRequest timeSetNtpServersRequest); } \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/TR-064/Services/UPnPFault2.cs b/RS.Fritz.Manager.API/Services/TR-064/Services/UPnPFault.cs similarity index 64% rename from RS.Fritz.Manager.API/Services/TR-064/Services/UPnPFault2.cs rename to RS.Fritz.Manager.API/Services/TR-064/Services/UPnPFault.cs index 8aeb1b32..30966d40 100644 --- a/RS.Fritz.Manager.API/Services/TR-064/Services/UPnPFault2.cs +++ b/RS.Fritz.Manager.API/Services/TR-064/Services/UPnPFault.cs @@ -2,7 +2,7 @@ using System.Runtime.Serialization; -[DataContract(Name = "UPnPError", Namespace = "urn:dslforum-org:control-1-0")] -public readonly record struct UPnPFault2( +[DataContract(Name = "UPnPError", Namespace = UPnPConstants.Control10Namespace)] +public readonly record struct UPnPFault( [property: DataMember(Name = "errorCode")] ushort ErrorCode, [property: DataMember(Name = "errorDescription")] string ErrorDescription); \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/TR-064/Services/UserInterface/IFritzUserInterfaceService.cs b/RS.Fritz.Manager.API/Services/TR-064/Services/UserInterface/IFritzUserInterfaceService.cs index 14a07a0a..f127d466 100644 --- a/RS.Fritz.Manager.API/Services/TR-064/Services/UserInterface/IFritzUserInterfaceService.cs +++ b/RS.Fritz.Manager.API/Services/TR-064/Services/UserInterface/IFritzUserInterfaceService.cs @@ -1,51 +1,51 @@ namespace RS.Fritz.Manager.API; -[ServiceContract(Namespace = "urn:dslforum-org:service:UserInterface:1")] +[ServiceContract(Namespace = $"{UPnPConstants.AvmServiceNamespace}:UserInterface:1")] [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] internal interface IFritzUserInterfaceService : IAsyncDisposable { - [OperationContract(Action = "urn:dslforum-org:service:UserInterface:1#GetInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:UserInterface:1#GetInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetInfoAsync(UserInterfaceGetInfoRequest userInterfaceGetInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:UserInterface:1#X_AVM-DE_CheckUpdate")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:UserInterface:1#X_AVM-DE_CheckUpdate")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task CheckUpdateAsync(UserInterfaceCheckUpdateRequest userInterfaceCheckUpdateRequest); - [OperationContract(Action = "urn:dslforum-org:service:UserInterface:1#X_AVM-DE_DoPrepareCGI")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:UserInterface:1#X_AVM-DE_DoPrepareCGI")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task DoPrepareCgiAsync(UserInterfaceDoPrepareCgiRequest userInterfaceDoPrepareCgiRequest); - [OperationContract(Action = "urn:dslforum-org:service:UserInterface:1#X_AVM-DE_DoUpdate")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:UserInterface:1#X_AVM-DE_DoUpdate")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task DoUpdateAsync(UserInterfaceDoUpdateRequest userInterfaceDoUpdateRequest); - [OperationContract(Action = "urn:dslforum-org:service:UserInterface:1#X_AVM-DE_DoManualUpdate")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:UserInterface:1#X_AVM-DE_DoManualUpdate")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task DoManualUpdateAsync(UserInterfaceDoManualUpdateRequest userInterfaceDoManualUpdateRequest); - [OperationContract(Action = "urn:dslforum-org:service:UserInterface:1#X_AVM-DE_GetInternationalConfig")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:UserInterface:1#X_AVM-DE_GetInternationalConfig")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetInternationalConfigAsync(UserInterfaceGetInternationalConfigRequest userInterfaceGetInternationalConfigRequest); - [OperationContract(Action = "urn:dslforum-org:service:UserInterface:1#X_AVM-DE_SetInternationalConfig")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:UserInterface:1#X_AVM-DE_SetInternationalConfig")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task SetInternationalConfigAsync(UserInterfaceSetInternationalConfigRequest userInterfaceSetInternationalConfigRequest); - [OperationContract(Action = "urn:dslforum-org:service:UserInterface:1#X_AVM-DE_GetInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:UserInterface:1#X_AVM-DE_GetInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task AvmGetInfoAsync(UserInterfaceAvmGetInfoRequest userInterfaceAvmGetInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:UserInterface:1#X_AVM-DE_SetConfig")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:UserInterface:1#X_AVM-DE_SetConfig")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task SetConfigAsync(UserInterfaceSetConfigRequest userInterfaceSetConfigRequest); } \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/TR-064/Services/WanCommonInterfaceConfig/IFritzWanCommonInterfaceConfigService.cs b/RS.Fritz.Manager.API/Services/TR-064/Services/WanCommonInterfaceConfig/IFritzWanCommonInterfaceConfigService.cs index a6c438ae..14a2b9d5 100644 --- a/RS.Fritz.Manager.API/Services/TR-064/Services/WanCommonInterfaceConfig/IFritzWanCommonInterfaceConfigService.cs +++ b/RS.Fritz.Manager.API/Services/TR-064/Services/WanCommonInterfaceConfig/IFritzWanCommonInterfaceConfigService.cs @@ -1,41 +1,41 @@ namespace RS.Fritz.Manager.API; -[ServiceContract(Namespace = "urn:dslforum-org:service:WANCommonInterfaceConfig:1")] +[ServiceContract(Namespace = $"{UPnPConstants.AvmServiceNamespace}:WANCommonInterfaceConfig:1")] [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] internal interface IFritzWanCommonInterfaceConfigService : IAsyncDisposable { - [OperationContract(Action = "urn:dslforum-org:service:WANCommonInterfaceConfig:1#GetTotalBytesReceived")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANCommonInterfaceConfig:1#GetTotalBytesReceived")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetTotalBytesReceivedAsync(WanCommonInterfaceConfigGetTotalBytesReceivedRequest wanCommonInterfaceConfigGetTotalBytesReceivedRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANCommonInterfaceConfig:1#GetTotalBytesSent")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANCommonInterfaceConfig:1#GetTotalBytesSent")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetTotalBytesSentAsync(WanCommonInterfaceConfigGetTotalBytesSentRequest wanCommonInterfaceConfigGetTotalBytesSentRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANCommonInterfaceConfig:1#GetCommonLinkProperties")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANCommonInterfaceConfig:1#GetCommonLinkProperties")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetCommonLinkPropertiesAsync(WanCommonInterfaceConfigGetCommonLinkPropertiesRequest wanCommonInterfaceConfigGetCommonLinkPropertiesRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANCommonInterfaceConfig:1#GetTotalPacketsSent")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANCommonInterfaceConfig:1#GetTotalPacketsSent")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetTotalPacketsSentAsync(WanCommonInterfaceConfigGetTotalPacketsSentRequest wanCommonInterfaceConfigGetTotalPacketsSentRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANCommonInterfaceConfig:1#GetTotalPacketsReceived")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANCommonInterfaceConfig:1#GetTotalPacketsReceived")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetTotalPacketsReceivedAsync(WanCommonInterfaceConfigGetTotalPacketsReceivedRequest wanCommonInterfaceConfigGetTotalPacketsReceivedRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANCommonInterfaceConfig:1#X_AVM-DE_SetWANAccessType")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANCommonInterfaceConfig:1#X_AVM-DE_SetWANAccessType")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task SetWanAccessTypeAsync(WanCommonInterfaceConfigSetWanAccessTypeRequest wanCommonInterfaceConfigSetWanAccessTypeRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANCommonInterfaceConfig:1#X_AVM-DE_GetOnlineMonitor")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANCommonInterfaceConfig:1#X_AVM-DE_GetOnlineMonitor")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetOnlineMonitorAsync(WanCommonInterfaceConfigGetOnlineMonitorRequest wanCommonInterfaceConfigGetOnlineMonitorRequest); } \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/TR-064/Services/WanDslInterfaceConfig/IFritzWanDslInterfaceConfigService.cs b/RS.Fritz.Manager.API/Services/TR-064/Services/WanDslInterfaceConfig/IFritzWanDslInterfaceConfigService.cs index 58ce31e5..c4025f79 100644 --- a/RS.Fritz.Manager.API/Services/TR-064/Services/WanDslInterfaceConfig/IFritzWanDslInterfaceConfigService.cs +++ b/RS.Fritz.Manager.API/Services/TR-064/Services/WanDslInterfaceConfig/IFritzWanDslInterfaceConfigService.cs @@ -1,26 +1,26 @@ namespace RS.Fritz.Manager.API; -[ServiceContract(Namespace = "urn:dslforum-org:service:WANDSLInterfaceConfig:1")] +[ServiceContract(Namespace = $"{UPnPConstants.AvmServiceNamespace}:WANDSLInterfaceConfig:1")] [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] internal interface IFritzWanDslInterfaceConfigService : IAsyncDisposable { - [OperationContract(Action = "urn:dslforum-org:service:WANDSLInterfaceConfig:1#GetInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANDSLInterfaceConfig:1#GetInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetInfoAsync(WanDslInterfaceConfigGetInfoRequest wanDslInterfaceConfigGetInfo); - [OperationContract(Action = "urn:dslforum-org:service:WANDSLInterfaceConfig:1#GetStatisticsTotal")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANDSLInterfaceConfig:1#GetStatisticsTotal")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetStatisticsTotalAsync(WanDslInterfaceConfigGetStatisticsTotalRequest wanDslInterfaceConfigGetStatisticsTotalRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANDSLInterfaceConfig:1#X_AVM-DE_GetDSLDiagnoseInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANDSLInterfaceConfig:1#X_AVM-DE_GetDSLDiagnoseInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetDslDiagnoseInfoAsync(WanDslInterfaceConfigGetDslDiagnoseInfoRequest wanDslInterfaceConfigGetDslDiagnoseInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANDSLInterfaceConfig:1#X_AVM-DE_GetDSLInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANDSLInterfaceConfig:1#X_AVM-DE_GetDSLInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetDslInfoAsync(WanDslInterfaceConfigGetDslInfoRequest wanDslInterfaceConfigGetDslInfoRequest); } \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/TR-064/Services/WanDslLinkConfig/IFritzWanDslLinkConfigService.cs b/RS.Fritz.Manager.API/Services/TR-064/Services/WanDslLinkConfig/IFritzWanDslLinkConfigService.cs index ddc0e5f8..6d283379 100644 --- a/RS.Fritz.Manager.API/Services/TR-064/Services/WanDslLinkConfig/IFritzWanDslLinkConfigService.cs +++ b/RS.Fritz.Manager.API/Services/TR-064/Services/WanDslLinkConfig/IFritzWanDslLinkConfigService.cs @@ -1,36 +1,36 @@ namespace RS.Fritz.Manager.API; -[ServiceContract(Namespace = "urn:dslforum-org:service:WANDSLLinkConfig:1")] +[ServiceContract(Namespace = $"{UPnPConstants.AvmServiceNamespace}:WANDSLLinkConfig:1")] [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] internal interface IFritzWanDslLinkConfigService : IAsyncDisposable { - [OperationContract(Action = "urn:dslforum-org:service:WANDSLLinkConfig:1#GetInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANDSLLinkConfig:1#GetInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetInfoAsync(WanDslLinkConfigGetInfoRequest wanDslLinkConfigGetInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANDSLLinkConfig:1#GetDSLLinkInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANDSLLinkConfig:1#GetDSLLinkInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetDslLinkInfoAsync(WanDslLinkConfigGetDslLinkInfoRequest wanDslLinkConfigGetDslLinkInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANDSLLinkConfig:1#GetDestinationAddress")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANDSLLinkConfig:1#GetDestinationAddress")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetDestinationAddressAsync(WanDslLinkConfigGetDestinationAddressRequest wanDslLinkConfigGetDestinationAddressRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANDSLLinkConfig:1#GetATMEncapsulation")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANDSLLinkConfig:1#GetATMEncapsulation")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetAtmEncapsulationAsync(WanDslLinkConfigGetAtmEncapsulationRequest wanDslLinkConfigGetAtmEncapsulationRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANDSLLinkConfig:1#GetAutoConfig")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANDSLLinkConfig:1#GetAutoConfig")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetAutoConfigAsync(WanDslLinkConfigGetAutoConfigRequest wanDslLinkConfigGetAutoConfigRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANDSLLinkConfig:1#GetStatistics")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANDSLLinkConfig:1#GetStatistics")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetStatisticsAsync(WanDslLinkConfigGetStatisticsRequest wanDslLinkConfigGetStatisticsRequest); } \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/TR-064/Services/WanEthernetLinkConfig/IFritzWanEthernetLinkConfigService.cs b/RS.Fritz.Manager.API/Services/TR-064/Services/WanEthernetLinkConfig/IFritzWanEthernetLinkConfigService.cs index cd7abb96..ce1f8371 100644 --- a/RS.Fritz.Manager.API/Services/TR-064/Services/WanEthernetLinkConfig/IFritzWanEthernetLinkConfigService.cs +++ b/RS.Fritz.Manager.API/Services/TR-064/Services/WanEthernetLinkConfig/IFritzWanEthernetLinkConfigService.cs @@ -1,11 +1,11 @@ namespace RS.Fritz.Manager.API; -[ServiceContract(Namespace = "urn:dslforum-org:service:WANEthernetLinkConfig:1")] +[ServiceContract(Namespace = $"{UPnPConstants.AvmServiceNamespace}:WANEthernetLinkConfig:1")] [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] internal interface IFritzWanEthernetLinkConfigService : IAsyncDisposable { - [OperationContract(Action = "urn:dslforum-org:service:WANEthernetLinkConfig:1#GetEthernetLinkStatus")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANEthernetLinkConfig:1#GetEthernetLinkStatus")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetEthernetLinkStatusAsync(WanEthernetLinkConfigGetEthernetLinkStatusRequest wanEthernetLinkConfigGetEthernetLinkStatusRequest); } \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/TR-064/Services/WanIpConnection/IFritzWanIpConnectionService.cs b/RS.Fritz.Manager.API/Services/TR-064/Services/WanIpConnection/IFritzWanIpConnectionService.cs index 1437cc9e..8c14560d 100644 --- a/RS.Fritz.Manager.API/Services/TR-064/Services/WanIpConnection/IFritzWanIpConnectionService.cs +++ b/RS.Fritz.Manager.API/Services/TR-064/Services/WanIpConnection/IFritzWanIpConnectionService.cs @@ -1,46 +1,46 @@ namespace RS.Fritz.Manager.API; -[ServiceContract(Namespace = "urn:dslforum-org:service:WANIPConnection:1")] +[ServiceContract(Namespace = $"{UPnPConstants.AvmServiceNamespace}:WANIPConnection:1")] [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] internal interface IFritzWanIpConnectionService : IAsyncDisposable { - [OperationContract(Action = "urn:dslforum-org:service:WANIPConnection:1#GetInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANIPConnection:1#GetInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetInfoAsync(WanConnectionGetInfoRequest wanConnectionGetInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANIPConnection:1#GetConnectionTypeInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANIPConnection:1#GetConnectionTypeInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetConnectionTypeInfoAsync(WanConnectionGetConnectionTypeInfoRequest wanConnectionGetConnectionTypeInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANIPConnection:1#GetStatusInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANIPConnection:1#GetStatusInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetStatusInfoAsync(WanConnectionGetStatusInfoRequest wanConnectionGetStatusInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANIPConnection:1#GetNATRSIPStatus")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANIPConnection:1#GetNATRSIPStatus")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetNatRsipStatusAsync(WanConnectionGetNatRsipStatusRequest wanConnectionGetNatRsipStatusRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANIPConnection:1#X_GetDNSServers")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANIPConnection:1#X_GetDNSServers")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetDnsServersAsync(WanConnectionGetDnsServersRequest wanConnectionGetDnsServersRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANIPConnection:1#GetPortMappingNumberOfEntries")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANIPConnection:1#GetPortMappingNumberOfEntries")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetPortMappingNumberOfEntriesAsync(WanConnectionGetPortMappingNumberOfEntriesRequest wanConnectionGetPortMappingNumberOfEntriesRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANIPConnection:1#GetExternalIPAddress")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANIPConnection:1#GetExternalIPAddress")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetExternalIpAddressAsync(WanConnectionGetExternalIpAddressRequest wanConnectionGetExternalIpAddressRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANIPConnection:1#GetGenericPortMappingEntry")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANIPConnection:1#GetGenericPortMappingEntry")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetGenericPortMappingEntryAsync(WanConnectionGetGenericPortMappingEntryRequest wanConnectionGetGenericPortMappingEntryRequest); } \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/TR-064/Services/WanPppConnection/IFritzWanPppConnectionService.cs b/RS.Fritz.Manager.API/Services/TR-064/Services/WanPppConnection/IFritzWanPppConnectionService.cs index 0a19ff2b..2b12b8dd 100644 --- a/RS.Fritz.Manager.API/Services/TR-064/Services/WanPppConnection/IFritzWanPppConnectionService.cs +++ b/RS.Fritz.Manager.API/Services/TR-064/Services/WanPppConnection/IFritzWanPppConnectionService.cs @@ -1,61 +1,61 @@ namespace RS.Fritz.Manager.API; -[ServiceContract(Namespace = "urn:dslforum-org:service:WANPPPConnection:1")] +[ServiceContract(Namespace = $"{UPnPConstants.AvmServiceNamespace}:WANPPPConnection:1")] [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] internal interface IFritzWanPppConnectionService : IAsyncDisposable { - [OperationContract(Action = "urn:dslforum-org:service:WANPPPConnection:1#GetInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANPPPConnection:1#GetInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetInfoAsync(WanConnectionGetInfoRequest wanConnectionGetInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANPPPConnection:1#GetConnectionTypeInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANPPPConnection:1#GetConnectionTypeInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetConnectionTypeInfoAsync(WanConnectionGetConnectionTypeInfoRequest wanConnectionGetConnectionTypeInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANPPPConnection:1#GetStatusInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANPPPConnection:1#GetStatusInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetStatusInfoAsync(WanConnectionGetStatusInfoRequest wanConnectionGetStatusInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANPPPConnection:1#GetLinkLayerMaxBitRates")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANPPPConnection:1#GetLinkLayerMaxBitRates")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetLinkLayerMaxBitRatesAsync(WanPppConnectionGetLinkLayerMaxBitRatesRequest wanPppConnectionGetLinkLayerMaxBitRatesRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANPPPConnection:1#GetUserName")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANPPPConnection:1#GetUserName")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetUserNameAsync(WanPppConnectionGetUserNameRequest wanPppConnectionGetUserNameRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANPPPConnection:1#GetNATRSIPStatus")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANPPPConnection:1#GetNATRSIPStatus")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetNatRsipStatusAsync(WanConnectionGetNatRsipStatusRequest wanConnectionGetNatRsipStatusRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANPPPConnection:1#X_GetDNSServers")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANPPPConnection:1#X_GetDNSServers")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetDnsServersAsync(WanConnectionGetDnsServersRequest wanConnectionGetDnsServersRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANPPPConnection:1#GetPortMappingNumberOfEntries")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANPPPConnection:1#GetPortMappingNumberOfEntries")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetPortMappingNumberOfEntriesAsync(WanConnectionGetPortMappingNumberOfEntriesRequest wanConnectionGetPortMappingNumberOfEntriesRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANPPPConnection:1#GetExternalIPAddress")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANPPPConnection:1#GetExternalIPAddress")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetExternalIpAddressAsync(WanConnectionGetExternalIpAddressRequest wanConnectionGetExternalIpAddressRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANPPPConnection:1#X_AVM-DE_GetAutoDisconnectTimeSpan")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANPPPConnection:1#X_AVM-DE_GetAutoDisconnectTimeSpan")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetAutoDisconnectTimeSpanAsync(WanPppConnectionGetAutoDisconnectTimeSpanRequest wanPppConnectionGetAutoDisconnectTimeSpanRequest); - [OperationContract(Action = "urn:dslforum-org:service:WANPPPConnection:1#GetGenericPortMappingEntry")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WANPPPConnection:1#GetGenericPortMappingEntry")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetGenericPortMappingEntryAsync(WanConnectionGetGenericPortMappingEntryRequest wanConnectionGetGenericPortMappingEntryRequest); } \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/TR-064/Services/WlanConfiguration/IFritzWlanConfiguration1Service.cs b/RS.Fritz.Manager.API/Services/TR-064/Services/WlanConfiguration/IFritzWlanConfiguration1Service.cs index 84a5d4ef..7c0f5d68 100644 --- a/RS.Fritz.Manager.API/Services/TR-064/Services/WlanConfiguration/IFritzWlanConfiguration1Service.cs +++ b/RS.Fritz.Manager.API/Services/TR-064/Services/WlanConfiguration/IFritzWlanConfiguration1Service.cs @@ -1,91 +1,91 @@ namespace RS.Fritz.Manager.API; -[ServiceContract(Namespace = "urn:dslforum-org:service:WLANConfiguration:1")] +[ServiceContract(Namespace = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:1")] [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] internal interface IFritzWlanConfiguration1Service : IAsyncDisposable { - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:1#GetInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:1#GetInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetInfoAsync(WlanConfigurationGetInfoRequest wlanConfigurationGetInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:1#X_AVM-DE_GetWLANDeviceListPath")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:1#X_AVM-DE_GetWLANDeviceListPath")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetWlanDeviceListPathAsync(WlanConfigurationGetWlanDeviceListPathRequest wlanConfigurationGetWlanDeviceListPathRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:1#GetBasBeaconSecurityProperties")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:1#GetBasBeaconSecurityProperties")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetBasBeaconSecurityPropertiesAsync(WlanConfigurationGetBasBeaconSecurityPropertiesRequest wlanConfigurationGetBasBeaconSecurityPropertiesRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:1#GetBSSID")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:1#GetBSSID")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetBssIdAsync(WlanConfigurationGetBssIdRequest wlanConfigurationGetBssIdRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:1#GetSSID")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:1#GetSSID")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetSsIdAsync(WlanConfigurationGetSsIdRequest wlanConfigurationGetSsIdRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:1#GetBeaconType")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:1#GetBeaconType")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetBeaconTypeAsync(WlanConfigurationGetBeaconTypeRequest wlanConfigurationGetBeaconTypeRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:1#GetChannelInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:1#GetChannelInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetChannelInfoAsync(WlanConfigurationGetChannelInfoRequest wlanConfigurationGetChannelInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:1#GetBeaconAdvertisement")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:1#GetBeaconAdvertisement")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetBeaconAdvertisementAsync(WlanConfigurationGetBeaconAdvertisementRequest wlanConfigurationGetBeaconAdvertisementRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:1#GetTotalAssociations")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:1#GetTotalAssociations")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetTotalAssociationsAsync(WlanConfigurationGetTotalAssociationsRequest wlanConfigurationGetTotalAssociationsRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:1#X_AVM-DE_GetIPTVOptimized")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:1#X_AVM-DE_GetIPTVOptimized")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetIpTvOptimizedAsync(WlanConfigurationGetIpTvOptimizedRequest wlanConfigurationGetIpTvOptimizedRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:1#GetStatistics")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:1#GetStatistics")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetStatisticsAsync(WlanConfigurationGetStatisticsRequest wlanConfigurationGetStatisticsRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:1#GetPacketStatistics")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:1#GetPacketStatistics")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetPacketStatisticsAsync(WlanConfigurationGetPacketStatisticsRequest wlanConfigurationGetPacketStatisticsRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:1#X_AVM-DE_GetNightControl")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:1#X_AVM-DE_GetNightControl")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetNightControlAsync(WlanConfigurationGetNightControlRequest wlanConfigurationGetNightControlRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:1#X_AVM-DE_GetWLANHybridMode")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:1#X_AVM-DE_GetWLANHybridMode")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetWlanHybridModeAsync(WlanConfigurationGetWlanHybridModeRequest wlanConfigurationGetWlanHybridModeRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:1#X_AVM-DE_GetWLANExtInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:1#X_AVM-DE_GetWLANExtInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetWlanExtInfoAsync(WlanConfigurationGetWlanExtInfoRequest wlanConfigurationGetWlanExtInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:1#X_AVM-DE_GetWPSInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:1#X_AVM-DE_GetWPSInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetWpsInfoAsync(WlanConfigurationGetWpsInfoRequest wlanConfigurationGetWpsInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:1#X_AVM-DE_GetWLANConnectionInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:1#X_AVM-DE_GetWLANConnectionInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetWlanConnectionInfoAsync(WlanConfigurationGetWlanConnectionInfoRequest wlanConfigurationGetWlanConnectionInfoRequest); } \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/TR-064/Services/WlanConfiguration/IFritzWlanConfiguration2Service.cs b/RS.Fritz.Manager.API/Services/TR-064/Services/WlanConfiguration/IFritzWlanConfiguration2Service.cs index 22812e77..4c133457 100644 --- a/RS.Fritz.Manager.API/Services/TR-064/Services/WlanConfiguration/IFritzWlanConfiguration2Service.cs +++ b/RS.Fritz.Manager.API/Services/TR-064/Services/WlanConfiguration/IFritzWlanConfiguration2Service.cs @@ -1,91 +1,91 @@ namespace RS.Fritz.Manager.API; -[ServiceContract(Namespace = "urn:dslforum-org:service:WLANConfiguration:2")] +[ServiceContract(Namespace = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:2")] [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] internal interface IFritzWlanConfiguration2Service : IAsyncDisposable { - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:2#GetInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:2#GetInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetInfoAsync(WlanConfigurationGetInfoRequest wlanConfigurationGetInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:2#X_AVM-DE_GetWLANDeviceListPath")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:2#X_AVM-DE_GetWLANDeviceListPath")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetWlanDeviceListPathAsync(WlanConfigurationGetWlanDeviceListPathRequest wlanConfigurationGetWlanDeviceListPathRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:2#GetBasBeaconSecurityProperties")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:2#GetBasBeaconSecurityProperties")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetBasBeaconSecurityPropertiesAsync(WlanConfigurationGetBasBeaconSecurityPropertiesRequest wlanConfigurationGetBasBeaconSecurityPropertiesRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:2#GetBSSID")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:2#GetBSSID")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetBssIdAsync(WlanConfigurationGetBssIdRequest wlanConfigurationGetBssIdRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:2#GetSSID")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:2#GetSSID")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetSsIdAsync(WlanConfigurationGetSsIdRequest wlanConfigurationGetSsIdRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:2#GetBeaconType")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:2#GetBeaconType")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetBeaconTypeAsync(WlanConfigurationGetBeaconTypeRequest wlanConfigurationGetBeaconTypeRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:2#GetChannelInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:2#GetChannelInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetChannelInfoAsync(WlanConfigurationGetChannelInfoRequest wlanConfigurationGetChannelInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:2#GetBeaconAdvertisement")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:2#GetBeaconAdvertisement")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetBeaconAdvertisementAsync(WlanConfigurationGetBeaconAdvertisementRequest wlanConfigurationGetBeaconAdvertisementRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:2#GetTotalAssociations")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:2#GetTotalAssociations")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetTotalAssociationsAsync(WlanConfigurationGetTotalAssociationsRequest wlanConfigurationGetTotalAssociationsRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:2#X_AVM-DE_GetIPTVOptimized")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:2#X_AVM-DE_GetIPTVOptimized")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetIpTvOptimizedAsync(WlanConfigurationGetIpTvOptimizedRequest wlanConfigurationGetIpTvOptimizedRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:2#GetStatistics")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:2#GetStatistics")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetStatisticsAsync(WlanConfigurationGetStatisticsRequest wlanConfigurationGetStatisticsRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:2#GetPacketStatistics")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:2#GetPacketStatistics")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetPacketStatisticsAsync(WlanConfigurationGetPacketStatisticsRequest wlanConfigurationGetPacketStatisticsRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:2#X_AVM-DE_GetNightControl")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:2#X_AVM-DE_GetNightControl")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetNightControlAsync(WlanConfigurationGetNightControlRequest wlanConfigurationGetNightControlRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:2#X_AVM-DE_GetWLANHybridMode")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:2#X_AVM-DE_GetWLANHybridMode")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetWlanHybridModeAsync(WlanConfigurationGetWlanHybridModeRequest wlanConfigurationGetWlanHybridModeRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:2#X_AVM-DE_GetWLANExtInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:2#X_AVM-DE_GetWLANExtInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetWlanExtInfoAsync(WlanConfigurationGetWlanExtInfoRequest wlanConfigurationGetWlanExtInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:2#X_AVM-DE_GetWPSInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:2#X_AVM-DE_GetWPSInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetWpsInfoAsync(WlanConfigurationGetWpsInfoRequest wlanConfigurationGetWpsInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:2#X_AVM-DE_GetWLANConnectionInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:2#X_AVM-DE_GetWLANConnectionInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetWlanConnectionInfoAsync(WlanConfigurationGetWlanConnectionInfoRequest wlanConfigurationGetWlanConnectionInfoRequest); } \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/TR-064/Services/WlanConfiguration/IFritzWlanConfiguration3Service.cs b/RS.Fritz.Manager.API/Services/TR-064/Services/WlanConfiguration/IFritzWlanConfiguration3Service.cs index fa06a59f..def20f91 100644 --- a/RS.Fritz.Manager.API/Services/TR-064/Services/WlanConfiguration/IFritzWlanConfiguration3Service.cs +++ b/RS.Fritz.Manager.API/Services/TR-064/Services/WlanConfiguration/IFritzWlanConfiguration3Service.cs @@ -1,91 +1,91 @@ namespace RS.Fritz.Manager.API; -[ServiceContract(Namespace = "urn:dslforum-org:service:WLANConfiguration:3")] +[ServiceContract(Namespace = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:3")] [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] internal interface IFritzWlanConfiguration3Service : IAsyncDisposable { - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:3#GetInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:3#GetInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetInfoAsync(WlanConfigurationGetInfoRequest wlanConfigurationGetInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:3#X_AVM-DE_GetWLANDeviceListPath")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:3#X_AVM-DE_GetWLANDeviceListPath")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetWlanDeviceListPathAsync(WlanConfigurationGetWlanDeviceListPathRequest wlanConfigurationGetWlanDeviceListPathRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:3#GetBasBeaconSecurityProperties")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:3#GetBasBeaconSecurityProperties")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetBasBeaconSecurityPropertiesAsync(WlanConfigurationGetBasBeaconSecurityPropertiesRequest wlanConfigurationGetBasBeaconSecurityPropertiesRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:3#GetBSSID")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:3#GetBSSID")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetBssIdAsync(WlanConfigurationGetBssIdRequest wlanConfigurationGetBssIdRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:3#GetSSID")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:3#GetSSID")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetSsIdAsync(WlanConfigurationGetSsIdRequest wlanConfigurationGetSsIdRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:3#GetBeaconType")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:3#GetBeaconType")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetBeaconTypeAsync(WlanConfigurationGetBeaconTypeRequest wlanConfigurationGetBeaconTypeRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:3#GetChannelInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:3#GetChannelInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetChannelInfoAsync(WlanConfigurationGetChannelInfoRequest wlanConfigurationGetChannelInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:3#GetBeaconAdvertisement")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:3#GetBeaconAdvertisement")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetBeaconAdvertisementAsync(WlanConfigurationGetBeaconAdvertisementRequest wlanConfigurationGetBeaconAdvertisementRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:3#GetTotalAssociations")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:3#GetTotalAssociations")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetTotalAssociationsAsync(WlanConfigurationGetTotalAssociationsRequest wlanConfigurationGetTotalAssociationsRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:3#X_AVM-DE_GetIPTVOptimized")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:3#X_AVM-DE_GetIPTVOptimized")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetIpTvOptimizedAsync(WlanConfigurationGetIpTvOptimizedRequest wlanConfigurationGetIpTvOptimizedRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:3#GetStatistics")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:3#GetStatistics")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetStatisticsAsync(WlanConfigurationGetStatisticsRequest wlanConfigurationGetStatisticsRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:3#GetPacketStatistics")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:3#GetPacketStatistics")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetPacketStatisticsAsync(WlanConfigurationGetPacketStatisticsRequest wlanConfigurationGetPacketStatisticsRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:3#X_AVM-DE_GetNightControl")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:3#X_AVM-DE_GetNightControl")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetNightControlAsync(WlanConfigurationGetNightControlRequest wlanConfigurationGetNightControlRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:3#X_AVM-DE_GetWLANHybridMode")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:3#X_AVM-DE_GetWLANHybridMode")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetWlanHybridModeAsync(WlanConfigurationGetWlanHybridModeRequest wlanConfigurationGetWlanHybridModeRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:3#X_AVM-DE_GetWLANExtInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:3#X_AVM-DE_GetWLANExtInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetWlanExtInfoAsync(WlanConfigurationGetWlanExtInfoRequest wlanConfigurationGetWlanExtInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:3#X_AVM-DE_GetWPSInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:3#X_AVM-DE_GetWPSInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetWpsInfoAsync(WlanConfigurationGetWpsInfoRequest wlanConfigurationGetWpsInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:3#X_AVM-DE_GetWLANConnectionInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:3#X_AVM-DE_GetWLANConnectionInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetWlanConnectionInfoAsync(WlanConfigurationGetWlanConnectionInfoRequest wlanConfigurationGetWlanConnectionInfoRequest); } \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/TR-064/Services/WlanConfiguration/IFritzWlanConfiguration4Service.cs b/RS.Fritz.Manager.API/Services/TR-064/Services/WlanConfiguration/IFritzWlanConfiguration4Service.cs index 86aeeb2c..fd0a5858 100644 --- a/RS.Fritz.Manager.API/Services/TR-064/Services/WlanConfiguration/IFritzWlanConfiguration4Service.cs +++ b/RS.Fritz.Manager.API/Services/TR-064/Services/WlanConfiguration/IFritzWlanConfiguration4Service.cs @@ -1,91 +1,91 @@ namespace RS.Fritz.Manager.API; -[ServiceContract(Namespace = "urn:dslforum-org:service:WLANConfiguration:4")] +[ServiceContract(Namespace = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:4")] [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] internal interface IFritzWlanConfiguration4Service : IAsyncDisposable { - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:4#GetInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:4#GetInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetInfoAsync(WlanConfigurationGetInfoRequest wlanConfigurationGetInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:4#X_AVM-DE_GetWLANDeviceListPath")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:4#X_AVM-DE_GetWLANDeviceListPath")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetWlanDeviceListPathAsync(WlanConfigurationGetWlanDeviceListPathRequest wlanConfigurationGetWlanDeviceListPathRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:4#GetBasBeaconSecurityProperties")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:4#GetBasBeaconSecurityProperties")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetBasBeaconSecurityPropertiesAsync(WlanConfigurationGetBasBeaconSecurityPropertiesRequest wlanConfigurationGetBasBeaconSecurityPropertiesRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:4#GetBSSID")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:4#GetBSSID")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetBssIdAsync(WlanConfigurationGetBssIdRequest wlanConfigurationGetBssIdRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:4#GetSSID")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:4#GetSSID")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetSsIdAsync(WlanConfigurationGetSsIdRequest wlanConfigurationGetSsIdRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:4#GetBeaconType")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:4#GetBeaconType")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetBeaconTypeAsync(WlanConfigurationGetBeaconTypeRequest wlanConfigurationGetBeaconTypeRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:4#GetChannelInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:4#GetChannelInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetChannelInfoAsync(WlanConfigurationGetChannelInfoRequest wlanConfigurationGetChannelInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:4#GetBeaconAdvertisement")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:4#GetBeaconAdvertisement")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetBeaconAdvertisementAsync(WlanConfigurationGetBeaconAdvertisementRequest wlanConfigurationGetBeaconAdvertisementRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:4#GetTotalAssociations")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:4#GetTotalAssociations")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetTotalAssociationsAsync(WlanConfigurationGetTotalAssociationsRequest wlanConfigurationGetTotalAssociationsRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:4#X_AVM-DE_GetIPTVOptimized")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:4#X_AVM-DE_GetIPTVOptimized")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetIpTvOptimizedAsync(WlanConfigurationGetIpTvOptimizedRequest wlanConfigurationGetIpTvOptimizedRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:4#GetStatistics")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:4#GetStatistics")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetStatisticsAsync(WlanConfigurationGetStatisticsRequest wlanConfigurationGetStatisticsRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:4#GetPacketStatistics")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:4#GetPacketStatistics")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetPacketStatisticsAsync(WlanConfigurationGetPacketStatisticsRequest wlanConfigurationGetPacketStatisticsRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:4#X_AVM-DE_GetNightControl")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:4#X_AVM-DE_GetNightControl")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetNightControlAsync(WlanConfigurationGetNightControlRequest wlanConfigurationGetNightControlRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:4#X_AVM-DE_GetWLANHybridMode")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:4#X_AVM-DE_GetWLANHybridMode")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetWlanHybridModeAsync(WlanConfigurationGetWlanHybridModeRequest wlanConfigurationGetWlanHybridModeRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:4#X_AVM-DE_GetWLANExtInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:4#X_AVM-DE_GetWLANExtInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetWlanExtInfoAsync(WlanConfigurationGetWlanExtInfoRequest wlanConfigurationGetWlanExtInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:4#X_AVM-DE_GetWPSInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:4#X_AVM-DE_GetWPSInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetWpsInfoAsync(WlanConfigurationGetWpsInfoRequest wlanConfigurationGetWpsInfoRequest); - [OperationContract(Action = "urn:dslforum-org:service:WLANConfiguration:4#X_AVM-DE_GetWLANConnectionInfo")] - [FaultContract(typeof(UPnPFault1))] - [FaultContract(typeof(UPnPFault2))] + [OperationContract(Action = $"{UPnPConstants.AvmServiceNamespace}:WLANConfiguration:4#X_AVM-DE_GetWLANConnectionInfo")] + [FaultContract(typeof(UPnPFault))] + [FaultContract(typeof(AvmUPnPFault))] Task GetWlanConnectionInfoAsync(WlanConfigurationGetWlanConnectionInfoRequest wlanConfigurationGetWlanConnectionInfoRequest); } \ No newline at end of file diff --git a/RS.Fritz.Manager.API/Services/TR-064/SoapClient/FritzServiceOperationHandler.cs b/RS.Fritz.Manager.API/Services/TR-064/SoapClient/FritzServiceOperationHandler.cs index 1b0d87b6..dfb0be6f 100644 --- a/RS.Fritz.Manager.API/Services/TR-064/SoapClient/FritzServiceOperationHandler.cs +++ b/RS.Fritz.Manager.API/Services/TR-064/SoapClient/FritzServiceOperationHandler.cs @@ -507,7 +507,7 @@ public Task DeviceConfigGetSupportDataIn => ExecuteAsync(GetFritzServiceClient(internetGatewayDevice, fritzDeviceConfigServiceClientFactory, (q, r, t) => new FritzDeviceConfigService(q, r, t!), FritzDeviceConfigService.ControlUrl), q => q.GetSupportDataInfoAsync(default)); private static T GetFritzServiceClient(InternetGatewayDevice internetGatewayDevice, IClientFactory clientFactory, Func createService, string controlUrl, bool secure = true) - => clientFactory.Build(createService, internetGatewayDevice.PreferredLocation, secure, controlUrl, secure ? internetGatewayDevice.SecurityPort : null, internetGatewayDevice.NetworkCredential); + => clientFactory.Build(createService, internetGatewayDevice.PreferredLocation!, secure, controlUrl, secure ? internetGatewayDevice.SecurityPort : null, internetGatewayDevice.NetworkCredential); private static async Task ExecuteAsync(T client, Func> operation) where T : IAsyncDisposable diff --git a/RS.Fritz.Manager.UI/Entities/DeviceLoginInfo.cs b/RS.Fritz.Manager.UI/Entities/DeviceLoginInfo.cs index fb7057b1..20eb42f3 100644 --- a/RS.Fritz.Manager.UI/Entities/DeviceLoginInfo.cs +++ b/RS.Fritz.Manager.UI/Entities/DeviceLoginInfo.cs @@ -1,34 +1,33 @@ namespace RS.Fritz.Manager.UI; using System.Security; +using System.ServiceModel.Security; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Messaging; using CommunityToolkit.Mvvm.Messaging.Messages; internal sealed class DeviceLoginInfo : ObservableRecipient { + private readonly ILogger logger; private ObservableInternetGatewayDevice? internetGatewayDevice; + private InternetGatewayDevice? selectedInternetGatewayDevice; private User? user; private SecureString? password; private bool loginInfoSet; + private bool authenticated; + private WanAccessType? wanAccessType; + private IEnumerable users = []; - public DeviceLoginInfo() + public DeviceLoginInfo(ILogger logger) : base(StrongReferenceMessenger.Default) { IsActive = true; + this.logger = logger; - StrongReferenceMessenger.Default.Register>(this, (r, m) => - { - ((DeviceLoginInfo)r).Receive(m); - }); - StrongReferenceMessenger.Default.Register>(this, (r, m) => - { - ((DeviceLoginInfo)r).Receive(m); - }); - StrongReferenceMessenger.Default.Register>(this, (r, m) => - { - ((DeviceLoginInfo)r).Receive(m); - }); + StrongReferenceMessenger.Default.Register>(this, (r, m) => ((DeviceLoginInfo)r).Receive(m)); + StrongReferenceMessenger.Default.Register>(this, (r, m) => ((DeviceLoginInfo)r).Receive(m)); + StrongReferenceMessenger.Default.Register>(this, (r, m) => ((DeviceLoginInfo)r).Receive(m)); + StrongReferenceMessenger.Default.Register>(this, (r, m) => ((DeviceLoginInfo)r).Receive(m)); } public ObservableInternetGatewayDevice? InternetGatewayDevice @@ -37,6 +36,12 @@ public ObservableInternetGatewayDevice? InternetGatewayDevice set => _ = SetProperty(ref internetGatewayDevice, value, true); } + public InternetGatewayDevice? SelectedInternetGatewayDevice + { + get => selectedInternetGatewayDevice; + set => _ = SetProperty(ref selectedInternetGatewayDevice, value, true); + } + public SecureString? Password { get => password; @@ -55,26 +60,74 @@ public bool LoginInfoSet private set => _ = SetProperty(ref loginInfoSet, value, true); } + public bool Authenticated + { + get => authenticated; + private set => _ = SetProperty(ref authenticated, value, true); + } + + public WanAccessType? WanAccessType + { + get => wanAccessType; + set => _ = SetProperty(ref wanAccessType, value, true); + } + + public IEnumerable Users + { + get => users; + set => _ = SetProperty(ref users, value, true); + } + + // ReSharper disable once AsyncVoidMethod private async void Receive(PropertyChangedMessage message) + { + try + { + if (message.Sender != this) + return; + + switch (message.PropertyName) + { + case nameof(InternetGatewayDevice): + { + if (message.NewValue is null) + { + User = null; + Password = null; + SelectedInternetGatewayDevice = null; + } + else + { + SelectedInternetGatewayDevice = message.NewValue.InternetGatewayDevices.SingleOrDefault(q => q.UniqueServiceName?.Contains(UPnPConstants.InternetGatewayDeviceV1AvmDeviceType, StringComparison.OrdinalIgnoreCase) ?? false) ?? message.NewValue.InternetGatewayDevices.MaxBy(q => q.Version); + + await SelectedInternetGatewayDevice!.InitializeAsync().ConfigureAwait(true); + + Users = SelectedInternetGatewayDevice.Users!; + User = Users.SingleOrDefault(q => q.LastUser); + } + + SetLoginInfo(); + + break; + } + } + } + catch (Exception ex) + { + logger.ExceptionThrown(ex); + } + } + + private void Receive(PropertyChangedMessage message) { if (message.Sender != this) return; switch (message.PropertyName) { - case nameof(InternetGatewayDevice): + case nameof(SelectedInternetGatewayDevice): { - if (message.NewValue is null) - { - User = null; - Password = null; - } - else - { - await message.NewValue.ApiDevice.InitializeAsync().ConfigureAwait(true); - - message.NewValue.Users = message.NewValue.ApiDevice.Users!; - } + Authenticated = false; SetLoginInfo(); @@ -91,8 +144,8 @@ private void Receive(PropertyChangedMessage message) switch (message.PropertyName) { case nameof(Password): - if (InternetGatewayDevice is not null) - InternetGatewayDevice!.ApiDevice.NetworkCredential = new(User?.Name, Password); + if (SelectedInternetGatewayDevice is not null) + SelectedInternetGatewayDevice.NetworkCredential = new(User?.Name, Password); SetLoginInfo(); break; @@ -107,8 +160,8 @@ private void Receive(PropertyChangedMessage message) switch (message.PropertyName) { case nameof(User): - if (InternetGatewayDevice is not null) - InternetGatewayDevice.ApiDevice.NetworkCredential = new(User?.Name, Password); + if (SelectedInternetGatewayDevice is not null) + SelectedInternetGatewayDevice.NetworkCredential = new(User?.Name, Password); SetLoginInfo(); break; @@ -116,5 +169,33 @@ private void Receive(PropertyChangedMessage message) } private void SetLoginInfo() - => LoginInfoSet = InternetGatewayDevice is not null && User is not null && Password is not null; + => LoginInfoSet = SelectedInternetGatewayDevice is not null && User is not null && Password is not null; + + public async ValueTask GetDeviceTypeAsync() + { + WanCommonInterfaceConfigGetCommonLinkPropertiesResponse wanCommonInterfaceConfigGetCommonLinkProperties; + + try + { + wanCommonInterfaceConfigGetCommonLinkProperties = await SelectedInternetGatewayDevice!.WanCommonInterfaceConfigGetCommonLinkPropertiesAsync().ConfigureAwait(true); + } + catch (MessageSecurityException) + { + Authenticated = false; + + throw; + } + + Authenticated = true; + WanAccessType = wanCommonInterfaceConfigGetCommonLinkProperties.WanAccessType switch + { + "DSL" => UI.WanAccessType.Dsl, + "Ethernet" => UI.WanAccessType.Ethernet, + "X_AVM-DE_Fiber" => UI.WanAccessType.Ethernet, + "X_AVM-DE_UMTS" => UI.WanAccessType.Ethernet, + "X_AVM-DE_Cable" => UI.WanAccessType.Ethernet, + "X_AVM-DE_LTE" => UI.WanAccessType.Ethernet, + _ => throw new ArgumentOutOfRangeException(nameof(WanCommonInterfaceConfigGetCommonLinkPropertiesResponse.WanAccessType), wanCommonInterfaceConfigGetCommonLinkProperties.WanAccessType, null) + }; + } } \ No newline at end of file diff --git a/RS.Fritz.Manager.UI/Entities/ObservableInternetGatewayDevice.cs b/RS.Fritz.Manager.UI/Entities/ObservableInternetGatewayDevice.cs index 4ca3174e..dc8017ef 100644 --- a/RS.Fritz.Manager.UI/Entities/ObservableInternetGatewayDevice.cs +++ b/RS.Fritz.Manager.UI/Entities/ObservableInternetGatewayDevice.cs @@ -1,60 +1,32 @@ namespace RS.Fritz.Manager.UI; -using System.ServiceModel.Security; +using System.Collections.ObjectModel; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Messaging; -internal sealed class ObservableInternetGatewayDevice(InternetGatewayDevice internetGatewayDevice) : ObservableRecipient(StrongReferenceMessenger.Default) +internal sealed class ObservableInternetGatewayDevice : ObservableRecipient { - private IEnumerable users = Enumerable.Empty(); - private WanAccessType? wanAccessType; - private bool authenticated; + private readonly ObservableCollection internetGatewayDevices = []; - public InternetGatewayDevice ApiDevice { get; } = internetGatewayDevice; + public ObservableInternetGatewayDevice(GroupedInternetGatewayDevice groupedInternetGatewayDevice) + : base(StrongReferenceMessenger.Default) + => InternetGatewayDevices = new(groupedInternetGatewayDevice.Devices.OrderByDescending(q => q.UniqueServiceName?.Contains(UPnPConstants.InternetGatewayDeviceV1AvmDeviceType, StringComparison.OrdinalIgnoreCase))); - public IEnumerable Users + public ObservableCollection InternetGatewayDevices { - get => users; - set => _ = SetProperty(ref users, value, true); + get => internetGatewayDevices; + private init => SetProperty(ref internetGatewayDevices, value, true); } - public bool Authenticated - { - get => authenticated; - private set => _ = SetProperty(ref authenticated, value, true); - } + public ObservableCollection Servers => new(InternetGatewayDevices.Select(q => q.Server).Distinct().OrderBy(q => q)); - public WanAccessType? WanAccessType - { - get => wanAccessType; - set => _ = SetProperty(ref wanAccessType, value, true); - } + public ObservableCollection Locations => new(InternetGatewayDevices.SelectMany(q => q.Locations ?? []).Distinct().OrderBy(q => q?.AbsoluteUri)); - public async ValueTask GetDeviceTypeAsync() - { - WanCommonInterfaceConfigGetCommonLinkPropertiesResponse wanCommonInterfaceConfigGetCommonLinkProperties; - - try - { - wanCommonInterfaceConfigGetCommonLinkProperties = await ApiDevice.WanCommonInterfaceConfigGetCommonLinkPropertiesAsync().ConfigureAwait(true); - } - catch (MessageSecurityException) - { - Authenticated = false; - - throw; - } - - Authenticated = true; - WanAccessType = wanCommonInterfaceConfigGetCommonLinkProperties.WanAccessType switch - { - "DSL" => UI.WanAccessType.Dsl, - "Ethernet" => UI.WanAccessType.Ethernet, - "X_AVM-DE_Fiber" => UI.WanAccessType.Ethernet, - "X_AVM-DE_UMTS" => UI.WanAccessType.Ethernet, - "X_AVM-DE_Cable" => UI.WanAccessType.Ethernet, - "X_AVM-DE_LTE" => UI.WanAccessType.Ethernet, - _ => throw new ArgumentOutOfRangeException(nameof(WanCommonInterfaceConfigGetCommonLinkPropertiesResponse.WanAccessType), wanCommonInterfaceConfigGetCommonLinkProperties.WanAccessType, null) - }; - } + public ObservableCollection SearchTargets => new(InternetGatewayDevices.Select(q => q.SearchTarget).Distinct().OrderBy(q => q)); + + public ObservableCollection CacheControls => new(InternetGatewayDevices.Select(q => q.CacheControl).Distinct().OrderBy(q => q)); + + public ObservableCollection Exts => new(InternetGatewayDevices.Select(q => q.Ext).Distinct().OrderBy(q => q)); + + public ObservableCollection UniqueServiceNames => new(InternetGatewayDevices.Select(q => q.UniqueServiceName).Distinct().OrderBy(q => q)); } \ No newline at end of file diff --git a/RS.Fritz.Manager.UI/Entities/UserInterfaceCaptureInterface.cs b/RS.Fritz.Manager.UI/Entities/UserInterfaceCaptureInterface.cs index d0bb134c..a175d52a 100644 --- a/RS.Fritz.Manager.UI/Entities/UserInterfaceCaptureInterface.cs +++ b/RS.Fritz.Manager.UI/Entities/UserInterfaceCaptureInterface.cs @@ -2,7 +2,7 @@ using CommunityToolkit.Mvvm.Input; -internal sealed record UserInterfaceCaptureInterface(CaptureInterface CaptureInterface, RelayCommand StartCommand, AsyncRelayCommand StopCommand) +internal sealed record UserInterfaceCaptureInterface(CaptureInterface CaptureInterface, AsyncRelayCommand StartCommand, AsyncRelayCommand StopCommand) { public bool Active { get; set; } } \ No newline at end of file diff --git a/RS.Fritz.Manager.UI/Infrastructure/FritzServiceViewModel.cs b/RS.Fritz.Manager.UI/Infrastructure/FritzServiceViewModel.cs index e06c8758..7d6aeaed 100644 --- a/RS.Fritz.Manager.UI/Infrastructure/FritzServiceViewModel.cs +++ b/RS.Fritz.Manager.UI/Infrastructure/FritzServiceViewModel.cs @@ -1,6 +1,5 @@ namespace RS.Fritz.Manager.UI; -using System.ComponentModel; using System.ServiceModel; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; @@ -22,12 +21,8 @@ protected FritzServiceViewModel(DeviceLoginInfo deviceLoginInfo, ILogger logger, DeviceLoginInfo = deviceLoginInfo; this.requiredServiceType = requiredServiceType; DefaultCommand = new AsyncRelayCommand(ExecuteDefaultCommandAsync, _ => CanExecuteDefaultCommand); - PropertyChanged += FritzServiceViewModelPropertyChanged; - StrongReferenceMessenger.Default.Register>(this, (r, m) => - { - ((FritzServiceViewModel)r).Receive(m); - }); + StrongReferenceMessenger.Default.Register>(this, (r, m) => ((FritzServiceViewModel)r).Receive(m)); } public DeviceLoginInfo DeviceLoginInfo { get; } @@ -39,12 +34,12 @@ public bool DefaultCommandActive get => defaultCommandActive; set { - if (SetProperty(ref defaultCommandActive, value)) + if (SetProperty(ref defaultCommandActive, value, true)) DefaultCommand.NotifyCanExecuteChanged(); } } - protected InternetGatewayDevice ApiDevice => DeviceLoginInfo.InternetGatewayDevice!.ApiDevice; + protected InternetGatewayDevice ApiDevice => DeviceLoginInfo.SelectedInternetGatewayDevice!; protected ILogger Logger { get; } @@ -62,22 +57,23 @@ private set protected virtual void Receive(PropertyChangedMessage message) { - if (message.Sender is DeviceLoginInfo) + if (message.Sender is FritzServiceViewModel) { switch (message.PropertyName) { - case nameof(DeviceLoginInfo.LoginInfoSet): + case nameof(DefaultCommandActive): { UpdateCanExecuteDefaultCommand(); break; } } } - else if (message.Sender == DeviceLoginInfo.InternetGatewayDevice) + else if (message.Sender == DeviceLoginInfo) { switch (message.PropertyName) { - case nameof(DeviceLoginInfo.InternetGatewayDevice.Authenticated): + case nameof(DeviceLoginInfo.LoginInfoSet): + case nameof(DeviceLoginInfo.Authenticated): { UpdateCanExecuteDefaultCommand(); break; @@ -86,24 +82,18 @@ protected virtual void Receive(PropertyChangedMessage message) } } - protected virtual void FritzServiceViewModelPropertyChanged(object? sender, PropertyChangedEventArgs e) - { - switch (e.PropertyName) - { - case nameof(DefaultCommandActive): - { - UpdateCanExecuteDefaultCommand(); - break; - } - } - } - protected virtual bool GetCanExecuteDefaultCommand() - => (DeviceLoginInfo.InternetGatewayDevice?.Authenticated ?? false) && !DefaultCommandActive && (requiredServiceType is null || ApiDevice.Services.Any(r => r.ServiceType.StartsWith(FormattableString.Invariant($"urn:dslforum-org:service:{requiredServiceType}:"), StringComparison.OrdinalIgnoreCase))); + => DeviceLoginInfo.Authenticated && !DefaultCommandActive && (requiredServiceType is null || ApiDevice.Services.Any(r => r.ServiceType.Contains(FormattableString.Invariant($":{requiredServiceType}:"), StringComparison.OrdinalIgnoreCase))); protected void UpdateCanExecuteDefaultCommand() => CanExecuteDefaultCommand = GetCanExecuteDefaultCommand(); + protected void UpdateAndNotifyCanExecuteDefaultCommand() + { + UpdateCanExecuteDefaultCommand(); + DefaultCommand.NotifyCanExecuteChanged(); + } + protected Task> ExecuteApiAsync(Func> operation, IDictionary? errorReasons = null) where T : struct => DoExecuteApiAsync(operation(ApiDevice), errorReasons); @@ -126,11 +116,11 @@ protected void UpdateCanExecuteDefaultCommand() { return new(await operation.ConfigureAwait(true), null); } - catch (FaultException ex) + catch (FaultException ex) { error = new(ex.Detail.ErrorCode, ex.Detail.ErrorDescription); } - catch (FaultException ex) + catch (FaultException ex) { error = new(ex.Detail.ErrorCode, ex.Detail.ErrorDescription); } diff --git a/RS.Fritz.Manager.UI/Infrastructure/NullVisibilityValueConverter.cs b/RS.Fritz.Manager.UI/Infrastructure/NullVisibilityValueConverter.cs new file mode 100644 index 00000000..7bebeb03 --- /dev/null +++ b/RS.Fritz.Manager.UI/Infrastructure/NullVisibilityValueConverter.cs @@ -0,0 +1,14 @@ +namespace RS.Fritz.Manager.UI; + +using System.Globalization; +using System.Windows; +using System.Windows.Data; + +internal sealed class NullVisibilityValueConverter : IValueConverter +{ + public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture) + => value is null ? parameter is string defaultInvisibility ? Enum.Parse(defaultInvisibility) : Visibility.Collapsed : Visibility.Visible; + + public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) + => throw new NotImplementedException(); +} \ No newline at end of file diff --git a/RS.Fritz.Manager.UI/Infrastructure/WanAccessTypeAwareFritzServiceViewModel.cs b/RS.Fritz.Manager.UI/Infrastructure/WanAccessTypeAwareFritzServiceViewModel.cs index 37a6359c..cee659e1 100644 --- a/RS.Fritz.Manager.UI/Infrastructure/WanAccessTypeAwareFritzServiceViewModel.cs +++ b/RS.Fritz.Manager.UI/Infrastructure/WanAccessTypeAwareFritzServiceViewModel.cs @@ -11,23 +11,20 @@ protected WanAccessTypeAwareFritzServiceViewModel(DeviceLoginInfo deviceLoginInf : base(deviceLoginInfo, logger, requiredServiceType) { this.wanAccessType = wanAccessType; - StrongReferenceMessenger.Default.Register>(this, (r, m) => - { - ((WanAccessTypeAwareFritzServiceViewModel)r).Receive(m); - }); + StrongReferenceMessenger.Default.Register>(this, (r, m) => ((WanAccessTypeAwareFritzServiceViewModel)r).Receive(m)); } protected override bool GetCanExecuteDefaultCommand() - => base.GetCanExecuteDefaultCommand() && DeviceLoginInfo.InternetGatewayDevice!.WanAccessType == wanAccessType; + => base.GetCanExecuteDefaultCommand() && DeviceLoginInfo.WanAccessType == wanAccessType; private void Receive(PropertyChangedMessage message) { - if (message.Sender != DeviceLoginInfo.InternetGatewayDevice) + if (message.Sender != DeviceLoginInfo) return; switch (message.PropertyName) { - case nameof(ObservableInternetGatewayDevice.WanAccessType): + case nameof(DeviceLoginInfo.WanAccessType): { UpdateCanExecuteDefaultCommand(); break; diff --git a/RS.Fritz.Manager.UI/MainWindow/MainWindow.xaml b/RS.Fritz.Manager.UI/MainWindow/MainWindow.xaml index 7c38a762..7d8f1be8 100644 --- a/RS.Fritz.Manager.UI/MainWindow/MainWindow.xaml +++ b/RS.Fritz.Manager.UI/MainWindow/MainWindow.xaml @@ -45,7 +45,20 @@ - + + + + + + + + + + + + + + @@ -55,7 +68,7 @@ - + diff --git a/RS.Fritz.Manager.UI/MainWindow/MainWindowViewModel.cs b/RS.Fritz.Manager.UI/MainWindow/MainWindowViewModel.cs index f8d94280..91646e81 100644 --- a/RS.Fritz.Manager.UI/MainWindow/MainWindowViewModel.cs +++ b/RS.Fritz.Manager.UI/MainWindow/MainWindowViewModel.cs @@ -1,7 +1,6 @@ namespace RS.Fritz.Manager.UI; using System.Collections.ObjectModel; -using System.ComponentModel; using System.ServiceModel.Security; using System.Windows; using System.Windows.Media; @@ -20,7 +19,6 @@ internal sealed class MainWindowViewModel : FritzServiceViewModel private readonly IDeviceSearchService deviceSearchService; private ObservableCollection devices = []; - private ObservableCollection users = []; private ObservableObject? activeView; private string? userMessage; private bool deviceAndLoginControlsEnabled = true; @@ -81,22 +79,9 @@ public MainWindowViewModel( CopyMessageCommand = new RelayCommand(ExecuteCopyMessageCommand); CloseMessageCommand = new RelayCommand(ExecuteCloseMessageCommand); - StrongReferenceMessenger.Default.Register(this, (r, m) => - { - ((MainWindowViewModel)r).UserMessage = m.Value.Message; - }); - StrongReferenceMessenger.Default.Register(this, (r, m) => - { - ((MainWindowViewModel)r).ActiveView = m.Value; - }); - StrongReferenceMessenger.Default.Register>>(this, (r, m) => - { - ((MainWindowViewModel)r).Receive(m); - }); - StrongReferenceMessenger.Default.Register>(this, (r, m) => - { - ((MainWindowViewModel)r).Receive(m); - }); + StrongReferenceMessenger.Default.Register(this, (r, m) => ((MainWindowViewModel)r).UserMessage = m.Value.Message); + StrongReferenceMessenger.Default.Register(this, (r, m) => ((MainWindowViewModel)r).ActiveView = m.Value); + StrongReferenceMessenger.Default.Register>(this, (r, m) => ((MainWindowViewModel)r).Receive(m)); UpdateCanExecuteDefaultCommand(); } @@ -184,17 +169,8 @@ private set public bool DeviceAndLoginControlsEnabled { - get => deviceAndLoginControlsEnabled; set => _ = SetProperty(ref deviceAndLoginControlsEnabled, value); - } - - public ObservableCollection Users - { - get => users; - private set - { - if (SetProperty(ref users, value)) - DeviceLoginInfo.User = Users.SingleOrDefault(q => q.LastUser); - } + get => deviceAndLoginControlsEnabled; + set => _ = SetProperty(ref deviceAndLoginControlsEnabled, value); } public ObservableObject? ActiveView @@ -262,37 +238,47 @@ protected override void Receive(PropertyChangedMessage message) { base.Receive(message); - if (message.Sender != DeviceLoginInfo) - return; - - switch (message.PropertyName) + if (message.Sender == this) { - case nameof(DeviceLoginInfo.LoginInfoSet): - { - if (message.NewValue) + switch (message.PropertyName) + { + case nameof(LoginCommandActive): + { UpdateCanExecuteLoginCommand(); - break; - } + break; + } + + case nameof(DefaultCommandActive): + { + DeviceAndLoginControlsEnabled = !DefaultCommandActive; + break; + } + } } - } - - protected override void FritzServiceViewModelPropertyChanged(object? sender, PropertyChangedEventArgs e) - { - base.FritzServiceViewModelPropertyChanged(sender, e); - - switch (e.PropertyName) + else if (message.Sender == DeviceLoginInfo) { - case nameof(LoginCommandActive): - { - UpdateCanExecuteLoginCommand(); - break; - } - - case nameof(DefaultCommandActive): - { - DeviceAndLoginControlsEnabled = !DefaultCommandActive; - break; - } + switch (message.PropertyName) + { + case nameof(DeviceLoginInfo.LoginInfoSet): + { + if (message.NewValue) + UpdateCanExecuteLoginCommand(); + break; + } + + case nameof(DeviceLoginInfo.Authenticated): + { + if (!message.NewValue) + { + ActiveView = DeviceLoginInfo.InternetGatewayDevice; + LoginButtonImage = new BitmapImage(new("pack://application:,,,/Images/Login.png")); + + UpdateCanExecuteLoginCommand(); + } + + break; + } + } } } @@ -300,23 +286,11 @@ protected override async ValueTask DoExecuteDefaultCommandAsync(CancellationToke { ActiveView = null; DeviceLoginInfo.InternetGatewayDevice = null; - Devices = new((await deviceSearchService.GetDevicesAsync(cancellationToken: cancellationToken).ConfigureAwait(true)).Select(q => new ObservableInternetGatewayDevice(q))); + Devices = new((await deviceSearchService.GetInternetGatewayDevicesAsync(cancellationToken: cancellationToken).ConfigureAwait(true)).Select(q => new ObservableInternetGatewayDevice(q))); } protected override bool GetCanExecuteDefaultCommand() => !DefaultCommandActive; - private void Receive(PropertyChangedMessage> message) - { - if (message.Sender != DeviceLoginInfo.InternetGatewayDevice) - return; - - Users = message.PropertyName switch - { - nameof(ObservableInternetGatewayDevice.Users) => new(message.NewValue.OrderByDescending(q => q.LastUser)), - _ => Users - }; - } - private void Receive(PropertyChangedMessage message) { if (message.Sender != DeviceLoginInfo) @@ -336,7 +310,7 @@ private void Receive(PropertyChangedMessage me } private void UpdateCanExecuteLoginCommand() - => CanExecuteLoginCommand = !LoginCommandActive && DeviceLoginInfo.LoginInfoSet; + => CanExecuteLoginCommand = !LoginCommandActive && (DeviceLoginInfo.SelectedInternetGatewayDevice?.SearchTarget?.StartsWith(UPnPConstants.InternetGatewayDeviceAvmNamespace, StringComparison.OrdinalIgnoreCase) ?? false) && DeviceLoginInfo.LoginInfoSet; private async Task ExecuteLoginCommandAsync(bool? showView) { @@ -344,7 +318,7 @@ private async Task ExecuteLoginCommandAsync(bool? showView) { LoginCommandActive = true; - await DeviceLoginInfo.InternetGatewayDevice!.GetDeviceTypeAsync().ConfigureAwait(true); + await DeviceLoginInfo.GetDeviceTypeAsync().ConfigureAwait(true); LoginButtonImage = new BitmapImage(new("pack://application:,,,/Images/Success.png")); } @@ -363,7 +337,7 @@ private async Task ExecuteLoginCommandAsync(bool? showView) } private void ExecuteCopyMessageCommand() - => Clipboard.SetText(UserMessage); + => Clipboard.SetText(UserMessage!); private void ExecuteCloseMessageCommand() => UserMessage = null; diff --git a/RS.Fritz.Manager.UI/RS.Fritz.Manager.UI.csproj b/RS.Fritz.Manager.UI/RS.Fritz.Manager.UI.csproj index da68801a..698eb492 100644 --- a/RS.Fritz.Manager.UI/RS.Fritz.Manager.UI.csproj +++ b/RS.Fritz.Manager.UI/RS.Fritz.Manager.UI.csproj @@ -29,6 +29,7 @@ win-x64;win-arm64 x64;ARM64 app.manifest + true diff --git a/RS.Fritz.Manager.UI/Resources/GeneralResourceDictionary.xaml b/RS.Fritz.Manager.UI/Resources/GeneralResourceDictionary.xaml index 8d2db044..e61844da 100644 --- a/RS.Fritz.Manager.UI/Resources/GeneralResourceDictionary.xaml +++ b/RS.Fritz.Manager.UI/Resources/GeneralResourceDictionary.xaml @@ -76,4 +76,5 @@ + \ No newline at end of file diff --git a/RS.Fritz.Manager.UI/Resources/UPnPResourceDictionary.xaml b/RS.Fritz.Manager.UI/Resources/UPnPResourceDictionary.xaml index 07952dee..98b88bf0 100644 --- a/RS.Fritz.Manager.UI/Resources/UPnPResourceDictionary.xaml +++ b/RS.Fritz.Manager.UI/Resources/UPnPResourceDictionary.xaml @@ -3,21 +3,40 @@ xmlns:api="clr-namespace:RS.Fritz.Manager.API;assembly=RS.Fritz.Manager.API" xmlns:ui="clr-namespace:RS.Fritz.Manager.UI"> - - - - - - - - - - - + + + + + + + + + + + + + + + + + - + @@ -26,10 +45,11 @@ + - + @@ -55,13 +76,15 @@ + - - - + + + + @@ -138,45 +161,48 @@ +