Imported Upstream version 1.0.10
[platform/upstream/lksctp-tools.git] / man / sctp_recvmsg.3
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 .SH "RETURN VALUE"
49 On success,
50 .BR sctp_recvmsg
51 returns the number of bytes received or -1 if an error occurred.
52 .SH "SEE ALSO"
53 .BR sctp (7)
54 .BR sctp_bindx (3),
55 .BR sctp_connectx (3),
56 .BR sctp_sendmsg (3),
57 .BR sctp_send (3),
58 .BR sctp_peeloff (3),
59 .BR sctp_getpaddrs (3),
60 .BR sctp_getladdrs (3),
61 .BR sctp_opt_info (3)