Debian Codegraph @

man/sctp_peeloff.3

raw
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 .BI "int sctp_peeloff_flags(int " sd ", sctp_assoc_t " assoc_id ", unsigned " flags );
19 .fi
20 .SH DESCRIPTION
21 .B sctp_peeloff
22 branches off an existing association
23 .I assoc_id
24 on a one-to-many style socket
25 .I sd
26 into a separate socket. The new socket is a one-to-one style socket.
27 .PP
28 This is particularly desirable when, for instance, the application wishes to
29 have a number of sporadic message senders/receivers remain under the original
30 one-to-many style socket, but branch off those assocations carrying high volume
31 data traffic into their own separate socket descriptors.
32
33 .B sctp_peeloff_flags
34 is a variant of sctp_peeloff, in which flags describing the behavior of
35 the newly peeled off socket can be specified. Currently the supported flags
36 are:
37 .TP
38 .B SOCK_NONBLOCK
39 Specifies that the new socket should not block on io operations.
40 .TP
41 .B SOCK_CLOEXEC
42 Specifies that the new socket should be closed when the owning process calls
43 exec.
44 .SH "RETURN VALUE"
45 On success, the new socket descriptor representing the branched-off asociation is returned.
46 On error, \-1 is returned, and
47 .I errno
48 is set appropriately.
49 .SH ERRORS
50 .TP
51 .B EBADF
52 .I sd
53 is not a valid descriptor.
54 .TP
55 .B EINVAL
56 The assoc id passed is invalid or if the socket is a one-to-one style socket.
57 .TP
58 .B ENOTSOCK
59 Argument is a descriptor for a file, not a socket.
60 .SH NOTES
61 .TP
62 sctp_peeloff_flags is a linux specific variant of sctp_peeloff. While it will compile on other systems, its use will result in an error return. Portable code should use sctp_peeloff.
63 .SH "SEE ALSO"
64 .BR sctp (7)
65 .BR sctp_bindx (3),
66 .BR sctp_connectx (3),
67 .BR sctp_sendmsg (3),
68 .BR sctp_sendv (3),
69 .BR sctp_send (3),
70 .BR sctp_recvmsg (3),
71 .BR sctp_recvv (3),
72 .BR sctp_getpaddrs (3),
73 .BR sctp_getladdrs (3),
74 .BR sctp_opt_info (3),