Changeset 87695 in vbox for trunk/src/VBox/NetworkServices
- Timestamp:
- Feb 10, 2021 5:10:05 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/NetworkServices/NetLib/utils.h
r84364 r87695 37 37 typedef std::vector<RTNETADDRIPV4> AddressList; 38 38 typedef std::map<RTNETADDRIPV4, int> AddressToOffsetMapping; 39 40 41 inline bool isDhcpRequired(const ComNatPtr& nat)42 {43 BOOL fNeedDhcpServer = false;44 if (FAILED(nat->COMGETTER(NeedDhcpServer)(&fNeedDhcpServer)))45 return false;46 47 return RT_BOOL(fNeedDhcpServer);48 }49 50 51 inline int findDhcpServer(const ComVirtualBoxPtr& vbox, const std::string& name, ComDhcpServerPtr& dhcp)52 {53 HRESULT hrc = vbox->FindDHCPServerByNetworkName(com::Bstr(name.c_str()).raw(),54 dhcp.asOutParam());55 AssertComRCReturn(hrc, VERR_NOT_FOUND);56 57 return VINF_SUCCESS;58 }59 60 61 inline int findNatNetwork(const ComVirtualBoxPtr& vbox, const std::string& name, ComNatPtr& nat)62 {63 HRESULT hrc = vbox->FindNATNetworkByName(com::Bstr(name.c_str()).raw(),64 nat.asOutParam());65 66 AssertComRCReturn(hrc, VERR_NOT_FOUND);67 68 return VINF_SUCCESS;69 }70 39 71 40
Note:
See TracChangeset
for help on using the changeset viewer.