Wireshark 2.9.0-477-g68ec514b The Wireshark network protocol analyzer

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

Functions
crc16-plain.c File Reference
`#include "wsutil/crc16-plain.h"`
`#include <stdlib.h>`

## Functions
long | crc16_plain_reflect (long data, size_t data_len)
crc16_plain_t | crc16_plain_update (crc16_plain_t crc, const unsigned char *data, size_t data_len)
guint16 | crc16_8005_noreflect_noxor (const guint8 *data, guint64 data_len)

## Detailed Description

Functions and types for CRC checks.

Generated on Wed Mar 18 14:12:09 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.

## Function Documentation

guint16 crc16_8005_noreflect_noxor | ( | const guint8 * | data,
|  | guint64 | 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.

Parameters

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

Returns
  The crc value.

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.

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.