Changeset 49561 in vbox
- Timestamp:
- Nov 20, 2013 5:37:41 AM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 90755
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp
r49558 r49561 153 153 /** @} */ 154 154 }; 155 #if 0156 /* 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 #endif162 155 163 156 /******************************************************************************* … … 176 169 { "--upper-ip", 'u', RTGETOPT_REQ_IPV4ADDR }, 177 170 }; 178 179 #if 0180 /* 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 a221 * 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 this235 * method will work for reusing RELEASEd leases when the client comes back after236 * a reboot or ipconfig /renew. Callers not interested in info on released237 * leases should check the state first.238 *239 * @returns true if expired, false if not.240 */241 bool VBoxNetDhcpLease::hasExpired() const242 {243 RTTIMESPEC Now;244 return RTTimeSpecGetSeconds(&m_ExpireTime) > RTTimeSpecGetSeconds(RTTimeNow(&Now));245 }246 #endif247 171 248 172 /**
Note:
See TracChangeset
for help on using the changeset viewer.