xref: /freebsd/lib/libc/net/sctp_getaddrlen.3 (revision dc36d6f9bb1753f3808552f3afd30eda9a7b206a)
1d8b5fd91SRandall Stewart.\" Copyright (c) 1983, 1991, 1993
2d8b5fd91SRandall Stewart.\"	The Regents of the University of California.  All rights reserved.
3d8b5fd91SRandall Stewart.\"
4d8b5fd91SRandall Stewart.\" Redistribution and use in source and binary forms, with or without
5d8b5fd91SRandall Stewart.\" modification, are permitted provided that the following conditions
6d8b5fd91SRandall Stewart.\" are met:
7d8b5fd91SRandall Stewart.\" 1. Redistributions of source code must retain the above copyright
8d8b5fd91SRandall Stewart.\"    notice, this list of conditions and the following disclaimer.
9d8b5fd91SRandall Stewart.\" 2. Redistributions in binary form must reproduce the above copyright
10d8b5fd91SRandall Stewart.\"    notice, this list of conditions and the following disclaimer in the
11d8b5fd91SRandall Stewart.\"    documentation and/or other materials provided with the distribution.
12*921ca2fdSEd Maste.\" 3. Neither the name of the University nor the names of its contributors
13d8b5fd91SRandall Stewart.\"    may be used to endorse or promote products derived from this software
14d8b5fd91SRandall Stewart.\"    without specific prior written permission.
15d8b5fd91SRandall Stewart.\"
16d8b5fd91SRandall Stewart.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17d8b5fd91SRandall Stewart.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18d8b5fd91SRandall Stewart.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19d8b5fd91SRandall Stewart.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20d8b5fd91SRandall Stewart.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21d8b5fd91SRandall Stewart.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22d8b5fd91SRandall Stewart.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23d8b5fd91SRandall Stewart.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24d8b5fd91SRandall Stewart.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25d8b5fd91SRandall Stewart.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26d8b5fd91SRandall Stewart.\" SUCH DAMAGE.
27d8b5fd91SRandall Stewart.\"
28d8b5fd91SRandall Stewart.Dd December 15, 2006
29d8b5fd91SRandall Stewart.Dt SCTP_GETADDRLEN 3
30d8b5fd91SRandall Stewart.Os
31d8b5fd91SRandall Stewart.Sh NAME
32d8b5fd91SRandall Stewart.Nm sctp_getaddrlen
33d8b5fd91SRandall Stewart.Nd return the address length of an address family
34d8b5fd91SRandall Stewart.Sh LIBRARY
35d8b5fd91SRandall Stewart.Lb libc
36d8b5fd91SRandall Stewart.Sh SYNOPSIS
37d8b5fd91SRandall Stewart.In sys/types.h
38d8b5fd91SRandall Stewart.In sys/socket.h
397c376800SRandall Stewart.In netinet/sctp.h
40d8b5fd91SRandall Stewart.Ft int
4116c90ceeSChristian Brueffer.Fn sctp_getaddrlen "sa_family_t family"
42d8b5fd91SRandall Stewart.Sh DESCRIPTION
43d8b5fd91SRandall StewartThe
44d8b5fd91SRandall Stewart.Fn sctp_getaddrlen
4516c90ceeSChristian Bruefferfunction returns the size of a specific address family.
4616c90ceeSChristian BruefferThis function
47edfa427cSJoel Dahlis provided for application binary compatibility since it
48d8b5fd91SRandall Stewartprovides the application with the size the operating system
4916c90ceeSChristian Bruefferthinks the specific address family is.
5016c90ceeSChristian BruefferNote that the function
51d8b5fd91SRandall Stewartwill actually create an SCTP socket and then gather the
52d8b5fd91SRandall Stewartinformation via a
53d8b5fd91SRandall Stewart.Fn getsockopt
5416c90ceeSChristian Brueffersystem calls.
5516c90ceeSChristian BruefferIf for some reason a SCTP socket cannot
5616c90ceeSChristian Bruefferbe created or the
5716c90ceeSChristian Brueffer.Fn getsockopt
5816c90ceeSChristian Brueffercall fails, an error will be returned
5916c90ceeSChristian Bruefferwith
6016c90ceeSChristian Brueffer.Va errno
6116c90ceeSChristian Bruefferset as specified in the
62d8b5fd91SRandall Stewart.Fn socket
63d8b5fd91SRandall Stewartor
64d8b5fd91SRandall Stewart.Fn getsockopt
65d8b5fd91SRandall Stewartsystem call.
66d8b5fd91SRandall Stewart.Sh RETURN VALUES
67d8b5fd91SRandall StewartThe call returns the number of bytes that the operating
68d8b5fd91SRandall Stewartsystem expects for the specific address family or -1.
69d8b5fd91SRandall Stewart.Sh ERRORS
70d8b5fd91SRandall StewartThe
71d8b5fd91SRandall Stewart.Fn sctp_getaddrlen
72a47698f8SChristian Bruefferfunction can return the following errors:
73d8b5fd91SRandall Stewart.Bl -tag -width Er
74d8b5fd91SRandall Stewart.It Bq Er EINVAL
75d8b5fd91SRandall StewartThe address family specified does NOT exist.
76d8b5fd91SRandall Stewart.El
77d8b5fd91SRandall Stewart.Sh SEE ALSO
78d8b5fd91SRandall Stewart.Xr getsockopt 2 ,
7916c90ceeSChristian Brueffer.Xr socket 2 ,
8016c90ceeSChristian Brueffer.Xr sctp 4
81