sctp_output.h revision 228653
1163953Srrs/*- 2169382Srrs * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. 3218319Srrs * Copyright (c) 2008-2011, by Randall Stewart. All rights reserved. 4218319Srrs * Copyright (c) 2008-2011, by Michael Tuexen. All rights reserved. 5163953Srrs * 6163953Srrs * Redistribution and use in source and binary forms, with or without 7163953Srrs * modification, are permitted provided that the following conditions are met: 8163953Srrs * 9163953Srrs * a) Redistributions of source code must retain the above copyright notice, 10228653Stuexen * this list of conditions and the following disclaimer. 11163953Srrs * 12163953Srrs * b) Redistributions in binary form must reproduce the above copyright 13163953Srrs * notice, this list of conditions and the following disclaimer in 14228653Stuexen * the documentation and/or other materials provided with the distribution. 15163953Srrs * 16163953Srrs * c) Neither the name of Cisco Systems, Inc. nor the names of its 17163953Srrs * contributors may be used to endorse or promote products derived 18163953Srrs * from this software without specific prior written permission. 19163953Srrs * 20163953Srrs * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21163953Srrs * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 22163953Srrs * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23163953Srrs * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 24163953Srrs * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25163953Srrs * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26163953Srrs * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27163953Srrs * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28163953Srrs * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29163953Srrs * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30163953Srrs * THE POSSIBILITY OF SUCH DAMAGE. 31163953Srrs */ 32163953Srrs 33163953Srrs/* $KAME: sctp_output.h,v 1.14 2005/03/06 16:04:18 itojun Exp $ */ 34163953Srrs 35163953Srrs#include <sys/cdefs.h> 36163953Srrs__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.h 228653 2011-12-17 19:21:40Z tuexen $"); 37163953Srrs 38163953Srrs#ifndef __sctp_output_h__ 39163953Srrs#define __sctp_output_h__ 40163953Srrs 41163953Srrs#include <netinet/sctp_header.h> 42163953Srrs 43180387Srrs#if defined(_KERNEL) || defined(__Userspace__) 44167598Srrs 45167598Srrs 46167598Srrsstruct mbuf * 47167598Srrssctp_add_addresses_to_i_ia(struct sctp_inpcb *inp, 48221904Stuexen struct sctp_tcb *stcb, 49167598Srrs struct sctp_scoping *scope, 50167598Srrs struct mbuf *m_at, 51167598Srrs int cnt_inits_to); 52167598Srrs 53167598Srrs 54167598Srrsint sctp_is_addr_restricted(struct sctp_tcb *, struct sctp_ifa *); 55167598Srrs 56167598Srrs 57167598Srrsint 58167598Srrssctp_is_address_in_scope(struct sctp_ifa *ifa, 59167598Srrs int ipv4_addr_legal, 60167598Srrs int ipv6_addr_legal, 61167598Srrs int loopback_scope, 62167598Srrs int ipv4_local_scope, 63167598Srrs int local_scope, 64167598Srrs int site_scope, 65167598Srrs int do_update); 66167598Srrsint 67167598Srrs sctp_is_addr_in_ep(struct sctp_inpcb *inp, struct sctp_ifa *ifa); 68167598Srrs 69167598Srrsstruct sctp_ifa * 70167598Srrssctp_source_address_selection(struct sctp_inpcb *inp, 71167598Srrs struct sctp_tcb *stcb, 72168299Srrs sctp_route_t * ro, struct sctp_nets *net, 73167598Srrs int non_asoc_addr_ok, uint32_t vrf_id); 74167598Srrs 75171990Srrsint 76171990Srrs sctp_v6src_match_nexthop(struct sockaddr_in6 *src6, sctp_route_t * ro); 77171990Srrsint 78171990Srrs sctp_v4src_match_nexthop(struct sctp_ifa *sifa, sctp_route_t * ro); 79167598Srrs 80172090Srrsvoid 81172090Srrssctp_send_initiate(struct sctp_inpcb *, struct sctp_tcb *, int 82172090Srrs#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) 83172090Srrs SCTP_UNUSED 84172090Srrs#endif 85172090Srrs); 86163953Srrs 87163953Srrsvoid 88163953Srrssctp_send_initiate_ack(struct sctp_inpcb *, struct sctp_tcb *, 89169352Srrs struct mbuf *, int, int, struct sctphdr *, struct sctp_init_chunk *, 90179157Srrs uint32_t, uint16_t, int); 91163953Srrs 92163953Srrsstruct mbuf * 93163953Srrssctp_arethere_unrecognized_parameters(struct mbuf *, int, int *, 94185694Srrs struct sctp_chunkhdr *, int *); 95163953Srrsvoid sctp_queue_op_err(struct sctp_tcb *, struct mbuf *); 96163953Srrs 97163953Srrsint 98163953Srrssctp_send_cookie_echo(struct mbuf *, int, struct sctp_tcb *, 99163953Srrs struct sctp_nets *); 100163953Srrs 101169378Srrsvoid sctp_send_cookie_ack(struct sctp_tcb *); 102169378Srrs 103163953Srrsvoid 104163953Srrssctp_send_heartbeat_ack(struct sctp_tcb *, struct mbuf *, int, int, 105163953Srrs struct sctp_nets *); 106163953Srrs 107189121Srrsvoid 108189121Srrssctp_remove_from_wheel(struct sctp_tcb *stcb, 109189121Srrs struct sctp_association *asoc, 110189121Srrs struct sctp_stream_out *strq, int holds_lock); 111163953Srrs 112189121Srrs 113169378Srrsvoid sctp_send_shutdown(struct sctp_tcb *, struct sctp_nets *); 114163953Srrs 115169378Srrsvoid sctp_send_shutdown_ack(struct sctp_tcb *, struct sctp_nets *); 116163953Srrs 117204141Stuexenvoid sctp_send_shutdown_complete(struct sctp_tcb *, struct sctp_nets *, int); 118163953Srrs 119169378Srrsvoid 120228653Stuexensctp_send_shutdown_complete2(struct mbuf *, struct sctphdr *, 121179157Srrs uint32_t, uint16_t); 122163953Srrs 123172190Srrsvoid sctp_send_asconf(struct sctp_tcb *, struct sctp_nets *, int addr_locked); 124163953Srrs 125171990Srrsvoid sctp_send_asconf_ack(struct sctp_tcb *); 126163953Srrs 127163953Srrsint sctp_get_frag_point(struct sctp_tcb *, struct sctp_association *); 128163953Srrs 129163953Srrsvoid sctp_toss_old_cookies(struct sctp_tcb *, struct sctp_association *); 130163953Srrs 131163953Srrsvoid sctp_toss_old_asconf(struct sctp_tcb *); 132163953Srrs 133163953Srrsvoid sctp_fix_ecn_echo(struct sctp_association *); 134163953Srrs 135212712Stuexenvoid sctp_move_chunks_from_net(struct sctp_tcb *stcb, struct sctp_nets *net); 136212712Stuexen 137163953Srrsint 138163953Srrssctp_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *, 139163953Srrs struct mbuf *, struct thread *, int); 140163953Srrs 141172090Srrsvoid 142172090Srrssctp_chunk_output(struct sctp_inpcb *, struct sctp_tcb *, int, int 143172090Srrs#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) 144172090Srrs SCTP_UNUSED 145172090Srrs#endif 146172090Srrs); 147172090Srrsvoid 148172090Srrssctp_send_abort_tcb(struct sctp_tcb *, struct mbuf *, int 149172090Srrs#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) 150172090Srrs SCTP_UNUSED 151172090Srrs#endif 152172090Srrs); 153163953Srrs 154163953Srrsvoid send_forward_tsn(struct sctp_tcb *, struct sctp_association *); 155163953Srrs 156221627Stuexenvoid sctp_send_sack(struct sctp_tcb *, int); 157163953Srrs 158224641Stuexenvoid sctp_send_hb(struct sctp_tcb *, struct sctp_nets *, int); 159163953Srrs 160163953Srrsvoid sctp_send_ecn_echo(struct sctp_tcb *, struct sctp_nets *, uint32_t); 161163953Srrs 162163953Srrs 163163953Srrsvoid 164163953Srrssctp_send_packet_dropped(struct sctp_tcb *, struct sctp_nets *, struct mbuf *, 165163953Srrs int, int); 166163953Srrs 167163953Srrs 168163953Srrs 169218072Srrsvoid sctp_send_cwr(struct sctp_tcb *, struct sctp_nets *, uint32_t, uint8_t); 170163953Srrs 171163953Srrs 172163953Srrsvoid 173163953Srrssctp_add_stream_reset_out(struct sctp_tmit_chunk *chk, 174163953Srrs int number_entries, uint16_t * list, 175163953Srrs uint32_t seq, uint32_t resp_seq, uint32_t last_sent); 176163953Srrs 177163953Srrsvoid 178163953Srrssctp_add_stream_reset_in(struct sctp_tmit_chunk *chk, 179163953Srrs int number_entries, uint16_t * list, 180163953Srrs uint32_t seq); 181163953Srrs 182163953Srrsvoid 183163953Srrssctp_add_stream_reset_tsn(struct sctp_tmit_chunk *chk, 184163953Srrs uint32_t seq); 185163953Srrs 186163953Srrsvoid 187163953Srrssctp_add_stream_reset_result(struct sctp_tmit_chunk *chk, 188163953Srrs uint32_t resp_seq, uint32_t result); 189163953Srrs 190163953Srrsvoid 191163953Srrssctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *chk, 192163953Srrs uint32_t resp_seq, uint32_t result, 193163953Srrs uint32_t send_una, uint32_t recv_next); 194163953Srrs 195163953Srrsint 196163953Srrssctp_send_str_reset_req(struct sctp_tcb *stcb, 197188854Srrs int number_entries, 198188854Srrs uint16_t * list, 199188854Srrs uint8_t send_out_req, 200188854Srrs uint32_t resp_seq, 201163953Srrs uint8_t send_in_req, 202188854Srrs uint8_t send_tsn_req, 203188854Srrs uint8_t add_str, 204188854Srrs uint16_t adding); 205163953Srrs 206163953Srrs 207163953Srrsvoid 208163953Srrssctp_send_abort(struct mbuf *, int, struct sctphdr *, uint32_t, 209179157Srrs struct mbuf *, uint32_t, uint16_t); 210163953Srrs 211179157Srrsvoid sctp_send_operr_to(struct mbuf *, int, struct mbuf *, uint32_t, uint32_t, uint16_t); 212163953Srrs 213180387Srrs#endif /* _KERNEL || __Userspace__ */ 214180387Srrs 215180387Srrs#if defined(_KERNEL) || defined (__Userspace__) 216163953Srrsint 217163953Srrssctp_sosend(struct socket *so, 218163953Srrs struct sockaddr *addr, 219163953Srrs struct uio *uio, 220163953Srrs struct mbuf *top, 221163953Srrs struct mbuf *control, 222163953Srrs int flags, 223163953Srrs struct thread *p 224163953Srrs); 225163953Srrs 226163953Srrs#endif 227163953Srrs#endif 228