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_RECVMSG 3 2005-10-25 "Linux 2.6" "Linux Programmer's Manual" |
| 9 | .SH NAME |
| 10 | sctp_recvmsg \- Receive 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_recvmsg(int " sd ", void * " msg ", size_t " len , |
| 18 | .BI " struct sockaddr * " from ", socklen_t * " fromlen , |
| 19 | .BI " struct sctp_sndrcvinfo * " sinfo ", int * " msg_flags); |
| 20 | .fi |
| 21 | .SH DESCRIPTION |
| 22 | .BR sctp_recvmsg |
| 23 | is a wrapper library function that can be used to receive a message from |
| 24 | a socket while using the advanced features of SCTP. |
| 25 | .I sd |
| 26 | is the socket descriptor on which the message pointed to by |
| 27 | .I msg |
| 28 | of length |
| 29 | .I len |
| 30 | is received. |
| 31 | .PP |
| 32 | If |
| 33 | .I from |
| 34 | is not NULL, the source address of the message is filled in. The argument |
| 35 | .I fromlen |
| 36 | is a value-result parameter. initialized to the size of the buffer associated |
| 37 | with |
| 38 | .I from , |
| 39 | and modified on return to indicate the actual size of the address stored. |
| 40 | .PP |
| 41 | .I sinfo |
| 42 | is a pointer to a sctp_sndrcvinfo structure to be filled upon receipt of the |
| 43 | message. |
| 44 | .I msg_flags |
| 45 | is a pointer to a integer that is filled with any message flags like |
| 46 | .B MSG_NOTIFICATION or |
| 47 | .B MSG_EOR. |
| 48 | The value of |
| 49 | .I msg_flags |
| 50 | pointer should be initialized to 0 to avoid unexpected behavior; |
| 51 | .I msg_flags |
| 52 | is also used as an input |
| 53 | .I flags |
| 54 | argument to |
| 55 | .I recvmsg |
| 56 | function. |
| 57 | .SH "RETURN VALUE" |
| 58 | On success, |
| 59 | .BR sctp_recvmsg |
| 60 | returns the number of bytes received or -1 if an error occurred. |
| 61 | .SH "SEE ALSO" |
| 62 | .BR sctp (7) |
| 63 | .BR sctp_bindx (3), |
| 64 | .BR sctp_connectx (3), |
| 65 | .BR sctp_sendmsg (3), |
| 66 | .BR sctp_sendv (3), |
| 67 | .BR sctp_send (3), |
| 68 | .BR sctp_peeloff (3), |
| 69 | .BR sctp_getpaddrs (3), |
| 70 | .BR sctp_getladdrs (3), |
| 71 | .BR sctp_opt_info (3) |