sctp_shutdown.c revision 769b977d34538d5f208de3a6178f04cb0876b7ca
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "sctp_impl.h"
void
{
return;
}
/*
* We set an upper bound on how long we will
* wait for a shutdown-ack from the peer. This
* is to prevent the receiver from attempting
* to create a half-closed state indefinately.
* See archive from IETF TSVWG mailing list
* for June 2001 for more information.
* Since we will not be calculating RTTs after
* sending the shutdown, we can overload out_time
* to track how long we have waited.
*/
}
/*
* If there is unsent (or unacked) data, wait for it to get ack'd
*/
return;
}
/* rotate faddrs if we are retransmitting */
if (!rexmit) {
} else {
}
/* Link in a SACK if resending the shutdown */
goto done;
}
} else {
goto done;
}
/* shutdown w/o sack, update lastacked */
}
/* Send the shutdown and restart the timer */
done:
}
int
{
int trysend = 0;
/* Extract and process the TSN in the shutdown chunk */
}
/* Don't allow sending new data */
if (!SCTP_IS_DETACHED(sctp))
/*
* If there is unsent or unacked data, try sending them out now.
* The other side should acknowledge them. After we have flushed
* the transmit queue, we can complete the shutdown sequence.
*/
return (1);
/* rotate faddrs if we are retransmitting */
if (!rexmit)
else
}
goto dotimer;
}
/*
* bundle a "cookie received while shutting down" error if
* the caller asks for it.
*/
if (crwsd) {
}
}
return (trysend);
}
void
{
/* XXX use timer approach */
return;
}
}
/*
* Similar to sctp_shutdown_complete(), except that since this
* is out-of-the-blue, we can't use an sctp's association information,
* and instead must draw all necessary info from the incoming packet.
*/
void
{
int i;
/*
* The gsctp should contain the minimal IP header. So the
* incoming mblk should be able to hold the new SCTP packet.
*/
/*
* Check to see if we can reuse the incoming mblk. There should
* not be other reference and the db_base of the mblk should be
* properly aligned. Since this packet comes from below,
* there should be enough header space to fill in what the lower
* layers want to add. And we will not stash anything there.
*/
return;
}
} else {
}
/*
* We follow the logic in tcp_xmit_early_reset() in that we skip
* reversing source route (i.e. relpace all IP options with EOL).
*/
if (isv4) {
for (i = IP_SIMPLE_HDR_LENGTH; i < (int)ip_hdr_len; i++)
/* Swap addresses */
sizeof (*scch));
inip4h->ipha_ident = 0;
} else {
/* Remove any extension headers assuming partial overlay */
if (ip_hdr_len > IPV6_HDR_LEN) {
}
sizeof (*scch) - IPV6_HDR_LEN);
}
/* Swap ports. Verification tag is reused. */
/* Lay in the shutdown complete chunk */
/* Set the T-bit */
/* Nothing to stash... */
}