VirtualBox

Changeset 12372 in vbox for trunk/src


Ignore:
Timestamp:
Sep 10, 2008 7:42:18 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
36416
Message:

VBoxService: Basic network interfaces lookup for guest properties.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxService/VBoxVMInfoNet.cpp

    r11982 r12372  
    3636    }
    3737
     38        char szPropPath [_MAX_PATH+1] = {0};
     39        char szTemp [_MAX_PATH+1] = {0};
    3840    int nNumInterfaces = nBytesReturned / sizeof(INTERFACE_INFO);
    39     Log(("vboxVMInfoThread: There are %d interfaces:\n", nNumInterfaces-1));
     41
     42        RTStrPrintf(szPropPath, sizeof(szPropPath), "GuestInfo/Net/Count");
     43        vboxVMInfoWritePropInt(a_pCtx, szPropPath, nNumInterfaces);
    4044
    4145    dwCurIface = 0;
     
    4852        sockaddr_in *pAddress;
    4953        pAddress = (sockaddr_in *) & (InterfaceList[i].iiAddress);
    50         Log((" %s", inet_ntoa(pAddress->sin_addr)));
     54                RTStrPrintf(szPropPath, sizeof(szPropPath), "GuestInfo/Net/%d/V4/IP", i);
     55                vboxVMInfoWriteProp(a_pCtx, szPropPath, inet_ntoa(pAddress->sin_addr));
    5156
    5257        pAddress = (sockaddr_in *) & (InterfaceList[i].iiBroadcastAddress);
    53         Log((" has bcast %s", inet_ntoa(pAddress->sin_addr)));
     58                RTStrPrintf(szPropPath, sizeof(szPropPath), "GuestInfo/Net/%d/V4/Broadcast", i);
     59                vboxVMInfoWriteProp(a_pCtx, szPropPath, inet_ntoa(pAddress->sin_addr));
    5460
    5561        pAddress = (sockaddr_in *) & (InterfaceList[i].iiNetmask);
    56         Log((" and netmask %s", inet_ntoa(pAddress->sin_addr)));
     62                RTStrPrintf(szPropPath, sizeof(szPropPath), "GuestInfo/Net/%d/V4/Netmask", i);
     63                vboxVMInfoWriteProp(a_pCtx, szPropPath, inet_ntoa(pAddress->sin_addr));
    5764
    58         Log((" Iface is "));
    5965        u_long nFlags = InterfaceList[i].iiFlags;
    60         if (nFlags & IFF_UP) Log(("up"));
    61         else                 Log(("down"));
    62         if (nFlags & IFF_POINTTOPOINT) Log((", is point-to-point"));
    63         Log((", and can do: "));
    64         if (nFlags & IFF_BROADCAST) Log(("bcast " ));
    65         if (nFlags & IFF_MULTICAST) Log(("multicast "));
    66         Log(("\n"));
     66        if (nFlags & IFF_UP)
     67                        RTStrPrintf(szTemp, sizeof(szTemp), "Up");
     68                else
     69                        RTStrPrintf(szTemp, sizeof(szTemp), "Down");
    6770
    68         /** @todo Add more information & storage here! */
     71                RTStrPrintf(szPropPath, sizeof(szPropPath), "GuestInfo/Net/%d/Status", i);
     72                vboxVMInfoWriteProp(a_pCtx, szPropPath, szTemp);
    6973    }
    7074
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