VirtualBox

Changeset 13234 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Oct 13, 2008 8:48:44 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
37817
Message:

UI/config part of win NetFlt

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DrvIntNet.cpp

    r13024 r13234  
    4141#include "../Builtins.h"
    4242
    43 #if defined(RT_OS_WINDOWS) && defined(VBOX_WITH_NETFLT) && !defined(VBOX_NETFLT_ONDEMAND_BIND)
     43#if defined(RT_OS_WINDOWS) && defined(VBOX_WITH_NETFLT)
    4444# include "win/DrvIntNet-win.h"
    4545#endif
     
    925925    }
    926926# endif
    927     /* Temporary hack: attach to a network with the name 'if=en0' and you're hitting the wire. */
    928     if (    !OpenReq.szTrunk[0]
    929         &&   OpenReq.enmTrunkType == kIntNetTrunkType_None
    930         &&  !strncmp(pThis->szNetwork, "if=en", sizeof("if=en") - 1)
    931         &&  RT_C_IS_DIGIT(pThis->szNetwork[sizeof("if=en") - 1])
    932         &&  !pThis->szNetwork[sizeof("if=en")])
    933     {
    934         OpenReq.enmTrunkType = kIntNetTrunkType_NetFlt;
    935         strcpy(OpenReq.szTrunk, &pThis->szNetwork[sizeof("if=") - 1]);
    936     }
    937     /* Temporary hack: attach to a network with the name 'wif=en0' and you're on the air. */
    938     if (    !OpenReq.szTrunk[0]
    939         &&   OpenReq.enmTrunkType == kIntNetTrunkType_None
    940         &&  !strncmp(pThis->szNetwork, "wif=en", sizeof("wif=en") - 1)
    941         &&  RT_C_IS_DIGIT(pThis->szNetwork[sizeof("wif=en") - 1])
    942         &&  !pThis->szNetwork[sizeof("wif=en")])
    943     {
    944         OpenReq.enmTrunkType = kIntNetTrunkType_NetFlt;
    945         OpenReq.fFlags |= INTNET_OPEN_FLAGS_SHARED_MAC_ON_WIRE;
    946         strcpy(OpenReq.szTrunk, &pThis->szNetwork[sizeof("wif=") - 1]);
    947     }
    948 
    949     //TODO: temporary hack, remove this
    950     if (OpenReq.enmTrunkType == kIntNetTrunkType_None)
    951     {
    952         OpenReq.enmTrunkType = kIntNetTrunkType_NetFlt;
    953         strcpy(OpenReq.szTrunk, &pThis->szNetwork[sizeof("if=") - 1]);
    954     }
    955 
     927
     928    if(OpenReq.enmTrunkType == kIntNetTrunkType_NetFlt)
     929    {
     930        char szBindName[INTNET_MAX_TRUNK_NAME];
     931        size_t cBindName = INTNET_MAX_TRUNK_NAME;
     932
     933        rc = drvIntNetWinIfNameToBindName(OpenReq.szTrunk, szBindName, cBindName);
     934        if (RT_FAILURE(rc))
     935        {
     936            return rc;
     937        }
     938
     939        strcpy(OpenReq.szTrunk, szBindName);
     940    }
    956941#endif
    957942
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette