2007-02-22 14:32:39 +00:00
|
|
|
.\" Copyright (c) 1983, 1991, 1993
|
|
|
|
.\" The Regents of the University of California. All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
2013-05-28 20:37:48 +00:00
|
|
|
.\" 3. Neither the name of the University nor the names of its contributors
|
2007-02-22 14:32:39 +00:00
|
|
|
.\" may be used to endorse or promote products derived from this software
|
|
|
|
.\" without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
2007-06-19 16:29:46 +00:00
|
|
|
.Dd June 19, 2007
|
2007-02-22 14:32:39 +00:00
|
|
|
.Dt SCTP_CONNECTX 3
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm sctp_connectx
|
2012-05-11 20:06:46 +00:00
|
|
|
.Nd connect an SCTP socket with multiple destination addresses
|
2007-02-22 14:32:39 +00:00
|
|
|
.Sh LIBRARY
|
|
|
|
.Lb libc
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.In sys/types.h
|
|
|
|
.In sys/socket.h
|
2007-02-26 12:23:32 +00:00
|
|
|
.In netinet/sctp.h
|
2007-02-22 14:32:39 +00:00
|
|
|
.Ft int
|
2010-01-12 21:45:03 +00:00
|
|
|
.Fn sctp_connectx "int sd" "struct sockaddr *addrs" "int addrcnt" "sctp_assoc_t *id"
|
2007-02-22 14:32:39 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Fn sctp_connectx
|
|
|
|
call attempts to initiate an association to a peer SCTP
|
2007-06-18 10:20:32 +00:00
|
|
|
endpoint.
|
|
|
|
The call operates similarly to
|
2007-02-22 14:32:39 +00:00
|
|
|
.Fn connect
|
|
|
|
but it also provides the ability to specify multiple destination
|
2007-06-18 10:20:32 +00:00
|
|
|
addresses for the peer.
|
|
|
|
This allows a fault tolerant method
|
|
|
|
of initiating an association.
|
|
|
|
When one of the peers addresses
|
2007-02-22 14:32:39 +00:00
|
|
|
is unreachable, the subsequent listed addresses will also be used
|
2012-03-29 05:02:12 +00:00
|
|
|
to set up the association with the peer.
|
2007-02-22 14:32:39 +00:00
|
|
|
.Pp
|
2012-03-29 05:02:12 +00:00
|
|
|
The user also needs to consider that any address listed in an
|
2007-02-22 14:32:39 +00:00
|
|
|
.Fn sctp_connectx
|
2007-06-18 10:20:32 +00:00
|
|
|
call is also considered "confirmed".
|
2007-02-22 14:32:39 +00:00
|
|
|
A confirmed address is one in
|
|
|
|
which the SCTP transport will trust is a part of the association
|
|
|
|
and it will not send a confirmation heartbeat to it with
|
2012-03-29 05:02:12 +00:00
|
|
|
a random nonce.
|
2007-02-22 14:32:39 +00:00
|
|
|
.Pp
|
|
|
|
If the peer SCTP stack does not list one or more of
|
2012-03-29 05:02:12 +00:00
|
|
|
the provided addresses in its response message then
|
2007-02-22 14:32:39 +00:00
|
|
|
the extra addresses sent in the
|
|
|
|
.Fn sctp_connectx
|
2007-06-19 16:29:46 +00:00
|
|
|
call will be silently discarded from the association.
|
|
|
|
On
|
|
|
|
successful completion the provided
|
2010-01-12 21:45:03 +00:00
|
|
|
.Fa id
|
2007-06-19 16:29:46 +00:00
|
|
|
will be
|
2007-06-19 16:18:43 +00:00
|
|
|
filled in with the association identification of the newly
|
|
|
|
forming association.
|
2007-02-22 14:32:39 +00:00
|
|
|
.Sh RETURN VALUES
|
|
|
|
The call returns 0 on success and -1 upon failure.
|
|
|
|
.Sh ERRORS
|
|
|
|
The
|
|
|
|
.Fn sctp_connectx
|
2010-01-12 21:45:03 +00:00
|
|
|
function can return the following errors:
|
2007-02-22 14:32:39 +00:00
|
|
|
.Bl -tag -width Er
|
|
|
|
.It Bq Er EINVAL
|
|
|
|
An address listed has an invalid family or no
|
|
|
|
addresses were provided.
|
|
|
|
.It Bq Er E2BIG
|
|
|
|
The size of the address list exceeds the amount of
|
|
|
|
data provided.
|
|
|
|
.It Bq Er EBADF
|
|
|
|
The argument
|
|
|
|
.Fa s
|
|
|
|
is not a valid descriptor.
|
|
|
|
.It Bq Er ENOTSOCK
|
|
|
|
The argument
|
|
|
|
.Fa s
|
|
|
|
is not a socket.
|
|
|
|
.El
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr connect 2 ,
|
2007-06-18 10:20:32 +00:00
|
|
|
.Xr sctp 4
|