儲存庫 vbox 的更動 11868
- 時間撮記:
- 2008-8-30 下午01:31:30 (16 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Main/HostImpl.cpp
r11849 r11868 47 47 #ifdef RT_OS_SOLARIS 48 48 # include <fcntl.h> 49 # include <syslog.h> 49 50 # include <unistd.h> 50 51 # include <stropts.h> … … 579 580 for (int i = 0; i < IfNum.lifn_count; i++) 580 581 { 582 /* 583 * Skip loopback interfaces. 584 */ 585 if (!strncmp(Ifaces[i].lifr_name, "lo", 2)) 586 continue; 587 581 588 rc = ioctl(Sock, SIOCGLIFADDR, &(Ifaces[i])); 582 589 if (!rc) 583 590 { 591 RTMAC Mac; 584 592 struct arpreq ArpReq; 585 593 memcpy(&ArpReq.arp_pa, &Ifaces[i].lifr_addr, sizeof(struct sockaddr_in)); 594 595 /* 596 * We might fail if the interface has not been assigned an IP address. 597 * That doesn't matter; as long as it's plumbed we can pick it up. 598 * But, if it has not acquired an IP address we cannot obtain it's MAC 599 * address this way, so we just use all zeros there. 600 */ 586 601 rc = ioctl(Sock, SIOCGARP, &ArpReq); 587 602 if (!rc) 588 {589 RTMAC Mac;590 603 memcpy(&Mac, ArpReq.arp_ha.sa_data, sizeof(RTMAC)); 591 592 char *pszIface = Ifaces[i].lifr_name; 593 594 RTUUID Uuid; 595 RTUuidClear(&Uuid); 596 memcpy(&Uuid, pszIface, RT_MIN(strlen(pszIface), sizeof(Uuid))); 597 Uuid.Gen.u8ClockSeqHiAndReserved = (Uuid.Gen.u8ClockSeqHiAndReserved & 0x3f) | 0x80; 598 Uuid.Gen.u16TimeHiAndVersion = (Uuid.Gen.u16TimeHiAndVersion & 0x0fff) | 0x4000; 599 Uuid.Gen.au8Node[0] = Mac.au8[0]; 600 Uuid.Gen.au8Node[1] = Mac.au8[1]; 601 Uuid.Gen.au8Node[2] = Mac.au8[2]; 602 Uuid.Gen.au8Node[3] = Mac.au8[3]; 603 Uuid.Gen.au8Node[4] = Mac.au8[4]; 604 Uuid.Gen.au8Node[5] = Mac.au8[5]; 605 606 ComObjPtr<HostNetworkInterface> IfObj; 607 IfObj.createObject(); 608 if (SUCCEEDED(IfObj->init(Bstr(pszIface), Guid(Uuid)))) 609 list.push_back(IfObj); 610 } 604 else 605 memset(&Mac, 0, sizeof(Mac)); 606 607 char *pszIface = Ifaces[i].lifr_name; 608 609 RTUUID Uuid; 610 RTUuidClear(&Uuid); 611 memcpy(&Uuid, pszIface, RT_MIN(strlen(pszIface), sizeof(Uuid))); 612 Uuid.Gen.u8ClockSeqHiAndReserved = (Uuid.Gen.u8ClockSeqHiAndReserved & 0x3f) | 0x80; 613 Uuid.Gen.u16TimeHiAndVersion = (Uuid.Gen.u16TimeHiAndVersion & 0x0fff) | 0x4000; 614 Uuid.Gen.au8Node[0] = Mac.au8[0]; 615 Uuid.Gen.au8Node[1] = Mac.au8[1]; 616 Uuid.Gen.au8Node[2] = Mac.au8[2]; 617 Uuid.Gen.au8Node[3] = Mac.au8[3]; 618 Uuid.Gen.au8Node[4] = Mac.au8[4]; 619 Uuid.Gen.au8Node[5] = Mac.au8[5]; 620 621 ComObjPtr<HostNetworkInterface> IfObj; 622 IfObj.createObject(); 623 if (SUCCEEDED(IfObj->init(Bstr(pszIface), Guid(Uuid)))) 624 list.push_back(IfObj); 611 625 } 612 626 }
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器