Example #1
0
 internal DhcpClientStateBound(DhcpClient client,
                               IPv4 serverAddress,
                               IPv4 hostAddress,
                               SortedList hostOptions)
     : base(client, "Bound")
 {
     this.serverAddress = serverAddress;
     this.hostAddress   = hostAddress;
     this.hostOptions   = hostOptions;
 }
Example #2
0
 internal DhcpClientStateRequesting(DhcpClient client,
                                    IPv4 serverAddress,
                                    IPv4 offeredAddress,
                                    SortedList offeredOptions)
     : base(client, "Requesting")
 {
     this.serverAddress  = serverAddress;
     this.offeredAddress = offeredAddress;
     this.offeredOptions = offeredOptions;
 }
 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);
 }
 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);
 }
Example #5
0
 internal DhcpClientStateInitialize(DhcpClient client)
     : base(client, "Initialize")
 {
 }
Example #6
0
 internal DhcpClientStateRebinding(DhcpClient client)
     : base(client, "Rebinding")
 {
 }
Example #7
0
 internal DhcpClientStateRenewing(DhcpClient client,
                                  SortedList hostOptions)
     : base(client, "Renewing")
 {
     this.hostOptions = hostOptions;
 }
Example #8
0
 internal DhcpClientState(DhcpClient client, string stateName)
 {
     this.client    = client;
     this.stateName = stateName;
 }
Example #9
0
 internal DhcpClientStateSelecting(DhcpClient client)
     : base(client, "Selecting")
 {
 }