SCTP_SENDV(3)
π SCTP_SENDV(3) β the Linux manual page, but make it make sense
okay bestie, gather round, because we're talking about sctp_sendv β the Linux man page, third section, and honestly? she's iconic. this is the send call that lets you send SCTP messages in an extensible way. no cap.
β¨ NAME β¨
sctp_sendv β Send messages from a SCTP socket with an extensible way. π
π SYNOPSIS π
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/sctp.h>
int sctp_sendv(int sd, const struct iovec * iov, int iovcnt,
struct sockaddr *addrs, int addrcnt, void * info,
socklen_t infolen, unsigned int infotype, int flags);
like. look at all those params. she's doing the MOST and we love her for it. π«Ά
π¦ DESCRIPTION π¦
so here's the tea, bestie: sctp_sendv gives your application an extensible way to communicate allllll kinds of different send attributes to the SCTP stack when it sends a message. it's giving "I have options and I'm not afraid to use them" energy. π
there are three types of attributes you can use to describe a message to be sent. they are:
struct sctp_sndinfostruct sctp_prinfostruct sctp_authinfo
and because sometimes ONE attribute just isn't enough (relatable), the following structure, sctp_sendv_spa, is defined to be used when more than one of the above attributes are needed to describe a message to be sent:
struct sctp_sendv_spa {
uint32_t sendv_flags;
struct sctp_sndinfo sendv_sndinfo;
struct sctp_prinfo sendv_prinfo;
struct sctp_authinfo sendv_authinfo;
};
the sendv_flags field holds a bitwise OR of SCTP_SEND_SNDINFO_VALID, SCTP_SEND_PRINFO_VALID, and SCTP_SEND_AUTHINFO_VALID, and it's basically telling everyone whether the sendv_sndinfo / sendv_prinfo / sendv_authinfo fields actually contain valid information. it's a vibe check for your structs, fr fr. β
now let's meet the cast of parameters, one by one, because they all matter:
sdβ the socket descriptor. that's your girl. πiovβ the gather buffer. the data in the buffer is treated as a single user message. one message, many buffers, she contains multitudes. β¨iovcntβ the number of elements iniov.addrsβ an array of addresses to be used to set up an association, or a single address to be used to send the message. and you pass inNULLif the caller neither wants to set up an association nor wants to send the message to a specific address. no addrs, no problem.addrcntβ the number of addresses in theaddrsarray.infoβ a pointer to the buffer containing the attribute associated with the message to be sent. the type is indicated by theinfo_typeparameter. πinfolenβ the length ofinfo, in bytes.infotypeβ identifies the type of the information provided ininfo. and the current defined values are as follows, bestie, get your notes app out:SCTP_SENDV_NOINFOβ No information is provided. The parameterinfois aNULLpointer, andinfolenis0. it's giving minimalism. πSCTP_SENDV_SNDINFOβ The parameterinfois pointing to astruct sctp_sndinfo.SCTP_SENDV_PRINFOβ The parameterinfois pointing to astruct sctp_prinfo.SCTP_SENDV_AUTHINFOβ The parameterinfois pointing to astruct sctp_authinfo.SCTP_SENDV_SPAβ The parameterinfois pointing to astruct sctp_sendv_spa. (that's the combo platter one π)flagsβ The same flags as used by thesendmsg()call flags (e.g.,MSG_DONTROUTE).
π«Ά friendly reminder:addrscan beNULL, and if you're going theSCTP_SENDV_NOINFOroute theninfoisNULLandinfolenis0. don't be out here passing random garbage, the stack will simply not be charmed.
πΈ RETURN VALUE πΈ
On success, sctp_sendv returns the number of bytes sent β¨ or -1 if an error occurred. π
π SEE ALSO π
go read these too, they're all part of the same friend group:
sctp(7), sctp_bindx(3), sctp_connectx(3), sctp_send(3), sctp_recvmsg(3), sctp_recvv(3), sctp_peeloff(3), sctp_getpaddrs(3), sctp_getladdrs(3), sctp_opt_info(3)
okay that's the whole page, you ate it, periodt π
this one's from Linux 4.16, dated 2018-04-29 β so yeah, vintage but still serving. mwah π go send some messages bestie, i believe in you π¦
π¦ where this page comes from
- alpine 3.22: lksctp-tools-doc 1.0.19-r5 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- alpine 3.23: lksctp-tools-doc 1.0.19-r5 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- alpine 3.24: lksctp-tools-doc 1.0.19-r5 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- arch rolling: lksctp-tools 1.0.21-1 Β· GPL-2.0-or-later AND LGPL-2.1-only
- centos-stream 10: lksctp-tools-devel 1.0.21-1.el10 Β· GPLv2 and GPLv2+ and LGPLv2 and MIT
- centos-stream 9: lksctp-tools-devel 1.0.19-2.el9 Β· GPLv2 and GPLv2+ and LGPLv2 and MIT
- centos-stream 9: lksctp-tools-devel 1.0.19-2.el9 Β· GPLv2 and GPLv2+ and LGPLv2 and MIT
- debian bookworm: libsctp-dev 1.0.19+dfsg-2 Β· GPL-2.0-or-later
- debian trixie: libsctp-dev 1.0.21+dfsg-1 Β· GPL-2.0-or-later
- fedora 43: lksctp-tools-devel 1.0.21-1.fc43 Β· GPL-2.0-or-later AND LGPL-2.0-only AND MIT
- fedora 43: lksctp-tools-devel 1.0.21-1.fc43 Β· GPL-2.0-or-later AND LGPL-2.0-only AND MIT
- fedora 44: lksctp-tools-devel 1.0.21-3.fc44 Β· GPL-2.0-or-later AND LGPL-2.0-only AND MIT
- fedora 44: lksctp-tools-devel 1.0.21-3.fc44 Β· GPL-2.0-or-later AND LGPL-2.0-only AND MIT
- nixos 26.05: lksctp-tools 1.0.21
- nixpkgs unstable: lksctp-tools 1.0.21
- opensuse-leap 16.0: lksctp-tools-devel 1.0.21-160000.3.2 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: lksctp-tools-devel 1.0.21-160000.3.2 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: lksctp-tools-devel 1.0.21-160000.3.2 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: lksctp-tools-devel 1.0.21-160000.3.2 Β· LGPL-2.1-or-later
- ubuntu jammy: libsctp-dev 1.0.19+dfsg-1build1 Β· GPL-2.0-or-later
- ubuntu noble: libsctp-dev 1.0.19+dfsg-2build1 Β· GPL-2.0-or-later
- ubuntu questing: libsctp-dev 1.0.21+dfsg-1build1
- ubuntu resolute: libsctp-dev 1.0.21+dfsg-1build2 Β· GPL-2.0-or-later
- ubuntu stonking: libsctp-dev 1.0.21+dfsg-2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms