Imported Upstream version 1.0.10
[platform/upstream/lksctp-tools.git] / man / sctp_peeloff.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_PEELOFF 3 2005-10-25 "Linux 2.6" "Linux Programmer's Manual"
9 .SH NAME
10 sctp_peeloff \- Branch off an association into a separate 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_peeloff(int " sd ", sctp_assoc_t " assoc_id );
18 .fi
19 .SH DESCRIPTION
20 .B sctp_peeloff
21 branches off an existing association
22 .I assoc_id
23 on a one-to-many style socket
24 .I sd
25 into a separate socket. The new socket is a one-to-one style socket.
26 .PP
27 This is particularly desirable when, for instance, the application wishes to
28 have a number of sporadic message senders/receivers remain under the original
29 one-to-many style socket, but branch off those assocations carrying high volume
30 data traffic into their own separate socket descriptors.
31 .SH "RETURN VALUE"
32 On success, the new socket descriptor representing the branched-off asociation is returned.
33 On error, \-1 is returned, and
34 .I errno
35 is set appropriately.
36 .SH ERRORS
37 .TP
38 .B EBADF
39 .I sd
40 is not a valid descriptor.
41 .TP
42 .B EINVAL
43 The assoc id passed is invalid or if the socket is a one-to-one style socket.
44 .TP
45 .B ENOTSOCK
46 Argument is a descriptor for a file, not a socket.
47 .SH "SEE ALSO"
48 .BR sctp (7)
49 .BR sctp_bindx (3),
50 .BR sctp_connectx (3),
51 .BR sctp_sendmsg (3),
52 .BR sctp_send (3),
53 .BR sctp_recvmsg (3),
54 .BR sctp_getpaddrs (3),
55 .BR sctp_getladdrs (3),
56 .BR sctp_opt_info (3),