VirtualBox

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/NAT
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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;
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