1 /*- 2 * Copyright (c) 2001-2006, Cisco Systems, Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are met: 6 * 7 * a) Redistributions of source code must retain the above copyright notice, 8 * this list of conditions and the following disclaimer. 9 * 10 * b) Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in 12 * the documentation and/or other materials provided with the distribution. 13 * 14 * c) Neither the name of Cisco Systems, Inc. nor the names of its 15 * contributors may be used to endorse or promote products derived 16 * from this software without specific prior written permission. 17 * 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 20 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 * THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31 /* $KAME: sctp_output.h,v 1.14 2005/03/06 16:04:18 itojun Exp $ */ 32 33 #include <sys/cdefs.h> 34 __FBSDID("$FreeBSD$"); 35 36 #ifndef __sctp_output_h__ 37 #define __sctp_output_h__ 38 39 40 41 42 #include <netinet/sctp_header.h> 43 44 45 46 #if defined(_KERNEL) 47 void sctp_send_initiate(struct sctp_inpcb *, struct sctp_tcb *); 48 49 void 50 sctp_send_initiate_ack(struct sctp_inpcb *, struct sctp_tcb *, 51 struct mbuf *, int, int, struct sctphdr *, struct sctp_init_chunk *); 52 53 struct mbuf * 54 sctp_arethere_unrecognized_parameters(struct mbuf *, int, int *, 55 struct sctp_chunkhdr *); 56 void sctp_queue_op_err(struct sctp_tcb *, struct mbuf *); 57 58 int 59 sctp_send_cookie_echo(struct mbuf *, int, struct sctp_tcb *, 60 struct sctp_nets *); 61 int sctp_send_cookie_ack(struct sctp_tcb *); 62 63 void 64 sctp_send_heartbeat_ack(struct sctp_tcb *, struct mbuf *, int, int, 65 struct sctp_nets *); 66 67 68 int sctp_send_shutdown(struct sctp_tcb *, struct sctp_nets *); 69 70 int sctp_send_shutdown_ack(struct sctp_tcb *, struct sctp_nets *); 71 72 int sctp_send_shutdown_complete(struct sctp_tcb *, struct sctp_nets *); 73 74 int sctp_send_shutdown_complete2(struct mbuf *, int, struct sctphdr *); 75 76 int sctp_send_asconf(struct sctp_tcb *, struct sctp_nets *); 77 78 int sctp_send_asconf_ack(struct sctp_tcb *, uint32_t); 79 80 int sctp_get_frag_point(struct sctp_tcb *, struct sctp_association *); 81 82 void sctp_toss_old_cookies(struct sctp_tcb *, struct sctp_association *); 83 84 void sctp_toss_old_asconf(struct sctp_tcb *); 85 86 void sctp_fix_ecn_echo(struct sctp_association *); 87 88 int 89 sctp_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *, 90 struct mbuf *, struct thread *, int); 91 92 93 void 94 sctp_insert_on_wheel(struct sctp_tcb *stcb, 95 struct sctp_association *asoc, 96 struct sctp_stream_out *strq, int holdslock); 97 98 int sctp_chunk_output(struct sctp_inpcb *, struct sctp_tcb *, int); 99 void sctp_send_abort_tcb(struct sctp_tcb *, struct mbuf *); 100 101 void send_forward_tsn(struct sctp_tcb *, struct sctp_association *); 102 103 void sctp_send_sack(struct sctp_tcb *); 104 105 int sctp_send_hb(struct sctp_tcb *, int, struct sctp_nets *); 106 107 void sctp_send_ecn_echo(struct sctp_tcb *, struct sctp_nets *, uint32_t); 108 109 110 void 111 sctp_send_packet_dropped(struct sctp_tcb *, struct sctp_nets *, struct mbuf *, 112 int, int); 113 114 115 116 void sctp_send_cwr(struct sctp_tcb *, struct sctp_nets *, uint32_t); 117 118 119 struct mbuf * 120 sctp_get_mbuf_for_msg(unsigned int space_needed, 121 int want_header, int how, int allonebuf, int type); 122 123 void 124 sctp_add_stream_reset_out(struct sctp_tmit_chunk *chk, 125 int number_entries, uint16_t * list, 126 uint32_t seq, uint32_t resp_seq, uint32_t last_sent); 127 128 void 129 sctp_add_stream_reset_in(struct sctp_tmit_chunk *chk, 130 int number_entries, uint16_t * list, 131 uint32_t seq); 132 133 void 134 sctp_add_stream_reset_tsn(struct sctp_tmit_chunk *chk, 135 uint32_t seq); 136 137 void 138 sctp_add_stream_reset_result(struct sctp_tmit_chunk *chk, 139 uint32_t resp_seq, uint32_t result); 140 141 void 142 sctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *chk, 143 uint32_t resp_seq, uint32_t result, 144 uint32_t send_una, uint32_t recv_next); 145 146 int 147 sctp_send_str_reset_req(struct sctp_tcb *stcb, 148 int number_entries, uint16_t * list, 149 uint8_t send_out_req, uint32_t resp_seq, 150 uint8_t send_in_req, 151 uint8_t send_tsn_req); 152 153 154 void 155 sctp_send_abort(struct mbuf *, int, struct sctphdr *, uint32_t, 156 struct mbuf *); 157 158 void sctp_send_operr_to(struct mbuf *, int, struct mbuf *, uint32_t); 159 160 int 161 sctp_sosend(struct socket *so, 162 struct sockaddr *addr, 163 struct uio *uio, 164 struct mbuf *top, 165 struct mbuf *control, 166 int flags, 167 struct thread *p 168 ); 169 170 #endif 171 #endif 172