System.Net.NetworkInformation.LinuxNetworkInterface.GetOperationalStatus C# (CSharp) Method

GetOperationalStatus() private static method

private static GetOperationalStatus ( string name ) : OperationalStatus
name string
return OperationalStatus
        private static OperationalStatus GetOperationalStatus(string name)
        {
            // /sys/class/net/<name>/operstate
            string path = Path.Combine(NetworkFiles.SysClassNetFolder, name, NetworkFiles.OperstateFileName);
            if (File.Exists(path))
            {
                try
                {
                    string state = File.ReadAllText(path).Trim();
                    return MapState(state);
                }
                catch (Exception) // Ignore any problems accessing or parsing the file.
                {
                }
            }

            return OperationalStatus.Unknown;
        }