NetIf-linux.cpp revision 22db201c588c7242f5f3cd47d999225cefad6475
/* $Id$ */
/** @file
* Main - NetIfList, Linux implementation.
*/
/*
* Copyright (C) 2008 Sun Microsystems, Inc.
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#define LOG_GROUP LOG_GROUP_MAIN
#include <list>
#include <stdio.h>
#include <unistd.h>
#include "HostNetworkInterfaceImpl.h"
#include "netif.h"
#include "Logging.h"
{
{
{
case ARPHRD_ETHER:
break;
default:
break;
}
/* Generate UUID from name and MAC address. */
RTUuidClear(&uuid);
if (fp)
{
char szName[30];
for (;;)
{
"%08x%08x%08x%08x"
" %02x %02x %02x %02x %20s\n",
if (n == EOF)
break;
{
n, uLength));
break;
}
{
}
}
}
}
return VINF_SUCCESS;
}
{
int rc = VINF_SUCCESS;
if (sock >= 0)
{
if (fp)
{
char buf[256];
{
if (!pszEndOfName)
continue;
*pszEndOfName = 0;
if (RT_FAILURE(rc))
break;
{
else
}
}
}
}
return rc;
}