Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Functions
crc16-tvb.h File Reference
#include "ws_symbol_export.h"

Go to the source code of this file.

Functions

WS_DLL_PUBLIC uint16_t crc16_ccitt_tvb (tvbuff_t *tvb, unsigned len)
 
WS_DLL_PUBLIC uint16_t crc16_x25_ccitt_tvb (tvbuff_t *tvb, unsigned len)
 
WS_DLL_PUBLIC uint16_t crc16_r3_ccitt_tvb (tvbuff_t *tvb, int offset, unsigned len)
 
WS_DLL_PUBLIC uint16_t crc16_ccitt_tvb_offset (tvbuff_t *tvb, unsigned offset, unsigned len)
 
WS_DLL_PUBLIC uint16_t crc16_ccitt_tvb_seed (tvbuff_t *tvb, unsigned len, uint16_t seed)
 
WS_DLL_PUBLIC uint16_t crc16_ccitt_tvb_offset_seed (tvbuff_t *tvb, unsigned offset, unsigned len, uint16_t seed)
 
WS_DLL_PUBLIC uint16_t crc16_iso14443a_tvb_offset (tvbuff_t *tvb, unsigned offset, unsigned len)
 
WS_DLL_PUBLIC uint16_t crc16_usb_tvb_offset (tvbuff_t *tvb, unsigned offset, unsigned len)
 
WS_DLL_PUBLIC uint16_t crc16_plain_tvb_offset (tvbuff_t *tvb, unsigned offset, unsigned len)
 
WS_DLL_PUBLIC uint16_t crc16_plain_tvb_offset_seed (tvbuff_t *tvb, unsigned offset, unsigned len, uint16_t crc)
 
WS_DLL_PUBLIC uint16_t crc16_0x9949_tvb_offset_seed (tvbuff_t *tvb, unsigned offset, unsigned len, uint16_t seed)
 
WS_DLL_PUBLIC uint16_t crc16_0x3D65_tvb_offset_seed (tvbuff_t *tvb, unsigned offset, unsigned len, uint16_t seed)
 

Detailed Description

Declaration of CRC-16 tvbuff routines

2004 Richard van der Hoff richa.nosp@m.rdv@.nosp@m.mxtel.nosp@m.ecom.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

◆ crc16_0x3D65_tvb_offset_seed()

WS_DLL_PUBLIC uint16_t crc16_0x3D65_tvb_offset_seed ( tvbuff_t tvb,
unsigned  offset,
unsigned  len,
uint16_t  seed 
)

Compute CRC16 checksum of a tv buffer using the parameters Width = 16 bits Poly = 0x3D65 Reflection = true Algorithm = table-driven

Parameters
tvbThe tv buffer containing the data.
offsetThe offset into the tv buffer.
lenThe number of bytes to include in the computation.
seedThe seed to use.
Returns
The CRC16 checksum.

◆ crc16_0x9949_tvb_offset_seed()

WS_DLL_PUBLIC uint16_t crc16_0x9949_tvb_offset_seed ( tvbuff_t tvb,
unsigned  offset,
unsigned  len,
uint16_t  seed 
)

Compute CRC16 checksum of a tv buffer using the parameters Width = 16 bits Poly = 0x9949 Reflection = true Algorithm = table-driven

Parameters
tvbThe tv buffer containing the data.
offsetThe offset into the tv buffer.
lenThe number of bytes to include in the computation.
seedThe seed to use.
Returns
The CRC16 checksum.

◆ crc16_ccitt_tvb()

WS_DLL_PUBLIC uint16_t crc16_ccitt_tvb ( tvbuff_t tvb,
unsigned  len 
)

Compute CRC16 CCITT checksum of a tv buffer.

Parameters
tvbThe tv buffer containing the data.
lenThe number of bytes to include in the computation.
Returns
The CRC16 CCITT checksum.

◆ crc16_ccitt_tvb_offset()

WS_DLL_PUBLIC uint16_t crc16_ccitt_tvb_offset ( tvbuff_t tvb,
unsigned  offset,
unsigned  len 
)

Compute CRC16 CCITT checksum of a tv buffer.

Parameters
tvbThe tv buffer containing the data.
offsetThe offset into the tv buffer.
lenThe number of bytes to include in the computation.
Returns
The CRC16 CCITT checksum.

◆ crc16_ccitt_tvb_offset_seed()

WS_DLL_PUBLIC uint16_t crc16_ccitt_tvb_offset_seed ( tvbuff_t tvb,
unsigned  offset,
unsigned  len,
uint16_t  seed 
)

Compute CRC16 CCITT checksum of a tv buffer. If computing the checksum over multiple tv buffers and you want to feed the partial CRC16 back in, remember to take the 1's complement of the partial CRC16 first.

Parameters
tvbThe tv buffer containing the data.
offsetThe offset into the tv buffer.
lenThe number of bytes to include in the computation.
seedThe seed to use.
Returns
The CRC16 CCITT checksum (using the given seed).

◆ crc16_ccitt_tvb_seed()

WS_DLL_PUBLIC uint16_t crc16_ccitt_tvb_seed ( tvbuff_t tvb,
unsigned  len,
uint16_t  seed 
)

Compute CRC16 CCITT checksum of a tv buffer. If computing the checksum over multiple tv buffers and you want to feed the partial CRC16 back in, remember to take the 1's complement of the partial CRC16 first.

Parameters
tvbThe tv buffer containing the data.
lenThe number of bytes to include in the computation.
seedThe seed to use.
Returns
The CRC16 CCITT checksum (using the given seed).

◆ crc16_iso14443a_tvb_offset()

WS_DLL_PUBLIC uint16_t crc16_iso14443a_tvb_offset ( tvbuff_t tvb,
unsigned  offset,
unsigned  len 
)

Compute the 16bit CRC_A value of a tv buffer as defined in ISO14443-3.

Parameters
tvbThe tv buffer containing the data.
offsetThe offset into the tv buffer.
lenThe number of bytes to include in the computation.
Returns
The calculated CRC_A.

◆ crc16_plain_tvb_offset()

WS_DLL_PUBLIC uint16_t crc16_plain_tvb_offset ( tvbuff_t tvb,
unsigned  offset,
unsigned  len 
)

Compute the "plain" CRC16 checksum of a tv buffer using the following parameters: Width = 16 Poly = 0x8005 XorIn = 0x0000 ReflectIn = True XorOut = 0x0000 ReflectOut = True Algorithm = table-driven Direct = True

Parameters
tvbThe tv buffer containing the data.
offsetThe offset into the tv buffer.
lenThe number of bytes to include in the computation.
Returns
The CRC16 checksum.

◆ crc16_plain_tvb_offset_seed()

WS_DLL_PUBLIC uint16_t crc16_plain_tvb_offset_seed ( tvbuff_t tvb,
unsigned  offset,
unsigned  len,
uint16_t  crc 
)

Compute the "plain" CRC16 checksum of a tv buffer using the following parameters: Width = 16 Poly = 0x8005 XorIn = 0x0000 ReflectIn = True XorOut = 0x0000 ReflectOut = True Algorithm = table-driven Direct = True

Parameters
tvbThe tv buffer containing the data.
offsetThe offset into the tv buffer.
lenThe number of bytes to include in the computation.
crcStarting CRC value
Returns
The CRC16 checksum.

◆ crc16_r3_ccitt_tvb()

WS_DLL_PUBLIC uint16_t crc16_r3_ccitt_tvb ( tvbuff_t tvb,
int  offset,
unsigned  len 
)

Compute CRC16 ASSA R3 CCITT checksum of a tv buffer.

Parameters
tvbThe tv buffer containing the data.
offsetThe offset into tv buffer containing the data.
lenThe number of bytes to include in the computation.
Returns
The CRC16 X.25 CCITT checksum.

◆ crc16_usb_tvb_offset()

WS_DLL_PUBLIC uint16_t crc16_usb_tvb_offset ( tvbuff_t tvb,
unsigned  offset,
unsigned  len 
)

Compute the 16bit CRC value of a tv buffer as defined in USB Standard.

Parameters
tvbThe tv buffer containing the data.
offsetThe offset into the tv buffer.
lenThe number of bytes to include in the computation.
Returns
The calculated CRC.

◆ crc16_x25_ccitt_tvb()

WS_DLL_PUBLIC uint16_t crc16_x25_ccitt_tvb ( tvbuff_t tvb,
unsigned  len 
)

Compute CRC16 X.25 CCITT checksum of a tv buffer.

Parameters
tvbThe tv buffer containing the data.
lenThe number of bytes to include in the computation.
Returns
The CRC16 X.25 CCITT checksum.