Lines Matching full:fcs
56 #define PPP_INITFCS 0xffff /* Initial FCS value */
57 #define PPP_GOODFCS 0xf0b8 /* Good final FCS value */
102 static uint16_t Crc16(uint16_t fcs, u_char *cp, int len);
385 uint16_t fcs, lenn; in ng_pred1_compress() local
415 /* Compute FCS. */ in ng_pred1_compress()
416 fcs = Crc16(PPP_INITFCS, (u_char *)&lenn, 2); in ng_pred1_compress()
417 fcs = Crc16(fcs, priv->inbuf + 2, inlen); in ng_pred1_compress()
418 fcs = ~fcs; in ng_pred1_compress()
437 /* Add FCS. */ in ng_pred1_compress()
438 (out + outlen)[0] = fcs & 0xFF; in ng_pred1_compress()
439 (out + outlen)[1] = fcs >> 8; in ng_pred1_compress()
468 uint16_t fcs; in ng_pred1_decompress() local
521 fcs = Crc16(PPP_INITFCS, (u_char *)&lenn, 2); in ng_pred1_decompress()
522 fcs = Crc16(fcs, priv->outbuf, len); in ng_pred1_decompress()
523 fcs = Crc16(fcs, priv->inbuf + inlen - 2, 2); in ng_pred1_decompress()
525 if (fcs != PPP_GOODFCS) { in ng_pred1_decompress()
554 m_adj(m, -2); /* Strip fcs. */ in ng_pred1_decompress()