RQ_SYMBOL(3)

πŸ’– RQ_SYMBOL πŸ’–

okay so bestie, welcome to rq_symbol(3) from the Librecast Programmer's Manual πŸŽ€ β€” this is the little function that pops out a RaptorQ encoding symbol so you can yeet it across the network. sit down, grab a strawberry πŸ“, let's go.


✨ 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 πŸ¦‹

It generates a RaptorQ encoding symbol that is ready for sending. that's it, that's the job, and it does it flawlessly πŸ’…

⚠️ before you even think about calling rq_symbol(), the intermediate symbols have to exist already β€” you get those by calling rq_encode(3) first. no intermediate symbols, no symbol. periodt.

rq has to be a pointer to a valid rq_t context. not vibes, an actual valid context.

pid will be set to the FEC payload ID, exactly as described in 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              |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

so like, break it down: 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. iconic little layout honestly πŸ‘‘

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

flags can be set to:

  • RQ_RAND β€” generate a random repair symbol instead of returning the next ESI. a little chaos, a little mystery, we love her for it πŸ™ˆ

⭐ RETURN VALUE ⭐

Returns a pointer to the encoded symbol. that's the whole thing, she delivers 🫢


πŸ’€ ERRORS πŸ’€

None. literally none. no cap, there is nothing here.


🌈 SEE ALSO 🌈

rq_init(3), rq_free(3), rq_encode(3), rq_decode(3), rq_query(3), lcrq(7), errno(3)


mwah πŸ’‹ that's the page. this one is LCRQ, dated 2022-07-07 β€” go forth and encode, bestie, you're gonna eat πŸ’…βœ¨

πŸ“¦ where this page comes from