- Timestamp:
- Dec 9, 2013 12:14:01 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp
r49827 r49837 86 86 * DHCP server instance. 87 87 */ 88 class VBoxNetDhcp: public VBoxNetBaseService 88 class VBoxNetDhcp: public VBoxNetBaseService, public NATNetworkEventAdapter 89 89 { 90 90 public: … … 109 109 int initNoMain(); 110 110 int initWithMain(); 111 HRESULT HandleEvent(VBoxEventType_T aEventType, IEvent *pEvent); 111 112 int fetchAndUpdateDnsInfo(); 112 113 … … 128 129 ComPtr<INATNetwork> m_NATNetwork; 129 130 131 /** Listener for Host DNS changes */ 132 ComPtr<NATNetworkListenerImpl> m_vboxListener; 130 133 /* 131 134 * We will ignore cmd line parameters IFF there will be some DHCP specific arguments … … 502 505 AssertMsgRCReturn(rc, ("Wasn't able to fetch Dns info"), rc); 503 506 507 ComEventTypeArray aVBoxEvents; 508 aVBoxEvents.push_back(VBoxEventType_OnHostNameResolutionConfigurationChange); 509 rc = createNatListener(m_vboxListener, virtualbox, this, aVBoxEvents); 510 AssertRCReturn(rc, rc); 511 504 512 com::Bstr strUpperIp, strLowerIp; 505 513 … … 510 518 AssertComRCReturn(hrc, VERR_INTERNAL_ERROR); 511 519 RTNetStrToIPv4Addr(com::Utf8Str(strUpperIp).c_str(), &UpperAddress); 512 513 520 514 521 hrc = m_DhcpServer->COMGETTER(LowerIP)(strLowerIp.asOutParam()); … … 572 579 573 580 return VINF_SUCCESS; 581 } 582 583 584 HRESULT VBoxNetDhcp::HandleEvent(VBoxEventType_T aEventType, IEvent *pEvent) 585 { 586 switch(aEventType) 587 { 588 case VBoxEventType_OnHostNameResolutionConfigurationChange: 589 fetchAndUpdateDnsInfo(); 590 break; 591 } 592 593 return S_OK; 574 594 } 575 595
Note:
See TracChangeset
for help on using the changeset viewer.