mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-24 02:02:29 -04:00
Remove GetMacAddresses from NetworkManager
This commit is contained in:
parent
83b2c47237
commit
d18066f0f2
@ -94,12 +94,6 @@ namespace MediaBrowser.Common.Net
|
|||||||
/// <returns>IP address to use, or loopback address if all else fails.</returns>
|
/// <returns>IP address to use, or loopback address if all else fails.</returns>
|
||||||
string GetBindAddress(string source, out int? port);
|
string GetBindAddress(string source, out int? port);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get a list of all the MAC addresses associated with active interfaces.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>List of MAC addresses.</returns>
|
|
||||||
IReadOnlyList<PhysicalAddress> GetMacAddresses();
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true if the address is part of the user defined LAN.
|
/// Returns true if the address is part of the user defined LAN.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -49,11 +49,6 @@ public class NetworkManager : INetworkManager, IDisposable
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private bool _eventfire;
|
private bool _eventfire;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// List of all interface MAC addresses.
|
|
||||||
/// </summary>
|
|
||||||
private IReadOnlyList<PhysicalAddress> _macAddresses;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Dictionary containing interface addresses and their subnets.
|
/// Dictionary containing interface addresses and their subnets.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -91,7 +86,6 @@ public class NetworkManager : INetworkManager, IDisposable
|
|||||||
_startupConfig = startupConfig;
|
_startupConfig = startupConfig;
|
||||||
_initLock = new();
|
_initLock = new();
|
||||||
_interfaces = new List<IPData>();
|
_interfaces = new List<IPData>();
|
||||||
_macAddresses = new List<PhysicalAddress>();
|
|
||||||
_publishedServerUrls = new List<PublishedServerUriOverride>();
|
_publishedServerUrls = new List<PublishedServerUriOverride>();
|
||||||
_networkEventLock = new();
|
_networkEventLock = new();
|
||||||
_remoteAddressFilter = new List<IPNetwork>();
|
_remoteAddressFilter = new List<IPNetwork>();
|
||||||
@ -215,7 +209,6 @@ public class NetworkManager : INetworkManager, IDisposable
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Generate a list of all the interface ip addresses and submasks where that are in the active/unknown state.
|
/// Generate a list of all the interface ip addresses and submasks where that are in the active/unknown state.
|
||||||
/// Generate a list of all active mac addresses that aren't loopback addresses.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeInterfaces()
|
private void InitializeInterfaces()
|
||||||
{
|
{
|
||||||
@ -224,7 +217,6 @@ public class NetworkManager : INetworkManager, IDisposable
|
|||||||
_logger.LogDebug("Refreshing interfaces.");
|
_logger.LogDebug("Refreshing interfaces.");
|
||||||
|
|
||||||
var interfaces = new List<IPData>();
|
var interfaces = new List<IPData>();
|
||||||
var macAddresses = new List<PhysicalAddress>();
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -236,13 +228,6 @@ public class NetworkManager : INetworkManager, IDisposable
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var ipProperties = adapter.GetIPProperties();
|
var ipProperties = adapter.GetIPProperties();
|
||||||
var mac = adapter.GetPhysicalAddress();
|
|
||||||
|
|
||||||
// Populate MAC list
|
|
||||||
if (adapter.NetworkInterfaceType != NetworkInterfaceType.Loopback && !PhysicalAddress.None.Equals(mac))
|
|
||||||
{
|
|
||||||
macAddresses.Add(mac);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Populate interface list
|
// Populate interface list
|
||||||
foreach (var info in ipProperties.UnicastAddresses)
|
foreach (var info in ipProperties.UnicastAddresses)
|
||||||
@ -302,7 +287,6 @@ public class NetworkManager : INetworkManager, IDisposable
|
|||||||
_logger.LogDebug("Discovered {NumberOfInterfaces} interfaces.", interfaces.Count);
|
_logger.LogDebug("Discovered {NumberOfInterfaces} interfaces.", interfaces.Count);
|
||||||
_logger.LogDebug("Interfaces addresses: {Addresses}", interfaces.OrderByDescending(s => s.AddressFamily == AddressFamily.InterNetwork).Select(s => s.Address.ToString()));
|
_logger.LogDebug("Interfaces addresses: {Addresses}", interfaces.OrderByDescending(s => s.AddressFamily == AddressFamily.InterNetwork).Select(s => s.Address.ToString()));
|
||||||
|
|
||||||
_macAddresses = macAddresses;
|
|
||||||
_interfaces = interfaces;
|
_interfaces = interfaces;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -711,13 +695,6 @@ public class NetworkManager : INetworkManager, IDisposable
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
|
||||||
public IReadOnlyList<PhysicalAddress> GetMacAddresses()
|
|
||||||
{
|
|
||||||
// Populated in construction - so always has values.
|
|
||||||
return _macAddresses;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public IReadOnlyList<IPData> GetLoopbacks()
|
public IReadOnlyList<IPData> GetLoopbacks()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user