xref: /freebsd/lib/libc/net/sctp_opt_info.3 (revision 5f4c09dd85bff675e0ca63c55ea3c517e0fddfcc)
1.\" Copyright (c) 1983, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. Neither the name of the University nor the names of its contributors
13.\"    may be used to endorse or promote products derived from this software
14.\"    without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\"     From: @(#)send.2	8.2 (Berkeley) 2/21/94
29.\"
30.Dd June 18, 2011
31.Dt SCTP_OPT_INFO 3
32.Os
33.Sh NAME
34.Nm sctp_opt_info
35.Nd get SCTP socket information
36.Sh LIBRARY
37.Lb libc
38.Sh SYNOPSIS
39.In sys/types.h
40.In sys/socket.h
41.In netinet/sctp.h
42.Ft int
43.Fn sctp_opt_info "int sd" "sctp_assoc_t id" "int opt" "void *arg" "socklen_t *size"
44.Sh DESCRIPTION
45The
46.Fn sctp_opt_info
47call provides a multi-os compatible method for getting
48specific
49.Fn getsockopt
50data where an association identification needs to be passed
51into the operating system.
52For
53.Fx
54a direct
55.Fn getsockopt
56may be used, since
57.Fx
58has the ability to pass information
59into the operating system on a
60.Fn getsockopt
61call.
62Other operating systems may not have this ability.
63For those
64who wish to write portable code amongst multiple operating systems
65this call should be used for the following SCTP
66socket options.
67.Pp
68.Dv SCTP_RTOINFO
69.Pp
70.Dv SCTP_ASSOCINFO
71.Pp
72.Dv SCTP_PRIMARY_ADDR
73.Pp
74.Dv SCTP_PEER_ADDR_PARAMS
75.Pp
76.Dv SCTP_DEFAULT_SEND_PARAM
77.Pp
78.Dv SCTP_MAX_SEG
79.Pp
80.Dv SCTP_AUTH_ACTIVE_KEY
81.Pp
82.Dv SCTP_DELAYED_SACK
83.Pp
84.Dv SCTP_MAX_BURST
85.Pp
86.Dv SCTP_CONTEXT
87.Pp
88.Dv SCTP_EVENT
89.Pp
90.Dv SCTP_DEFAULT_SNDINFO
91.Pp
92.Dv SCTP_DEFAULT_PRINFO
93.Pp
94.Dv SCTP_STATUS
95.Pp
96.Dv SCTP_GET_PEER_ADDR_INFO
97.Pp
98.Dv SCTP_PEER_AUTH_CHUNKS
99.Pp
100.Dv SCTP_LOCAL_AUTH_CHUNKS
101.Sh RETURN VALUES
102The call returns 0 on success and -1 upon error.
103.Sh ERRORS
104The
105.Fn sctp_opt_info
106function can return the following errors:
107.Bl -tag -width Er
108.It Bq Er EINVAL
109The argument
110.Fa arg
111value was invalid.
112.It Bq Er EOPNOTSUPP
113The argument
114.Fa opt
115was not one of the above listed SCTP socket
116options.
117.It Bq Er EBADF
118The argument
119.Fa s
120is not a valid descriptor.
121.It Bq Er ENOTSOCK
122The argument
123.Fa s
124is not a socket.
125.El
126.Sh SEE ALSO
127.Xr getsockopt 2 ,
128.Xr sctp 4
129.Sh BUGS
130Because the structure used for
131.Fa arg
132of the
133.Dv SCTP_MAX_BURST
134socket option has changed in FreeBSD 9.0 and higher,
135using
136.Dv SCTP_MAX_BURST
137as
138.Fa opt
139is only supported in FreeBSD 9.0 and higher.
140