diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2014-03-26 19:21:20 +0000 |
---|---|---|
committer | <> | 2014-05-08 15:03:54 +0000 |
commit | fb123f93f9f5ce42c8e5785d2f8e0edaf951740e (patch) | |
tree | c2103d76aec5f1f10892cd1d3a38e24f665ae5db /src/VBox/Main/include/netif.h | |
parent | 58ed4748338f9466599adfc8a9171280ed99e23f (diff) | |
download | VirtualBox-master.tar.gz |
Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2.HEADVirtualBox-4.3.10master
Diffstat (limited to 'src/VBox/Main/include/netif.h')
-rw-r--r-- | src/VBox/Main/include/netif.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/VBox/Main/include/netif.h b/src/VBox/Main/include/netif.h index b1ab8901..bd618922 100644 --- a/src/VBox/Main/include/netif.h +++ b/src/VBox/Main/include/netif.h @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 2008-2009 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; @@ -84,14 +84,16 @@ typedef NETIFINFO const *PCNETIFINFO; #endif int NetIfList(std::list <ComObjPtr<HostNetworkInterface> > &list); -int NetIfEnableStaticIpConfig(VirtualBox *pVbox, HostNetworkInterface * pIf, ULONG aOldIp, ULONG aNewIp, ULONG aMask); -int NetIfEnableStaticIpConfigV6(VirtualBox *pVbox, HostNetworkInterface * pIf, IN_BSTR aOldIPV6Address, IN_BSTR aIPV6Address, ULONG aIPV6MaskPrefixLength); -int NetIfEnableDynamicIpConfig(VirtualBox *pVbox, HostNetworkInterface * pIf); -int NetIfCreateHostOnlyNetworkInterface (VirtualBox *pVbox, IHostNetworkInterface **aHostNetworkInterface, IProgress **aProgress, const char *pcszName = NULL); -int NetIfRemoveHostOnlyNetworkInterface (VirtualBox *pVbox, IN_GUID aId, IProgress **aProgress); +int NetIfEnableStaticIpConfig(VirtualBox *pVBox, HostNetworkInterface * pIf, ULONG aOldIp, ULONG aNewIp, ULONG aMask); +int NetIfEnableStaticIpConfigV6(VirtualBox *pVBox, HostNetworkInterface * pIf, IN_BSTR aOldIPV6Address, IN_BSTR aIPV6Address, ULONG aIPV6MaskPrefixLength); +int NetIfEnableDynamicIpConfig(VirtualBox *pVBox, HostNetworkInterface * pIf); +int NetIfCreateHostOnlyNetworkInterface (VirtualBox *pVBox, IHostNetworkInterface **aHostNetworkInterface, IProgress **aProgress, const char *pcszName = NULL); +int NetIfRemoveHostOnlyNetworkInterface (VirtualBox *pVBox, IN_GUID aId, IProgress **aProgress); int NetIfGetConfig(HostNetworkInterface * pIf, NETIFINFO *); int NetIfGetConfigByName(PNETIFINFO pInfo); -int NetIfDhcpRediscover(VirtualBox *pVbox, HostNetworkInterface * pIf); +int NetIfGetState(const char *pcszIfName, NETIFSTATUS *penmState); +int NetIfGetLinkSpeed(const char *pcszIfName, uint32_t *puMbits); +int NetIfDhcpRediscover(VirtualBox *pVBox, HostNetworkInterface * pIf); int NetIfAdpCtlOut(const char * pcszName, const char * pcszCmd, char *pszBuffer, size_t cBufSize); DECLINLINE(Bstr) composeIPv6Address(PRTNETADDRIPV6 aAddrPtr) @@ -121,12 +123,12 @@ DECLINLINE(ULONG) composeIPv6PrefixLenghFromAddress(PRTNETADDRIPV6 aAddrPtr) DECLINLINE(int) prefixLength2IPv6Address(ULONG cPrefix, PRTNETADDRIPV6 aAddrPtr) { - if(cPrefix > 128) + if (cPrefix > 128) return VERR_INVALID_PARAMETER; - if(!aAddrPtr) + if (!aAddrPtr) return VERR_INVALID_PARAMETER; - memset(aAddrPtr, 0, sizeof(RTNETADDRIPV6)); + RT_ZERO(*aAddrPtr); ASMBitSetRange(aAddrPtr, 0, cPrefix); @@ -150,7 +152,8 @@ DECLINLINE(Bstr) getDefaultIPv4Address(Bstr bstrIfName) /* Get the index from the name */ Utf8Str strTmp = bstrIfName; const char *pszIfName = strTmp.c_str(); - int iInstance = 0, iPos = strcspn(pszIfName, "0123456789"); + int iInstance = 0; + size_t iPos = strcspn(pszIfName, "0123456789"); if (pszIfName[iPos]) iInstance = RTStrToUInt32(pszIfName + iPos); |