xref: /freebsd/lib/libc/net/sctp_connectx.3 (revision 5590bacaafd8687bf522bb0413178c177c43f952)
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.
12921ca2fdSEd 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.\"
28*5590bacaSLexi Winter.Dd February 2, 2024
29d8b5fd91SRandall Stewart.Dt SCTP_CONNECTX 3
30d8b5fd91SRandall Stewart.Os
31d8b5fd91SRandall Stewart.Sh NAME
32d8b5fd91SRandall Stewart.Nm sctp_connectx
33a3fb6da9SGlen Barber.Nd connect an SCTP socket with multiple destination addresses
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
41a47698f8SChristian Brueffer.Fn sctp_connectx "int sd" "struct sockaddr *addrs" "int addrcnt" "sctp_assoc_t *id"
42d8b5fd91SRandall Stewart.Sh DESCRIPTION
43d8b5fd91SRandall StewartThe
44d8b5fd91SRandall Stewart.Fn sctp_connectx
45d8b5fd91SRandall Stewartcall attempts to initiate an association to a peer SCTP
4616c90ceeSChristian Bruefferendpoint.
4716c90ceeSChristian BruefferThe call operates similarly to
48d8b5fd91SRandall Stewart.Fn connect
49d8b5fd91SRandall Stewartbut it also provides the ability to specify multiple destination
5016c90ceeSChristian Bruefferaddresses for the peer.
5116c90ceeSChristian BruefferThis allows a fault tolerant method
5216c90ceeSChristian Bruefferof initiating an association.
5316c90ceeSChristian BruefferWhen one of the peers addresses
54d8b5fd91SRandall Stewartis unreachable, the subsequent listed addresses will also be used
55d8b5fd91SRandall Stewartto set up the association with the peer.
56d8b5fd91SRandall Stewart.Pp
57d8b5fd91SRandall StewartThe user also needs to consider that any address listed in an
58d8b5fd91SRandall Stewart.Fn sctp_connectx
5916c90ceeSChristian Brueffercall is also considered "confirmed".
60d8b5fd91SRandall StewartA confirmed address is one in
61d8b5fd91SRandall Stewartwhich the SCTP transport will trust is a part of the association
62d8b5fd91SRandall Stewartand it will not send a confirmation heartbeat to it with
63d8b5fd91SRandall Stewarta random nonce.
64d8b5fd91SRandall Stewart.Pp
65d8b5fd91SRandall StewartIf the peer SCTP stack does not list one or more of
66d8b5fd91SRandall Stewartthe provided addresses in its response message then
67d8b5fd91SRandall Stewartthe extra addresses sent in the
68d8b5fd91SRandall Stewart.Fn sctp_connectx
69c8918191SChristian Brueffercall will be silently discarded from the association.
70c8918191SChristian BruefferOn
71c8918191SChristian Brueffersuccessful completion the provided
72a47698f8SChristian Brueffer.Fa id
73c8918191SChristian Bruefferwill be
747e94ae79SRandall Stewartfilled in with the association identification of the newly
757e94ae79SRandall Stewartforming association.
76d8b5fd91SRandall Stewart.Sh RETURN VALUES
77d8b5fd91SRandall StewartThe call returns 0 on success and -1 upon failure.
78d8b5fd91SRandall Stewart.Sh ERRORS
79d8b5fd91SRandall StewartThe
80d8b5fd91SRandall Stewart.Fn sctp_connectx
81a47698f8SChristian Bruefferfunction can return the following errors:
82d8b5fd91SRandall Stewart.Bl -tag -width Er
83d8b5fd91SRandall Stewart.It Bq Er EINVAL
84d8b5fd91SRandall StewartAn address listed has an invalid family or no
85d8b5fd91SRandall Stewartaddresses were provided.
86d8b5fd91SRandall Stewart.It Bq Er E2BIG
87d8b5fd91SRandall StewartThe size of the address list exceeds the amount of
88d8b5fd91SRandall Stewartdata provided.
89d8b5fd91SRandall Stewart.It Bq Er EBADF
90d8b5fd91SRandall StewartThe argument
91d8b5fd91SRandall Stewart.Fa s
92d8b5fd91SRandall Stewartis not a valid descriptor.
93d8b5fd91SRandall Stewart.It Bq Er ENOTSOCK
94d8b5fd91SRandall StewartThe argument
95d8b5fd91SRandall Stewart.Fa s
96d8b5fd91SRandall Stewartis not a socket.
97d8b5fd91SRandall Stewart.El
98d8b5fd91SRandall Stewart.Sh SEE ALSO
99d8b5fd91SRandall Stewart.Xr connect 2 ,
10016c90ceeSChristian Brueffer.Xr sctp 4
101*5590bacaSLexi Winter.Rs
102*5590bacaSLexi Winter.%A R. Stewart
103*5590bacaSLexi Winter.%A M. Tuexen
104*5590bacaSLexi Winter.%A K. Poon
105*5590bacaSLexi Winter.%A P. Lei
106*5590bacaSLexi Winter.%A V. Yasevich
107*5590bacaSLexi Winter.%T Sockets API Extensions for the Stream Control Transmission Protocol (SCTP)
108*5590bacaSLexi Winter.%R RFC 6458
109*5590bacaSLexi Winter.%D December 2011
110*5590bacaSLexi Winter.Re
111*5590bacaSLexi Winter.Sh STANDARDS
112*5590bacaSLexi WinterThe
113*5590bacaSLexi Winter.Fn sctp_connectx
114*5590bacaSLexi Winterfunction conforms to RFC 6458.
115