/*
* 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
*/
/*
*/
#include <inet/ipsec_impl.h>
#include <inet/ipsec_impl.h>
#include <inet/ipclassifier.h>
#include "sctp_impl.h"
#include "sctp_asconf.h"
{
return (-1);
}
/* Chunk header */
if (tbit)
if (serror == 0) {
return (alen);
}
if (len > 0) {
}
/* XXX pad */
return (alen);
}
void
{
char *cause;
/*
* Don't need notification if connection is not yet setup,
* call sctp_clean_death() to reclaim resources.
* Any pending connect call(s) will error out.
*/
return;
}
return;
}
/*
* Create abort chunk.
*/
if (data) {
} else {
}
}
} else {
len = 0;
}
/*
* Since it is a user abort, we should have the sctp_t and hence
* the correct verification tag. So we should not set the T-bit
* in the ABORT.
*/
B_FALSE)) < 0) {
return;
}
}
/*
* If iserror == 0, sends an abort. If iserror != 0, sends an error.
*/
void
{
uchar_t *p;
int isv4;
if (isv4) {
} else {
}
/*
* If this is a labeled system, then check to see if we're allowed to
* send a response to this particular sender. If not, then just drop.
*/
return;
/* XXX no resources */
return;
}
/* copy in the IP / SCTP header */
if (isv4) {
/*
* Composite is likely incomplete at this point, so pull
* info from the incoming IP / SCTP headers.
*/
/* Copy in the peer's IP addr */
} else {
/* Copy in the peer's IP addr */
}
/* Fill in the holes in the SCTP common header */
/* Link in the abort chunk */
< 0) {
return;
}
/*
* Base the transmission on any routing-related socket options
* that have been set on the listener/connection.
*/
return;
}
if (isv4) {
} else {
}
}
/*
* Apply IPsec based on how IPsec was applied to
* the packet that caused the abort.
*/
/* Note: mp already consumed and ip_drop_packet done */
return;
}
} else {
}
}
/*
* OOTB version of the above.
* If iserror == 0, sends an abort. If iserror != 0, sends an error.
*/
void
{
int i;
int isv4;
/*
* If this is a labeled system, then check to see if we're allowed to
* send a response to this particular sender. If not, then just drop.
*/
return;
return;
}
/*
* We follow the logic in tcp_xmit_early_reset() in that we skip
* reversing source route (i.e. replace all IP options with EOL).
*/
if (isv4) {
for (i = IP_SIMPLE_HDR_LENGTH; i < (int)ip_hdr_len; i++)
/* Swap addresses */
ipha->ipha_ident = 0;
} else {
/* Remove any extension headers assuming partial overlay */
if (ip_hdr_len > IPV6_HDR_LEN) {
}
}
}
/* Swap ports. Verification tag is reused. */
/* Link in the abort chunk */
< 0) {
return;
}
if (isv4) {
} else {
}
ixas.ixa_ifindex = 0;
if (is_system_labeled()) {
}
/*
* Apply IPsec based on how IPsec was applied to
* the packet that was out of the blue.
*/
/* Note: mp already consumed and ip_drop_packet done */
return;
}
} else {
/*
* This is in clear. The abort message we are building
* here should go out in clear, independent of our policy.
*/
}
ixa_cleanup(&ixas);
}
/*ARGSUSED*/
mblk_t *
{
int pad;
}
return (NULL);
}
/* Chunk header */
if (len > 0) {
}
if (pad != 0) {
}
return (emp);
}
/*
* Called from sctp_input_data() to add one error chunk to the error
* chunks list. The error chunks list will be processed at the end
* of sctp_input_data() by calling sctp_process_err().
*/
void
{
return;
} else {
}
/*
* If the current output packet cannot include the new error chunk,
* send out the current packet and then add the new error chunk
* to the new output packet.
*/
/* Just free the latest error chunk. */
return;
}
} else {
else
}
/* Assume that we will send it out... */
}
/*
* Called from sctp_input_data() to send out error chunks created during
* the processing of all the chunks in an incoming packet.
*/
void
{
goto done;
}
done:
sctp->sctp_err_len = 0;
}
/*
* Returns 0 on non-fatal error, otherwise a system error on fatal
* error.
*/
int
{
/* no error cause given */
return (0);
}
/*
* Both BAD_SID and NO_USR_DATA errors
* indicate a serious bug in our stack,
* so complain and abort the association.
*/
case SCTP_ERR_BAD_SID:
ira);
return (ECONNABORTED);
case SCTP_ERR_NO_USR_DATA:
ira);
return (ECONNABORTED);
case SCTP_ERR_UNREC_CHUNK:
/* Pull out the unrecognized chunk type */
/* Not enough to process */
return (0);
}
/* Turn on ASCONF sending */
/*
* Hand off to asconf to clear out the unacked
* asconf chunk.
*/
/* malformed */
dprint(0, ("Malformed Unrec Chunk error\n"));
return (0);
}
return (0);
}
/* Else drop it */
break;
default:
break;
}
return (0);
}