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]
cc [ flag... ] file... -lsocket -lnsl -lsctp [ library... ] #include <sys/types.h> #include <sys/socket.h> #include <netinet/sctp.h> int sctp_peeloff(int sock, sctp_assoc_t id);
The sctp_peeloff() 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.
The sock argument is a one-to-many socket. The association specified by the id argument is branched off sock.
Upon successful completion, the sctp_peeloff() function returns the file descriptor that references the branched-off socket. The function returns -1 if an error occurs.
The sctp_peeloff() function fails under the following conditions. EOPTNOTSUPP
The sock argument is not a one-to-many style SCTP socket.
The id is 0 or greater than the maximum number of associations for sock.
Failure to create a new user file descriptor or file structure.
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE ATTRIBUTE VALUE |
Interface Stability Evolving |
MT-Level Safe |
in.h (3HEAD), libsctp (3LIB), socket (3SOCKET), sctp (4P)