| 1 |
.\" (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 |
| 10 |
sctp_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 |
| 25 |
is a wrapper library function that can be used to send a message from a socket |
| 26 |
while using the advanced features of SCTP. |
| 27 |
.I sd |
| 28 |
is the socket descriptor from which the message pointed to by |
| 29 |
.I msg |
| 30 |
of length |
| 31 |
.I len |
| 32 |
is sent. |
| 33 |
.I to |
| 34 |
is the destination address of the message and |
| 35 |
.I tolen |
| 36 |
is the length of the destination address. |
| 37 |
.I stream_no |
| 38 |
identifies the stream number that the application wishes to send this message to. |
| 39 |
.I flags |
| 40 |
parameter is composed of a bitwise OR of the following values. |
| 41 |
.TP |
| 42 |
.B SCTP_UNORDERED |
| 43 |
This flags requests the un-ordered delivery of the message. |
| 44 |
.TP |
| 45 |
.B SCTP_ADDR_OVER |
| 46 |
This flag, in the one-to-many style, requests the SCTP stack to override the |
| 47 |
primary destination address with address specified in |
| 48 |
.I to. |
| 49 |
.TP |
| 50 |
.B SCTP_ABORT |
| 51 |
Setting this flag causes the specified association to abort by sending an ABORT |
| 52 |
message to the peer(one-to-many style only). The ABORT chunk will contain an |
| 53 |
error cause 'User Initiated Abort' with cause code 12. The cause specific |
| 54 |
information of this error cause is provided in |
| 55 |
.I msg. |
| 56 |
.TP |
| 57 |
.B SCTP_EOF |
| 58 |
Setting this flag invokes the SCTP graceful shutdown procedure on the specific |
| 59 |
association(one-to-many style only). |
| 60 |
.TP |
| 61 |
.B SCTP_SENDALL |
| 62 |
This flag, if set, will cause a one-to-many style socket to send the message |
| 63 |
to all associations that are currently established on this socket. For the |
| 64 |
one-to-one style socket, this flag has no effect. |
| 65 |
.TP |
| 66 |
.B SCTP_SACK_IMMEDIATELY |
| 67 |
This flag allows the application to set the I bit of the last DATA chunk when |
| 68 |
sending each user message to make sure the corresponding SACK can be sent by |
| 69 |
peer without delay. |
| 70 |
.TP |
| 71 |
.B SCTP_PR_SCTP_{TTL|RTX|PRIO} |
| 72 |
One of these 3 pr_policies can be used through this flag with its pr_value |
| 73 |
set in timetolive parameter for this message. Note that |
| 74 |
.B sctp_sendv(3) |
| 75 |
with infotype SCTP_SENDV_PRINFO also works for PR-SCTP. |
| 76 |
.PP |
| 77 |
.I timetolive |
| 78 |
specifies the time duration in milliseconds. The sending side will expire the |
| 79 |
message if the message has not been sent to the peer within this time period. |
| 80 |
A value of 0 indicates that no timeout should occur on this message. It also |
| 81 |
works as the pr_value if flags parameter is set to pr_policy. |
| 82 |
.I ppid |
| 83 |
is an opaque unsigned value that is passed to the remote end along with the |
| 84 |
message. |
| 85 |
.I context |
| 86 |
is a 32 bit opaque value that is passed back to the upper layer along with the |
| 87 |
undelivered message if an error occurs on the send of the message. |
| 88 |
.SH "RETURN VALUE" |
| 89 |
On success, |
| 90 |
.BR sctp_sendmsg |
| 91 |
returns the number of bytes sent or -1 if an error occurred. |
| 92 |
.SH "SEE ALSO" |
| 93 |
.BR sctp (7) |
| 94 |
.BR sctp_bindx (3), |
| 95 |
.BR sctp_connectx (3), |
| 96 |
.BR sctp_sendv (3), |
| 97 |
.BR sctp_send (3), |
| 98 |
.BR sctp_recvmsg (3), |
| 99 |
.BR sctp_recvv (3), |
| 100 |
.BR sctp_peeloff (3), |
| 101 |
.BR sctp_getpaddrs (3), |
| 102 |
.BR sctp_getladdrs (3), |
| 103 |
.BR sctp_opt_info (3), |