libosmocore
1.10.0
Osmocom core library
|
Files | |
file | crc16.h |
This was copied from the linux kernel and adjusted for our types. | |
file | crcgen.h |
Osmocom generic CRC routines global header. | |
file | crc16.c |
This was copied from the linux kernel and adjusted for our types. | |
Functions | |
uint16_t | osmo_crc16 (uint16_t crc, uint8_t const *buffer, size_t len) |
Compute 16bit CCITT polynome 0x8408 (x^0 + x^5 + x^12) over given buffer. More... | |
static uint16_t | osmo_crc16_byte (uint16_t crc, const uint8_t data) |
CRC-16 polynome 0x8005 (x^16 + x^15 + x^2 + 1) More... | |
uint16_t | osmo_crc16_ccitt (uint16_t crc, uint8_t const *buffer, size_t len) |
Compute 16bit CCITT polynome 0x8408 (x^0 + x^5 + x^12) over given buffer. More... | |
static uint16_t | osmo_crc16_ccitt_byte (uint16_t crc, const uint8_t data) |
CCITT polynome 0x8408 (x^0 + x^5 + x^12) More... | |
Variables | |
uint16_t const | osmo_crc16_table [256] |
CRC table for the CRC-16. More... | |
uint16_t const | osmo_crc16_ccitt_table [256] |
CRC table for the CCITT CRC-6. More... | |
uint16_t const | osmo_crc16_table [256] |
CRC table for the CRC-16. More... | |
uint16_t const | osmo_crc16_ccitt_table [256] |
CRC table for the CCITT CRC-6. More... | |
uint16_t osmo_crc16 | ( | uint16_t | crc, |
uint8_t const * | buffer, | ||
size_t | len | ||
) |
Compute 16bit CCITT polynome 0x8408 (x^0 + x^5 + x^12) over given buffer.
crc[in] | previous CRC value |
buffer[in] | data pointer |
len[in] | number of bytes in input buffer |
References len(), and osmo_crc16_byte().
|
inlinestatic |
CRC-16 polynome 0x8005 (x^16 + x^15 + x^2 + 1)
References data, and osmo_crc16_table.
Referenced by osmo_crc16().
uint16_t osmo_crc16_ccitt | ( | uint16_t | crc, |
uint8_t const * | buffer, | ||
size_t | len | ||
) |
Compute 16bit CCITT polynome 0x8408 (x^0 + x^5 + x^12) over given buffer.
[in] | crc | initial value of CRC |
[in] | buffer | pointer to buffer of input data |
[in] | len | length of buffer in bytes |
References len(), and osmo_crc16_ccitt_byte().
|
inlinestatic |
CCITT polynome 0x8408 (x^0 + x^5 + x^12)
References data, and osmo_crc16_ccitt_table.
Referenced by osmo_crc16_ccitt().
|
extern |
CRC table for the CCITT CRC-6.
The poly is 0x8408 (x^0 + x^5 + x^12)
Referenced by osmo_crc16_ccitt_byte().
uint16_t const osmo_crc16_ccitt_table[256] |
CRC table for the CCITT CRC-6.
The poly is 0x8408 (x^0 + x^5 + x^12)
Referenced by osmo_crc16_ccitt_byte().
|
extern |
CRC table for the CRC-16.
The poly is 0x8005 (x^16 + x^15 + x^2 + 1)
Referenced by osmo_crc16_byte().
uint16_t const osmo_crc16_table[256] |
CRC table for the CRC-16.
The poly is 0x8005 (x^16 + x^15 + x^2 + 1)
Referenced by osmo_crc16_byte().