VirtualBox

Changeset 97078 in vbox


Ignore:
Timestamp:
Oct 10, 2022 7:32:33 PM (2 years ago)
Author:
vboxsync
Message:

Networkservices: Further cleanup and consolidation, get rid of the almost useless IntNetIf helper class and add methods to the low level code offering the missing functionality there, bugref:10297

Location:
trunk/src/VBox/NetworkServices
Files:
5 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/NetworkServices/Dhcpd/Makefile.kmk

    r97071 r97078  
    9090        Timestamp.cpp \
    9191        VBoxNetDhcpd.cpp \
    92         ../NetLib/IntNetIfCtx.cpp \
     92        ../NetLib/IntNetIf.cpp \
    9393        ../../Main/glue/VBoxLogRelCreate.cpp \
    9494        ../../Main/glue/GetVBoxUserHomeDirectory.cpp \
  • trunk/src/VBox/NetworkServices/Dhcpd/VBoxNetDhcpd.cpp

    r97077 r97078  
    176176    if (m_hIf != NULL)
    177177    {
    178         int rc = IntNetR3IfCtxDestroy(m_hIf);
     178        int rc = IntNetR3IfDestroy(m_hIf);
    179179        AssertRC(rc);
    180180        m_hIf = NULL;
     
    227227        enmTrunkType = kIntNetTrunkType_WhateverNone;
    228228
    229     int rc = IntNetR3IfCtxCreate(&m_hIf, strNetwork.c_str(), enmTrunkType,
    230                                  strTrunk.c_str(), _128K /*cbSend*/, _256K /*cbRecv*/,
    231                                  0 /*fFlags*/);
     229    int rc = IntNetR3IfCreateEx(&m_hIf, strNetwork.c_str(), enmTrunkType,
     230                                strTrunk.c_str(), _128K /*cbSend*/, _256K /*cbRecv*/,
     231                                0 /*fFlags*/);
    232232    if (RT_SUCCESS(rc))
    233233    {
    234         rc = IntNetR3IfCtxQueryBufferPtr(m_hIf, &m_pIfBuf);
     234        rc = IntNetR3IfQueryBufferPtr(m_hIf, &m_pIfBuf);
    235235        if (RT_SUCCESS(rc))
    236             rc = IntNetR3IfCtxSetActive(m_hIf, true /*fActive*/);
     236            rc = IntNetR3IfSetActive(m_hIf, true /*fActive*/);
    237237    }
    238238
  • trunk/src/VBox/NetworkServices/NAT/Makefile.kmk

    r97071 r97078  
    106106        VBoxNetLwipNAT.cpp \
    107107        ../NetLib/IntNetIf.cpp \
    108         ../NetLib/IntNetIfCtx.cpp \
    109108        ../NetLib/VBoxNetPortForwardString.cpp \
    110109        $(addprefix ../../Devices/Network/lwip-new/,$(LWIP_SOURCES)) \
  • trunk/src/VBox/NetworkServices/NAT/VBoxNetLwipNAT.cpp

    r96407 r97078  
    150150
    151151    RTMAC m_MacAddress;
    152     IntNetIf m_IntNetIf;
     152    INTNETIFCTX m_hIf;
    153153    RTTHREAD m_hThrRecv;
    154154
     
    483483
    484484    /* connect to the intnet */
    485     rc = m_IntNetIf.init(m_strNetworkName);
     485    rc = IntNetR3IfCreate(&m_hIf, m_strNetworkName.c_str());
    486486    if (RT_FAILURE(rc))
    487487        return rc;
     
    13921392
    13931393    /* tell the intnet input pump to terminate */
    1394     m_IntNetIf.ifAbort();
     1394    IntNetR3IfWaitAbort(m_hIf);
    13951395
    13961396    /* tell the lwIP tcpip thread to terminate */
     
    18651865        return VERR_GENERAL_FAILURE;
    18661866
    1867     rc = self->m_IntNetIf.setInputCallback(VBoxNetLwipNAT::processFrame, self);
    1868     AssertRCReturn(rc, rc);
    1869 
    1870     rc = self->m_IntNetIf.ifPump();
     1867    rc = IntNetR3IfPumpPkts(self->m_hIf, VBoxNetLwipNAT::processFrame, self,
     1868                            NULL /*pfnInputGso*/, NULL /*pvUserGso*/);
    18711869    if (rc == VERR_SEM_DESTROYED)
    18721870        return VINF_SUCCESS;
    18731871
    1874     LogRel(("receiveThread: ifPump: unexpected %Rrc\n", rc));
     1872    LogRel(("receiveThread: IntNetR3IfPumpPkts: unexpected %Rrc\n", rc));
    18751873    return VERR_INVALID_STATE;
    18761874}
     
    19551953
    19561954    size_t cbFrame = (size_t)pPBuf->tot_len - ETH_PAD_SIZE;
    1957     IntNetIf::Frame frame;
    1958     rc = self->m_IntNetIf.getOutputFrame(frame, cbFrame);
     1955    INTNETFRAME Frame;
     1956    rc = IntNetR3IfQueryOutputFrame(self->m_hIf, cbFrame, &Frame);
    19591957    if (RT_FAILURE(rc))
    19601958        return ERR_MEM;
    19611959
    1962     pbuf_copy_partial(pPBuf, frame.pvFrame, (u16_t)cbFrame, ETH_PAD_SIZE);
    1963     rc = self->m_IntNetIf.ifOutput(frame);
     1960    pbuf_copy_partial(pPBuf, Frame.pvFrame, (u16_t)cbFrame, ETH_PAD_SIZE);
     1961    rc = IntNetR3IfOutputFrameCommit(self->m_hIf, &Frame);
    19641962    if (RT_FAILURE(rc))
    19651963        return ERR_IF;
  • trunk/src/VBox/NetworkServices/NetLib/IntNetIf.cpp

    r97075 r97078  
    100100 * @param   pReqHdr         Pointer to the request header.
    101101 */
    102 static int intnetR3IfCtxCallSvc(PINTNETIFCTXINT pThis, uint32_t uOperation, PSUPVMMR0REQHDR pReqHdr)
     102static int intnetR3IfCallSvc(PINTNETIFCTXINT pThis, uint32_t uOperation, PSUPVMMR0REQHDR pReqHdr)
    103103{
    104104#if defined(VBOX_WITH_INTNET_SERVICE_IN_R3)
     
    139139 * @param   pReqHdr         Pointer to the request header.
    140140 */
    141 static int intnetR3IfCtxCallSvcAsync(PINTNETIFCTXINT pThis, uint32_t uOperation, PSUPVMMR0REQHDR pReqHdr)
     141static int intnetR3IfCallSvcAsync(PINTNETIFCTXINT pThis, uint32_t uOperation, PSUPVMMR0REQHDR pReqHdr)
    142142{
    143143    if (pThis->fIntNetR3Svc)
     
    161161 * @param   pThis           The internal network driver instance data.
    162162 */
    163 static int intnetR3IfCtxMapBufferPointers(PINTNETIFCTXINT pThis)
     163static int intnetR3IfMapBufferPointers(PINTNETIFCTXINT pThis)
    164164{
    165165    int rc = VINF_SUCCESS;
     
    210210
    211211
    212 static void intnetR3IfCtxClose(PINTNETIFCTXINT pThis)
     212static void intnetR3IfClose(PINTNETIFCTXINT pThis)
    213213{
    214214    if (pThis->hIf != INTNET_HANDLE_INVALID)
     
    221221
    222222        pThis->hIf = INTNET_HANDLE_INVALID;
    223         int rc = intnetR3IfCtxCallSvc(pThis, VMMR0_DO_INTNET_IF_CLOSE, &CloseReq.Hdr);
     223        int rc = intnetR3IfCallSvc(pThis, VMMR0_DO_INTNET_IF_CLOSE, &CloseReq.Hdr);
    224224        AssertRC(rc);
    225225    }
     
    227227
    228228
    229 DECLHIDDEN(int) IntNetR3IfCtxCreate(PINTNETIFCTX phIfCtx, const char *pszNetwork, INTNETTRUNKTYPE enmTrunkType,
    230                                     const char *pszTrunk, uint32_t cbSend, uint32_t cbRecv, uint32_t fFlags)
     229DECLHIDDEN(int) IntNetR3IfCreate(PINTNETIFCTX phIfCtx, const char *pszNetwork)
     230{
     231    return IntNetR3IfCreateEx(phIfCtx, pszNetwork, kIntNetTrunkType_WhateverNone, "",
     232                              _128K /*cbSend*/, _256K /*cbRecv*/, 0 /*fFlags*/);
     233}
     234
     235
     236DECLHIDDEN(int) IntNetR3IfCreateEx(PINTNETIFCTX phIfCtx, const char *pszNetwork, INTNETTRUNKTYPE enmTrunkType,
     237                                   const char *pszTrunk, uint32_t cbSend, uint32_t cbRecv, uint32_t fFlags)
    231238{
    232239    AssertPtrReturn(phIfCtx, VERR_INVALID_POINTER);
     
    307314                if (RT_SUCCESS(rc))
    308315                {
    309                     rc = intnetR3IfCtxCallSvc(pThis, VMMR0_DO_INTNET_OPEN, &OpenReq.Hdr);
     316                    rc = intnetR3IfCallSvc(pThis, VMMR0_DO_INTNET_OPEN, &OpenReq.Hdr);
    310317                    if (RT_SUCCESS(rc))
    311318                    {
    312319                        pThis->hIf = OpenReq.hIf;
    313320
    314                         rc = intnetR3IfCtxMapBufferPointers(pThis);
     321                        rc = intnetR3IfMapBufferPointers(pThis);
    315322                        if (RT_SUCCESS(rc))
    316323                        {
     
    320327                    }
    321328
    322                     intnetR3IfCtxClose(pThis);
     329                    intnetR3IfClose(pThis);
    323330                }
    324331            }
     
    348355
    349356
    350 DECLHIDDEN(int) IntNetR3IfCtxDestroy(INTNETIFCTX hIfCtx)
    351 {
    352     PINTNETIFCTXINT pThis = hIfCtx;
    353     AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    354 
    355     intnetR3IfCtxClose(pThis);
     357DECLHIDDEN(int) IntNetR3IfDestroy(INTNETIFCTX hIfCtx)
     358{
     359    PINTNETIFCTXINT pThis = hIfCtx;
     360    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     361
     362    intnetR3IfClose(pThis);
    356363
    357364#if defined(VBOX_WITH_INTNET_SERVICE_IN_R3)
     
    374381
    375382
    376 DECLHIDDEN(int) IntNetR3IfCtxQueryBufferPtr(INTNETIFCTX hIfCtx, PINTNETBUF *ppIfBuf)
     383DECLHIDDEN(int) IntNetR3IfQueryBufferPtr(INTNETIFCTX hIfCtx, PINTNETBUF *ppIfBuf)
    377384{
    378385    PINTNETIFCTXINT pThis = hIfCtx;
     
    385392
    386393
    387 DECLHIDDEN(int) IntNetR3IfCtxSetActive(INTNETIFCTX hIfCtx, bool fActive)
     394DECLHIDDEN(int) IntNetR3IfSetActive(INTNETIFCTX hIfCtx, bool fActive)
    388395{
    389396    PINTNETIFCTXINT pThis = hIfCtx;
     
    396403    Req.hIf          = pThis->hIf;
    397404    Req.fActive      = fActive;
    398     return intnetR3IfCtxCallSvc(pThis, VMMR0_DO_INTNET_IF_SET_ACTIVE, &Req.Hdr);
    399 }
    400 
    401 
    402 DECLHIDDEN(int) IntNetR3IfCtxSetPromiscuous(INTNETIFCTX hIfCtx, bool fPromiscuous)
     405    return intnetR3IfCallSvc(pThis, VMMR0_DO_INTNET_IF_SET_ACTIVE, &Req.Hdr);
     406}
     407
     408
     409DECLHIDDEN(int) IntNetR3IfSetPromiscuous(INTNETIFCTX hIfCtx, bool fPromiscuous)
    403410{
    404411    PINTNETIFCTXINT pThis = hIfCtx;
     
    411418    Req.hIf             = pThis->hIf;
    412419    Req.fPromiscuous    = fPromiscuous;
    413     return intnetR3IfCtxCallSvc(pThis, VMMR0_DO_INTNET_IF_SET_PROMISCUOUS_MODE, &Req.Hdr);
     420    return intnetR3IfCallSvc(pThis, VMMR0_DO_INTNET_IF_SET_PROMISCUOUS_MODE, &Req.Hdr);
    414421}
    415422
     
    425432    Req.pSession     = pThis->pSupDrvSession;
    426433    Req.hIf          = pThis->hIf;
    427     return intnetR3IfCtxCallSvc(pThis, VMMR0_DO_INTNET_IF_SEND, &Req.Hdr);
     434    return intnetR3IfCallSvc(pThis, VMMR0_DO_INTNET_IF_SEND, &Req.Hdr);
    428435}
    429436
     
    445452    {
    446453        /* Send an asynchronous message. */
    447         rc = intnetR3IfCtxCallSvcAsync(pThis, VMMR0_DO_INTNET_IF_WAIT, &WaitReq.Hdr);
     454        rc = intnetR3IfCallSvcAsync(pThis, VMMR0_DO_INTNET_IF_WAIT, &WaitReq.Hdr);
    448455        if (RT_SUCCESS(rc))
    449456        {
     
    454461    else
    455462#endif
    456         rc = intnetR3IfCtxCallSvc(pThis, VMMR0_DO_INTNET_IF_WAIT, &WaitReq.Hdr);
     463        rc = intnetR3IfCallSvc(pThis, VMMR0_DO_INTNET_IF_WAIT, &WaitReq.Hdr);
    457464
    458465    return rc;
     
    471478    AbortWaitReq.hIf          = pThis->hIf;
    472479    AbortWaitReq.fNoMoreWaits = true;
    473     return intnetR3IfCtxCallSvc(pThis, VMMR0_DO_INTNET_IF_ABORT_WAIT, &AbortWaitReq.Hdr);
    474 }
     480    return intnetR3IfCallSvc(pThis, VMMR0_DO_INTNET_IF_ABORT_WAIT, &AbortWaitReq.Hdr);
     481}
     482
     483
     484DECLHIDDEN(int) IntNetR3IfPumpPkts(INTNETIFCTX hIfCtx, PFNINPUT pfnInput, void *pvUser,
     485                                      PFNINPUTGSO pfnInputGso, void *pvUserGso)
     486{
     487    PINTNETIFCTXINT pThis = hIfCtx;
     488    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     489    AssertPtrReturn(pfnInput, VERR_INVALID_POINTER);
     490
     491    int rc;
     492    for (;;)
     493    {
     494        rc = IntNetR3IfWait(hIfCtx, RT_INDEFINITE_WAIT);
     495        if (RT_SUCCESS(rc) || rc == VERR_INTERRUPTED || rc == VERR_TIMEOUT)
     496        {
     497            PCINTNETHDR pHdr = IntNetRingGetNextFrameToRead(&pThis->pBuf->Recv);
     498            while (pHdr)
     499            {
     500                const uint8_t u8Type = pHdr->u8Type;
     501                void *pvSegFrame;
     502                uint32_t cbSegFrame;
     503
     504                if (u8Type == INTNETHDR_TYPE_FRAME)
     505                {
     506                    pvSegFrame = IntNetHdrGetFramePtr(pHdr, pThis->pBuf);
     507                    cbSegFrame = pHdr->cbFrame;
     508
     509                    /* pass the frame to the user callback */
     510                    pfnInput(pvUser, pvSegFrame, cbSegFrame);
     511                }
     512                else if (u8Type == INTNETHDR_TYPE_GSO)
     513                {
     514                    size_t cbGso = pHdr->cbFrame;
     515                    size_t cbFrame = cbGso - sizeof(PDMNETWORKGSO);
     516
     517                    PCPDMNETWORKGSO pcGso = IntNetHdrGetGsoContext(pHdr, pThis->pBuf);
     518                    if (PDMNetGsoIsValid(pcGso, cbGso, cbFrame))
     519                    {
     520                        if (pfnInputGso != NULL)
     521                        {
     522                            /* pass the frame to the user GSO input callback if set */
     523                            pfnInputGso(pvUserGso, pcGso, (uint32_t)cbFrame);
     524                        }
     525                        else
     526                        {
     527                            const uint32_t cSegs = PDMNetGsoCalcSegmentCount(pcGso, cbFrame);
     528                            for (uint32_t i = 0; i < cSegs; ++i)
     529                            {
     530                                uint8_t abHdrScratch[256];
     531                                pvSegFrame = PDMNetGsoCarveSegmentQD(pcGso, (uint8_t *)(pcGso + 1), cbFrame,
     532                                                                     abHdrScratch,
     533                                                                     i, cSegs,
     534                                                                     &cbSegFrame);
     535
     536                                /* pass carved frames to the user input callback */
     537                                pfnInput(pvUser, pvSegFrame, (uint32_t)cbSegFrame);
     538                            }
     539                        }
     540                    }
     541                }
     542
     543                /* advance to the next input frame */
     544                IntNetRingSkipFrame(&pThis->pBuf->Recv);
     545                pHdr = IntNetRingGetNextFrameToRead(&pThis->pBuf->Recv);
     546            }
     547        }
     548        else
     549            break;
     550    }
     551    return rc;
     552}
     553
     554
     555DECLHIDDEN(int) IntNetR3IfQueryOutputFrame(INTNETIFCTX hIfCtx, uint32_t cbFrame, PINTNETFRAME pFrame)
     556{
     557    PINTNETIFCTXINT pThis = hIfCtx;
     558    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     559
     560    return IntNetRingAllocateFrame(&pThis->pBuf->Send, cbFrame, &pFrame->pHdr, &pFrame->pvFrame);
     561}
     562
     563
     564DECLHIDDEN(int) IntNetR3IfOutputFrameCommit(INTNETIFCTX hIfCtx, PCINTNETFRAME pFrame)
     565{
     566    PINTNETIFCTXINT pThis = hIfCtx;
     567    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     568
     569    IntNetRingCommitFrame(&pThis->pBuf->Send, pFrame->pHdr);
     570    return IntNetR3IfSend(hIfCtx);
     571}
  • trunk/src/VBox/NetworkServices/NetLib/IntNetIf.h

    r97075 r97078  
    5151typedef INTNETIFCTX *PINTNETIFCTX;
    5252
     53/**
     54 * User input callback function.
     55 *
     56 * @param pvUser    The user specified argument.
     57 * @param pvFrame   The pointer to the frame data.
     58 * @param cbFrame   The length of the frame data.
     59 */
     60typedef DECLCALLBACKTYPE(void, FNINPUT,(void *pvUser, void *pvFrame, uint32_t cbFrame));
    5361
    54 DECLHIDDEN(int) IntNetR3IfCtxCreate(PINTNETIFCTX phIfCtx, const char *pszNetwork, INTNETTRUNKTYPE enmTrunkType,
    55                                     const char *pszTrunk, uint32_t cbSend, uint32_t cbRecv, uint32_t fFlags);
    56 DECLHIDDEN(int) IntNetR3IfCtxDestroy(INTNETIFCTX hIfCtx);
    57 DECLHIDDEN(int) IntNetR3IfCtxQueryBufferPtr(INTNETIFCTX hIfCtx, PINTNETBUF *ppIfBuf);
    58 DECLHIDDEN(int) IntNetR3IfCtxSetActive(INTNETIFCTX hIfCtx, bool fActive);
    59 DECLHIDDEN(int) IntNetR3IfCtxSetPromiscuous(INTNETIFCTX hIfCtx, bool fPromiscuous);
     62/** Pointer to the user input callback function. */
     63typedef FNINPUT *PFNINPUT;
     64
     65/**
     66 * User GSO input callback function.
     67 *
     68 * @param pvUser    The user specified argument.
     69 * @param pcGso     The pointer to the GSO context.
     70 * @param cbFrame   The length of the GSO data.
     71 */
     72typedef DECLCALLBACKTYPE(void, FNINPUTGSO,(void *pvUser, PCPDMNETWORKGSO pcGso, uint32_t cbFrame));
     73
     74/** Pointer to the user GSO input callback function. */
     75typedef FNINPUTGSO *PFNINPUTGSO;
     76
     77
     78/**
     79 * An output frame in the send ring buffer.
     80 *
     81 * Obtained with IntNetR3IfCtxQueryOutputFrame().  Caller should copy frame
     82 * contents to pvFrame and pass the frame structure to IntNetR3IfCtxOutputFrameCommit()
     83 * to be sent to the network.
     84 */
     85typedef struct INTNETFRAME
     86{
     87    /** The intrnal network frame header. */
     88    PINTNETHDR pHdr;
     89    /** The actual frame data. */
     90    void       *pvFrame;
     91} INTNETFRAME;
     92typedef INTNETFRAME *PINTNETFRAME;
     93typedef const INTNETFRAME *PCINTNETFRAME;
     94
     95
     96DECLHIDDEN(int) IntNetR3IfCreate(PINTNETIFCTX phIfCtx, const char *pszNetwork);
     97DECLHIDDEN(int) IntNetR3IfCreateEx(PINTNETIFCTX phIfCtx, const char *pszNetwork, INTNETTRUNKTYPE enmTrunkType,
     98                                   const char *pszTrunk, uint32_t cbSend, uint32_t cbRecv, uint32_t fFlags);
     99DECLHIDDEN(int) IntNetR3IfDestroy(INTNETIFCTX hIfCtx);
     100DECLHIDDEN(int) IntNetR3IfQueryBufferPtr(INTNETIFCTX hIfCtx, PINTNETBUF *ppIfBuf);
     101DECLHIDDEN(int) IntNetR3IfSetActive(INTNETIFCTX hIfCtx, bool fActive);
     102DECLHIDDEN(int) IntNetR3IfSetPromiscuous(INTNETIFCTX hIfCtx, bool fPromiscuous);
    60103DECLHIDDEN(int) IntNetR3IfSend(INTNETIFCTX hIfCtx);
    61104DECLHIDDEN(int) IntNetR3IfWait(INTNETIFCTX hIfCtx, uint32_t cMillies);
    62105DECLHIDDEN(int) IntNetR3IfWaitAbort(INTNETIFCTX hIfCtx);
    63106
    64 
    65 /**
    66  * Convenience class implementing an IntNet connection.
    67  */
    68 class IntNetIf
    69 {
    70 public:
    71     /**
    72      * User input callback function.
    73      *
    74      * @param pvUser    The user specified argument.
    75      * @param pvFrame   The pointer to the frame data.
    76      * @param cbFrame   The length of the frame data.
    77      */
    78     typedef DECLCALLBACKTYPE(void, FNINPUT,(void *pvUser, void *pvFrame, uint32_t cbFrame));
    79 
    80     /** Pointer to the user input callback function. */
    81     typedef FNINPUT *PFNINPUT;
    82 
    83     /**
    84      * User GSO input callback function.
    85      *
    86      * @param pvUser    The user specified argument.
    87      * @param pcGso     The pointer to the GSO context.
    88      * @param cbFrame   The length of the GSO data.
    89      */
    90     typedef DECLCALLBACKTYPE(void, FNINPUTGSO,(void *pvUser, PCPDMNETWORKGSO pcGso, uint32_t cbFrame));
    91 
    92     /** Pointer to the user GSO input callback function. */
    93     typedef FNINPUTGSO *PFNINPUTGSO;
    94 
    95 
    96     /**
    97      * An output frame in the send ring buffer.
    98      *
    99      * Obtained with getOutputFrame().  Caller should copy frame
    100      * contents to pvFrame and pass the frame structure to ifOutput()
    101      * to be sent to the network.
    102      */
    103     struct Frame {
    104         PINTNETHDR pHdr;
    105         void *pvFrame;
    106     };
    107 
    108 
    109 private:
    110     INTNETIFCTX m_hIf;
    111     PINTNETBUF  m_pIfBuf;
    112 
    113     PFNINPUT m_pfnInput;
    114     void *m_pvUser;
    115 
    116     PFNINPUTGSO m_pfnInputGSO;
    117     void *m_pvUserGSO;
    118 
    119 public:
    120     IntNetIf();
    121     ~IntNetIf();
    122 
    123     int init(const RTCString &strNetwork,
    124              INTNETTRUNKTYPE enmTrunkType = kIntNetTrunkType_WhateverNone,
    125              const RTCString &strTrunk = RTCString());
    126     void uninit();
    127 
    128     int setInputCallback(PFNINPUT pfnInput, void *pvUser);
    129     int setInputGSOCallback(PFNINPUTGSO pfnInputGSO, void *pvUser);
    130 
    131     int ifSetPromiscuous(bool fPromiscuous = true);
    132 
    133     int ifPump();
    134     int ifAbort();
    135 
    136     int getOutputFrame(Frame &rFrame, size_t cbFrame);
    137     int ifOutput(Frame &rFrame);
    138 
    139     int ifClose();
    140 
    141 private:
    142     int ifOpen(const RTCString &strNetwork,
    143                INTNETTRUNKTYPE enmTrunkType,
    144                const RTCString &strTrunk);
    145     int ifGetBuf();
    146     int ifActivate();
    147 
    148     int ifWait(uint32_t cMillies = RT_INDEFINITE_WAIT);
    149     int ifProcessInput();
    150 
    151     int ifFlush();
    152 };
     107DECLHIDDEN(int) IntNetR3IfPumpPkts(INTNETIFCTX hIfCtx, PFNINPUT pfnInput, void *pvUser,
     108                                   PFNINPUTGSO pfnInputGso, void *pvUserGso);
     109DECLHIDDEN(int) IntNetR3IfQueryOutputFrame(INTNETIFCTX hIfCtx, uint32_t cbFrame, PINTNETFRAME pFrame);
     110DECLHIDDEN(int) IntNetR3IfOutputFrameCommit(INTNETIFCTX hIfCtx, PCINTNETFRAME pFrame);
    153111
    154112#endif /* !VBOX_INCLUDED_SRC_NetLib_IntNetIf_h */
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