DuplicateAddressDetectionState 列挙体
アセンブリ: System (system.dll 内)

Public Enumeration DuplicateAddressDetectionState

メンバ名 | 説明 | |
---|---|---|
Deprecated | アドレスは有効ですが、リースの有効期間が間もなく終了するので、アプリケーションでは使用しないでください。 | |
Duplicate | アドレスが一意ではありません。このアドレスは、ネットワーク インターフェイスに割り当てないでください。 | |
Invalid | アドレスが有効ではありません。無効なアドレスは、有効期限が切れており、インターフェイスに割り当てられていません。アプリケーションでこのアドレスにデータ パケットを送信しないでください。 | |
Preferred | アドレスは有効で、使用が制限されていません。 | |
Tentative | 重複アドレス検出プロシージャによるアドレスの評価が正常に完了していません。このアドレスはまだ有効ではなく、このアドレス宛てに送信されたパケットは破棄されるため、アプリケーションでこのアドレスを使用しないでください。 |

ネットワーク上のすべてのインターフェイスのアドレスが確実に一意になるようにするには、インターフェイス ホストがユニキャスト アドレスに対して "重複アドレス検出アルゴリズム" を実行する必要があります。このアルゴリズムの目的は、ネットワーク上に一意でないアドレスが存在しないようにすることです。このプロセスは、IETF RFC 1971 で定義されています。
この列挙体は、UnicastIPAddressInformation クラスおよび MulticastIPAddressInformation クラスで使用されます。NetworkInterface オブジェクトのユニキャスト アドレス情報を取得すると、このクラスのインスタンスが返されます。

ユニキャスト アドレス情報を特定するコード例を次に示します。
Public Shared Sub DisplayUnicastAddresses() Console.WriteLine("Unicast Addresses") Dim adapters As NetworkInterface() = NetworkInterface.GetAllNetworkInterfaces() Dim adapter As NetworkInterface For Each adapter In adapters Dim adapterProperties As IPInterfaceProperties = adapter.GetIPProperties() Dim uniCast As UnicastIPAddressInformationCollection = adapterProperties.UnicastAddresses If uniCast.Count > 0 Then Console.WriteLine(adapter.Description) Dim lifeTimeFormat As String = "dddd, MMMM dd, yyyy hh:mm:ss tt" Dim uni As UnicastIPAddressInformation For Each uni In uniCast Dim [when] As DateTime Console.WriteLine(" Unicast Address ......................... : {0}", uni.Address) Console.WriteLine(" Prefix Origin ........................ : {0}", uni.PrefixOrigin) Console.WriteLine(" Suffix Origin ........................ : {0}", uni.SuffixOrigin) Console.WriteLine(" Duplicate Address Detection .......... : {0}", uni.DuplicateAddressDetectionState) ' Format the lifetimes as Sunday, February 16, 2003 11:33:44 PM ' if en-us is the current culture. ' Calculate the date and time at the end of the lifetimes. [when] = DateTime.UtcNow + TimeSpan.FromSeconds(uni.AddressValidLifetime) [when] = [when].ToLocalTime() Console.WriteLine(" Valid Life Time ...................... : {0}", [when].ToString(lifeTimeFormat, System.Globalization.CultureInfo.CurrentCulture)) [when] = DateTime.UtcNow + TimeSpan.FromSeconds(uni.AddressPreferredLifetime) [when] = [when].ToLocalTime() Console.WriteLine(" Preferred life time .................. : {0}", [when].ToString(lifeTimeFormat, System.Globalization.CultureInfo.CurrentCulture)) [when] = DateTime.UtcNow + TimeSpan.FromSeconds(uni.DhcpLeaseLifetime) [when] = [when].ToLocalTime() Console.WriteLine(" DHCP Leased Life Time ................ : {0}", [when].ToString(lifeTimeFormat, System.Globalization.CultureInfo.CurrentCulture)) Next uni Console.WriteLine() End If Next adapter End Sub 'DisplayUnicastAddresses
public static void DisplayUnicastAddresses() { Console.WriteLine("Unicast Addresses"); NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces(); foreach (NetworkInterface adapter in adapters) { IPInterfaceProperties adapterProperties = adapter.GetIPProperties(); UnicastIPAddressInformationCollection uniCast = adapterProperties.UnicastAddresses; if (uniCast.Count >0) { Console.WriteLine(adapter.Description); string lifeTimeFormat = "dddd, MMMM dd, yyyy hh:mm:ss tt"; foreach (UnicastIPAddressInformation uni in uniCast) { DateTime when; Console.WriteLine(" Unicast Address ......................... : {0}", uni.Address); Console.WriteLine(" Prefix Origin ........................ : {0}", uni.PrefixOrigin); Console.WriteLine(" Suffix Origin ........................ : {0}", uni.SuffixOrigin); Console.WriteLine(" Duplicate Address Detection .......... : {0}", uni.DuplicateAddressDetectionState); // Format the lifetimes as Sunday, February 16, 2003 11:33:44 PM // if en-us is the current culture. // Calculate the date and time at the end of the lifetimes. when = DateTime.UtcNow + TimeSpan.FromSeconds(uni.AddressValidLifetime); when = when.ToLocalTime(); Console.WriteLine(" Valid Life Time ...................... : {0}", when.ToString(lifeTimeFormat,System.Globalization.CultureInfo.CurrentCulture) ); when = DateTime.UtcNow + TimeSpan.FromSeconds(uni.AddressPreferredLifetime); when = when.ToLocalTime(); Console.WriteLine(" Preferred life time .................. : {0}", when.ToString(lifeTimeFormat,System.Globalization.CultureInfo.CurrentCulture) ); when = DateTime.UtcNow + TimeSpan.FromSeconds(uni.DhcpLeaseLifetime); when = when.ToLocalTime(); Console.WriteLine(" DHCP Leased Life Time ................ : {0}", when.ToString(lifeTimeFormat,System.Globalization.CultureInfo.CurrentCulture) ); } Console.WriteLine(); } } }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からDuplicateAddressDetectionState 列挙体を検索する場合は、下記のリンクをクリックしてください。

- DuplicateAddressDetectionState 列挙体のページへのリンク