xref: /freebsd/lib/libc/net/sctp_opt_info.3 (revision d8a0fe102c0cfdfcd5b818f850eff09d8536c9bc)
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.\" $FreeBSD$
30.\"
31.Dd June 18, 2011
32.Dt SCTP_OPT_INFO 3
33.Os
34.Sh NAME
35.Nm sctp_opt_info
36.Nd get SCTP socket information
37.Sh LIBRARY
38.Lb libc
39.Sh SYNOPSIS
40.In sys/types.h
41.In sys/socket.h
42.In netinet/sctp.h
43.Ft int
44.Fn sctp_opt_info "int sd" "sctp_assoc_t id" "int opt" "void *arg" "socklen_t *size"
45.Sh DESCRIPTION
46The
47.Fn sctp_opt_info
48call provides a multi-os compatible method for getting
49specific
50.Fn getsockopt
51data where an association identification needs to be passed
52into the operating system.
53For
54.Fx
55a direct
56.Fn getsockopt
57may be used, since
58.Fx
59has the ability to pass information
60into the operating system on a
61.Fn getsockopt
62call.
63Other operating systems may not have this ability.
64For those
65who wish to write portable code amongst multiple operating systems
66this call should be used for the following SCTP
67socket options.
68.Pp
69.Dv SCTP_RTOINFO
70.Pp
71.Dv SCTP_ASSOCINFO
72.Pp
73.Dv SCTP_PRIMARY_ADDR
74.Pp
75.Dv SCTP_PEER_ADDR_PARAMS
76.Pp
77.Dv SCTP_DEFAULT_SEND_PARAM
78.Pp
79.Dv SCTP_MAX_SEG
80.Pp
81.Dv SCTP_AUTH_ACTIVE_KEY
82.Pp
83.Dv SCTP_DELAYED_SACK
84.Pp
85.Dv SCTP_MAX_BURST
86.Pp
87.Dv SCTP_CONTEXT
88.Pp
89.Dv SCTP_EVENT
90.Pp
91.Dv SCTP_DEFAULT_SNDINFO
92.Pp
93.Dv SCTP_DEFAULT_PRINFO
94.Pp
95.Dv SCTP_STATUS
96.Pp
97.Dv SCTP_GET_PEER_ADDR_INFO
98.Pp
99.Dv SCTP_PEER_AUTH_CHUNKS
100.Pp
101.Dv SCTP_LOCAL_AUTH_CHUNKS
102.Sh RETURN VALUES
103The call returns 0 on success and -1 upon error.
104.Sh ERRORS
105The
106.Fn sctp_opt_info
107function can return the following errors:
108.Bl -tag -width Er
109.It Bq Er EINVAL
110The argument
111.Fa arg
112value was invalid.
113.It Bq Er EOPNOTSUPP
114The argument
115.Fa opt
116was not one of the above listed SCTP socket
117options.
118.It Bq Er EBADF
119The argument
120.Fa s
121is not a valid descriptor.
122.It Bq Er ENOTSOCK
123The argument
124.Fa s
125is not a socket.
126.El
127.Sh SEE ALSO
128.Xr getsockopt 2 ,
129.Xr sctp 4
130.Sh BUGS
131Because the structure used for
132.Fa arg
133of the
134.Dv SCTP_MAX_BURST
135socket option has changed in FreeBSD 9.0 and higher,
136using
137.Dv SCTP_MAX_BURST
138as
139.Fa opt
140is only supported in FreeBSD 9.0 and higher.
141