Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Macros | Typedefs | Functions
reedsolomon.h File Reference

Go to the source code of this file.

Macros

#define MM   8 /* Symbol size in bits */
 
#define KK   207 /* Number of data symbols per block */
 
#define B0   1 /* First root of generator polynomial, alpha form */
 
#define PRIM   1 /* power of alpha used to generate roots of generator poly */
 
#define STANDARD_ORDER
 
#define NN   ((1 << MM) - 1)
 

Typedefs

typedef unsigned char dtype
 

Functions

int encode_rs (dtype data[], dtype bb[])
 Encodes data using Reed-Solomon error correction.
 
int eras_dec_rs (dtype data[], int eras_pos[], int no_eras)
 Performs ERRORS+ERASURES decoding of Reed-Solomon codes.
 

Detailed Description

Global definitions for Reed-Solomon encoder/decoder, by Phil Karn (karn@.nosp@m.ka9q.nosp@m..ampr.nosp@m..org) September 1996 Copyright 1999 Phil Karn, KA9Q

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

◆ encode_rs()

int encode_rs ( dtype  data[],
dtype  bb[] 
)

Encodes data using Reed-Solomon error correction.

Reed-Solomon encoding data[] is the input block, parity symbols are placed in bb[] bb[] may lie past the end of the data, e.g., for (255,223): encode_rs(&data[0],&data[223]);

Parameters
dataInput data array to be encoded.
bbOutput buffer for the encoded data.
Returns
Number of corrected symbols if successful, -1 otherwise.

◆ eras_dec_rs()

int eras_dec_rs ( dtype  data[],
int  eras_pos[],
int  no_eras 
)

Performs ERRORS+ERASURES decoding of Reed-Solomon codes.

Reed-Solomon erasures-and-errors decoding The received block goes into data[], and a list of zero-origin erasure positions, if any, goes in eras_pos[] with a count in no_eras.

The decoder corrects the symbols in place, if possible and returns the number of corrected symbols. If the codeword is illegal or uncorrectable, the data array is unchanged and -1 is returned

Parameters
dataPointer to the input and output data array.
eras_posArray containing the positions of known erased symbols.
no_erasNumber of known erased symbols.
Returns
Number of symbols corrected, or -1 if codeword is illegal or uncorrectable.