mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 01:24:44 +01:00
Fix namespacing so it lines up properly with file names and paths (#715)
* Fix stupid namespacing so it lines up properly with file names and paths.
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
|
||||
namespace System.Net
|
||||
namespace Emby.Server.Implementations.Networking.IPNetwork
|
||||
{
|
||||
using System;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods to convert <see cref="BigInteger"/>
|
||||
/// instances to hexadecimal, octal, and binary strings.
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Numerics;
|
||||
|
||||
namespace System.Net
|
||||
namespace Emby.Server.Implementations.Networking.IPNetwork
|
||||
{
|
||||
public class IPAddressCollection : IEnumerable<IPAddress>, IEnumerator<IPAddress>
|
||||
{
|
||||
@@ -29,7 +31,7 @@ namespace System.Net
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(i));
|
||||
}
|
||||
byte width = this._ipnetwork.AddressFamily == Sockets.AddressFamily.InterNetwork ? (byte)32 : (byte)128;
|
||||
byte width = this._ipnetwork.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork ? (byte)32 : (byte)128;
|
||||
var ipn = this._ipnetwork.Subnet(width);
|
||||
return ipn[i].Network;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Numerics;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace System.Net
|
||||
namespace Emby.Server.Implementations.Networking.IPNetwork
|
||||
{
|
||||
/// <summary>
|
||||
/// IP Network utility class.
|
||||
@@ -60,7 +62,7 @@ namespace System.Net
|
||||
get
|
||||
{
|
||||
|
||||
int width = this._family == Sockets.AddressFamily.InterNetwork ? 4 : 16;
|
||||
int width = this._family == System.Net.Sockets.AddressFamily.InterNetwork ? 4 : 16;
|
||||
var uintBroadcast = this._network + this._netmask.PositiveReverse(width);
|
||||
return uintBroadcast;
|
||||
}
|
||||
@@ -73,7 +75,7 @@ namespace System.Net
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this._family == Sockets.AddressFamily.InterNetworkV6)
|
||||
if (this._family == System.Net.Sockets.AddressFamily.InterNetworkV6)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -88,7 +90,7 @@ namespace System.Net
|
||||
{
|
||||
get
|
||||
{
|
||||
var fisrt = this._family == Sockets.AddressFamily.InterNetworkV6
|
||||
var fisrt = this._family == System.Net.Sockets.AddressFamily.InterNetworkV6
|
||||
? this._network
|
||||
: (this.Usable <= 0) ? this._network : this._network + 1;
|
||||
return IPNetwork.ToIPAddress(fisrt, this._family);
|
||||
@@ -102,7 +104,7 @@ namespace System.Net
|
||||
{
|
||||
get
|
||||
{
|
||||
var last = this._family == Sockets.AddressFamily.InterNetworkV6
|
||||
var last = this._family == System.Net.Sockets.AddressFamily.InterNetworkV6
|
||||
? this._broadcast
|
||||
: (this.Usable <= 0) ? this._network : this._broadcast - 1;
|
||||
return IPNetwork.ToIPAddress(last, this._family);
|
||||
@@ -117,7 +119,7 @@ namespace System.Net
|
||||
get
|
||||
{
|
||||
|
||||
if (this._family == Sockets.AddressFamily.InterNetworkV6)
|
||||
if (this._family == System.Net.Sockets.AddressFamily.InterNetworkV6)
|
||||
{
|
||||
return this.Total;
|
||||
}
|
||||
@@ -136,7 +138,7 @@ namespace System.Net
|
||||
get
|
||||
{
|
||||
|
||||
int max = this._family == Sockets.AddressFamily.InterNetwork ? 32 : 128;
|
||||
int max = this._family == System.Net.Sockets.AddressFamily.InterNetwork ? 32 : 128;
|
||||
var count = BigInteger.Pow(2, (max - _cidr));
|
||||
return count;
|
||||
}
|
||||
@@ -161,7 +163,7 @@ namespace System.Net
|
||||
IPNetwork(BigInteger ipaddress, AddressFamily family, byte cidr)
|
||||
{
|
||||
|
||||
int maxCidr = family == Sockets.AddressFamily.InterNetwork ? 32 : 128;
|
||||
int maxCidr = family == System.Net.Sockets.AddressFamily.InterNetwork ? 32 : 128;
|
||||
if (cidr > maxCidr)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(cidr));
|
||||
@@ -930,7 +932,7 @@ namespace System.Net
|
||||
/// return;
|
||||
/// }
|
||||
|
||||
int maxCidr = family == Sockets.AddressFamily.InterNetwork ? 32 : 128;
|
||||
int maxCidr = family == System.Net.Sockets.AddressFamily.InterNetwork ? 32 : 128;
|
||||
if (cidr > maxCidr)
|
||||
{
|
||||
if (tryParse == false)
|
||||
@@ -1303,7 +1305,7 @@ namespace System.Net
|
||||
return;
|
||||
}
|
||||
|
||||
int maxCidr = network._family == Sockets.AddressFamily.InterNetwork ? 32 : 128;
|
||||
int maxCidr = network._family == System.Net.Sockets.AddressFamily.InterNetwork ? 32 : 128;
|
||||
if (cidr > maxCidr)
|
||||
{
|
||||
if (trySubnet == false)
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
|
||||
namespace System.Net
|
||||
namespace Emby.Server.Implementations.Networking.IPNetwork
|
||||
{
|
||||
public class IPNetworkCollection : IEnumerable<IPNetwork>, IEnumerator<IPNetwork>
|
||||
{
|
||||
@@ -25,7 +26,7 @@ namespace System.Net
|
||||
IPNetworkCollection(IPNetwork ipnetwork, byte cidrSubnet)
|
||||
{
|
||||
|
||||
int maxCidr = ipnetwork.AddressFamily == Sockets.AddressFamily.InterNetwork ? 32 : 128;
|
||||
int maxCidr = ipnetwork.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork ? 32 : 128;
|
||||
if (cidrSubnet > maxCidr)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(cidrSubnet));
|
||||
@@ -61,7 +62,7 @@ namespace System.Net
|
||||
throw new ArgumentOutOfRangeException(nameof(i));
|
||||
}
|
||||
|
||||
var last = this._ipnetwork.AddressFamily == Sockets.AddressFamily.InterNetworkV6
|
||||
var last = this._ipnetwork.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6
|
||||
? this._lastUsable : this._broadcast;
|
||||
var increment = (last - this._network) / this.Count;
|
||||
var uintNetwork = this._network + ((increment + 1) * i);
|
||||
|
||||
Reference in New Issue
Block a user