Lines Matching refs:pTcpHdr

230  * @param   pTcpHdr         Pointer to the TCP header to checksum, network
235 DECLINLINE(uint32_t) rtNetIPv4AddTCPChecksum(PCRTNETTCP pTcpHdr, uint32_t u32Sum)
237 uint16_t const *paw = (uint16_t const *)pTcpHdr;
248 if (pTcpHdr->th_off > RTNETTCP_MIN_LEN / 4)
251 switch (pTcpHdr->th_off)
276 * @param pTcpHdr Pointer to the TCP header to checksum, network
281 RTDECL(uint32_t) RTNetIPv4AddTCPChecksum(PCRTNETTCP pTcpHdr, uint32_t u32Sum)
283 return rtNetIPv4AddTCPChecksum(pTcpHdr, u32Sum);
507 * @param pTcpHdr Pointer to the TCP header, in network endian (big).
513 RTDECL(uint16_t) RTNetIPv4TCPChecksum(PCRTNETIPV4 pIpHdr, PCRTNETTCP pTcpHdr, void const *pvData)
518 u32Sum = rtNetIPv4AddTCPChecksum(pTcpHdr, u32Sum);
520 cbData = RT_BE2H_U16(pIpHdr->ip_len) - pIpHdr->ip_hl * 4 - pTcpHdr->th_off * 4;
521 u32Sum = rtNetIPv4AddDataChecksum(pvData ? pvData : (uint8_t const *)pTcpHdr + pTcpHdr->th_off * 4,
537 * @param pTcpHdr Pointer to the TCP header, in network endian (big).
541 RTDECL(uint16_t) RTNetTCPChecksum(uint32_t u32Sum, PCRTNETTCP pTcpHdr, void const *pvData, size_t cbData)
544 u32Sum = rtNetIPv4AddTCPChecksum(pTcpHdr, u32Sum);
558 * @param pTcpHdr Pointer to the TCP header, in network endian (big).
559 * @param cbHdrMax The max TCP header size (what pTcpHdr points to).
562 DECLINLINE(bool) rtNetIPv4IsTCPSizeValid(PCRTNETIPV4 pIpHdr, PCRTNETTCP pTcpHdr, size_t cbHdrMax, size_t cbPktMax)
574 cbTcpHdr = pTcpHdr->th_off * 4;
590 * @param pTcpHdr Pointer to the TCP header, in network endian (big).
591 * @param cbHdrMax The max TCP header size (what pTcpHdr points to).
594 RTDECL(bool) RTNetIPv4IsTCPSizeValid(PCRTNETIPV4 pIpHdr, PCRTNETTCP pTcpHdr, size_t cbHdrMax, size_t cbPktMax)
596 return rtNetIPv4IsTCPSizeValid(pIpHdr, pTcpHdr, cbHdrMax, cbPktMax);
607 * @param pTcpHdr Pointer to the TCP header, in network endian (big).
608 * @param cbHdrMax The max TCP header size (what pTcpHdr points to).
616 RTDECL(bool) RTNetIPv4IsTCPValid(PCRTNETIPV4 pIpHdr, PCRTNETTCP pTcpHdr, size_t cbHdrMax, void const *pvData, size_t cbPktMax,
619 if (RT_UNLIKELY(!rtNetIPv4IsTCPSizeValid(pIpHdr, pTcpHdr, cbHdrMax, cbPktMax)))
623 uint16_t u16Sum = RTNetIPv4TCPChecksum(pIpHdr, pTcpHdr, pvData);
624 if (RT_UNLIKELY(pTcpHdr->th_sum != u16Sum))