michael@0: /*- michael@0: * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. michael@0: * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. michael@0: * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. michael@0: * michael@0: * Redistribution and use in source and binary forms, with or without michael@0: * modification, are permitted provided that the following conditions are met: michael@0: * michael@0: * a) Redistributions of source code must retain the above copyright notice, michael@0: * this list of conditions and the following disclaimer. michael@0: * michael@0: * b) Redistributions in binary form must reproduce the above copyright michael@0: * notice, this list of conditions and the following disclaimer in michael@0: * the documentation and/or other materials provided with the distribution. michael@0: * michael@0: * c) Neither the name of Cisco Systems, Inc. nor the names of its michael@0: * contributors may be used to endorse or promote products derived michael@0: * from this software without specific prior written permission. michael@0: * michael@0: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS michael@0: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, michael@0: * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE michael@0: * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE michael@0: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR michael@0: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF michael@0: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS michael@0: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN michael@0: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) michael@0: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF michael@0: * THE POSSIBILITY OF SUCH DAMAGE. michael@0: */ michael@0: michael@0: #ifdef __FreeBSD__ michael@0: #include michael@0: __FBSDID("$FreeBSD: head/sys/netinet/sctp_output.h 246595 2013-02-09 17:26:14Z tuexen $"); michael@0: #endif michael@0: michael@0: #ifndef _NETINET_SCTP_OUTPUT_H_ michael@0: #define _NETINET_SCTP_OUTPUT_H_ michael@0: michael@0: #include michael@0: michael@0: #if defined(_KERNEL) || defined(__Userspace__) michael@0: michael@0: michael@0: struct mbuf * michael@0: sctp_add_addresses_to_i_ia(struct sctp_inpcb *inp, michael@0: struct sctp_tcb *stcb, michael@0: struct sctp_scoping *scope, michael@0: struct mbuf *m_at, michael@0: int cnt_inits_to, michael@0: uint16_t *padding_len, uint16_t *chunk_len); michael@0: michael@0: michael@0: int sctp_is_addr_restricted(struct sctp_tcb *, struct sctp_ifa *); michael@0: michael@0: michael@0: int michael@0: sctp_is_address_in_scope(struct sctp_ifa *ifa, michael@0: struct sctp_scoping *scope, michael@0: int do_update); michael@0: michael@0: int michael@0: sctp_is_addr_in_ep(struct sctp_inpcb *inp, struct sctp_ifa *ifa); michael@0: michael@0: struct sctp_ifa * michael@0: sctp_source_address_selection(struct sctp_inpcb *inp, michael@0: struct sctp_tcb *stcb, michael@0: sctp_route_t *ro, struct sctp_nets *net, michael@0: int non_asoc_addr_ok, uint32_t vrf_id); michael@0: michael@0: #if defined(__FreeBSD__) || defined(__APPLE__) || defined(__Userspace__) michael@0: int michael@0: sctp_v6src_match_nexthop(struct sockaddr_in6 *src6, sctp_route_t *ro); michael@0: int michael@0: sctp_v4src_match_nexthop(struct sctp_ifa *sifa, sctp_route_t *ro); michael@0: #endif michael@0: michael@0: void sctp_send_initiate(struct sctp_inpcb *, struct sctp_tcb *, int michael@0: #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) michael@0: SCTP_UNUSED michael@0: #endif michael@0: ); michael@0: michael@0: void michael@0: sctp_send_initiate_ack(struct sctp_inpcb *, struct sctp_tcb *, struct mbuf *, michael@0: int, int, michael@0: struct sockaddr *, struct sockaddr *, michael@0: struct sctphdr *, struct sctp_init_chunk *, michael@0: #if defined(__FreeBSD__) michael@0: uint8_t, uint32_t, michael@0: #endif michael@0: uint32_t, uint16_t, int); michael@0: michael@0: struct mbuf * michael@0: sctp_arethere_unrecognized_parameters(struct mbuf *, int, int *, michael@0: struct sctp_chunkhdr *, int *); michael@0: void sctp_queue_op_err(struct sctp_tcb *, struct mbuf *); michael@0: michael@0: int michael@0: sctp_send_cookie_echo(struct mbuf *, int, struct sctp_tcb *, michael@0: struct sctp_nets *); michael@0: michael@0: void sctp_send_cookie_ack(struct sctp_tcb *); michael@0: michael@0: void michael@0: sctp_send_heartbeat_ack(struct sctp_tcb *, struct mbuf *, int, int, michael@0: struct sctp_nets *); michael@0: michael@0: void michael@0: sctp_remove_from_wheel(struct sctp_tcb *stcb, michael@0: struct sctp_association *asoc, michael@0: struct sctp_stream_out *strq, int holds_lock); michael@0: michael@0: michael@0: void sctp_send_shutdown(struct sctp_tcb *, struct sctp_nets *); michael@0: michael@0: void sctp_send_shutdown_ack(struct sctp_tcb *, struct sctp_nets *); michael@0: michael@0: void sctp_send_shutdown_complete(struct sctp_tcb *, struct sctp_nets *, int); michael@0: michael@0: void sctp_send_shutdown_complete2(struct sockaddr *, struct sockaddr *, michael@0: struct sctphdr *, michael@0: #if defined(__FreeBSD__) michael@0: uint8_t, uint32_t, michael@0: #endif michael@0: uint32_t, uint16_t); michael@0: michael@0: void sctp_send_asconf(struct sctp_tcb *, struct sctp_nets *, int addr_locked); michael@0: michael@0: void sctp_send_asconf_ack(struct sctp_tcb *); michael@0: michael@0: int sctp_get_frag_point(struct sctp_tcb *, struct sctp_association *); michael@0: michael@0: void sctp_toss_old_cookies(struct sctp_tcb *, struct sctp_association *); michael@0: michael@0: void sctp_toss_old_asconf(struct sctp_tcb *); michael@0: michael@0: void sctp_fix_ecn_echo(struct sctp_association *); michael@0: michael@0: void sctp_move_chunks_from_net(struct sctp_tcb *stcb, struct sctp_nets *net); michael@0: michael@0: #if defined(__FreeBSD__) && __FreeBSD_version >= 500000 michael@0: int michael@0: sctp_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *, michael@0: struct mbuf *, struct thread *, int); michael@0: #elif defined(__Windows__) michael@0: sctp_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *, michael@0: struct mbuf *, PKTHREAD, int); michael@0: #else michael@0: #if defined(__Userspace__) michael@0: /* sctp_output is called bu sctp_sendm. Not using sctp_sendm for __Userspace__ */ michael@0: #endif michael@0: int michael@0: sctp_output(struct sctp_inpcb *, michael@0: #if defined(__Panda__) michael@0: pakhandle_type, michael@0: #else michael@0: struct mbuf *, michael@0: #endif michael@0: struct sockaddr *, michael@0: #if defined(__Panda__) michael@0: pakhandle_type, michael@0: #else michael@0: struct mbuf *, michael@0: #endif michael@0: struct proc *, int); michael@0: #endif michael@0: michael@0: void sctp_chunk_output(struct sctp_inpcb *, struct sctp_tcb *, int, int michael@0: #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) michael@0: SCTP_UNUSED michael@0: #endif michael@0: ); michael@0: void sctp_send_abort_tcb(struct sctp_tcb *, struct mbuf *, int michael@0: #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) michael@0: SCTP_UNUSED michael@0: #endif michael@0: ); michael@0: michael@0: void send_forward_tsn(struct sctp_tcb *, struct sctp_association *); michael@0: michael@0: void sctp_send_sack(struct sctp_tcb *, int); michael@0: michael@0: void sctp_send_hb(struct sctp_tcb *, struct sctp_nets *, int); michael@0: michael@0: void sctp_send_ecn_echo(struct sctp_tcb *, struct sctp_nets *, uint32_t); michael@0: michael@0: michael@0: void michael@0: sctp_send_packet_dropped(struct sctp_tcb *, struct sctp_nets *, struct mbuf *, michael@0: int, int, int); michael@0: michael@0: michael@0: michael@0: void sctp_send_cwr(struct sctp_tcb *, struct sctp_nets *, uint32_t, uint8_t); michael@0: michael@0: michael@0: void michael@0: sctp_add_stream_reset_out(struct sctp_tmit_chunk *, michael@0: int, uint16_t *, uint32_t, uint32_t, uint32_t); michael@0: michael@0: void michael@0: sctp_add_stream_reset_result(struct sctp_tmit_chunk *, uint32_t, uint32_t); michael@0: michael@0: void michael@0: sctp_add_stream_reset_result_tsn(struct sctp_tmit_chunk *, michael@0: uint32_t, uint32_t, uint32_t, uint32_t); michael@0: michael@0: int michael@0: sctp_send_str_reset_req(struct sctp_tcb *, int , uint16_t *, uint8_t, uint8_t, michael@0: uint8_t, uint8_t, uint16_t, uint16_t, uint8_t); michael@0: michael@0: void michael@0: sctp_send_abort(struct mbuf *, int, struct sockaddr *, struct sockaddr *, michael@0: struct sctphdr *, uint32_t, struct mbuf *, michael@0: #if defined(__FreeBSD__) michael@0: uint8_t, uint32_t, michael@0: #endif michael@0: uint32_t, uint16_t); michael@0: michael@0: void sctp_send_operr_to(struct sockaddr *, struct sockaddr *, michael@0: struct sctphdr *, uint32_t, struct mbuf *, michael@0: #if defined(__FreeBSD__) michael@0: uint8_t, uint32_t, michael@0: #endif michael@0: uint32_t, uint16_t); michael@0: michael@0: #endif /* _KERNEL || __Userspace__ */ michael@0: michael@0: #if defined(_KERNEL) || defined(__Userspace__) michael@0: int michael@0: sctp_sosend(struct socket *so, michael@0: struct sockaddr *addr, michael@0: struct uio *uio, michael@0: #ifdef __Panda__ michael@0: pakhandle_type top, michael@0: pakhandle_type control, michael@0: #else michael@0: struct mbuf *top, michael@0: struct mbuf *control, michael@0: #endif michael@0: #if defined(__APPLE__) || defined(__Panda__) michael@0: int flags michael@0: #else michael@0: int flags, michael@0: #if defined(__FreeBSD__) && __FreeBSD_version >= 500000 michael@0: struct thread *p michael@0: #elif defined(__Windows__) michael@0: PKTHREAD p michael@0: #else michael@0: #if defined(__Userspace__) michael@0: /* proc is a dummy in __Userspace__ and will not be passed to sctp_lower_sosend */ michael@0: #endif michael@0: struct proc *p michael@0: #endif michael@0: #endif michael@0: ); michael@0: michael@0: #endif michael@0: #endif michael@0: