NetIf-solaris.cpp revision 3b6c08154fc4ef3b6766320d72f2685eb488cb07
1881dc979c443212bf91478a1799b23a43d8666fvboxsync * Main - NetIfList, Solaris implementation.
1881dc979c443212bf91478a1799b23a43d8666fvboxsync * Copyright (C) 2008-2012 Oracle Corporation
1881dc979c443212bf91478a1799b23a43d8666fvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
1881dc979c443212bf91478a1799b23a43d8666fvboxsync * available from http://www.virtualbox.org. This file is free software;
1881dc979c443212bf91478a1799b23a43d8666fvboxsync * you can redistribute it and/or modify it under the terms of the GNU
1881dc979c443212bf91478a1799b23a43d8666fvboxsync * General Public License (GPL) as published by the Free Software
1881dc979c443212bf91478a1799b23a43d8666fvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
1881dc979c443212bf91478a1799b23a43d8666fvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
1881dc979c443212bf91478a1799b23a43d8666fvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
1881dc979c443212bf91478a1799b23a43d8666fvboxsync/*******************************************************************************
1881dc979c443212bf91478a1799b23a43d8666fvboxsync* Header Files *
1881dc979c443212bf91478a1799b23a43d8666fvboxsync*******************************************************************************/
#include <map>
#include <string>
#include <fcntl.h>
#include <unistd.h>
#include <stropts.h>
#include <limits.h>
#include <stdio.h>
#include <libdevinfo.h>
#include <kstat.h>
#include "DynLoadLibSolaris.h"
/** @todo Unify this define with VBoxNetFltBow-solaris.c */
int cbInstance = 0;
cbInstance++;
pszEnd--;
return uInstance;
if (ksAdapter == 0)
if (ksAdapter == 0)
if (ksAdapter == 0)
return uSpeed;
SolarisNICMap.insert(NICPair(VBOXBOW_VNIC_TEMPLATE_NAME, "VirtualBox Virtual Network Interface Template"));
* We want prefix matching only for "vboxvnic_template" as it's possible to create "vboxvnic_template_abcd123",
if (Sock > 0)
if (Sock > 0)
static boolean_t vboxSolarisAddLinkHostIface(const char *pszIface, void *pvHostNetworkInterfaceList)
return _B_FALSE;
* These names originate from VBoxNetFltBow-solaris.c, hardcoded here for now.
return _B_FALSE;
if (pszColon)
int cbInstance = 0;
cbInstance++;
pszEnd--;
return _B_FALSE;
static bool vboxSolarisSortNICList(const ComObjPtr<HostNetworkInterface> Iface1, const ComObjPtr<HostNetworkInterface> Iface2)
static bool vboxSolarisSameNIC(const ComObjPtr<HostNetworkInterface> Iface1, const ComObjPtr<HostNetworkInterface> Iface2)
static int vboxSolarisAddPhysHostIface(di_node_t Node, di_minor_t Minor, void *pvHostNetworkInterfaceList)
return DI_WALK_CONTINUE;
return DI_WALK_CONTINUE;
return DI_WALK_CONTINUE;
if (VBoxSolarisLibDlpiFound())
if (Sock > 0)
if (!rc)
if (Ifaces)
if (!rc)
for (int i = 0; i < cIfaces; i++)
if (rc >= 0)
if (rc >= 0)
return VINF_SUCCESS;
return VERR_NOT_IMPLEMENTED;
return VERR_NOT_IMPLEMENTED;
return VINF_SUCCESS;