VirtualBox

Changeset 49826 in vbox for trunk/src


Ignore:
Timestamp:
Dec 9, 2013 9:21:41 AM (11 years ago)
Author:
vboxsync
Message:

VBoxNetDHCP: usage of exported functions.

File:
1 edited

Legend:

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

    r49824 r49826  
    480480    std::string networkName = getNetwork();
    481481
    482     HRESULT hrc = virtualbox->FindDHCPServerByNetworkName(com::Bstr(networkName.c_str()).raw(),
    483                                                           m_DhcpServer.asOutParam());
    484     AssertComRCReturn(hrc, VERR_INTERNAL_ERROR);
    485 
    486     hrc = virtualbox->FindNATNetworkByName(com::Bstr(networkName.c_str()).raw(),
    487                                            m_NATNetwork.asOutParam());
    488 
    489     BOOL fNeedDhcpServer = false;
    490     if (FAILED(m_NATNetwork->COMGETTER(NeedDhcpServer)(&fNeedDhcpServer)))
    491         return VERR_INTERNAL_ERROR;
    492 
     482    int rc = findDhcpServer(virtualbox, networkName, m_DhcpServer);
     483    AssertRCReturn(rc, rc);
     484
     485    rc = findNatNetwork(virtualbox, networkName, m_NATNetwork);
     486    AssertRCReturn(rc, rc);
     487
     488    BOOL fNeedDhcpServer = isDhcpRequired(m_NATNetwork);
    493489    if (!fNeedDhcpServer)
    494490        return VERR_CANCELLED;
     
    496492    RTNETADDRIPV4 gateway;
    497493    com::Bstr strGateway;
    498 
    499     hrc = m_NATNetwork->COMGETTER(Gateway)(strGateway.asOutParam());
     494    HRESULT hrc = m_NATNetwork->COMGETTER(Gateway)(strGateway.asOutParam());
    500495    AssertComRCReturn(hrc, VERR_INTERNAL_ERROR);
    501496    RTNetStrToIPv4Addr(com::Utf8Str(strGateway).c_str(), &gateway);
     
    505500    confManager->addToAddressList(RTNET_DHCP_OPT_ROUTERS, gateway);
    506501
    507     int rc = fetchAndUpdateDnsInfo();
     502    rc = fetchAndUpdateDnsInfo();
    508503    AssertMsgRCReturn(rc, ("Wasn't able to fetch Dns info"), rc);
    509504
Note: See TracChangeset for help on using the changeset viewer.

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