gnutls_dtls_set_data_mtu(3)

πŸ’– gnutls_dtls_set_data_mtu πŸ’–

okay bestie, welcome to the gnutls manual, this page is gnutls_dtls_set_data_mtu(3) and it's literally so specific but so important, stay with me 🫢


✨ NAME ✨

gnutls_dtls_set_data_mtu β€” API function. that's it, that's the name, she's an API function and she's iconic for it πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/dtls.h>

int gnutls_dtls_set_data_mtu(gnutls_session_t session, unsigned int
mtu);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_session_t session β€” is a gnutls_session_t type. yes queen, the session itself, the whole vibe, the main character 🌈
  • unsigned int mtu β€” The maximum unencrypted transfer unit of the session. note the word unencrypted, it's about to matter so much, iykyk πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea β˜• β€” this function will set the maximum size of the *unencrypted* records which will be sent over a DTLS session.

and the way it does that?? it's equivalent to calculating the DTLS packet overhead with the current encryption parameters, and calling gnutls_dtls_set_mtu() with that value. periodt. that's literally what it is.

⚠️ and this next part is NOT a drill bestie: because of that, you may need to call this function again after any negotiation or renegotiation, in order to ensure that the MTU is still sufficient to account for the new protocol overhead. the encryption params change, the overhead changes, and suddenly your number isn't cute anymore. so re-check it, okay?? 😭

and honestly? in most cases you only need to call gnutls_dtls_set_mtu() with the maximum MTU of your transport layer. like, that's the normal-girl path. this function is for when you want the fine-grained control and you're ready for the upkeep πŸ’–


⭐ RETURNS ⭐

GNUTLS_E_SUCCESS (0) on success, or a negative error code. so like, zero = slay, negative = not slay, check it, always check it πŸŽ€


🌟 SINCE 🌟

3.1 β€” she's been here since 3.1, a true veteran, an elder icon πŸ‘‘


πŸ™ˆ REPORTING BUGS πŸ™ˆ

found a bug? don't suffer in silence, tell the people:


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. (yes, go ahead, redistribute her, she said it's fine 🌸)


πŸ”₯ 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 visit

https://www.gnutls.org/manual/


and that's the whole page bestie, you ate that πŸ’…βœ¨

cute sign-off time: this lil masterpiece lives in the gnutls manual, version 3.8.13, and it's the gnutls_dtls_set_data_mtu(3) page β€” go forth and set your MTUs responsibly, mwah πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from