diff options
| author | Erwin de Haan <EraYaN@users.noreply.github.com> | 2019-01-18 16:48:01 +0100 |
|---|---|---|
| committer | Erwin de Haan <EraYaN@users.noreply.github.com> | 2019-01-18 16:48:01 +0100 |
| commit | c1f76eb8ab2c4fe536a9b612d659bf739f0cc7ac (patch) | |
| tree | b78e697ec3676c70a2db5c98ce2a5ea27fdea105 /Mono.Nat | |
| parent | 38f96af079887cce7c38fcde8340fd7c6d1150ad (diff) | |
Reformat JustAMan review pt3 changes
Diffstat (limited to 'Mono.Nat')
| -rw-r--r-- | Mono.Nat/NatProtocol.cs | 1 | ||||
| -rw-r--r-- | Mono.Nat/Pmp/PmpSearcher.cs | 10 | ||||
| -rw-r--r-- | Mono.Nat/Upnp/Messages/Requests/CreatePortMappingMessage.cs | 2 | ||||
| -rw-r--r-- | Mono.Nat/Upnp/UpnpNatDevice.cs | 2 |
4 files changed, 7 insertions, 8 deletions
diff --git a/Mono.Nat/NatProtocol.cs b/Mono.Nat/NatProtocol.cs index a796f9483..2768f133c 100644 --- a/Mono.Nat/NatProtocol.cs +++ b/Mono.Nat/NatProtocol.cs @@ -1,4 +1,3 @@ - namespace Mono.Nat { public enum NatProtocol diff --git a/Mono.Nat/Pmp/PmpSearcher.cs b/Mono.Nat/Pmp/PmpSearcher.cs index cbd0d3686..46c2e9d80 100644 --- a/Mono.Nat/Pmp/PmpSearcher.cs +++ b/Mono.Nat/Pmp/PmpSearcher.cs @@ -85,10 +85,10 @@ namespace Mono.Nat { if (n.OperationalStatus != OperationalStatus.Up && n.OperationalStatus != OperationalStatus.Unknown) continue; - var properties = n.GetIPProperties(); + IPInterfaceProperties properties = n.GetIPProperties(); var gatewayList = new List<IPEndPoint>(); - foreach (var gateway in properties.GatewayAddresses) + foreach (GatewayIPAddressInformation gateway in properties.GatewayAddresses) { if (gateway.Address.AddressFamily == AddressFamily.InterNetwork) { @@ -105,7 +105,7 @@ namespace Mono.Nat gatewayList.Add(new IPEndPoint(gw2, PmpConstants.ServerPort)); } } - foreach (var unicast in properties.UnicastAddresses) + foreach (UnicastIPAddressInformation unicast in properties.UnicastAddresses) { if (/*unicast.DuplicateAddressDetectionState == DuplicateAddressDetectionState.Preferred && unicast.AddressPreferredLifetime != UInt32.MaxValue @@ -150,7 +150,7 @@ namespace Mono.Nat public async void Search() { - foreach (var s in sockets) + foreach (UdpClient s in sockets) { try { @@ -181,7 +181,7 @@ namespace Mono.Nat // The nat-pmp search message. Must be sent to GatewayIP:53531 byte[] buffer = new byte[] { PmpConstants.Version, PmpConstants.OperationCode }; - foreach (var gatewayEndpoint in gatewayLists[client]) + foreach (IPEndPoint gatewayEndpoint in gatewayLists[client]) { await client.SendAsync(buffer, buffer.Length, gatewayEndpoint).ConfigureAwait(false); } diff --git a/Mono.Nat/Upnp/Messages/Requests/CreatePortMappingMessage.cs b/Mono.Nat/Upnp/Messages/Requests/CreatePortMappingMessage.cs index 217095e49..7d6844e32 100644 --- a/Mono.Nat/Upnp/Messages/Requests/CreatePortMappingMessage.cs +++ b/Mono.Nat/Upnp/Messages/Requests/CreatePortMappingMessage.cs @@ -57,7 +57,7 @@ namespace Mono.Nat.Upnp var culture = CultureInfo.InvariantCulture; var builder = new StringBuilder(256); - var writer = CreateWriter(builder); + XmlWriter writer = CreateWriter(builder); WriteFullElement(writer, "NewRemoteHost", string.Empty); WriteFullElement(writer, "NewExternalPort", this.mapping.PublicPort.ToString(culture)); diff --git a/Mono.Nat/Upnp/UpnpNatDevice.cs b/Mono.Nat/Upnp/UpnpNatDevice.cs index 63a28ebdc..fd408ee63 100644 --- a/Mono.Nat/Upnp/UpnpNatDevice.cs +++ b/Mono.Nat/Upnp/UpnpNatDevice.cs @@ -146,7 +146,7 @@ namespace Mono.Nat.Upnp var ns = new XmlNamespaceManager(xmldoc.NameTable); ns.AddNamespace("ns", "urn:schemas-upnp-org:device-1-0"); - var nodes = xmldoc.SelectNodes("//*/ns:serviceList", ns); + XmlNodeList nodes = xmldoc.SelectNodes("//*/ns:serviceList", ns); foreach (XmlNode node in nodes) { |
