示例#1
0
 internal DhcpClientStateBound(DhcpClient client,
                               IPv4 serverAddress,
                               IPv4 hostAddress,
                               SortedList hostOptions)
     : base(client, "Bound")
 {
     this.serverAddress = serverAddress;
     this.hostAddress   = hostAddress;
     this.hostOptions   = hostOptions;
 }
示例#2
0
 internal DhcpClientStateRequesting(DhcpClient client,
                                    IPv4 serverAddress,
                                    IPv4 offeredAddress,
                                    SortedList offeredOptions)
     : base(client, "Requesting")
 {
     this.serverAddress  = serverAddress;
     this.offeredAddress = offeredAddress;
     this.offeredOptions = offeredOptions;
 }
示例#3
0
 public bool StopDhcp(IAdapter adapter)
 {
     using (dhcpClientsLock.Lock()) {
         for (int i = 0; i < dhcpClients.Count; i++)
         {
             DhcpClient client = (DhcpClient)dhcpClients[i];
             if (client.Adapter == adapter)
             {
                 client.Stop();
                 dhcpClients.RemoveAt(i);
                 return(true);
             }
         }
     }
     return(false);
 }
示例#4
0
 public bool StartDhcp(IAdapter adapter)
 {
     using (dhcpClientsLock.Lock()) {
         foreach (DhcpClient client in dhcpClients)
         {
             if (client.Adapter == adapter)
             {
                 return(false);
             }
         }
         DhcpClient dc = new DhcpClient(adapter);
         dc.Start();
         dhcpClients.Add(dc);
     }
     return(true);
 }
示例#5
0
 internal DhcpClientStateInitialize(DhcpClient client)
     : base(client, "Initialize")
 {
 }
示例#6
0
 internal DhcpClientStateRebinding(DhcpClient client)
     : base(client, "Rebinding")
 {
 }
示例#7
0
 internal DhcpClientStateRenewing(DhcpClient client,
                                  SortedList hostOptions)
     : base(client, "Renewing")
 {
     this.hostOptions = hostOptions;
 }
示例#8
0
 internal DhcpClientState(DhcpClient client, string stateName)
 {
     this.client    = client;
     this.stateName = stateName;
 }
示例#9
0
 internal DhcpClientStateSelecting(DhcpClient client)
     : base(client, "Selecting")
 {
 }