VirtualBox

Changeset 49561 in vbox


Ignore:
Timestamp:
Nov 20, 2013 5:37:41 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
90755
Message:

VBoxNetDHCP: g/c removed #if 0/endif.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp

    r49558 r49561  
    153153    /** @} */
    154154};
    155 #if 0
    156 /* XXX: clean up it. */
    157 typedef std::vector<VBoxNetDhcpLease> DhcpLeaseContainer;
    158 typedef DhcpLeaseContainer::iterator DhcpLeaseIterator;
    159 typedef DhcpLeaseContainer::reverse_iterator DhcpLeaseRIterator;
    160 typedef DhcpLeaseContainer::const_iterator DhcpLeaseCIterator;
    161 #endif
    162155
    163156/*******************************************************************************
     
    176169  { "--upper-ip",       'u',   RTGETOPT_REQ_IPV4ADDR },
    177170};
    178 
    179 #if 0
    180 /* XXX this will gone */
    181 /**
    182  * Offer this lease to a client.
    183  *
    184  * @param   xid             The transaction ID.
    185  */
    186 void VBoxNetDhcpLease::offer(uint32_t xid)
    187 {
    188     m_enmState = kState_Offer;
    189     m_xid = xid;
    190     RTTimeNow(&m_ExpireTime);
    191     RTTimeSpecAddSeconds(&m_ExpireTime, 60);
    192 }
    193 
    194 
    195 /**
    196  * Activate this lease (i.e. a client is now using it).
    197  */
    198 void VBoxNetDhcpLease::activate(void)
    199 {
    200     m_enmState = kState_Active;
    201     RTTimeNow(&m_ExpireTime);
    202     RTTimeSpecAddSeconds(&m_ExpireTime, m_pCfg ? m_pCfg->m_cSecLease : 60); /* m_pCfg can be NULL right now... */
    203 }
    204 
    205 
    206 /**
    207  * Activate this lease with a new transaction ID.
    208  *
    209  * @param   xid     The transaction ID.
    210  * @todo    check if this is really necessary.
    211  */
    212 void VBoxNetDhcpLease::activate(uint32_t xid)
    213 {
    214     activate();
    215     m_xid = xid;
    216 }
    217 
    218 
    219 /**
    220  * Release a lease either upon client request or because it didn't quite match a
    221  * DHCP_REQUEST.
    222  */
    223 void VBoxNetDhcpLease::release(void)
    224 {
    225     m_enmState = kState_Free;
    226     RTTimeNow(&m_ExpireTime);
    227     RTTimeSpecAddSeconds(&m_ExpireTime, 5);
    228 }
    229 
    230 
    231 /**
    232  * Checks if the lease has expired or not.
    233  *
    234  * This just checks the expiration time not the state. This is so that this
    235  * method will work for reusing RELEASEd leases when the client comes back after
    236  * a reboot or ipconfig /renew. Callers not interested in info on released
    237  * leases should check the state first.
    238  *
    239  * @returns true if expired, false if not.
    240  */
    241 bool VBoxNetDhcpLease::hasExpired() const
    242 {
    243     RTTIMESPEC Now;
    244     return RTTimeSpecGetSeconds(&m_ExpireTime) > RTTimeSpecGetSeconds(RTTimeNow(&Now));
    245 }
    246 #endif
    247171
    248172/**
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette