Lines Matching defs:pMBuf

348  * @param   pMBuf           The mbuf.
351 DECLINLINE(bool) vboxNetFltDarwinMBufIsOur(PVBOXNETFLTINS pThis, mbuf_t pMBuf, void *pvFrame)
360 errno_t err = mbuf_tag_find(pMBuf, g_idTag, 0 /* type */, &cbTagData, (void **)&pTagData);
370 pEthHdr = (PCRTNETETHERHDR)mbuf_pkthdr_header(pMBuf);
372 pEthHdr = (PCRTNETETHERHDR)mbuf_data(pMBuf);
512 * @param pMBuf The mbuf.
515 DECLINLINE(unsigned) vboxNetFltDarwinMBufCalcSGSegs(PVBOXNETFLTINS pThis, mbuf_t pMBuf, void *pvFrame)
523 for (mbuf_t pCur = pMBuf; pCur; pCur = mbuf_next(pCur))
528 && (uintptr_t)pvFrame - (uintptr_t)mbuf_datastart(pMBuf) < mbuf_maxlen(pMBuf))
537 if (mbuf_pkthdr_len(pMBuf) < 60)
555 * @param pMBuf The mbuf.
562 DECLINLINE(void) vboxNetFltDarwinMBufToSG(PVBOXNETFLTINS pThis, mbuf_t pMBuf, void *pvFrame, PINTNETSG pSG, unsigned cSegs, uint32_t fSrc)
571 for (mbuf_t pCur = pMBuf; pCur; pCur = mbuf_next(pCur))
581 void *pvStart = mbuf_datastart(pMBuf);
584 Assert(pvStart && pvSeg && offSeg < mbuf_maxlen(pMBuf) && offSegEnd <= mbuf_maxlen(pMBuf)); NOREF(offSegEnd);
593 pvFrame, pvStart, pvSeg, offSeg, cbSeg, offSegEnd, offFrame, mbuf_maxlen(pMBuf)));
607 && (uintptr_t)pvFrame - (uintptr_t)mbuf_datastart(pMBuf) < mbuf_maxlen(pMBuf))
609 cbSeg = (uintptr_t)mbuf_datastart(pMBuf) + mbuf_maxlen(pMBuf) - (uintptr_t)pvFrame;
684 AssertMsg(!pvFrame, ("pvFrame=%p pMBuf=%p iSeg=%d\n", pvFrame, pMBuf, iSeg));
863 * @param pMBuf The mbuf.
868 static errno_t vboxNetFltDarwinIffInputOutputWorker(PVBOXNETFLTINS pThis, mbuf_t pMBuf, void *pvFrame,
874 Log2(("vboxNetFltDarwinIffInputOutputWorker: pThis=%p pMBuf=%p pvFrame=%p fSrc=%#x cbPkt=%x\n",
875 pThis, pMBuf, pvFrame, fSrc, pMBuf ? mbuf_pkthdr_len(pMBuf) : -1));
876 if (!pMBuf)
879 if (mbuf_pkthdr_len(pMBuf) > 0x300)
881 uint8_t *pb = (uint8_t *)(pvFrame ? pvFrame : mbuf_data(pMBuf));
885 if (vboxNetFltDarwinMBufIsOur(pThis, pMBuf, pvFrame))
903 mbuf_outbound_finalize(pMBuf, eProtocol, sizeof(RTNETETHERHDR));
910 unsigned cSegs = vboxNetFltDarwinMBufCalcSGSegs(pThis, pMBuf, pvFrame);
914 vboxNetFltDarwinMBufToSG(pThis, pMBuf, pvFrame, pSG, cSegs, fSrc);
927 mbuf_freem(pMBuf);
1123 mbuf_t pMBuf = vboxNetFltDarwinMBufFromSG(pThis, pSG);
1124 if (pMBuf)
1126 errno_t err = ifnet_output_raw(pIfNet, PF_LINK, pMBuf);
1139 mbuf_t pMBuf = vboxNetFltDarwinMBufFromSG(pThis, pSG);
1140 if (pMBuf)
1144 mbuf_pkthdr_setheader(pMBuf, mbuf_data(pMBuf));
1145 mbuf_pkthdr_setlen(pMBuf, mbuf_pkthdr_len(pMBuf) - cbEthHdr);
1146 mbuf_setdata(pMBuf, (uint8_t *)mbuf_data(pMBuf) + cbEthHdr, mbuf_len(pMBuf) - cbEthHdr);
1147 mbuf_pkthdr_setrcvif(pMBuf, pIfNet); /* will crash without this. */
1149 errno_t err = ifnet_input(pIfNet, pMBuf, NULL);