gnutls_record_recv_seq(3)
π gnutls_record_recv_seq β the gnutls manual page, bestie edition π
okay so you're deep in the gnutls docs, huh? love that for you. this one lives in the gnutls manual (section 3, the library calls), and it's all about grabbing data off a session and peeking at which packet it came from. let's get into it π«Ά
β¨ NAME β¨
gnutls_record_recv_seq β it's an API function, babes. that's the whole name. iconic, honestly.
πΈ SYNOPSIS πΈ
#include <gnutls/gnutls.h>
ssize_t gnutls_record_recv_seq(gnutls_session_t session, void * data,
size_t data_size, unsigned char * seq);
likeβ¦ look at her. four little params and a dream β¨
π ARGUMENTS π
gnutls_session_t sessionβ this is agnutls_session_ttype. that's it, that's the whole vibe. it's your session, your girl, your connection πvoid * dataβ the buffer that the data will be read into. so like, the lil basket where the bytes land π§Ίsize_t data_sizeβ the number of requested bytes. how many you're asking for, bestie.unsigned char * seqβ this is the packet's 64-bit sequence number. it should have space for8bytes. yes, eight. count them. don't be stingy with the buffer π
π¦ DESCRIPTION π¦
okay so picture gnutls_record_recv(). this function is literally the same thing, EXCEPT it also hands you back the sequence number of the data alongside the data itself. that's the whole plot twist.
why do you care? because in DTLS, record packets might be received out-of-order. the universe is chaos, packets show up whenever they want, no cap. so having that sequence number is lowkey essential.
the returned 8-byte sequence number is an integer in big-endian format, and you should treat it as a unique message identification. it's giving "this specific packet, and no other." periodt π
π RETURNS π
- the number of bytes received, and zero on EOF
- a negative error code is returned in case of an error
- heads up: the number of bytes received might be less than
data_size. don't come for her, that's just how it is π
β SINCE β
3.0 β she's been here a minute. seasoned. veteran behavior π
π REPORTING BUGS π
found a bug? don't suffer in silence, tell the people:
- report bugs to
<bugs@gnutls.org> - home page:
https://www.gnutls.org
π COPYRIGHT π
Copyright Β© 2001-2023 Free Software Foundation, Inc., and others.
copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. so likeβ¦ go off, just keep the receipts π§Ύβ¨
π₯ SEE ALSO π₯
the full documentation for gnutls is maintained as a Texinfo manual. if the /usr/share/doc/gnutls/ directory does not contain the HTML form, go visit:
https://www.gnutls.org/manual/
bestie reminder: if the local docs ghost you, the website will never ghost you π«Ά
and that's the page, fr fr π this was gnutls_record_recv_seq(3) from the gnutls manual, version 3.8.13 β mwah, slay, go read your packets in order (or don't, that's literally what seq is for) π
π
π¦ where this page comes from
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms