Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Functions
crc5.h File Reference
#include <wireshark.h>

Go to the source code of this file.

Functions

WS_DLL_PUBLIC uint8_t crc5_usb_11bit_input (uint16_t input)
 Compute the 5-bit CRC value for a USB token using the CRC-5 polynomial.
 
WS_DLL_PUBLIC uint8_t crc5_usb_19bit_input (uint32_t input)
 Compute the 5-bit CRC value for a USB token using the CRC-5 polynomial.
 

Detailed Description

Declaration of CRC-5 routines and table

2019 Tomasz Mon desow.nosp@m.in@g.nosp@m.mail..nosp@m.com

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later

Function Documentation

◆ crc5_usb_11bit_input()

WS_DLL_PUBLIC uint8_t crc5_usb_11bit_input ( uint16_t  input)

Compute the 5-bit CRC value for a USB token using the CRC-5 polynomial.

Implements the CRC-5 checksum algorithm as defined in the USB 2.0 Specification. The calculation is performed on the lower 11 bits of the input value; any higher bits are ignored. This function is typically used to validate USB token packets.

Parameters
input11-bit input value (lower 11 bits of input are used).
Returns
5-bit CRC checksum.

◆ crc5_usb_19bit_input()

WS_DLL_PUBLIC uint8_t crc5_usb_19bit_input ( uint32_t  input)

Compute the 5-bit CRC value for a USB token using the CRC-5 polynomial.

Implements the CRC-5 checksum algorithm as defined in the USB 2.0 Specification. The calculation is performed on the lower 19 bits of the input value; any higher bits are ignored. This function is typically used to validate USB handshake packets or other protocol elements that utilize extended bit-width tokens.

Parameters
input19-bit input value (lower 19 bits of input are used).
Returns
5-bit CRC checksum.