1163953Srrs/*- 2169382Srrs * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. 3237896Stuexen * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. 4237896Stuexen * Copyright (c) 2008-2012, 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, 10231038Stuexen * 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 14231038Stuexen * 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#include <sys/cdefs.h> 34163953Srrs__FBSDID("$FreeBSD$"); 35163953Srrs 36237896Stuexen#ifndef _NETINET_SCTP_OUTPUT_H_ 37237896Stuexen#define _NETINET_SCTP_OUTPUT_H_ 38163953Srrs 39163953Srrs#include <netinet/sctp_header.h> 40163953Srrs 41180387Srrs#if defined(_KERNEL) || defined(__Userspace__) 42167598Srrs 43167598Srrs 44167598Srrsstruct mbuf * 45167598Srrssctp_add_addresses_to_i_ia(struct sctp_inpcb *inp, 46221904Stuexen struct sctp_tcb *stcb, 47167598Srrs struct sctp_scoping *scope, 48167598Srrs struct mbuf *m_at, 49252953Stuexen int cnt_inits_to, 50252953Stuexen uint16_t * padding_len, uint16_t * chunk_len); 51167598Srrs 52167598Srrs 53167598Srrsint sctp_is_addr_restricted(struct sctp_tcb *, struct sctp_ifa *); 54167598Srrs 55167598Srrs 56167598Srrsint 57167598Srrssctp_is_address_in_scope(struct sctp_ifa *ifa, 58252961Stuexen struct sctp_scoping *scope, 59167598Srrs int do_update); 60252961Stuexen 61167598Srrsint 62167598Srrs sctp_is_addr_in_ep(struct sctp_inpcb *inp, struct sctp_ifa *ifa); 63167598Srrs 64167598Srrsstruct sctp_ifa * 65167598Srrssctp_source_address_selection(struct sctp_inpcb *inp, 66167598Srrs struct sctp_tcb *stcb, 67168299Srrs sctp_route_t * ro, struct sctp_nets *net, 68167598Srrs int non_asoc_addr_ok, uint32_t vrf_id); 69167598Srrs 70171990Srrsint 71171990Srrs sctp_v6src_match_nexthop(struct sockaddr_in6 *src6, sctp_route_t * ro); 72171990Srrsint 73171990Srrs sctp_v4src_match_nexthop(struct sctp_ifa *sifa, sctp_route_t * ro); 74167598Srrs 75172090Srrsvoid 76172090Srrssctp_send_initiate(struct sctp_inpcb *, struct sctp_tcb *, int 77172090Srrs#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) 78172090Srrs SCTP_UNUSED 79172090Srrs#endif 80172090Srrs); 81163953Srrs 82163953Srrsvoid 83238253Stuexensctp_send_initiate_ack(struct sctp_inpcb *, struct sctp_tcb *, struct mbuf *, 84252889Stuexen int, int, 85252889Stuexen struct sockaddr *, struct sockaddr *, 86252889Stuexen struct sctphdr *, struct sctp_init_chunk *, 87238253Stuexen uint8_t, uint32_t, 88179157Srrs uint32_t, uint16_t, int); 89163953Srrs 90163953Srrsstruct mbuf * 91163953Srrssctp_arethere_unrecognized_parameters(struct mbuf *, int, int *, 92185694Srrs struct sctp_chunkhdr *, int *); 93163953Srrsvoid sctp_queue_op_err(struct sctp_tcb *, struct mbuf *); 94163953Srrs 95163953Srrsint 96163953Srrssctp_send_cookie_echo(struct mbuf *, int, struct sctp_tcb *, 97163953Srrs struct sctp_nets *); 98163953Srrs 99169378Srrsvoid sctp_send_cookie_ack(struct sctp_tcb *); 100169378Srrs 101163953Srrsvoid 102163953Srrssctp_send_heartbeat_ack(struct sctp_tcb *, struct mbuf *, int, int, 103163953Srrs struct sctp_nets *); 104163953Srrs 105189121Srrsvoid 106189121Srrssctp_remove_from_wheel(struct sctp_tcb *stcb, 107189121Srrs struct sctp_association *asoc, 108189121Srrs struct sctp_stream_out *strq, int holds_lock); 109163953Srrs 110189121Srrs 111169378Srrsvoid sctp_send_shutdown(struct sctp_tcb *, struct sctp_nets *); 112163953Srrs 113169378Srrsvoid sctp_send_shutdown_ack(struct sctp_tcb *, struct sctp_nets *); 114163953Srrs 115204141Stuexenvoid sctp_send_shutdown_complete(struct sctp_tcb *, struct sctp_nets *, int); 116163953Srrs 117169378Srrsvoid 118252889Stuexensctp_send_shutdown_complete2(struct sockaddr *, struct sockaddr *, 119252889Stuexen struct sctphdr *, 120238253Stuexen uint8_t, uint32_t, 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 *, 165252881Stuexen int, int, int); 166163953Srrs 167163953Srrs 168163953Srrs 169218072Srrsvoid sctp_send_cwr(struct sctp_tcb *, struct sctp_nets *, uint32_t, uint8_t); 170163953Srrs 171163953Srrs 172163953Srrsvoid 173252933Stuexensctp_add_stream_reset_out(struct sctp_tmit_chunk *, 174252933Stuexen int, uint16_t *, uint32_t, uint32_t, uint32_t); 175163953Srrs 176163953Srrsvoid 177252933Stuexen sctp_add_stream_reset_result(struct sctp_tmit_chunk *, uint32_t, uint32_t); 178163953Srrs 179163953Srrsvoid 180252933Stuexensctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *, 181252933Stuexen uint32_t, uint32_t, uint32_t, uint32_t); 182163953Srrs 183163953Srrsint 184252933Stuexensctp_send_str_reset_req(struct sctp_tcb *, int, uint16_t *, uint8_t, uint8_t, 185252933Stuexen uint8_t, uint8_t, uint16_t, uint16_t, uint8_t); 186163953Srrs 187163953Srrsvoid 188252889Stuexensctp_send_abort(struct mbuf *, int, struct sockaddr *, struct sockaddr *, 189252889Stuexen struct sctphdr *, uint32_t, struct mbuf *, 190238253Stuexen uint8_t, uint32_t, 191238253Stuexen uint32_t, uint16_t); 192163953Srrs 193238251Stuexenvoid 194252889Stuexensctp_send_operr_to(struct sockaddr *, struct sockaddr *, 195252889Stuexen struct sctphdr *, uint32_t, struct mbuf *, 196238253Stuexen uint8_t, uint32_t, 197238253Stuexen uint32_t, uint16_t); 198163953Srrs 199180387Srrs#endif /* _KERNEL || __Userspace__ */ 200180387Srrs 201238253Stuexen#if defined(_KERNEL) || defined(__Userspace__) 202163953Srrsint 203163953Srrssctp_sosend(struct socket *so, 204163953Srrs struct sockaddr *addr, 205163953Srrs struct uio *uio, 206163953Srrs struct mbuf *top, 207163953Srrs struct mbuf *control, 208163953Srrs int flags, 209163953Srrs struct thread *p 210163953Srrs); 211163953Srrs 212163953Srrs#endif 213163953Srrs#endif 214