blob: 03a2e4418bc9b318090a4ea3628439a8ca25684a [file] [log] [blame]
Austin Schuh8d0a2852019-12-28 22:54:28 -08001.\" (C) Copyright Xin Long REDHAT Corp. 2018.
2.\"
3.\" Permission is granted to distribute possibly modified copies
4.\" of this manual provided the header is included verbatim,
5.\" and in case of nontrivial modification author and date
6.\" of the modification is added to the header.
7.\"
8.TH SCTP_SENDV 3 2018-04-29 "Linux 4.16 "Linux Programmer's Manual"
9.SH NAME
10sctp_sendv \- Send messages from a SCTP socket with an extensible way.
11.SH SYNOPSIS
12.nf
13.B #include <sys/types.h>
14.B #include <sys/socket.h>
15.B #include <netinet/sctp.h>
16.sp
17.BI "int sctp_sendv(int " sd ", const struct iovec * " iov ", int " iovcnt ,
18.BI " struct sockaddr *" addrs ", int " addrcnt ", void * " info ,
19.BI " socklen_t " infolen ", unsigned int " infotype ", int " flags );
20.fi
21.SH DESCRIPTION
22.BR sctp_sendv
23provides an extensible way for an application to communicate different send
24attributes to the SCTP stack when sending a message. There are three types
25of attributes that can be used to describe a message to be sent. They are
26struct sctp_sndinfo, struct sctp_prinfo, and struct sctp_authinfo. The
27following structure, sctp_sendv_spa, is defined to be used when more than
28one of the above attributes are needed to describe a message to be sent.
29
30 struct sctp_sendv_spa {
31 uint32_t sendv_flags;
32 struct sctp_sndinfo sendv_sndinfo;
33 struct sctp_prinfo sendv_prinfo;
34 struct sctp_authinfo sendv_authinfo;
35 };
36
37The sendv_flags field holds a bitwise OR of SCTP_SEND_SNDINFO_VALID,
38SCTP_SEND_PRINFO_VALID, and SCTP_SEND_AUTHINFO_VALID indicating if
39the sendv_sndinfo/sendv_prinfo/sendv_authinfo fields contain valid
40information.
41
42.I sd
43is the socket descriptor.
44.I iov
45is the gather buffer, the data in the buffer is treated as a single
46user message.
47.I iovcnt
48is the number of elements in iov.
49.I addrs
50is an array of addresses to be used to set up an association or
51a single address to be used to send the message, and NULL is passed
52in if the caller neither wants to set up an association nor wants
53to send the message to a specific address.
54.I addrcnt
55is the number of addresses in the addrs array.
56.I info
57is a pointer to the buffer containing the attribute associated with the
58message to be sent, and the type is indicated by the info_type parameter.
59.I infolen
60is the length of info, in bytes.
61.I infotype
62identifies the type of the information provided in info ,and the current
63defined values are as follows:
64.TP
65.B SCTP_SENDV_NOINFO
66No information is provided. The parameter info is a NULL pointer, and
67infolen is 0.
68.TP
69.B SCTP_SENDV_SNDINFO
70The parameter info is pointing to a struct sctp_sndinfo.
71.TP
72.B SCTP_SENDV_PRINFO
73The parameter info is pointing to a struct sctp_prinfo.
74.TP
75.B SCTP_SENDV_AUTHINFO
76The parameter info is pointing to a struct sctp_authinfo.
77.TP
78.B SCTP_SENDV_SPA
79The parameter info is pointing to a struct sctp_sendv_spa.
80.PP
81.I flags
82The same flags as used by the sendmsg() call flags (e.g., MSG_DONTROUTE).
83.SH "RETURN VALUE"
84On success,
85.BR sctp_sendv
86returns the number of bytes sent or -1 if an error occurred.
87.SH "SEE ALSO"
88.BR sctp (7)
89.BR sctp_bindx (3),
90.BR sctp_connectx (3),
91.BR sctp_send (3),
92.BR sctp_recvmsg (3),
93.BR sctp_recvv (3),
94.BR sctp_peeloff (3),
95.BR sctp_getpaddrs (3),
96.BR sctp_getladdrs (3),
97.BR sctp_opt_info (3),