5e51f77955856516645bade5bd68a5bef1be13e9
[mono.git] / mcs / class / referencesource / System / net / System / Net / NetworkInformation / SystemIPAddressInformation.cs
1
2     /// <summary><para>
3     ///    Provides support for ip configuation information and statistics.
4     ///</para></summary>
5     ///
6 namespace System.Net.NetworkInformation {
7
8     using System.Net;
9     using System.Net.Sockets;
10     using System;
11     using System.Runtime.InteropServices;
12     using System.Collections;
13     using System.ComponentModel;
14     using System.Security.Permissions;
15     using Microsoft.Win32;
16
17
18
19     //this is the main addressinformation class that contains the ipaddress
20     //and other properties
21     internal class SystemIPAddressInformation:IPAddressInformation{
22
23         IPAddress address;
24         internal bool transient = false;
25         internal bool dnsEligible = true;
26
27         internal SystemIPAddressInformation(IPAddress address, AdapterAddressFlags flags) {
28             this.address = address;
29             transient = (flags & AdapterAddressFlags.Transient) > 0;
30             dnsEligible = (flags & AdapterAddressFlags.DnsEligible) > 0;
31         }
32
33         public override IPAddress Address{get {return address;}}
34
35         /// <summary>The address is a cluster address and shouldn't be used by most applications.</summary>
36         public override bool IsTransient{
37             get {
38                 return (transient);
39             }
40         }
41
42         /// <summary>This address can be used for DNS.</summary>
43         public override bool IsDnsEligible{
44             get {
45                 return (dnsEligible);
46             }
47         }
48     }
49 }
50