| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Macros | Typedefs | Functions
crc16-plain.h File Reference
`#include <stddef.h>`
`#include <stdint.h>`
`#include "ws_symbol_export.h"`

Go to the source code of this file.

## Macros
#define | CRC_ALGO_TABLE_DRIVEN 1

## Typedefs
typedef uint16_t | crc16_plain_t

## Functions
long | crc16_plain_reflect (long data, size_t data_len)
| Reflect all bits of a data word of data_len bytes.
WS_DLL_PUBLIC crc16_plain_t | crc16_plain_update (crc16_plain_t crc, const unsigned char *data, size_t data_len)
| Update the crc value with new data.
WS_DLL_PUBLIC uint16_t | crc16_8005_noreflect_noxor (const uint8_t *data, uint64_t data_len)
| Calculate the crc-16 (x^16 + x^15 + x^2 + 1) value for data. Note that this CRC is not equal to crc16_plain.

## Detailed Description

http://www.tty1.net/pycrc/faq_en.html#code-ownership

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

Functions and types for CRC checks.

Generated on Wed Mar 18 14:12:15 2009, by pycrc v0.7, http://www.tty1.net/pycrc/ using the configuration: Width = 16 Poly = 0x8005 XorIn = 0x0000 ReflectIn = True XorOut = 0x0000 ReflectOut = True Algorithm = table-driven Direct = True

Modified 2009-03-16 not to include <stdint.h> as our Win32 environment appears not to have it; we're using GLib types, instead.

## Macro Definition Documentation

## ◆ CRC_ALGO_TABLE_DRIVEN

#define CRC_ALGO_TABLE_DRIVEN 1

The definition of the used algorithm.

## Typedef Documentation

## ◆ crc16_plain_t

typedef uint16_t crc16_plain_t

The type of the CRC values.

This type must be big enough to contain at least 16 bits.

## Function Documentation

## ◆ crc16_8005_noreflect_noxor()

WS_DLL_PUBLIC uint16_t crc16_8005_noreflect_noxor | ( | const uint8_t * | data,
|  | uint64_t | data_len
| ) |  |

Calculate the crc-16 (x^16 + x^15 + x^2 + 1) value for data. Note that this CRC is not equal to crc16_plain.

Generated on Tue Jul 24 09:08:46 2012, by pycrc v0.7.10, http://www.tty1.net/pycrc/ using the configuration: Width = 16 Poly = 0x8005 XorIn = 0x0000 ReflectIn = False XorOut = 0x0000 ReflectOut = False Algorithm = table-driven

Parameters

  data | Pointer to a buffer of data_len bytes.
  data_len | Number of bytes in the data buffer.

Returns
  The crc value.

Calculate the crc-16 (x^16 + x^15 + x^2 + 1) value for data. Note that this CRC is not equal to crc16_plain.

Parameters

  data | Pointer to a buffer of data_len bytes.
  data_len | Number of bytes in the data buffer.

Returns
  The crc value.

## ◆ crc16_plain_reflect()

long crc16_plain_reflect | ( | long | data,
|  | size_t | data_len
| ) |  |

Reflect all bits of a data word of data_len bytes.

Parameters

  data | The data word to be reflected.
  data_len | The width of data expressed in number of bits.

Returns
  The reflected data.

Reflect all bits of a data word of data_len bytes.

Parameters

  data | The data word to be reflected.
  data_len | The width of data expressed in number of bits.

Returns
  The reflected data.

## ◆ crc16_plain_update()

WS_DLL_PUBLIC crc16_plain_t crc16_plain_update | ( | crc16_plain_t | crc,
|  | const unsigned char * | data,
|  | size_t | data_len
| ) |  |

Update the crc value with new data.

Parameters

  crc | The current crc value.
  data | Pointer to a buffer of data_len bytes.
  data_len | Number of bytes in the data buffer.

Returns
  The updated crc value.

Update the crc value with new data.

Parameters

  crc | The current crc value.
  data | Pointer to a buffer of data_len bytes.
  data_len | Number of bytes in the data buffer.

Returns
  The updated crc value.