blob: 51828fb0575af8802bb0e4673bc796b6683e90a5 [file] [log] [blame]
Austin Schuh8d0a2852019-12-28 22:54:28 -08001.\" (C) Copyright Sridhar Samudrala IBM Corp. 2004, 2005.
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_SENDMSG 3 2004-10-25 "Linux 2.6" "Linux Programmer's Manual"
9.SH NAME
10sctp_sendmsg \- Send a message from a SCTP socket.
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_sendmsg(int " sd ", const void * " msg ", size_t " len ,
18.BI " struct sockaddr *" to ", socklen_t " tolen ,
19.BI " uint32_t " ppid ", uint32_t " flags ,
20.BI " uint16_t " stream_no ", uint32_t " timetolive ,
21.BI " uint32_t " context );
22.fi
23.SH DESCRIPTION
24.BR sctp_sendmsg
25is a wrapper library function that can be used to send a message from a socket
26while using the advanced features of SCTP.
27.I sd
28is the socket descriptor from which the message pointed to by
29.I msg
30of length
31.I len
32is sent.
33.I to
34is the destination address of the message and
35.I tolen
36is the length of the destination address.
37.I stream_no
38identifies the stream number that the application wishes to send this message to.
39.I flags
40parameter is composed of a bitwise OR of the following values.
41.TP
42.B SCTP_UNORDERED
43This flags requests the un-ordered delivery of the message.
44.TP
45.B SCTP_ADDR_OVER
46This flag, in the one-to-many style, requests the SCTP stack to override the
47primary destination address with address specified in
48.I to.
49.TP
50.B SCTP_ABORT
51Setting this flag causes the specified association to abort by sending an ABORT
52message to the peer(one-to-many style only). The ABORT chunk will contain an
53error cause 'User Initiated Abort' with cause code 12. The cause specific
54information of this error cause is provided in
55.I msg.
56.TP
57.B SCTP_EOF
58Setting this flag invokes the SCTP graceful shutdown procedure on the specific
59association(one-to-many style only).
60.PP
61.I timetolive
62specifies the time duration in milliseconds. The sending side will expire the
63message if the message has not been sent to the peer within this time period.
64A value of 0 indicates that no timeout should occur on this message.
65.I ppid
66is an opaque unsigned value that is passed to the remote end along with the
67message.
68.I context
69is a 32 bit opaque value that is passed back to the upper layer along with the
70undelivered message if an error occurs on the send of the message.
71.SH "RETURN VALUE"
72On success,
73.BR sctp_sendmsg
74returns the number of bytes sent or -1 if an error occurred.
75.SH "SEE ALSO"
76.BR sctp (7)
77.BR sctp_bindx (3),
78.BR sctp_connectx (3),
79.BR sctp_sendv (3),
80.BR sctp_send (3),
81.BR sctp_recvmsg (3),
82.BR sctp_recvv (3),
83.BR sctp_peeloff (3),
84.BR sctp_getpaddrs (3),
85.BR sctp_getladdrs (3),
86.BR sctp_opt_info (3),