Austin Schuh | 8d0a285 | 2019-12-28 22:54:28 -0800 | [diff] [blame^] | 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 | .PP |
| 61 | .I timetolive |
| 62 | specifies the time duration in milliseconds. The sending side will expire the |
| 63 | message if the message has not been sent to the peer within this time period. |
| 64 | A value of 0 indicates that no timeout should occur on this message. |
| 65 | .I ppid |
| 66 | is an opaque unsigned value that is passed to the remote end along with the |
| 67 | message. |
| 68 | .I context |
| 69 | is a 32 bit opaque value that is passed back to the upper layer along with the |
| 70 | undelivered message if an error occurs on the send of the message. |
| 71 | .SH "RETURN VALUE" |
| 72 | On success, |
| 73 | .BR sctp_sendmsg |
| 74 | returns 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), |