| Current File : //usr/man/man3socket/sctp_peeloff.3socket |
'\" te
.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
.TH sctp_peeloff 3SOCKET "05 Mar 2004" "SunOS 5.11" "Sockets Library Functions"
.SH NAME
sctp_peeloff \- branch off existing association from a one-to-many SCTP socket to create a one-to-one STP 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>
\fBint\fR \fBsctp_peeloff\fR(\fBint\fR \fIsock\fR, \fBsctp_assoc_t\fR \fIid\fR);
.fi
.SH DESCRIPTION
.sp
.LP
The \fBsctp_peeloff()\fR function branches off an existing association from a one-to-many style SCTP socket into a separate socket file descriptor. The resulting branched-off socket is a one-to-one style SCTP socket and is confined to operations allowed on a one-to-one style SCTP socket.
.sp
.LP
The \fIsock\fR argument is a one-to-many socket. The association specified by the \fIid\fR argument is branched off \fIsock\fR.
.SH RETURN VALUES
.sp
.LP
Upon successful completion, the \fBsctp_peeloff()\fR function returns the file descriptor that references the branched-off socket. The function returns \fB-1\fR if an error occurs.
.SH ERRORS
.sp
.LP
The \fBsctp_peeloff()\fR function fails under the following conditions.
.sp
.ne 2
.mk
.na
\fB\fBEOPTNOTSUPP\fR\fR
.ad
.RS 15n
.rt
The \fIsock\fR argument is not a one-to-many style SCTP socket.
.RE
.sp
.ne 2
.mk
.na
\fB\fBEINVAL\fR\fR
.ad
.RS 15n
.rt
The \fIid\fR is \fB0\fR or greater than the maximum number of associations for \fIsock\fR.
.RE
.sp
.ne 2
.mk
.na
\fB\fBEMFILE\fR\fR
.ad
.RS 15n
.rt
Failure to create a new user file descriptor or file structure.
.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 StabilityCommitted
_
MT-LevelSafe
.TE
.SH SEE ALSO
.sp
.LP
\fBin.h\fR(3HEAD), \fBlibsctp\fR(3LIB), \fBsocket\fR(3SOCKET), \fBsctp\fR(7P)