---
name: "rq_symbol"
section: "3"
platform: "linux"
package: "liblcrq0.0"
version: "0.2.3-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rq_symbol"
---

# rq\_symbol(3)

generate RaptorQ encoding symbol

## NAME

rq\_symbol - generate RaptorQ encoding symbol

## SYNOPSIS

```
#include <lcrq.h>
```

**int rq\_symbol(rq\_t \****rq***, rq\_pid\_t \****pid***, uint8\_t \****sym***, int** *flags***);**

Compile and link with *-llcrq*.

## DESCRIPTION

Generates a RaptorQ encoding symbol ready for sending.

Before calling **rq\_symbol()** the intermediate symbols must first be created with a call to [**rq\_encode**(3)](/rq_encode/3.md).

*rq* must be a pointer to valid **rq\_t** context

*pid* will be set to the FEC payload ID as per Section 3.2 of RFC6330:

```
0                   1                   2                   3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     SBN       |               Encoding Symbol ID              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
```

SBN (Source Block Number) is an 8 bit unsigned integer. The Encoding Symbol ID (ESI) is a 24 bit unsigned integer in network byte order.

On success, *sym* will be a pointer to the encoding symbol.

*flags* can be set to:

- **RQ\_RAND**

  Generate a random repair symbol instead of returning the next ESI.

## RETURN VALUE

Returns a pointer to the encoded symbol.

## ERRORS

None.

## SEE ALSO

[**rq\_init**(3)](/rq_init/3.md), [**rq\_free**(3)](/rq_free/3.md), [**rq\_encode**(3)](/rq_encode/3.md), [**rq\_decode**(3)](/rq_decode/3.md), [**rq\_query**(3)](/rq_query/3.md), [**lcrq**(7)](/lcrq/7.md), [**errno**(3)](/errno/3.md)
