summaryrefslogtreecommitdiff
path: root/src/VBox/Main/src-server/freebsd
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/Main/src-server/freebsd')
-rw-r--r--src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp13
-rw-r--r--src/VBox/Main/src-server/freebsd/NetIf-freebsd.cpp22
-rw-r--r--src/VBox/Main/src-server/freebsd/PerformanceFreeBSD.cpp13
-rw-r--r--src/VBox/Main/src-server/freebsd/USBProxyServiceFreeBSD.cpp2
4 files changed, 34 insertions, 16 deletions
diff --git a/src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp b/src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp
index b654f5a6..c65e47c3 100644
--- a/src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp
+++ b/src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2008 Oracle Corporation
+ * Copyright (C) 2008-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -31,7 +31,6 @@
#include <iprt/mem.h>
#include <iprt/param.h>
#include <iprt/path.h>
-#include <iprt/thread.h> /* for RTThreadSleep() */
#include <iprt/string.h>
#ifdef RT_OS_FREEBSD
@@ -172,8 +171,8 @@ static int getDVDInfoFromCAM(DriveInfoList *pList, bool *pfSuccess)
struct dev_match_pattern DeviceMatchPattern;
struct dev_match_result *paMatches = NULL;
- memset(&DeviceCCB, 0, sizeof(union ccb));
- memset(&DeviceMatchPattern, 0, sizeof(struct device_match_pattern));
+ RT_ZERO(DeviceCCB);
+ RT_ZERO(DeviceMatchPattern);
/* We want to get all devices. */
DeviceCCB.ccb_h.func_code = XPT_DEV_MATCH;
@@ -236,9 +235,9 @@ static int getDVDInfoFromCAM(DriveInfoList *pList, bool *pfSuccess)
struct periph_match_result *pPeriphResult = NULL;
unsigned iPeriphMatch = 0;
- memset(&PeriphCCB, 0, sizeof(union ccb));
- memset(&PeriphMatchPattern, 0, sizeof(struct dev_match_pattern));
- memset(aPeriphMatches, 0, sizeof(aPeriphMatches));
+ RT_ZERO(PeriphCCB);
+ RT_ZERO(PeriphMatchPattern);
+ RT_ZERO(aPeriphMatches);
/* This time we only want the specific nodes for the device. */
PeriphCCB.ccb_h.func_code = XPT_DEV_MATCH;
diff --git a/src/VBox/Main/src-server/freebsd/NetIf-freebsd.cpp b/src/VBox/Main/src-server/freebsd/NetIf-freebsd.cpp
index 7066dab9..049aaaf6 100644
--- a/src/VBox/Main/src-server/freebsd/NetIf-freebsd.cpp
+++ b/src/VBox/Main/src-server/freebsd/NetIf-freebsd.cpp
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2008 Oracle Corporation
+ * Copyright (C) 2008-2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -43,6 +43,7 @@
#include <net/if_dl.h>
#include <netinet/in.h>
+#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
@@ -271,7 +272,7 @@ int NetIfList(std::list <ComObjPtr<HostNetworkInterface> > &list)
if (pSdl->sdl_type == IFT_ETHER || pSdl->sdl_type == IFT_L2VLAN)
{
struct ifreq IfReq;
- strcpy(IfReq.ifr_name, pNew->szShortName);
+ RTStrCopy(IfReq.ifr_name, sizeof(IfReq.ifr_name), pNew->szShortName);
if (ioctl(sock, SIOCGIFFLAGS, &IfReq) < 0)
{
Log(("NetIfList: ioctl(SIOCGIFFLAGS) -> %d\n", errno));
@@ -281,7 +282,7 @@ int NetIfList(std::list <ComObjPtr<HostNetworkInterface> > &list)
pNew->enmStatus = (IfReq.ifr_flags & IFF_UP) ? NETIF_S_UP : NETIF_S_DOWN;
HostNetworkInterfaceType_T enmType;
- if (strncmp("vboxnet", pNew->szName, 7))
+ if (strncmp(pNew->szName, RT_STR_TUPLE("vboxnet")))
enmType = HostNetworkInterfaceType_Bridged;
else
enmType = HostNetworkInterfaceType_HostOnly;
@@ -388,7 +389,7 @@ int NetIfGetConfigByName(PNETIFINFO pInfo)
pInfo->Uuid = uuid;
struct ifreq IfReq;
- strcpy(IfReq.ifr_name, pInfo->szShortName);
+ RTStrCopy(IfReq.ifr_name, sizeof(IfReq.ifr_name), pInfo->szShortName);
if (ioctl(sock, SIOCGIFFLAGS, &IfReq) < 0)
{
Log(("NetIfList: ioctl(SIOCGIFFLAGS) -> %d\n", errno));
@@ -405,3 +406,16 @@ int NetIfGetConfigByName(PNETIFINFO pInfo)
return rc;
}
+/**
+ * Retrieve the physical link speed in megabits per second. If the interface is
+ * not up or otherwise unavailable the zero speed is returned.
+ *
+ * @returns VBox status code.
+ *
+ * @param pcszIfName Interface name.
+ * @param puMbits Where to store the link speed.
+ */
+int NetIfGetLinkSpeed(const char * /*pcszIfName*/, uint32_t * /*puMbits*/)
+{
+ return VERR_NOT_IMPLEMENTED;
+}
diff --git a/src/VBox/Main/src-server/freebsd/PerformanceFreeBSD.cpp b/src/VBox/Main/src-server/freebsd/PerformanceFreeBSD.cpp
index 0b817842..6770c75b 100644
--- a/src/VBox/Main/src-server/freebsd/PerformanceFreeBSD.cpp
+++ b/src/VBox/Main/src-server/freebsd/PerformanceFreeBSD.cpp
@@ -4,7 +4,7 @@
*/
/*
- * Copyright (C) 2008-2009 Oracle Corporation
+ * Copyright (C) 2008-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -39,7 +39,7 @@ CollectorHAL *createHAL()
int CollectorFreeBSD::getHostCpuLoad(ULONG *user, ULONG *kernel, ULONG *idle)
{
- return E_NOTIMPL;
+ return VERR_NOT_IMPLEMENTED;
}
int CollectorFreeBSD::getHostCpuMHz(ULONG *mhz)
@@ -101,12 +101,17 @@ int CollectorFreeBSD::getHostMemoryUsage(ULONG *total, ULONG *used, ULONG *avail
int CollectorFreeBSD::getProcessCpuLoad(RTPROCESS process, ULONG *user, ULONG *kernel)
{
- return E_NOTIMPL;
+ return VERR_NOT_IMPLEMENTED;
}
int CollectorFreeBSD::getProcessMemoryUsage(RTPROCESS process, ULONG *used)
{
- return E_NOTIMPL;
+ return VERR_NOT_IMPLEMENTED;
+}
+
+int getDiskListByFs(const char *name, DiskList& list)
+{
+ return VERR_NOT_IMPLEMENTED;
}
} /* namespace pm */
diff --git a/src/VBox/Main/src-server/freebsd/USBProxyServiceFreeBSD.cpp b/src/VBox/Main/src-server/freebsd/USBProxyServiceFreeBSD.cpp
index ef8856a3..98535312 100644
--- a/src/VBox/Main/src-server/freebsd/USBProxyServiceFreeBSD.cpp
+++ b/src/VBox/Main/src-server/freebsd/USBProxyServiceFreeBSD.cpp
@@ -266,7 +266,7 @@ PUSBDEVICE USBProxyServiceFreeBSD::getDevices(void)
LogFlowFunc((": %s opened successfully\n", pszDevicePath));
struct usb_device_info UsbDevInfo;
- memset(&UsbDevInfo, 0, sizeof(struct usb_device_info));
+ RT_ZERO(UsbDevInfo);
rc = ioctl(FileUsb, USB_GET_DEVICEINFO, &UsbDevInfo);
if (rc < 0)