1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
'\" te
.\" Copyright (c) 2004, Sun Microsystems, Inc.
.\" All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH sctp_recvmsg 3SOCKET "14 Jul 2004" "SunOS 5.11" "Sockets Library Functions"
.SH NAME
sctp_recvmsg \- receive message from an SCTP socket
.SH SYNOPSIS
.LP
.nf
\fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lsocket\fR \fB -lnsl \fR \fB -lsctp \fR [ \fIlibrary\fR... ]
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/sctp.h>
\fBssize_t\fR \fBsctp_recvmsg\fR(\fBint\fR \fIs\fR, \fBvoid *\fR\fImsg\fR, \fBsize_t\fR \fIlen\fR, \fBstruct sockaddr *\fR\fIfrom\fR,
\fBsocklen_t *\fR\fIfromlen\fR, \fBstruct sctp_sndrcvinfo *\fR\fIsinfo\fR, \fBint *\fR\fImsg_flags\fR);
.fi
.SH DESCRIPTION
.sp
.LP
The \fBsctp_recvmsg()\fR function receives a message from the SCTP endpoint
\fIs\fR.
.sp
.LP
In addition to specifying the message buffer \fImsg\fR and the length \fIlen\fR
of the buffer, the following parameters can be set:
.sp
.ne 2
.mk
.na
\fB\fIfrom\fR\fR
.ad
.RS 13n
.rt
Pointer to an address, filled in with the sender's address
.RE
.sp
.ne 2
.mk
.na
\fB\fIfromlen\fR\fR
.ad
.RS 13n
.rt
Size of the buffer associated with the \fIfrom\fR parameter
.RE
.sp
.ne 2
.mk
.na
\fB\fIsinfo\fR\fR
.ad
.RS 13n
.rt
Pointer to an \fBsctp_sndrcvinfo\fR structure, filled in upon the receipt of
the message
.RE
.sp
.ne 2
.mk
.na
\fB\fImsg_flags\fR\fR
.ad
.RS 13n
.rt
Message flags such as \fBMSG_CTRUNC\fR, \fBMSG_NOTIFICATION\fR, \fBMSG_EOR\fR
.RE
.sp
.LP
The \fIsinfo\fR parameter is filled in only when the caller has enabled
\fBsctp_data_io_events\fR by calling \fBsetsockopt()\fR with the socket option
\fBSCTP_EVENTS\fR.
.SH RETURN VALUES
.sp
.LP
Upon successful completion, the \fBsctp_recvmsg()\fR function returns the
number of bytes received. The function returns \fB-1\fR if an error occurs.
.SH ERRORS
.sp
.LP
The \fBsctp_recvmsg()\fR function fails under the following conditions.
.sp
.ne 2
.mk
.na
\fB\fBEBADF\fR\fR
.ad
.RS 14n
.rt
The \fIs\fR argument is an invalid file descriptor.
.RE
.sp
.ne 2
.mk
.na
\fB\fBENOTSOCK\fR\fR
.ad
.RS 14n
.rt
The \fIs\fR argument is not a socket.
.RE
.sp
.ne 2
.mk
.na
\fB\fBEOPNOTSUPP\fR\fR
.ad
.RS 14n
.rt
\fBMSG_OOB\fR is set as a flag.
.RE
.sp
.ne 2
.mk
.na
\fB\fBENOTCONN\fR\fR
.ad
.RS 14n
.rt
There is no established association.
.RE
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
.sp
.TS
tab() box;
cw(2.75i) |cw(2.75i)
lw(2.75i) |lw(2.75i)
.
ATTRIBUTE TYPEATTRIBUTE VALUE
_
Interface StabilityEvolving
_
MT-LevelSafe
.TE
.SH SEE ALSO
.sp
.LP
\fBaccept\fR(3SOCKET), \fBbind\fR(3SOCKET), \fBconnect\fR(3SOCKET),
\fBin.h\fR(3HEAD), \fBlibsctp\fR(3LIB), \fBlisten\fR(3SOCKET),
\fBrecvmsg\fR(3SOCKET), \fBsctp_opt_info\fR(3SOCKET),
\fBsetsockopt\fR(3SOCKET), \fBsocket\fR(3SOCKET), \fBsocket.h\fR(3HEAD),
\fBsctp\fR(7P)
|