1 /* SCTP kernel Implementation: User API extensions.
5 * Distributed under the terms of the LGPL v2.1 as described in
6 * http://www.gnu.org/copyleft/lesser.txt
8 * This file is part of the user library that offers support for the
9 * SCTP kernel Implementation. The main purpose of this
10 * code is to provide the SCTP Socket API mappings for user
11 * application to interface with the SCTP in kernel.
13 * This implementation is based on the Socket API Extensions for SCTP
14 * defined in <draft-ietf-tsvwg-sctpsocket-10.txt.
16 * (C) Copyright IBM Corp. 2001, 2003
18 * Written or modified by:
19 * Sridhar Samudrala <sri@us.ibm.com>
22 #include <sys/socket.h> /* struct sockaddr_storage, setsockopt() */
23 #include <netinet/sctp.h> /* SCTP_SOCKOPT_BINDX_* */
26 /* Branch off an association into a seperate socket. This is a new SCTP API
27 * described in the section 8.2 of the Sockets API Extensions for SCTP.
28 * This is implemented using the getsockopt() interface.
31 sctp_peeloff(int fd, sctp_assoc_t associd)
33 sctp_peeloff_arg_t peeloff;
34 socklen_t peeloff_size = sizeof(peeloff);
37 peeloff.associd = associd;
39 err = getsockopt(fd, SOL_SCTP, SCTP_SOCKOPT_PEELOFF, &peeloff,
47 } /* sctp_peeloff() */