VirtualBox

Changeset 15455 in vbox for trunk/src/VBox/Main/solaris


Ignore:
Timestamp:
Dec 14, 2008 9:58:42 AM (16 years ago)
Author:
vboxsync
Message:

#3282 HostNetIf API: Solaris implementaion is functional except IP V6 addresses. Fixed erroneous return codes in Host::MemorySize and Host::MemoryAvailable along the way.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/solaris/NetIfList-solaris.cpp

    r15446 r15455  
    4040#include <list>
    4141
     42#include "Logging.h"
    4243#include "HostNetworkInterfaceImpl.h"
    4344#include "netif.h"
     
    126127        if (ioctl(Sock, SIOCGLIFADDR, &IfReq) >= 0)
    127128        {
    128             memcpy(Info.IPAddress.au8, ((struct sockaddr *)&IfReq.lifr_addr)->sa_data,
     129            memcpy(Info.IPAddress.au8, &((struct sockaddr_in *)&IfReq.lifr_addr)->sin_addr.s_addr,
    129130                    sizeof(Info.IPAddress.au8));
    130             // SIOCGLIFNETMASK
    131131            struct arpreq ArpReq;
    132132            memcpy(&ArpReq.arp_pa, &IfReq.lifr_addr, sizeof(struct sockaddr_in));
     
    139139             */
    140140            if (ioctl(Sock, SIOCGARP, &ArpReq) >= 0)
     141            {
    141142                memcpy(&Info.MACAddress, ArpReq.arp_ha.sa_data, sizeof(Info.MACAddress));
     143            }
    142144
    143145        }
     
    145147        if (ioctl(Sock, SIOCGLIFNETMASK, &IfReq) >= 0)
    146148        {
    147             memcpy(Info.IPNetMask.au8, ((struct sockaddr *)&IfReq.lifr_addr)->sa_data,
     149            memcpy(Info.IPNetMask.au8, &((struct sockaddr_in *)&IfReq.lifr_addr)->sin_addr.s_addr,
    148150                    sizeof(Info.IPNetMask.au8));
    149151        }
     
    169171    Uuid.Gen.au8Node[5] = Info.MACAddress.au8[5];
    170172    Info.Uuid = Uuid;
     173    Info.enmType = NETIF_T_ETHERNET;
    171174
    172175    ComObjPtr<HostNetworkInterface> IfObj;
    173176    IfObj.createObject();
    174     if (SUCCEEDED(IfObj->init(Bstr(szNICDesc), Guid(Uuid))))
     177    if (SUCCEEDED(IfObj->init(Bstr(szNICDesc), &Info)))
    175178        pList->push_back(IfObj);
    176179}
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