diff -pru VirtualBox-6.1.26.orig/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp VirtualBox-6.1.26/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp
|
old
|
new
|
static HRESULT listNetworkInterfaces(con
|
| 182 | 182 | BOOL fWireless = FALSE; |
| 183 | 183 | networkInterface->COMGETTER(Wireless)(&fWireless); |
| 184 | 184 | RTPrintf("Wireless: %s\n", fWireless ? "Yes" : "No"); |
| | 185 | BOOL fMaster = FALSE; |
| | 186 | networkInterface->COMGETTER(Master)(&fMaster); |
| | 187 | RTPrintf("Master: %s\n", fMaster ? "Yes" : "No"); |
| 185 | 188 | HostNetworkInterfaceStatus_T Status; |
| 186 | 189 | networkInterface->COMGETTER(Status)(&Status); |
| 187 | 190 | RTPrintf("Status: %s\n", getHostIfStatusText(Status)); |
diff -pru VirtualBox-6.1.26.orig/src/VBox/Main/idl/VirtualBox.xidl VirtualBox-6.1.26/src/VBox/Main/idl/VirtualBox.xidl
|
old
|
new
|
|
| 10145 | 10145 | <desc>Specifies whether the interface is wireless.</desc> |
| 10146 | 10146 | </attribute> |
| 10147 | 10147 | |
| | 10148 | <attribute name="master" type="boolean" readonly="yes"> |
| | 10149 | <desc>Specifies whether the interface is a master device.</desc> |
| | 10150 | </attribute> |
| | 10151 | |
| 10148 | 10152 | <method name="enableStaticIPConfig"> |
| 10149 | 10153 | <desc>sets and enables the static IP V4 configuration for the given interface.</desc> |
| 10150 | 10154 | <param name="IPAddress" type="wstring" dir="in"> |
diff -pru VirtualBox-6.1.26.orig/src/VBox/Main/include/HostNetworkInterfaceImpl.h VirtualBox-6.1.26/src/VBox/Main/include/HostNetworkInterfaceImpl.h
|
old
|
new
|
private:
|
| 76 | 76 | HRESULT getInterfaceType(HostNetworkInterfaceType_T *aType); |
| 77 | 77 | HRESULT getNetworkName(com::Utf8Str &aNetworkName); |
| 78 | 78 | HRESULT getWireless(BOOL *aWireless); |
| | 79 | HRESULT getMaster(BOOL *aMaster); |
| 79 | 80 | |
| 80 | 81 | // Wrapped IHostNetworkInterface methods |
| 81 | 82 | HRESULT enableStaticIPConfig(const com::Utf8Str &aIPAddress, |
| … |
… |
private:
|
| 125 | 126 | HostNetworkInterfaceStatus_T status; |
| 126 | 127 | ULONG speedMbits; |
| 127 | 128 | BOOL wireless; |
| | 129 | BOOL master; |
| 128 | 130 | } m; |
| 129 | 131 | |
| 130 | 132 | }; |
diff -pru VirtualBox-6.1.26.orig/src/VBox/Main/include/netif.h VirtualBox-6.1.26/src/VBox/Main/include/netif.h
|
old
|
new
|
typedef struct NETIFINFO
|
| 77 | 77 | BOOL fDhcpEnabled; |
| 78 | 78 | BOOL fIsDefault; |
| 79 | 79 | BOOL fWireless; |
| | 80 | BOOL fMaster; |
| 80 | 81 | RTMAC MACAddress; |
| 81 | 82 | NETIFTYPE enmMediumType; |
| 82 | 83 | NETIFSTATUS enmStatus; |
diff -pru VirtualBox-6.1.26.orig/src/VBox/Main/src-client/ConsoleImpl2.cpp VirtualBox-6.1.26/src/VBox/Main/src-client/ConsoleImpl2.cpp
|
old
|
new
|
int Console::i_configNetwork(const char
|
| 5596 | 5596 | trunkName = Bstr(pszTrunk); |
| 5597 | 5597 | trunkType = Bstr(TRUNKTYPE_NETFLT); |
| 5598 | 5598 | |
| 5599 | | BOOL fSharedMacOnWire = false; |
| 5600 | | hrc = hostInterface->COMGETTER(Wireless)(&fSharedMacOnWire); |
| | 5599 | BOOL fSharedMacOnWire; |
| | 5600 | BOOL fWireless; |
| | 5601 | BOOL fMaster; |
| | 5602 | hrc = hostInterface->COMGETTER(Wireless)(&fWireless); |
| 5601 | 5603 | if (FAILED(hrc)) |
| 5602 | 5604 | { |
| | 5605 | fWireless = false; |
| 5603 | 5606 | LogRel(("NetworkAttachmentType_Bridged: COMGETTER(Wireless) failed, hrc (0x%x)\n", hrc)); |
| 5604 | 5607 | H(); |
| 5605 | 5608 | } |
| 5606 | | else if (fSharedMacOnWire) |
| | 5609 | hrc = hostInterface->COMGETTER(Master)(&fMaster); |
| | 5610 | if (FAILED(hrc)) |
| | 5611 | { |
| | 5612 | fMaster = false; |
| | 5613 | LogRel(("NetworkAttachmentType_Bridged: COMGETTER(Master) failed, hrc (0x%x)\n", hrc)); |
| | 5614 | H(); |
| | 5615 | } |
| | 5616 | /* A wireless interface may be an active slave of a master interface */ |
| | 5617 | fSharedMacOnWire = fMaster || fWireless; |
| | 5618 | if (fSharedMacOnWire) |
| 5607 | 5619 | { |
| 5608 | 5620 | InsertConfigInteger(pCfg, "SharedMacOnWire", true); |
| 5609 | 5621 | Log(("Set SharedMacOnWire\n")); |
diff -pru VirtualBox-6.1.26.orig/src/VBox/Main/src-server/HostNetworkInterfaceImpl.cpp VirtualBox-6.1.26/src/VBox/Main/src-server/HostNetworkInterfaceImpl.cpp
|
old
|
new
|
HRESULT HostNetworkInterface::updateConf
|
| 265 | 265 | m.status = (HostNetworkInterfaceStatus_T)info.enmStatus; |
| 266 | 266 | m.speedMbits = info.uSpeedMbits; |
| 267 | 267 | m.wireless = info.fWireless; |
| | 268 | m.master = info.fMaster; |
| 268 | 269 | return S_OK; |
| 269 | 270 | } |
| 270 | 271 | return rc == VERR_NOT_IMPLEMENTED ? E_NOTIMPL : E_FAIL; |
| … |
… |
HRESULT HostNetworkInterface::init(Utf8S
|
| 326 | 327 | m.status = (HostNetworkInterfaceStatus_T)pIf->enmStatus; |
| 327 | 328 | m.speedMbits = pIf->uSpeedMbits; |
| 328 | 329 | m.wireless = pIf->fWireless; |
| | 330 | m.master = pIf->fMaster; |
| 329 | 331 | |
| 330 | 332 | /* Confirm a successful initialization */ |
| 331 | 333 | autoInitSpan.setSucceeded(); |
| … |
… |
HRESULT HostNetworkInterface::getWireles
|
| 535 | 537 | |
| 536 | 538 | return S_OK; |
| 537 | 539 | } |
| | 540 | |
| | 541 | HRESULT HostNetworkInterface::getMaster(BOOL *aMaster) |
| | 542 | { |
| | 543 | *aMaster = m.master; |
| | 544 | |
| | 545 | return S_OK; |
| | 546 | } |
| 538 | 547 | |
| 539 | 548 | HRESULT HostNetworkInterface::enableStaticIPConfig(const com::Utf8Str &aIPAddress, |
| 540 | 549 | const com::Utf8Str &aNetworkMask) |
diff -pru VirtualBox-6.1.26.orig/src/VBox/Main/src-server/linux/NetIf-linux.cpp VirtualBox-6.1.26/src/VBox/Main/src-server/linux/NetIf-linux.cpp
|
old
|
new
|
static int getInterfaceInfo(int iSocket,
|
| 163 | 163 | sizeof(pInfo->IPNetMask.au8)); |
| 164 | 164 | |
| 165 | 165 | if (ioctl(iSocket, SIOCGIFFLAGS, &Req) >= 0) |
| | 166 | { |
| 166 | 167 | pInfo->enmStatus = Req.ifr_flags & IFF_UP ? NETIF_S_UP : NETIF_S_DOWN; |
| | 168 | pInfo->fMaster = Req.ifr_flags & IFF_MASTER; |
| | 169 | } |
| 167 | 170 | |
| 168 | 171 | struct iwreq WRq; |
| 169 | 172 | RT_ZERO(WRq); |