Changeset 54499 in vbox
- Timestamp:
- Feb 25, 2015 3:42:17 PM (10 years ago)
- Location:
- trunk/src/VBox/NetworkServices/DHCP
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/NetworkServices/DHCP/Config.cpp
r50587 r54499 74 74 static ConfigurationManager *g_ConfigurationManager = ConfigurationManager::getConfigurationManager(); 75 75 76 static NetworkManager *g_NetworkManager = NetworkManager::getNetworkManager();76 NetworkManager *NetworkManager::g_NetworkManager; 77 77 78 78 bool MACClientMatchCriteria::check(const Client& client) const -
trunk/src/VBox/NetworkServices/DHCP/Config.h
r50587 r54499 517 517 int doReply(const Client& client, const std::vector<RawOption>& extra); 518 518 int processParameterReqList(const Client& client, const uint8_t *pu8ReqList, int cReqList, std::vector<RawOption>& extra); 519 520 private: 521 static NetworkManager *g_NetworkManager; 519 522 520 523 private: -
trunk/src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp
r50587 r54499 130 130 /** Listener for Host DNS changes */ 131 131 ComPtr<NATNetworkListenerImpl> m_vboxListener; 132 133 NetworkManager *m_NetworkManager; 134 132 135 /* 133 136 * We will ignore cmd line parameters IFF there will be some DHCP specific arguments … … 192 195 * Construct a DHCP server with a default configuration. 193 196 */ 194 VBoxNetDhcp::VBoxNetDhcp():VBoxNetBaseService("VBoxNetDhcp", "VBoxNetDhcp") 197 VBoxNetDhcp::VBoxNetDhcp() 198 : VBoxNetBaseService("VBoxNetDhcp", "VBoxNetDhcp"), 199 m_NetworkManager(NULL) 195 200 { 196 201 /* m_enmTrunkType = kIntNetTrunkType_WhateverNone; */ … … 281 286 AssertRCReturn(rc, rc); 282 287 283 NetworkManager *netManager = NetworkManager::getNetworkManager();284 285 netManager->setOurAddress(getIpv4Address());286 netManager->setOurNetmask(getIpv4Netmask());287 netManager->setOurMac(getMacAddress());288 netManager->setService(this);289 290 288 if (isMainNeeded()) 291 289 rc = initWithMain(); 292 290 else 293 291 rc = initNoMain(); 294 295 292 AssertRCReturn(rc, rc); 293 294 m_NetworkManager = NetworkManager::getNetworkManager(); 295 AssertPtrReturn(m_NetworkManager, VERR_INTERNAL_ERROR); 296 297 m_NetworkManager->setOurAddress(getIpv4Address()); 298 m_NetworkManager->setOurNetmask(getIpv4Netmask()); 299 m_NetworkManager->setOurMac(getMacAddress()); 300 m_NetworkManager->setService(this); 296 301 297 302 return VINF_SUCCESS; … … 338 343 if (pDhcpMsg->bp_op == RTNETBOOTP_OP_REQUEST) 339 344 { 340 NetworkManager *networkManager = NetworkManager::getNetworkManager();345 AssertPtrReturn(m_NetworkManager, false); 341 346 342 347 switch (uMsgType) 343 348 { 344 349 case RTNET_DHCP_MT_DISCOVER: 345 return networkManager->handleDhcpReqDiscover(pDhcpMsg, cb);350 return m_NetworkManager->handleDhcpReqDiscover(pDhcpMsg, cb); 346 351 347 352 case RTNET_DHCP_MT_REQUEST: 348 return networkManager->handleDhcpReqRequest(pDhcpMsg, cb);353 return m_NetworkManager->handleDhcpReqRequest(pDhcpMsg, cb); 349 354 350 355 case RTNET_DHCP_MT_DECLINE: 351 return networkManager->handleDhcpReqDecline(pDhcpMsg, cb);356 return m_NetworkManager->handleDhcpReqDecline(pDhcpMsg, cb); 352 357 353 358 case RTNET_DHCP_MT_RELEASE: 354 return networkManager->handleDhcpReqRelease(pDhcpMsg, cb);359 return m_NetworkManager->handleDhcpReqRelease(pDhcpMsg, cb); 355 360 356 361 case RTNET_DHCP_MT_INFORM:
Note:
See TracChangeset
for help on using the changeset viewer.