mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-24 09:44:47 +03:00
Add GPL modules
This commit is contained in:
37
MediaBrowser.Model/Net/IpAddressInfo.cs
Normal file
37
MediaBrowser.Model/Net/IpAddressInfo.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
|
||||
namespace MediaBrowser.Model.Net
|
||||
{
|
||||
public class IpAddressInfo
|
||||
{
|
||||
public static IpAddressInfo Any = new IpAddressInfo("0.0.0.0", IpAddressFamily.InterNetwork);
|
||||
public static IpAddressInfo IPv6Any = new IpAddressInfo("00000000000000000000", IpAddressFamily.InterNetworkV6);
|
||||
public static IpAddressInfo Loopback = new IpAddressInfo("127.0.0.1", IpAddressFamily.InterNetwork);
|
||||
public static IpAddressInfo IPv6Loopback = new IpAddressInfo("::1", IpAddressFamily.InterNetworkV6);
|
||||
|
||||
public string Address { get; set; }
|
||||
public IpAddressFamily AddressFamily { get; set; }
|
||||
|
||||
public IpAddressInfo(string address, IpAddressFamily addressFamily)
|
||||
{
|
||||
Address = address;
|
||||
AddressFamily = addressFamily;
|
||||
}
|
||||
|
||||
public bool Equals(IpAddressInfo address)
|
||||
{
|
||||
return string.Equals(address.Address, Address, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public override String ToString()
|
||||
{
|
||||
return Address;
|
||||
}
|
||||
}
|
||||
|
||||
public enum IpAddressFamily
|
||||
{
|
||||
InterNetwork,
|
||||
InterNetworkV6
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user