VirtualBox

Changeset 16854 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 17, 2009 3:50:47 PM (16 years ago)
Author:
vboxsync
Message:

TAP/win: host only networking for windows

Location:
trunk/src/VBox
Files:
6 edited

Legend:

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

    r15541 r16854  
    745745    bool f;
    746746
     747    __asm {int 3};
     748
    747749    /*
    748750     * Init the static parts.
     
    10261028
    10271029#elif defined(RT_OS_WINDOWS) && defined(VBOX_WITH_NETFLT)
    1028     if (OpenReq.enmTrunkType == kIntNetTrunkType_NetFlt)
     1030    if (OpenReq.enmTrunkType == kIntNetTrunkType_NetFlt
     1031            || OpenReq.enmTrunkType == kIntNetTrunkType_NetTap)
    10291032    {
    10301033# ifndef VBOX_NETFLT_ONDEMAND_BIND
     
    10331036         * tell the filter driver to init VBoxNetFlt functionality.
    10341037         */
    1035         rc = drvIntNetWinConstruct(pDrvIns, pCfgHandle);
     1038        rc = drvIntNetWinConstruct(pDrvIns, pCfgHandle, OpenReq.enmTrunkType);
    10361039        AssertLogRelMsgRCReturn(rc, ("drvIntNetWinConstruct failed, rc=%Rrc", rc), rc);
    10371040# endif
    10381041
    1039         /*
    1040          * <Describe what this does here or/and in the function docs of drvIntNetWinIfGuidToBindName>.
    1041          */
    1042         char szBindName[INTNET_MAX_TRUNK_NAME];
    1043         rc = drvIntNetWinIfGuidToBindName(OpenReq.szTrunk, szBindName, INTNET_MAX_TRUNK_NAME);
    1044         AssertLogRelMsgRCReturn(rc, ("drvIntNetWinIfGuidToBindName failed, rc=%Rrc", rc), rc);
    1045         strcpy(OpenReq.szTrunk, szBindName);
     1042        if (OpenReq.enmTrunkType == kIntNetTrunkType_NetFlt)
     1043        {
     1044            /*
     1045             * <Describe what this does here or/and in the function docs of drvIntNetWinIfGuidToBindName>.
     1046             */
     1047            char szBindName[INTNET_MAX_TRUNK_NAME];
     1048            rc = drvIntNetWinIfGuidToBindName(OpenReq.szTrunk, szBindName, INTNET_MAX_TRUNK_NAME);
     1049            AssertLogRelMsgRCReturn(rc, ("drvIntNetWinIfGuidToBindName failed, rc=%Rrc", rc), rc);
     1050            strcpy(OpenReq.szTrunk, szBindName);
     1051        }
     1052        else
     1053        {
     1054            strcpy(OpenReq.szTrunk, "dummy name");
     1055        }
    10461056    }
    10471057#endif /* WINDOWS && NETFLT */
  • trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp

    r16750 r16854  
    41234123
    41244124        case kIntNetTrunkType_NetFlt:
     4125        case kIntNetTrunkType_NetTap:
    41254126            AssertReturn(pszTrunk, VERR_INVALID_PARAMETER);
    41264127            break;
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsNetwork.cpp

    r16509 r16854  
    355355    mCbNAType->setItemData (3,
    356356        mCbNAType->itemText(3), Qt::ToolTipRole);
    357 #ifdef RT_OS_LINUX
     357#if defined(RT_OS_LINUX) || defined (RT_OS_WINDOWS)
    358358    mCbNAType->insertItem (4,
    359359        vboxGlobal().toString (KNetworkAttachmentType_HostOnly));
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk

    r16803 r16854  
    214214endif #ifeq ($(KBUILD_TARGET), win)
    215215
     216#
     217# VBoxNetAdp.sys - The VirtualBox Adapter miniport driver.
     218#
     219SYSMODS.win += VBoxNetAdp
     220VBoxNetAdp_TEMPLATE = VBOXR0DRV
     221VBoxNetAdp_INST = $(INST_VBOXNETFLT)
     222if defined(VBOX_SIGNING_MODE)
     223 VBoxNetAdp_NOINST = true
     224endif
     225VBoxNetAdp_DEFS = IN_RT_R0 VBOX_SVN_REV=$(VBOX_SVN_REV) IN_SUP_STATIC
     226VBoxNetAdp_SDKS = W2K3DDK WINPSDKINCS
     227VBoxNetAdp_INCS := $(PATH_SUB_CURRENT)
     228VBoxNetAdp_SOURCES = \
     229        VBoxNetFlt.c \
     230        win/VBoxNetFlt-win.c \
     231        win/VBoxNetFltMp-win.c \
     232        win/VBoxNetFlt-win.rc
     233VBoxNetAdp_DEFS += VBOXNETFLT_STATIC_CONFIG VBOX_TAPMINIPORT
     234VBoxNetAdp_LDFLAGS.win.x86 = -Entry:DriverEntry@8
     235VBoxNetAdp_LDFLAGS.win.amd64 = -Entry:DriverEntry
     236VBoxNetAdp_SOURCES.win.amd64 += win/VBoxNetFltA-win.asm
     237VBoxNetAdp_DEFS.win.amd64    += RT_WITH_W64_UNWIND_HACK
     238VBoxNetAdp_LIBS.win = \
     239        $(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \
     240        $(PATH_SDK_W2K3DDK_LIB)/hal.lib \
     241        $(PATH_SDK_W2K3DDK_LIB)/ndis.lib \
     242        $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
     243VBoxNetAdp_LIBS = \
     244        $(PATH_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
     245
     246
     247INSTALLS.win += VBoxNetAdp-inf
     248VBoxNetAdp-inf_INST = $(INST_BIN)
     249VBoxNetAdp-inf_MODE = a+r,u+w
     250VBoxNetAdp-inf_SOURCES = \
     251        $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.inf
     252VBoxNetAdp-inf_CLEAN = $(VBoxNetAdp-inf_SOURCES)
     253VBoxNetAdp-inf_BLDDIRS = $(PATH_TARGET)/VBoxNetAdpCat.dir
     254
     255$(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.inf: $(PATH_SUB_CURRENT)/win/VBoxNetAdp.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
     256        $(call MSG_GENERATE,VBoxNetAdp-inf,$@,$<)
     257        $(call VBOX_EDIT_INF_FN,$<,$@)
     258
     259 ifdef VBOX_SIGNING_MODE
     260VBoxNetAdp-inf_SOURCES += \
     261        $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.sys \
     262        $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.cat
     263
     264$(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.sys: $$(TARGET_VBoxNetAdp) | $$(dir $$@)
     265        $(INSTALL) -m 644 $< $(@D)
     266
     267$(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.cat: \
     268                $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.sys \
     269                $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.inf
     270        $(call MSG_TOOL,Inf2Cat,VBoxNetFlt-inf,$@,$<)
     271        $(call VBOX_MAKE_CAT_FN, $(@D),$@)
     272
     273 endif #  ifdef VBOX_SIGNING_MODE
     274 
    216275else if1of ($(KBUILD_TARGET), linux solaris) ## @todo merge this with the mixed case stuff.
    217276#
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/VBoxNetFlt.c

    r16193 r16854  
    10371037    AssertRCReturn(rc, rc);
    10381038
     1039#if defined(VBOX_TAPMINIPORT) && defined(RT_OS_WINDOWS)
     1040    /* temporary hack to pick up the first adapter */
     1041    pCur = pGlobals->pInstanceHead;
     1042#else
    10391043    pCur = vboxNetFltFindInstanceLocked(pGlobals, pszName);
     1044#endif
    10401045    if (pCur)
    10411046    {
     
    12681273            pGlobals->TrunkFactory.pfnRelease = vboxNetFltFactoryRelease;
    12691274            pGlobals->TrunkFactory.pfnCreateAndConnect = vboxNetFltFactoryCreateAndConnect;
    1270 
     1275#if defined(RT_OS_WINDOWS) && defined(VBOX_TAPMINIPORT)
     1276            strcpy(pGlobals->SupDrvFactory.szName, "VBoxNetTap");
     1277#else
    12711278            strcpy(pGlobals->SupDrvFactory.szName, "VBoxNetFlt");
     1279#endif
    12721280            pGlobals->SupDrvFactory.pfnQueryFactoryInterface = vboxNetFltQueryFactoryInterface;
    12731281
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r16853 r16854  
    16381638                rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg);                 RC_CHECK();
    16391639                rc = CFGMR3InsertString(pCfg, "Trunk", "vboxnet0");             RC_CHECK();
     1640                rc = CFGMR3InsertString(pCfg, "Network", "HostInterfaceNetworking-vboxnet0"); RC_CHECK();
     1641#ifdef RT_OS_WINDOWS
     1642                /* TODO: set the proper Trunk and Network values, currently the driver uses the first adapter instance */
     1643                rc = CFGMR3InsertInteger(pCfg, "TrunkType", kIntNetTrunkType_NetTap); RC_CHECK();
     1644#else
    16401645                rc = CFGMR3InsertInteger(pCfg, "TrunkType", kIntNetTrunkType_NetFlt); RC_CHECK();
    1641                 rc = CFGMR3InsertString(pCfg, "Network", "HostInterfaceNetworking-vboxnet0"); RC_CHECK();
     1646#endif
    16421647                break;
    16431648            }
Note: See TracChangeset for help on using the changeset viewer.

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